repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
BeDjango/intef-openedx
refs/heads/master
lms/djangoapps/mobile_api/__init__.py
218
""" Mobile API """
MFoster/breeze
refs/heads/master
django/contrib/formtools/tests/wizard/wizardtests/forms.py
313
import os import tempfile from django import forms from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.forms.models import modelformset_factory from django.http import HttpResponse from django.template import ...
ycaihua/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/test_strptime.py
84
"""PyUnit testing against strptime""" import unittest import time import locale import re import sys from test import support from datetime import date as datetime_date import _strptime class getlang_Tests(unittest.TestCase): """Test _getlang""" def test_basic(self): self.assertEqual(_strptime._getla...
drmrd/ansible
refs/heads/devel
lib/ansible/playbook/role/definition.py
47
# (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...
almarklein/visvis.dev
refs/heads/master
wobjects/sliceTextures.py
5
# -*- coding: utf-8 -*- # Copyright (C) 2012, Almar Klein # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. """ Module sliceTextures Defines texture wobjects for visualizing slices in 3D volumes. """ import OpenGL.GL as gl import OpenGL.GLU as glu ...
MaplePlan/djwp
refs/heads/master
django/contrib/gis/geometry/backend/__init__.py
104
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos') try: module = import_module('django.contrib.gis.geometry.backend.%s' % geom_backend) except ImportError: try: ...
M4gn4tor/mastercard-api-python
refs/heads/master
Services/restaurants/services/countrieslocalfavoritesservice.py
1
from common import connector from common import environment from common import xmlutil from services.restaurants.domain.countries import country from services.restaurants.domain.countries import countries import xml.etree.ElementTree as ET SANDBOX_URL = 'https://sandbox.api.mastercard.com/restaurants/v1/country?Format...
leeseuljeong/leeseulstack_neutron
refs/heads/master
neutron/plugins/ml2/drivers/l2pop/db.py
8
# Copyright (c) 2013 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...
bikong2/django
refs/heads/master
django/contrib/gis/db/backends/mysql/schema.py
448
import logging from django.contrib.gis.db.models.fields import GeometryField from django.db.backends.mysql.schema import DatabaseSchemaEditor from django.db.utils import OperationalError logger = logging.getLogger('django.contrib.gis') class MySQLGISSchemaEditor(DatabaseSchemaEditor): sql_add_spatial_index = 'C...
Peddle/hue
refs/heads/master
desktop/core/ext-py/boto-2.38.0/boto/elasticache/layer1.py
150
# 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 ...
matejcik/osc
refs/heads/osclib
osclib/util.py
1
from collections import namedtuple from . import package class PackagePath (namedtuple("PackagePath", "project, name")): """ This is horrible. It must be changed. We can't have inconsistency between things that return PackagePath and Package. That's pure bullshit. Why am I even doing this. ...
yephper/django
refs/heads/master
tests/migrations/test_state.py
1
from django.apps.registry import Apps from django.contrib.contenttypes.fields import GenericForeignKey from django.db import models from django.db.migrations.exceptions import InvalidBasesError from django.db.migrations.operations import ( AddField, AlterField, DeleteModel, RemoveField, ) from django.db.migr...
Freso/beets
refs/heads/master
beets/util/confit.py
1
# -*- coding: utf-8 -*- # This file is part of Confit. # Copyright 2016, Adrian Sampson. # # 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 ...
Seinlin/nv7fire-external-protobuf
refs/heads/master
gtest/test/gtest_help_test.py
68
#!/usr/bin/env python # # Copyright 2009, 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...
Yong-Lee/django
refs/heads/master
tests/i18n/urls.py
205
from __future__ import unicode_literals from django.conf.urls.i18n import i18n_patterns from django.http import HttpResponse, StreamingHttpResponse from django.test import ignore_warnings from django.utils.deprecation import RemovedInDjango110Warning from django.utils.translation import ugettext_lazy as _ # test depr...
lbybee/food_truck_project
refs/heads/master
food_truck_scraper.py
1
import requests from BeautifulSoup import BeautifulSoup def getPage(date): """gets all the food trucks, locations and dates for a page""" url = "http://chicagofoodtruckfinder.com/weekly-schedule?date=" truck_data_list = [] soup = BeautifulSoup(requests.post(url + date).text) table = soup.find("ta...
laonawuli/addrest
refs/heads/master
web2py/gluon/contrib/qdb.py
43
#!/usr/bin/env python # coding:utf-8 "Queues(Pipe)-based independent remote client-server Python Debugger" __author__ = "Mariano Reingart (reingart@gmail.com)" __copyright__ = "Copyright (C) 2011 Mariano Reingart" __license__ = "LGPL 3.0" __version__ = "1.01b" # remote debugger queue-based (jsonrpc-like interface): ...
crosswalk-project/crosswalk-android-extensions
refs/heads/master
build/idl-generator/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/breakpad/dump_reader_win.py
50
# Copyright (C) 2013 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 ...
tomalrussell/smif
refs/heads/master
src/smif/convert/register.py
3
"""Register, ResolutionSet abstract classes to contain metadata and generate conversion coefficients. NDimensionalRegister is used in :class:`smif.convert.interval.IntervalAdaptor` and :class:`smif.convert.region.RegionAdaptor`. """ import logging from abc import ABCMeta, abstractmethod from collections import Ordered...
ChrisGoedhart/Uforia
refs/heads/master
source/testdirs.py
1
import os top=os.getcwd() for root, dirs, files in os.walk(top, topdown=False): for name in files: print os.path.join(root,name) for name in dirs: x=os.path.join(root,name) print x
emanuelschuetze/OpenSlides
refs/heads/master
openslides/users/management/commands/createsuperuser.py
2
from django.core.management.base import BaseCommand from ...models import User class Command(BaseCommand): """ Command to create or reset the admin user. """ help = "Creates or resets the admin user." def handle(self, *args, **options): created = User.objects.create_or_reset_admin_user(...
rouge8/pip
refs/heads/develop
src/pip/_vendor/packaging/utils.py
62
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import re from .version import InvalidVersion, Version _canonicalize_re...
lynxis/pyLogicSniffer
refs/heads/master
analyzer_tool_spi.py
2
# -*- coding: UTF-8 -*- '''SPI analysis tool for pyLogicSniffer. Copyright © 2011, Mel Wilson mwilson@melwilsonsoftware.ca This file is part of pyLogicSniffer. pyLogicSniffer is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
ProfessionalIT/maxigenios-website
refs/heads/master
sdk/google_appengine/lib/django-1.2/django/views/decorators/__init__.py
12133432
DmitryErmolchik/MediaCatalog
refs/heads/master
__init__.py
12133432
MonsterNya/Starbound_RU
refs/heads/web-interface
tools/parser_settings.py
6
from re import compile as regex foi = { "*": [".*escription$","^(.+/)?[Tt]ext$","^(.+/)?[Dd]ialog/[^/]+/[^/]+/.*[0-9]+$", "^(.+/)?(sub)?[tT]itle(/value)?$", "^(.+/)+caption$", "^(.+/)?label$", "^(.+/)?message$", "^.+Name/value$", "^.*friendlyName$", ".*senderName$", ".*destinations/.+[Nn]ame$", ".+[lL]...
nicecapj/crossplatfromMmorpgServer
refs/heads/master
ThirdParty/boost_1_61_0/tools/build/src/tools/types/obj.py
75
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) from b2.build import type def register (): type.register_type ('OBJ', ['obj'], None, ['NT', 'CYGWIN']) type.register_type ('OB...
gvlproject/bioconda-recipes
refs/heads/master
recipes/peptide-shaker/1.16.16/peptide-shaker.py
45
#!/usr/bin/env python # # Wrapper script for Java Conda packages that ensures that the java runtime # is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128). # # Program Parameters # import os import s...
jonsito/AgilityContest
refs/heads/master
applications/RaspBerryPi_NowRunning/NRMain.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2018-2021 by Juan Antonio Martinez ( juansgaviota at gmail dot com ) # # This program is free software; you can redistribute it and/or modify it under the terms # of the GNU General Public License as published by the Free Software Foundation; # either versio...
shail2810/nova
refs/heads/master
nova/network/__init__.py
63
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
danielneis/osf.io
refs/heads/develop
website/addons/box/tests/test_utils.py
8
# -*- coding: utf-8 -*- """Tests for website.addons.box.utils.""" import mock from nose.tools import * # noqa (PEP8 asserts) from framework.auth import Auth from website.project.model import NodeLog from tests.factories import ProjectFactory from website.addons.box.tests.utils import BoxAddonTestCase from website....
britcey/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_snmp_location.py
55
#!/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 distribut...
soltanmm-google/grpc
refs/heads/master
src/python/grpcio/grpc/framework/foundation/stream_util.py
29
# 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...
bootphon/abkhazia
refs/heads/master
abkhazia/utils/old/kaldi2features.py
1
# Copyright 2016 Thomas Schatz, Xuan-Nga Cao, Mathieu Bernard # # This file is part of abkhazia: 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. # # Abkh...
xiandiancloud/edx-platform-Y
refs/heads/master
lms/djangoapps/courseware/tests/test_about.py
15
""" Test the about xblock """ import mock from mock import patch import pytz import datetime from django.test.utils import override_settings from django.core.urlresolvers import reverse from django.conf import settings from .helpers import LoginEnrollmentTestCase from xmodule.modulestore.tests.django_utils import Modu...
alexdglover/shill-isms
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py
2754
######################## 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...
niloynibhochaudhury/ud858
refs/heads/master
Lesson_3/00_Conference_Central/conference.py
34
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import ...
rcbops/melange-buildpackage
refs/heads/master
melange/db/sqlalchemy/migrate_repo/__init__.py
73
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/encodings/utf_32_be.py
703
""" Python 'utf-32-be' Codec """ import codecs ### Codec APIs encode = codecs.utf_32_be_encode def decode(input, errors='strict'): return codecs.utf_32_be_decode(input, errors, True) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): return codecs.utf_32_be_en...
pk400/catering
refs/heads/master
myvenv/lib/python3.4/site-packages/pip/status_codes.py
408
SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
jazkarta/edx-platform-for-isc
refs/heads/backport-auto-certification
common/lib/sandbox-packages/verifiers/tests_draganddrop.py
173
import unittest import draganddrop from .draganddrop import PositionsCompare import json class Test_PositionsCompare(unittest.TestCase): """ describe""" def test_nested_list_and_list1(self): self.assertEqual(PositionsCompare([[1, 2], 40]), PositionsCompare([1, 3])) def test_nested_list_and_list...
OlivierLarrieu/HYDV2_EFL
refs/heads/master
Xlib/keysymdef/__init__.py
6
# Xlib.keysymdef -- X keysym defs # # Copyright (C) 2001 Peter Liljenberg <petli@ctrl-c.liu.se> # # 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 ...
chrisrburns/obstool
refs/heads/master
obstool/urls.py
1
"""obstool URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-bas...
FlymeOS/tools
refs/heads/marshmallow-6.0
__init__.py
12133432
developerfm/zulip
refs/heads/master
analytics/management/commands/__init__.py
12133432
Russell-IO/ansible
refs/heads/devel
lib/ansible/modules/network/layer2/__init__.py
12133432
Daksh/Colors
refs/heads/master
colorsc/linux32_26/__init__.py
12133432
arokem/scipy
refs/heads/master
scipy/sparse/construct.py
1
"""Functions to construct sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag'] import numpy as np from .s...
abircse06/youtube-dl
refs/heads/master
youtube_dl/extractor/stanfordoc.py
173
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, orderedSet, unescapeHTML, ) class StanfordOpenClassroomIE(InfoExtractor): IE_NAME = 'stanfordoc' IE_DESC = 'Stanford Open ClassRoom' _VALID_URL = r'https?://openclassroom...
redfin/react-server
refs/heads/master
packages/react-server-website/deployment/encrypt_credentials.py
6
import argparse from base64 import b64decode, b64encode import boto3 import json """ Use this script to generate a new encrypted data blob that contains secrets we need on the production machine. """ def encrypt(args): data = { 'asini-slack.api.token' : args.asini_slack_key, 'react-server-s...
prutseltje/ansible
refs/heads/devel
test/units/plugins/lookup/test_password.py
71
# -*- coding: utf-8 -*- # (c) 2015, Toshio Kuratomi <tkuratomi@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 # (a...
trondhindenes/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_cluster.py
20
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
pombredanne/pushmanager
refs/heads/master
tests/test_bookmarklet.py
6
import contextlib import mock from pushmanager_main import CreateRequestBookmarkletHandler from pushmanager_main import CheckSitesBookmarkletHandler import testing as T class BookmarkletTest(T.TestCase, T.AsyncTestCase): def get_handlers(self): return [ (CreateRequestBookmarkletHandler.url, ...
jfelectron/python-driver
refs/heads/master
tests/unit/io/test_eventletreactor.py
7
# Copyright 2013-2015 DataStax, 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 writi...
xavierdutreilh/django-mailviews
refs/heads/master
mailviews/tests/manage.py
3
#!/usr/bin/env python import logging import sys from mailviews.tests import settings logging.basicConfig(level=logging.DEBUG) if __name__ == "__main__": try: from django.core.management import execute_manager execute_manager(settings) except ImportError: from django.core.management i...
qq1012803704/zulip
refs/heads/master
zerver/__init__.py
12133432
k3nnyfr/s2a_fr-nsis
refs/heads/master
s2a/Python/Lib/site-packages/serial/urlhandler/__init__.py
12133432
softak/webfaction_demo
refs/heads/master
apps/pages/__init__.py
12133432
nhenezi/kuma
refs/heads/master
vendor/packages/pylint/test/input/func_noerror_classes_meth_signature.py
6
# pylint: disable-msg=C0111,R0922,R0903 """#2485 W0222 "Signature differs from overriden method" false positive """ __revision__ = 1 class Super(object): def method(self, param): raise NotImplementedError class Sub(Super): def method(self, param = 'abc'): pass
pdellaert/ansible
refs/heads/devel
lib/ansible/modules/remote_management/oneview/oneview_fcoe_network_info.py
21
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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', ...
phlizik/xbmctorrent
refs/heads/master
resources/site-packages/html5lib/treebuilders/_base.py
715
from __future__ import absolute_import, division, unicode_literals from six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent formatting # fr...
thomdixon/pysha2
refs/heads/master
sha2/sha224.py
1
#!/usr/bin/python __author__ = 'Thomas Dixon' __license__ = 'MIT' from sha2.sha256 import sha256 def new(m=None): return sha224(m) class sha224(sha256): _h = (0xc1059ed8L, 0x367cd507L, 0x3070dd17L, 0xf70e5939L, 0xffc00b31L, 0x68581511L, 0x64f98fa7L, 0xbefa4fa4L) _output_size = 7 digest_size...
mopsalarm/feedbacky
refs/heads/master
main.py
1
import argparse import base64 import traceback import zlib import flask from flask import request, jsonify from mailer import Mailer, Message def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument("--port", default=5000, type=int, help="Port to bind the http api to") parser.add_arg...
Printrbot/FirmwareUpdatr
refs/heads/master
dfu/src/pyserial-2.7/examples/wxTerminal.py
22
#!/usr/bin/env python # generated by wxGlade 0.3.1 on Fri Oct 03 23:23:45 2003 #from wxPython.wx import * import wx import wxSerialConfigDialog import serial import threading #---------------------------------------------------------------------- # Create an own event type, so that GUI updates can be delegated # this...
bastik/youtube-dl
refs/heads/master
youtube_dl/extractor/eporner.py
129
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, str_to_int, ) class EpornerIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?eporner\.com/hd-porn/(?P<id>\d+)/(?P<display_id>[\w-]+)' _TEST = { 'url': ...
mKeRix/home-assistant
refs/heads/dev
homeassistant/util/yaml/objects.py
10
"""Custom yaml object types.""" class NodeListClass(list): """Wrapper class to be able to add attributes on a list.""" class NodeStrClass(str): """Wrapper class to be able to add attributes on a string."""
betoesquivel/fil2014
refs/heads/master
build/django/build/lib.linux-x86_64-2.7/django/conf/locale/__init__.py
111
# -*- encoding: utf-8 -*- from __future__ import unicode_literals # About name_local: capitalize it as if your language name was appearing # inside a sentence in your language. LANG_INFO = { 'af': { 'bidi': False, 'code': 'af', 'name': 'Afrikaans', 'name_local': 'Afrikaans', },...
Dhivyap/ansible
refs/heads/devel
test/units/modules/remote_management/oneview/test_oneview_network_set.py
68
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from units.compat import unittest, mock from hpe_test_utils import OneViewBaseTestCase from oneview_module_loader import NetworkSetModule FAKE_MSG_ERROR = 'F...
hupf/passwordchest
refs/heads/master
src/loxodo/twofish/twofish.py
1
## twofish.py - pure Python implementation of the Twofish algorithm. ## Bjorn Edstrom <be@bjrn.se> 13 december 2007. ## ## Copyrights ## ========== ## ## This code is a derived from an implementation by Dr Brian Gladman ## (gladman@seven77.demon.co.uk) which is subject to the following license. ## This Python implemen...
GustavoHennig/ansible
refs/heads/devel
lib/ansible/modules/cloud/lxd/lxd_container.py
27
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Hiroaki Nakamura <hnakamur@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...
benlk/harvey-senior-homes
refs/heads/master
fabfile/utils.py
3
#!/usr/bin/env python # _*_ coding:utf-8 _*_ import app_config import boto import logging from boto.s3.connection import OrdinaryCallingFormat from fabric.api import local, task logging.basicConfig(format=app_config.LOG_FORMAT) logger = logging.getLogger(__name__) logger.setLevel(app_config.LOG_LEVEL) """ Utilities ...
danakj/chromium
refs/heads/master
tools/grit/grit/node/structure.py
7
#!/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. '''The <structure> element. ''' import os import platform import re from grit import exception from grit import util from grit.no...
semonte/intellij-community
refs/heads/master
python/testData/testRunner/env/doc/test1.py
84
def factorial(n): """Return the factorial of n, an exact integer >= 0. If the result is small enough to fit in an int, return an int. Else return a long. >>> [factorial(n) for n in range(6)] [1, 1, 2, 6, 24, 120] """ import math if not n >= 0: raise ValueError("n must be >= 0"...
cp0153/programarcade
refs/heads/master
134.py
1
class Ball(): # class attributes # Ball position x = 0 y = 0 # Ball's vector change_x = 0 change_y = 0 # Ball size size = 10 # ball color color = [255, 255, 255] # ---- class methods ---- def move(self): self.x += self.change_x self.y += slef.change_y def draw(self, screen): pygame.draw.circle(...
hyperized/ansible
refs/heads/devel
test/integration/targets/sns_topic/files/sns_topic_lambda/sns_topic_lambda.py
77
from __future__ import print_function def handler(event, context): print(event) return True
kaichogami/scikit-learn
refs/heads/master
examples/model_selection/plot_underfitting_overfitting.py
53
""" ============================ Underfitting vs. Overfitting ============================ This example demonstrates the problems of underfitting and overfitting and how we can use linear regression with polynomial features to approximate nonlinear functions. The plot shows the function that we want to approximate, wh...
xiangshouding/nv
refs/heads/master
node/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/other.py
49
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
tgecho/pipedream
refs/heads/master
pipedream/tests/exceptions_test.py
1
import pytest class FooBar(Exception): pass def test_exceptions_without_handler(dispatcher): @dispatcher.add def a(): 1/0 with pytest.raises(ZeroDivisionError): assert dispatcher.call('a') def test_handled_exceptions(dispatcher): @dispatcher.error_handler def handle(error)...
almeidapaulopt/frappe
refs/heads/develop
frappe/printing/doctype/letter_head/__init__.py
12133432
kholidfu/django
refs/heads/master
tests/template_tests/syntax_tests/__init__.py
12133432
craigderington/studentloan5
refs/heads/master
studentloan5/Lib/site-packages/django/contrib/sitemaps/management/__init__.py
12133432
HugoKuo/keystone-essex3
refs/heads/master
keystone/middleware/auth_basic.py
2
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2010-2011 OpenStack, 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 # # http://www.apache.org/lice...
saurabh6790/ON-RISAPP
refs/heads/master
patches/march_2013/p01_c_form.py
30
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import webnotes def execute(): for cform in webnotes.conn.sql("""select name from `tabC-Form` where docstatus=2"""): webnotes.conn.sql("""update `tabSales Invoice` set c_form_no=null ...
kustodian/ansible
refs/heads/devel
lib/ansible/plugins/action/edgeos_config.py
10
# # Copyright 2018 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 # (at your option) any later version. # # Ansibl...
ebigelow/LOTlib
refs/heads/master
LOTlib/Examples/GrammarInferenceDemo/Model/Grammar.py
3
__author__ = 'eric' from LOTlib.Grammar import Grammar # ------------------------------------------------------------------------------------------------------------ # This grammar has 20 rules |Expressions| * |Constants| simple_grammar = Grammar() simple_grammar.add_rule('START', '', ['SET'], 1.) # Mapping expr...
getzze/python-ivi
refs/heads/master
ivi/agilent/agilentMSOX4104A.py
7
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014 Alex Forencich 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 righ...
FrontSide/Sizun
refs/heads/master
sizun/controllers/externalexecutor.py
1
""" Sizun - Software Quality Inspection MIT License (C) 2015 David Rieger """ from subprocess import Popen, PIPE from flask import current_app as app class ExternalExecutor(): def exe(commandlist, resultdelimiter=None, instream=None): """ Executes an external executable witht the command...
hasecbinusr/pysal
refs/heads/master
pysal/core/IOHandlers/tests/test_mat.py
20
import unittest import pysal from pysal.core.IOHandlers.mat import MatIO import tempfile import os import warnings class test_MatIO(unittest.TestCase): def setUp(self): self.test_file = test_file = pysal.examples.get_path('spat-sym-us.mat') self.obj = MatIO(test_file, 'r') def test_close(self...
mrquim/repository.mrquim
refs/heads/master
script.module.liveresolver/lib/liveresolver/modules/f4mproxy/utils/python_rc4.py
207
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Pure-Python RC4 implementation.""" from .rc4 import RC4 from .cryptomath import * def new(key): return Python_RC4(key) class Python_RC4(RC4): def __init__(self, keyBytes): RC4.__init__(self, keyBytes,...
MerlijnWajer/pyroTorrent
refs/heads/master
lib/filerequester.py
1
""" .. _torrentrequester-class: TorrentRequester ================ The TorrentRequester is a class created to quickly and efficiently query all the torrents in a view. It only uses one XMLRPC request. All the methods you can perform on TorrentRequester are identical to the methods on :ref:`torrent-class`. (Although se...
lubart2517/lubart_repo
refs/heads/master
lubart_repo/contrib/sites/migrations/__init__.py
147
""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.org/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ # -*- coding: utf-8 -*-
chrisjsewell/ipypublish
refs/heads/develop
ipypublish/sphinx/tests/test_notebook.py
1
# -*- coding: utf-8 -*- """ test_sphinx ~~~~~~~~~~~ General Sphinx test and check output. """ import pytest import sphinx from ipypublish.sphinx.tests import get_test_source_dir from ipypublish.tests.utils import HTML2JSONParser @pytest.mark.sphinx(buildername="html", srcdir=get_test_source_dir("notebo...
oldhill/miniramp
refs/heads/master
utils/soundcloud_utils.py
1
import json import logging import urllib2 def username_to_user_id(artistUsername): """ SoundCloud username to id converter """ artistUrl = 'http://soundcloud.com/%s&client_id=YOUR_CLIENT_ID' % artistUsername # This 'resolve' prefix URL is necessary to get info by username rather than ID number. # doc: ht...
Greennut/ostproject
refs/heads/master
django/contrib/auth/management/commands/changepassword.py
97
import getpass from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.db import DEFAULT_DB_ALIAS class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--database', action='stor...
tinloaf/home-assistant
refs/heads/dev
homeassistant/components/binary_sensor/verisure.py
5
""" Interfaces with Verisure sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.verisure/ """ import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.verisure import CONF_DOOR...
valdecdev/odoo
refs/heads/master
addons/base_import_module/models/ir_module.py
10
import logging import os import sys import zipfile from os.path import join as opj import openerp from openerp.osv import osv from openerp.tools import convert_file from openerp.tools.translate import _ from openerp.exceptions import UserError _logger = logging.getLogger(__name__) MAX_FILE_SIZE = 100 * 1024 * 1024 #...
robovm/robovm-studio
refs/heads/master
python/lib/Lib/distutils/command/upload.py
87
"""distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to PyPI).""" from distutils.errors import * from distutils.core import Command from distutils.spawn import spawn from distutils import log from hashlib import md5 import os import socket import platform import ConfigParser import...
lmcro/letsencrypt
refs/heads/master
letsencrypt-auto-source/pieces/pipstrap.py
25
#!/usr/bin/env python """A small script that can act as a trust root for installing pip 8 Embed this in your project, and your VCS checkout is all you have to trust. In a post-peep era, this lets you claw your way to a hash-checking version of pip, with which you can install the rest of your dependencies safely. All i...
caot/intellij-community
refs/heads/master
python/testData/inspections/PyUnboundLocalVariableInspection/InstanceFieldAndGlobal.py
83
x = 1 class C: def __init__(self): self.x = x #pass
vikas1885/test1
refs/heads/master
common/djangoapps/util/config_parse.py
197
""" Helper functions for configuration parsing """ import collections def convert_tokens(tokens): """ This function is called on the token dictionary that is imported from a yaml file. It returns a new dictionary where all strings containing 'None' are converted to a literal None due to a bug ...