repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
andreas-andrade/outputty
refs/heads/develop
outputty/plugin_mysql.py
2
#!/usr/bin/env python # coding: utf-8 import datetime from unicodedata import normalize import MySQLdb MYSQL_TYPE = {str: 'TEXT', int: 'INT', float: 'FLOAT', datetime.date: 'DATE', datetime.datetime: 'DATETIME'} MYSQLDB_TYPE = {getattr(MySQLdb.FIELD_TYPE, x): x \ for x in dir(MySQLdb.FI...
abramhindle/UnnaturalCodeFork
refs/heads/master
python/testdata/launchpad/lib/lp/services/identity/model/emailaddress.py
1
# Copyright 2009-2012 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). __metaclass__ = type __all__ = [ 'EmailAddress', 'EmailAddressSet', 'HasOwnerMixin', 'UndeletableEmailAddress', ] import hashlib import operator from sq...
ttair/TuxSinbad
refs/heads/master
Tools/BlenderExport/ogrepkg/gui.py
28
"""Graphical user interface system. Widgets properties are classified as mutable or static. Mutable properties have a clear separation between model and view. @author Michael Reimpell """ # Copyright (C) 2005 Michael Reimpell # # This library is free software; you can redistribute it and/or # modify it unde...
svdwulp/da-programming-1
refs/heads/master
game/blackjack.py
1
"""Blackjack Multiplayer version of a simplified blackjack game. Rules: - cards are dealt from a single, shuffled deck of 52 standard 'playing cards' - when the deck runs out, a fresh deck is shuffled and used (note: this entails a player can receive the same card twice, e.g. aces of spades, in a single round, bu...
sambyers/o365_fmc
refs/heads/master
.venv/lib/python3.6/site-packages/pip/commands/search.py
343
from __future__ import absolute_import import logging import sys import textwrap from pip.basecommand import Command, SUCCESS from pip.compat import OrderedDict from pip.download import PipXmlrpcTransport from pip.models import PyPI from pip.utils import get_terminal_size from pip.utils.logging import indent_log from...
bplancher/odoo
refs/heads/9.0
openerp/addons/base/tests/test_ir_actions.py
40
import unittest from openerp.exceptions import ValidationError import openerp.tests.common as common from openerp.tools import mute_logger class TestServerActionsBase(common.TransactionCase): def setUp(self): super(TestServerActionsBase, self).setUp() cr, uid = self.cr, self.uid # Model...
kvar/ansible
refs/heads/seas_master_2.9.5
lib/ansible/modules/network/fortios/fortios_log_syslogd3_setting.py
14
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
pdellaert/ansible
refs/heads/devel
lib/ansible/modules/database/postgresql/postgresql_schema.py
10
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible Project # 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', ...
ColOfAbRiX/ansible
refs/heads/devel
lib/ansible/modules/cloud/webfaction/webfaction_db.py
23
#!/usr/bin/python # # Create a webfaction database using Ansible and the Webfaction API # # ------------------------------------------ # # (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from: # * Andy Baker # * Federico Tarantini # # This file is part of Ansible # # Ansible is free...
PhobosXIII/qc
refs/heads/master
coordination/models.py
1
from datetime import timedelta from itertools import groupby from ckeditor.fields import RichTextField from django.conf import settings from django.contrib.auth.models import User from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from django.utils import timezone from...
alisidd/tensorflow
refs/heads/asgd-dc
tensorflow/python/training/server_lib_same_variables_no_clear_test.py
125
# 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...
Ivaylo-Popov/Theano-Lights
refs/heads/master
models/lm_draw.py
11
import theano import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams from theano.tensor.nnet.conv import conv2d from theano.tensor.signal.downsample import max_pool_2d from theano.tensor.shared_randomstreams import RandomStreams import numpy as np from toolbox import * from modelbase import * ...
testalt/electrum-NMC
refs/heads/master
setup-release.py
1
""" py2app/py2exe build script for Electrum Litecoin Usage (Mac OS X): python setup.py py2app Usage (Windows): python setup.py py2exe """ from setuptools import setup import os import re import shutil import sys from lib.util import print_error from lib.version import ELECTRUM_VERSION as version name = ...
Xperia-Nicki/android_platform_sony_nicki
refs/heads/master
external/webkit/Tools/Scripts/webkitpy/common/config/build.py
15
# Copyright (C) 2010 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
JioCloud/python-openstackclient
refs/heads/master
openstackclient/compute/v2/security_group.py
2
# Copyright 2012 OpenStack Foundation # Copyright 2013 Nebula 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 ...
gaddman/ansible
refs/heads/devel
lib/ansible/modules/network/junos/junos_vrf.py
27
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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', ...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.7/Lib/distutils/msvc9compiler.py
2
"""distutils.msvc9compiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio 2008. The module is compatible with VS 2005 and VS 2008. You can find legacy support for older versions of VS in distutils.msvccompiler. """ # Written by Perry Stoll # hacked by Robin B...
c3nav/c3nav
refs/heads/master
src/c3nav/mapdata/render/engines/wavefront.py
1
import os from itertools import chain import numpy as np from c3nav.mapdata.render.engines import register_engine from c3nav.mapdata.render.engines.base3d import Base3DEngine @register_engine class WavefrontEngine(Base3DEngine): filetype = 'obj' def _normal_normal(self, normal): return normal / (np...
riklaunim/django-custom-multisite
refs/heads/master
tests/modeltests/choices/tests.py
150
from __future__ import absolute_import from django.test import TestCase from .models import Person class ChoicesTests(TestCase): def test_display(self): a = Person.objects.create(name='Adrian', gender='M') s = Person.objects.create(name='Sara', gender='F') self.assertEqual(a.gender, 'M')...
BaesFr/Sick-Beard
refs/heads/development
lib/hachoir_metadata/metadata_item.py
90
from lib.hachoir_core.tools import makeUnicode, normalizeNewline from lib.hachoir_core.error import HACHOIR_ERRORS from lib.hachoir_metadata import config from lib.hachoir_metadata.setter import normalizeString MIN_PRIORITY = 100 MAX_PRIORITY = 999 QUALITY_FASTEST = 0.0 QUALITY_FAST = 0.25 QUALITY_NORMAL = 0.5 QUALIT...
GbalsaC/bitnamiP
refs/heads/master
venv/lib/python2.7/site-packages/sympy/polys/constructor.py
5
"""Tools for constructing domains for expressions. """ from sympy.polys.polyutils import parallel_dict_from_basic from sympy.polys.polyoptions import build_options from sympy.polys.domains import ZZ, QQ, RR, EX from sympy.assumptions import ask, Q from sympy.core import S, sympify def _construct_simple(coeffs, opt): ...
abhishekjairath/codeyard
refs/heads/master
commit/lib/python2.7/site-packages/pkg_resources.py
134
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
ryano144/intellij-community
refs/heads/master
python/testData/intentions/beforeImportFromToImport.py
83
from sys import * for x in argv: print x print version
capergroup/bayou
refs/heads/master
src/main/python/bayou/lda/__init__.py
12133432
aosingh/lexpy
refs/heads/master
lexpy/_constants.py
12133432
gunchleoc/django
refs/heads/master
tests/inline_formsets/__init__.py
12133432
dahlstrom-g/intellij-community
refs/heads/master
python/testData/debug/qt/test_pyside2_3.py
13
from PySide2 import QtCore import sys class Runnable(QtCore.QRunnable): def run(self): app = QtCore.QCoreApplication.instance() for i in range(3): print("ping %d" % i) app.quit() app = QtCore.QCoreApplication([]) runnable = Runnable() QtCore.QThreadPool.globalInstance().star...
srimai/odoo
refs/heads/8.0
addons/mail/mail_thread.py
14
# -*- 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...
shakamunyi/sahara
refs/heads/master
sahara/service/api/v2/images.py
3
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
greytide/greytide
refs/heads/master
bot/config.py
207
# Configuration for the minibot.py bot starts here server = "irc.rizon.net" port = 6667 channels = ["#asdfgbus", "#botbus"] defaultchannel = "#asdfgbus" nick = "minibot-testing-ss13" altnick = "minibot-testing-ss13_" name = "minibot" ident = "minibot" realname = "minibot" password = "CHANGETHIS" # Configuration ends ...
arjoly/scikit-learn
refs/heads/master
sklearn/feature_extraction/setup.py
314
import os def configuration(parent_package='', top_path=None): import numpy from numpy.distutils.misc_util import Configuration config = Configuration('feature_extraction', parent_package, top_path) libraries = [] if os.name == 'posix': libraries.append('m') config.add_extension('_ha...
zdary/intellij-community
refs/heads/master
python/helpers/pycharm/teamcity/flake8_plugin.py
31
try: from flake8.formatting import base # noqa except ImportError: from teamcity.flake8_v2_plugin import * # noqa else: from teamcity.flake8_v3_plugin import * # noqa
kumarshivam675/Mobile10X-Hack
refs/heads/master
build/lib.linux-x86_64-2.7/yowsup/structs/__init__.py
70
from .protocolentity import ProtocolEntity from .protocoltreenode import ProtocolTreeNode
seba3c/scamera
refs/heads/master
notifications/admin.py
1
from django.contrib import admin from notifications.models import NotificationUserProfile from notifications.telegram.models import TelegramNotificationHandler, TelegramBot admin.site.register(NotificationUserProfile) admin.site.register(TelegramBot) admin.site.register(TelegramNotificationHandler)
jflater/Ederson-hpc
refs/heads/master
Scripts/primer_compliment.py
1
"""Find reverse complement of reverse primer, print forward primer""" # Input file should be in .fa format, with both forward and reverse primer # the word "reverse" in record.name of each reverse primer import sys import screed from Bio.Seq import Seq def main(): """this is the main, see above""" for record...
hzlf/openbroadcast
refs/heads/master
website/apps/alibrary/migrations/0155_auto__add_namevariation.py
1
# -*- coding: 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 model 'NameVariation' db.create_table('alibrary_namevariation', ( ('id', self.gf('djang...
mixturemodel-flow/tensorflow
refs/heads/master
tensorflow/python/grappler/model_analyzer.py
38
# 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...
luotao1/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/npu/test_sgd_op_npu.py
2
# Copyright (c) 2021 PaddlePaddle 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 appli...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/snapshot_paged.py
2
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
linkmax91/bitquant
refs/heads/master
web/home/ipython/examples/bitcoin-pricer.py
1
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> #!/usr/bin/python # Copyright (c) 2014 Bitquant Research Laboratories (Asia) Ltd. # 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 Sof...
rowhit/h2o-2
refs/heads/master
py/testdir_multi_jvm/test_GLM2_catdata.py
9
import unittest, time, sys, copy sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_glm, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3,java_heap_GB=4) ...
NischalLal/Humpty-Dumpty-SriGanesh
refs/heads/master
my_website/urls.py
1
"""my_website URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
AndrewGrossman/django
refs/heads/master
tests/utils_tests/test_lorem_ipsum.py
246
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from django.utils.lorem_ipsum import paragraphs, words class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur adipisicing') def test_paragraphs(...
chriskiehl/Gooey
refs/heads/master
gooey/tests/integration/runner.py
2
import os import time from concurrent import futures from gooey.gui.util.freeze import getResourcePath from gooey.python_bindings import config_generator from gooey.util.functional import merge def run_integration(module, assertionFunction, **kwargs): """ Integration test harness. WXPython ...
kalxas/QGIS
refs/heads/master
tests/src/python/test_qgsprocessingrecentalgorithmslog.py
45
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProcessingRecentAlgorithmLog. .. note:: 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 late...
jamesorr/mocsy
refs/heads/master
src/GSW/make_saar_data.py
1
#!/usr/bin/env python # $id$ """ Make gsw_mod_saar_data.f from the current gsw_data_v3_0.nc. This is a developer utility and not a part of the public distribution, but its end-product is. Note that it generates gsw_saar_data.c but will not overwrite it if it exists. General concept: we don't want end-users of this dis...
brchiu/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/learn_io/numpy_io.py
28
# 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...
jgoclawski/django
refs/heads/master
tests/validators/tests.py
163
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io import os import re import types from datetime import datetime, timedelta from unittest import TestCase from django.core.exceptions import ValidationError from django.core.validators import ( BaseValidator, EmailValidator, MaxLengthValidato...
iresprite/json-chunked-stream-client
refs/heads/master
test_singleQuoteBlock.py
1
from unittest import TestCase import ByteStreamHandler class TestSingleQuoteBlock(TestCase): def setUp(self): stack = [ByteStreamHandler.State()] self.single_quote_block = ByteStreamHandler.SingleQuoteBlock(stack) def test_handle(self): self.assertIsInstance(self.single_quote_block.ha...
p4datasystems/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/test/badsyntax_future9.py
202
"""This is a test""" from __future__ import nested_scopes, braces def f(x): def g(y): return x + y return g print f(2)(4)
robmagee/django-cms
refs/heads/develop
cms/south_migrations/0067_auto__add_field_aliaspluginmodel_alias_placeholder__chg_field_aliasplu.py
59
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'AliasPluginModel.alias_placeholder' db.add_column(u'cms_a...
free-electrons/custom_tests_tool
refs/heads/master
tests/test_crawlers.py
1
import requests import requests_mock import time from nose.tools import assert_equal, assert_raises from crawlers import FreeElectronsCrawler, KernelCICrawler from crawlers import RemoteAccessError, RemoteEmptyError class TestKernelCICrawler(object): BASE_URL = 'https://storage.kernelci.org/' RELEASE_URL = '...
brendandahl/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py
636
# 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...
oliverdrake/ucbc
refs/heads/master
main/migrations/0001_initial.py
2
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserRole' db.create_table('main_userrole', ( ...
asnir/airflow
refs/heads/master
tests/contrib/hooks/test_zendesk_hook.py
37
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
waheedahmed/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/transcripts_ajax.py
140
""" Actions manager for transcripts ajax calls. +++++++++++++++++++++++++++++++++++++++++++ Module do not support rollback (pressing "Cancel" button in Studio) All user changes are saved immediately. """ import copy import os import logging import json import requests from django.http import HttpResponse, Http404 fro...
sahmed95/sympy
refs/heads/master
sympy/polys/tests/test_ring_series.py
12
from sympy.polys.domains import QQ, EX, RR from sympy.polys.rings import ring from sympy.polys.ring_series import (_invert_monoms, rs_integrate, rs_trunc, rs_mul, rs_square, rs_pow, _has_constant_term, rs_hadamard_exp, rs_series_from_list, rs_exp, rs_log, rs_newton, rs_series_inversion, rs_compose_add, rs_a...
joerocklin/gem5
refs/heads/master
ext/ply/test/lex_dup2.py
174
# lex_dup2.py # # Duplicated rule specifiers import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = [ "PLUS", "MINUS", "NUMBER", ] t_PLUS = r'\+' t_MINUS = r'-' def t_NUMBER(t): r'\d+' pass def t_NUMBER(t): r'\d+' pass def t_error(t): pass ...
akretion/stock-logistics-warehouse
refs/heads/8.0
__unported__/stock_orderpoint_creator/orderpoint_template.py
23
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher (Camptocamp) # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
xHeliotrope/injustice_dropper
refs/heads/master
env/lib/python3.4/site-packages/phonenumbers/shortdata/region_UA.py
11
"""Auto-generated file, do not edit by hand. UA metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_UA = PhoneMetadata(id='UA', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2}', possible_number_pattern='\\d{...
shuangshuangwang/spark
refs/heads/master
python/pyspark/ml/pipeline.py
1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
ax003d/openerp
refs/heads/master
openerp/addons/hr_attendance/res_config.py
434
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
renyi533/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/eig_op_test.py
2
# Copyright 2019 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...
deepaklukose/grpc
refs/heads/master
src/python/grpcio/grpc/_grpcio_metadata.py
2
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
geekaia/edx-platform
refs/heads/master
common/djangoapps/student/management/commands/emaillist.py
68
from django.core.management.base import BaseCommand from django.contrib.auth.models import User class Command(BaseCommand): help = \ ''' Extract an e-mail list of all active students. ''' def handle(self, *args, **options): #text = open(args[0]).read() #subject = open(args[1]).read() ...
TeamEOS/external_chromium_org
refs/heads/lp5.0
tools/site_compare/scrapers/chrome/__init__.py
179
#!/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. """Selects the appropriate scraper for Chrome.""" def GetScraper(version): """Returns the scraper module for the given version....
ajenta/dj-oydiv
refs/heads/master
dj_oydiv/config/__init__.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import logging from django.conf import settings from django.conf import ImproperlyConfigured from . import default_settings log = logging.getLogger(__name__) __all__ = ['config'] PREFIX = 'OYDIV_' class _Config(object): """ ...
sihart25/Vimto
refs/heads/master
vimto/local_apps/polls/StationHandler.py
1
from django.conf import settings MEDIA_ROOT = getattr(settings, "MEDIA_ROOT", None) STATIONS = {} SECTIONS = [] ######################################################################### # Station and Section Classes class Station(): def __init__(self, num, lat, lng, nme): self.num = num ...
resmo/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_mariadbserver_info.py
29
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com> # Copyright (c) 2019 Matti Ranta, (@techknowlogick) # # 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 AN...
shedskin/shedskin
refs/heads/master
tests/185.py
6
# file.next print file('run.py').next().strip() # re.groups returns tuple import re m = re.match(r"(\d+)\.?(\d+)?", "24") groups = m.groups() print groups # overloading __getitem__ problem class Vector3f: def __getitem__(self, key): return 19 v = Vector3f() print v[0] # more string formatting print '!'+...
sujeetv/incubator-hawq
refs/heads/master
src/bin/gpupgrade/setcatversion.py
9
import subprocess releases = {"3.0": "200703112", "3.1": "200712072", "3.2": "200808253", "3.3": "200902041"} def release2catverno(rno): if not rno in releases.keys(): raise Exception("unknown version %s" % rno) return releases[rno] def stop_cluster(): p.subprocess.Popen(['gp...
signed/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/regex_helper.py
361
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ # Mapping of an escape character to a r...
caot/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/auth/signals.py
334
from django.dispatch import Signal user_logged_in = Signal(providing_args=['request', 'user']) user_logged_out = Signal(providing_args=['request', 'user'])
MrSurly/micropython
refs/heads/master
tests/basics/list1.py
17
# basic list functionality x = [1, 2, 3 * 4] print(x) x[0] = 4 print(x) x[1] += -4 print(x) x.append(5) print(x) f = x.append f(4) print(x) x.extend([100, 200]) print(x) x.extend(range(3)) print(x) x += [2, 1] print(x) # unsupported type on RHS of add try: [] + None except TypeError: print('TypeError')
ejeschke/ginga
refs/heads/master
ginga/util/io_rgb.py
3
# # io_rgb.py -- RGB image file handling. # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import sys import time import mimetypes from io import BytesIO import numpy as np from ginga.BaseImage import Header, ImageError from ginga.util import iohelper, rg...
halvertoluke/edx-platform
refs/heads/default_branch
common/lib/xmodule/xmodule/library_root_xblock.py
42
""" 'library' XBlock (LibraryRoot) """ import logging from xmodule.studio_editable import StudioEditableModule from xblock.fields import Scope, String, List, Boolean from xblock.fragment import Fragment from xblock.core import XBlock log = logging.getLogger(__name__) # Make '_' a no-op so we can scrape strings. Usi...
LittleLama/Sick-Beard-BoxCar2
refs/heads/development
lib/hachoir_parser/program/java.py
90
""" Compiled Java classes parser. Author: Thomas de Grenier de Latour (TGL) <degrenier@easyconnect.fr> Creation: 2006/11/01 Last-update: 2006/11/06 Introduction: * This parser is for compiled Java classes, aka .class files. What is nice with this format is that it is well documented in the official Java VM specs...
ghjm/ansible
refs/heads/devel
test/integration/targets/ignore_unreachable/fake_connectors/bad_exec.py
35
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import ansible.plugins.connection.local as ansible_local from ansible.errors import AnsibleConnectionFailure from ansible.utils.display import Display display = Display() class Connection(ansible_local.Connection): def exec_...
ctsit/redi-dropper-client
refs/heads/master
app/tests/test_api.py
1
""" Goal: Simulate api calls Authors: Patrick White <pfwhite9@gmail.com> <pfwhite@ufl.edu> """ from __future__ import print_function from flask import url_for from .base_test_with_data import BaseTestCaseWithData from redidropper.main import app from redidropper.main import db from redidropper.models.user_enti...
tedelhourani/ansible
refs/heads/devel
lib/ansible/plugins/lookup/keyring.py
82
# (c) 2016, Samuel Boucher <boucher.samuel.c@gmail.com> # (c) 2017 Ansible Project # 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 DOCUMENTATION = """ lookup: keyring author: ...
lach76/scancode-toolkit
refs/heads/develop
tests/cluecode/data/ics/markdown-markdown-extensions/tables.py
13
Content Cell | Content Cell Content Cell | Content Cell Copyright 2009 - [Waylan Limberg](http://achinghead.com) """ import markdown
Kazade/NeHe-Website
refs/heads/master
google_appengine/google/appengine/ext/remote_api/throttle.py
13
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
sepehr125/pybrain
refs/heads/master
pybrain/rl/environments/twoplayergames/pente.py
25
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.rl.environments.twoplayergames.gomoku import GomokuGame class PenteGame(GomokuGame): """ The game of Pente. The rules are similar to Go-Moku, except that it is now possible to capture stones, in pairs, by putting stones at both ends of a pair of the o...
davidhax0r/Twoooly-For-Twitter
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py
316
# urllib3/response.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import zlib import io from .exceptions import DecodeError from .packages.six ...
chamaken/cpylmnl
refs/heads/master
tests/cpylmnl/linux/netlink/__init__.py
12133432
rsouza/pypln.web
refs/heads/develop
pypln/web/backend_adapter/models.py
12133432
ocadotechnology/django-tastypie
refs/heads/master
tests/validation/api/__init__.py
12133432
thnee/ansible
refs/heads/devel
lib/ansible/module_utils/oracle/oci_utils.py
29
# Copyright (c) 2017, 2018, 2019 Oracle and/or its affiliates. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import import logging import logging.config import os import tempfile from datetime import datetime from operator import eq impor...
philuu12/PYTHON_4_NTWK_ENGRS
refs/heads/master
wk4_hw/Solution_wk4/ex1_paramiko.py
1
#!/usr/bin/env python ''' Use Paramiko to retrieve the entire 'show version' output. ''' import paramiko import time from getpass import getpass MAX_BUFFER = 65535 def clear_buffer(remote_conn): ''' Clear any data in the receive buffer ''' if remote_conn.recv_ready(): return remote_conn.recv(...
tangfeixiong/nova
refs/heads/stable/juno
nova/tests/unit/db/__init__.py
179
# Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
jmetzen/scikit-learn
refs/heads/master
examples/exercises/plot_iris_exercise.py
323
""" ================================ SVM Exercise ================================ A tutorial exercise for using different SVM kernels. This exercise is used in the :ref:`using_kernels_tut` part of the :ref:`supervised_learning_tut` section of the :ref:`stat_learn_tut_index`. """ print(__doc__) import numpy as np i...
iodoom-gitorious/thelinkers-iodoom3
refs/heads/master
neo/sys/linux/pk4/id_utils.py
19
# a collection of utility functions to manipulate pak files import os, zipfile, md5, pdb # sorts in reverse alphabetical order like doom does for searching def list_paks( path ): files = os.listdir( path ) for i in files: if ( i[-4:] != '.pk4' ): files.remove( i ) files.sort() files.reverse() return files ...
detiber/openshift-ansible-contrib
refs/heads/master
reference-architecture/vmware-ansible/playbooks/library/vmware_resource_pool.py
8
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Davis Phillips davis.phillips@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 t...
varunagrawal/azure-services
refs/heads/master
varunagrawal/VarunWeb/env/Lib/site-packages/django/contrib/gis/tests/geoadmin/urls.py
383
from django.conf.urls import patterns, include from django.contrib import admin urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), )
fengyie007/shadowsocks
refs/heads/master
shadowsocks/shell.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
msebire/intellij-community
refs/heads/master
python/testData/inspections/PyCompatibilityInspection/underscoresInNumericLiterals.py
1
# hex <warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals">0xCAFE_F00D</warning> # oct <warning descr="Python version 2.6, 2.7, 3.4, 3.5 do not support underscores in numeric literals">0o1_23</warning> <error descr="Python version 3.6 does not support this syntax. It requir...
abhattad4/Digi-Menu
refs/heads/master
digimenu2/django/core/serializers/xml_serializer.py
95
""" XML serializer. """ from __future__ import unicode_literals from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import base from django.db import DEFAULT_DB_A...
guileschool/beagleboard
refs/heads/master
u-boot/tools/patman/patman.py
4
#!/usr/bin/env python # # Copyright (c) 2011 The Chromium OS Authors. # # SPDX-License-Identifier: GPL-2.0+ # """See README for more information""" from optparse import OptionParser import os import re import sys import unittest # Our modules try: from patman import checkpatch, command, gitutil, patchstream, \ ...
aselle/tensorflow
refs/heads/master
tensorflow/contrib/distributions/python/kernel_tests/geometric_test.py
68
# 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...
gogobook/Spirit
refs/heads/master
spirit/core/utils/models_fields.py
12
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db.models.fields import SlugField from django.utils.text import slugify from django.utils.encoding import smart_text __all__ = ['AutoSlugField', ] class AutoSlugField(SlugField): """ Auto populates itself from another field. I...