repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
wyc/django
refs/heads/master
tests/get_earliest_or_latest/models.py
540
from django.db import models class Article(models.Model): headline = models.CharField(max_length=100) pub_date = models.DateField() expire_date = models.DateField() class Meta: get_latest_by = 'pub_date' class Person(models.Model): name = models.CharField(max_length=30) birthday = m...
GuardianRG/CuckooSploit
refs/heads/master
analyzer/windows/lib/jsh/server.py
6
#!/usr/bin/python """ Save this file as server.py >>> python server.py 0.0.0.0 8001 serving on 0.0.0.0:8001 or simply >>> python server.py Serving on localhost:8000 You can use this to test GET and POST methods. """ import SimpleHTTPServer import SocketServer import logging import cgi import...
wevote/WeVoteServer
refs/heads/develop
apis_v1/documentation_source/organization_count_doc.py
1
# apis_v1/documentation_source/organization_count_doc.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- def organization_count_doc_template_values(url_root): """ Show documentation about organizationCount """ required_query_parameter_list = [ { 'name': 'api_k...
SaturninoMateus/jaikuengine
refs/heads/master
login/models.py
1073
# Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
agry/NGECore2
refs/heads/master
scripts/object/tangible/theme_park/invisible_object.py
85615
import sys def setup(core, object): return
lbrabbit/mypaperbackup
refs/heads/master
python/big52u.py
1
from string import replace import re outfile=file('txt_chinese.py','w+') outfile.write("txt_backstage=['','','']\n") outfile.write("txt_userid2=['','','']\n") mapping={ 'txt_backstage[0]': '­Ó¤H·s»D¥x«á¥x³Æ¥÷', 'txt_backstage[1]': 'Taipeilink¯d¨¥ª©³Æ¥÷', 'txt_backstage[2]': 'µL¦W¯d¨¥ªO³Æ¥÷', 'txt_error_noi...
alkadis/vcv
refs/heads/master
scripts/watching_testrunnter.py
6
#!/usr/bin/env python import glob import os import sys import time class FileWatcher(object): def __init__(self, basepath, watch_wildcard): self.basepath = basepath self.wildcard = watch_wildcard self.existing_files = {} def file_did_change(self, filename): change_detecte...
Superjom/models-1
refs/heads/develop
image_classification/tf2paddle/tf2paddle.py
4
import os import re import collections import struct import gzip import tarfile import cStringIO import numpy as np import tensorflow as tf from paddle.proto.ParameterConfig_pb2 import ParameterConfig from paddle.trainer_config_helpers.default_decorators import wrap_name_default class ModelConverter(object): de...
xxChinasaurxx/script.tvdbrating
refs/heads/master
resources/lib/tvdb_authenticate/tvdb_authenticate.py
1
import requests import cookielib from bs4 import BeautifulSoup import re import logging from requests.exceptions import ConnectionError # TODO: Allow setting for number of retries on operations e.g number of times to retry getting account id class TVDB(object): jar = None def __init__(self, username, passw...
cloud9UG/odoo
refs/heads/8.0
addons/hr_holidays/wizard/hr_holidays_summary_employees.py
337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
shakamunyi/neutron-vrrp
refs/heads/master
neutron/plugins/embrane/l2base/__init__.py
62
# Copyright 2013 Embrane, Inc. # 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...
patrioticcow/MessagesForSkype
refs/heads/master
packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/idlelib/MultiCall.py
5
""" MultiCall - a class which inherits its methods from a Tkinter widget (Text, for example), but enables multiple calls of functions per virtual event - all matching events will be called, not only the most specific one. This is done by wrapping the event functions - event_add, event_delete and event_info. MultiCall r...
Glasgow2015/team-10
refs/heads/master
env/lib/python2.7/site-packages/django/contrib/auth/checks.py
186
# -*- 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...
jbassen/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/tests/test_conditional.py
131
import json import unittest from fs.memoryfs import MemoryFS from mock import Mock, patch from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.error_module import NonStaffErrorDescriptor from opaque_keys.edx.locations import SlashSeparatedCourseKey, Location from xmodule.modules...
jiobert/python
refs/heads/master
Preston_Kellen/Assignments/flaskolympics/olympics6/server.py
2
from flask import Flask, render_template, session, request, redirect import random from random import randint app = Flask(__name__) app.secret_key = 'my_secret_key' @app.route('/') def index(): if not 'gold' in session: session['gold'] = 0 if not 'activities' in session: session['activities'] =...
francois-vincent/navitia
refs/heads/dev
source/tyr/migrations/versions/2dbd03089f34_.py
11
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
yongju-hong/thrift
refs/heads/master
lib/py/src/protocol/TProtocol.py
9
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
buechele/replayer
refs/heads/master
replayer/url_builder.py
1
import re from log_constants import LogConstants class URLBuilder(object): def __init__(self, protocol, host, port, regex_list): self.__protocol = protocol self.__host = host self.__port = port self.__regex_list = regex_list self.__fix_host_regex = re.compile('^http://[^/]...
chromium/chromium
refs/heads/master
chrome/android/features/autofill_assistant/tools/password_change_tests_runner/runner.py
4
#!/usr/bin/env python # # Copyright (c) 2021 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 script runs password change tests present in PasswordChangeFixtureTest. Example Steps: 1. Fill arguments in config...
zedr/django
refs/heads/master
tests/migrations/models.py
13
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps.registry import Apps from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class UnicodeModel(models.Model): title = models.CharField('ÚÑÍ¢ÓÐÉ', max_length=20, defaul...
jamezpolley/pip
refs/heads/develop
tests/unit/test_appdirs.py
26
import sys import pretend from pip.utils import appdirs class TestUserCacheDir: def test_user_cache_dir_win(self, monkeypatch): @pretend.call_recorder def _get_win_folder(base): return "C:\\Users\\test\\AppData\\Local" monkeypatch.setattr( appdirs, "...
CivicTechTO/open-cabinet
refs/heads/master
venv/lib/python2.7/site-packages/wheel/test/test_keys.py
565
import tempfile import os.path import unittest import json from wheel.signatures import keys wheel_json = """ { "verifiers": [ { "scope": "+", "vk": "bp-bjK2fFgtA-8DhKKAAPm9-eAZcX_u03oBv2RlKOBc" }, { "scope": "+", "vk": "KAHZBfyqFW3OcFDbLSG4nPCjXxUPy72phP9I4Rn9MAo" }, ...
xiaonanln/myleetcode-python
refs/heads/master
src/Remove Duplicates from Sorted Array.py
1
class Solution: # @param a list of integers # @return an integer def removeDuplicates(self, A): last = None writep = 0 cur = 0 while cur < len(A): if A[cur] != last: A[writep] = A[cur] last = A[writep] writep += 1 ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/wearables/bodysuit/bodysuit_s13.py
85615
import sys def setup(core, object): return
agry/NGECore2
refs/heads/master
scripts/object/tangible/ship/components/chassis/tieinterceptor_chassis_token.py
85615
import sys def setup(core, object): return
kogotko/carburetor
refs/heads/master
openstack_dashboard/test/integration_tests/pages/project/network/routerinterfacespage.py
10
# 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...
cernops/nova
refs/heads/master
nova/db/sqlalchemy/migrate_repo/versions/297_add_forced_down_for_services.py
62
# 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...
openplans/shareabouts-demos
refs/heads/master
src/sa_web/management/commands/flavormessages.py
36
from django.core.management.base import NoArgsCommand, CommandError from django.core.management.commands.makemessages import process_file, write_po_file import django import optparse from optparse import make_option import sys import os import os.path import re import glob import subprocess import tempfile from sa_web...
2016-Capstone/PythonController
refs/heads/master
src/Bybop_LTE.py
1
import socket import os import sys import time import errno ''' HOST = '210.125.31.25' PORT = 443 ADDR = (HOST, PORT) ''' CMD = [65,66,68,67,114,102,100,103,113] def get_from_LTE(c_socket, locker, fifo): while (True): ''' try: c_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM...
malishevg/edugraph
refs/heads/master
common/djangoapps/util/testing.py
45
import sys from django.conf import settings from django.core.urlresolvers import clear_url_caches, resolve class UrlResetMixin(object): """Mixin to reset urls.py before and after a test Django memoizes the function that reads the urls module (whatever module urlconf names). The module itself is also sto...
ArneBab/pypyjs
refs/heads/master
website/demo/home/rfk/repos/pypy/lib-python/2.7/encodings/euc_kr.py
816
# # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_kr, codecs import _multibytecodec as mbc codec = _codecs_kr.getcodec('euc_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
scvalencia/ROBOCOL_desastres
refs/heads/master
Galileo/Python/venv/lib/python2.7/site-packages/werkzeug/test.py
116
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...
helldorado/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_devtestlabvirtualnetwork_facts.py
16
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', ...
kaedroho/django
refs/heads/master
tests/forms_tests/widget_tests/test_timeinput.py
84
from datetime import time from django.forms import TimeInput from django.test import override_settings from django.utils import translation from .base import WidgetTest class TimeInputTest(WidgetTest): widget = TimeInput() def test_render_none(self): self.check_html(self.widget, 'time', None, html=...
zottejos/merelcoin
refs/heads/master-0.10
qa/rpc-tests/python-bitcoinrpc/setup.py
172
#!/usr/bin/env python2 from distutils.core import setup setup(name='python-bitcoinrpc', version='0.1', description='Enhanced version of python-jsonrpc for use with Bitcoin', long_description=open('README').read(), author='Jeff Garzik', author_email='<jgarzik@exmulti.com>', maintain...
slamice/gmail
refs/heads/master
setup.py
12
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.di...
Semi-global/edx-platform
refs/heads/master
openedx/core/lib/api/__init__.py
199
""" Package for common functionality shared across various APIs. """
ds0nt/or-tools
refs/heads/master
examples/python/diet1.py
34
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
aidanlister/django
refs/heads/master
django/contrib/gis/apps.py
590
from django.apps import AppConfig from django.core import serializers from django.utils.translation import ugettext_lazy as _ class GISConfig(AppConfig): name = 'django.contrib.gis' verbose_name = _("GIS") def ready(self): if 'geojson' not in serializers.BUILTIN_SERIALIZERS: serialize...
endere/pyramid-learning-journal
refs/heads/master
pyramid_learning_journal/pyramid_learning_journal/models/meta.py
30
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import MetaData # Recommended naming convention used by Alembic, as various different database # providers will autogenerate vastly different names making migrations more # difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.ht...
ThoughtWorksInc/treadmill
refs/heads/master
treadmill/state.py
3
"""Basic listing module that treadmill_list and REST API can use""" import fnmatch import logging try: import pickle as pickle except ImportError: import pickle from enum import Enum from . import zknamespace as z _LOGGER = logging.getLogger(__name__) class StateEnum(Enum): # pylint: disable=W0232 ...
krishna-pandey-git/django
refs/heads/master
tests/template_tests/syntax_tests/test_lorem.py
443
from django.test import SimpleTestCase from ..utils import setup class LoremTagTests(SimpleTestCase): @setup({'lorem1': '{% lorem 3 w %}'}) def test_lorem1(self): output = self.engine.render_to_string('lorem1') self.assertEqual(output, 'lorem ipsum dolor')
Dziolas/invenio
refs/heads/scoap3
modules/websearch/lib/search_engine_query_parser.py
13
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2008, 2010, 2011, 2012, 2013 CERN. ## ## Invenio 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,...
bmourit/owl2x-linux__old__
refs/heads/3.14-experimental
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
wheeldog515/lightshowPi
refs/heads/master
py/examples/play_message.py
4
"""simple script to play a message in the lightshow""" # import the subprocess module so that # we can play some audio in a seperate process # which will allow us to manipulate the lights at the same time # the os module is also required, allowing the audio to be ended # if a play now event happens in the pre show imp...
amit0701/rally
refs/heads/master
rally/plugins/openstack/context/keystone/roles.py
1
# Copyright 2014: Mirantis Inc. # 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 b...
zofuthan/edx-platform
refs/heads/master
lms/djangoapps/courseware/management/commands/tests/test_clean_history.py
88
"""Test the clean_history management command.""" import fnmatch from mock import Mock from nose.plugins.attrib import attr import os.path import textwrap import dateutil.parser from django.test import TransactionTestCase from django.db import connection from courseware.management.commands.clean_history import Stude...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/graph_objs/histogram2d/_xbins.py
2
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class XBins(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "histogram2d" _path_str = "histogram2d.xbins" _valid_props = {"end", "size", "start"} # e...
costadorione/purestream
refs/heads/master
lib/mechanize/__init__.py
133
__all__ = [ 'AbstractBasicAuthHandler', 'AbstractDigestAuthHandler', 'BaseHandler', 'Browser', 'BrowserStateError', 'CacheFTPHandler', 'ContentTooShortError', 'Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy', 'DefaultFactory', 'FTPHandler', 'Factory', ...
cloudera/hue
refs/heads/master
desktop/core/ext-py/SQLAlchemy-1.3.17/test/orm/test_generative.py
4
import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import testing from sqlalchemy.orm import create_session from sqlalchemy.orm import mapper from sqlalchemy.orm import relationship from sqlalchemy.testing import eq_ from sqlalchemy.testi...
google-code-export/pyglet
refs/heads/master
contrib/scene2d/tests/scene2d/SPRITE_OVERLAP.py
29
#!/usr/bin/env python '''Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygl...
ThiagoGarciaAlves/erpnext
refs/heads/develop
erpnext/setup/doctype/sms_settings/sms_settings.py
15
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, json from frappe import _, throw, msgprint from frappe.utils import cstr, nowdate from frappe.model.document import Document class SMS...
MerlinZhang/osf.io
refs/heads/develop
website/addons/zotero/settings/__init__.py
562
import logging from .defaults import * # noqa logger = logging.getLogger(__name__) try: from .local import * # noqa except ImportError as error: logger.warn('No local.py settings file found')
gavincyi/BitcoinExchangeFH
refs/heads/master
befh/handler/zmq_handler.py
1
import logging from datetime import datetime import zmq from .handler import Handler LOGGER = logging.getLogger(__name__) class ZmqHandler(Handler): """Zmq handler. """ def __init__(self, connection, **kwargs): """Constructor. """ super().__init__(**kwargs) self._connec...
ingokegel/intellij-community
refs/heads/master
python/helpers/py3only/docutils/parsers/rst/languages/sv.py
49
# $Id: sv.py 7119 2011-09-02 13:00:23Z milde $ # Author: Adam Chodorowski <chodorowski@users.sourceforge.net> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must...
greg-hellings/ansible-modules-extras
refs/heads/devel
notification/slack.py
61
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Ramon de la Fuente <ramon@delafuente.nl> # # 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 ...
semonte/intellij-community
refs/heads/master
python/testData/mover/comment_afterDown.py
83
for item in lst: c = 1 #comment <caret> a = 1 b = 1
leiferikb/bitpop
refs/heads/master
src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mac.py
1
# Copyright (C) 2010 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 ...
mchrzanowski/ProjectEuler
refs/heads/master
src/python/Problem078.py
1
''' Created on Feb 24, 2012 @author: mchrzanowski ''' from time import time SUM_LIMIT = 10 ** 6 LIMIT = 6 * 10 ** 4 # found through trial and error def main(): numberOfWays = [0 for i in xrange(LIMIT + 1)] numberOfWays[0] = 1 # start it off solution = 0 for i in xrange(1, LIMI...
a0c/odoo
refs/heads/master
openerp/modules/registry.py
37
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
ContinuumIO/numpy
refs/heads/master
numpy/dual.py
71
""" Aliases for functions which may be accelerated by Scipy. Scipy_ can be built to use accelerated or otherwise improved libraries for FFTs, linear algebra, and special functions. This module allows developers to transparently support these accelerated functions when scipy is available but still support users who hav...
ChihoWon/Project-Euler
refs/heads/master
python/prob002.py
1
a = 1 b = 2 s = 0 while b <= 4000000: if b % 2 is 0: s += b a, b = b, a + b print s
bjorand/django-allauth
refs/heads/master
allauth/socialaccount/providers/hubic/models.py
4209
# Create your models here.
tbeckham/eutester
refs/heads/master
testcases/cloud_admin/get_debug.py
6
#!/usr/bin/python from eucaops import Eucaops from eutester.eutestcase import EutesterTestCase class GatherDebug(EutesterTestCase): basic_commands = ['df -B M', 'ps aux', 'free', 'uptime'] network_commands = ['iptables -L', ...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/camp/camp_crate_s1.py
85615
import sys def setup(core, object): return
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/dressed_noble_fat_twilek_female_02.py
85615
import sys def setup(core, object): return
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/loot/dungeon/death_watch_bunker/fuel_injector_tank.py
85615
import sys def setup(core, object): return
dr0pz0ne/sibble
refs/heads/add_block_rescue_task_variables
lib/ansible/executor/process/worker.py
7
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
fastconnect/cloudify-azure-plugin
refs/heads/master
plugin/public_ip.py
1
# -*- coding: utf-8 -*- ######## # Copyright (c) 2015 Fastconnect - Atost. 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/LICENS...
Pablo126/SSBW
refs/heads/master
Tarea1y2/flask_1/flask1/lib/python3.5/site-packages/itsdangerous.py
626
# -*- coding: utf-8 -*- """ itsdangerous ~~~~~~~~~~~~ A module that implements various functions to deal with untrusted sources. Mainly useful for web applications. :copyright: (c) 2014 by Armin Ronacher and the Django Software Foundation. :license: BSD, see LICENSE for more details. """ imp...
nicko96/Chrome-Infra
refs/heads/master
appengine/chromium_build_logs/third_party/httplib2/__init__.py
83
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
skybird6672/micropython
refs/heads/master
tests/basics/subclass_native2_list.py
117
class Base1: def __init__(self, *args): print("Base1.__init__", args) class Clist1(Base1, list): pass a = Clist1() print(len(a)) # Not compliant - list assignment should happen in list.__init__, which is not called # because there's Base1.__init__, but we assign in list.__new__ #a = Clist1([1, 2, 3]) ...
jeroenj/CouchPotatoServer
refs/heads/master
couchpotato/core/media/__init__.py
9
import os import traceback from couchpotato import CPLog from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.plugins.base import Plugin import six log = CPLog(__name__) class MediaBase(Plugin): _type = None d...
Rogentos/rogentos-anaconda
refs/heads/master
iw/partition_gui.py
3
# # partition_gui.py: allows the user to choose how to partition their disks # # Copyright (C) 2001, 2002 Red Hat, Inc. All rights reserved. # # 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; e...
bruderstein/PythonScript
refs/heads/master
PythonLib/full/distutils/tests/support.py
3
"""Support code for distutils test cases.""" import os import sys import shutil import tempfile import unittest import sysconfig from copy import deepcopy import test.support from distutils import log from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL from distutils.core import Distribution class LoggingSilen...
farsightsec/fsisketch
refs/heads/master
setup.py
1
# Copyright (c) 2014 by Farsight Security, 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 agre...
spacewalkproject/spacewalk
refs/heads/master
backend/satellite_tools/satComputePkgHeaders.py
2
# # Copyright (c) 2008--2018 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
qbicogneuro/QBI-Cogneuro-Docs
refs/heads/master
conf.py
1
# -*- coding: utf-8 -*- # # QBI-Cogneuro-Docs documentation build configuration file, created by # sphinx-quickstart on Fri Aug 25 12:19:37 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated f...
tsdmgz/ansible
refs/heads/devel
lib/ansible/modules/network/avi/avi_sslprofile.py
27
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
izrik/tudor
refs/heads/master
tests/logic_t/layer/LogicLayer/test_get_task_data.py
1
#!/usr/bin/env python import unittest from werkzeug.exceptions import NotFound, Forbidden, Unauthorized from persistence.sqlalchemy.layer import Pager from .util import generate_ll class GetTaskDataTest(unittest.TestCase): def setUp(self): self.ll = generate_ll() self.pl = self.ll.pl se...
stefankoegl/django-couchdb-utils
refs/heads/master
django_couchdb_utils/cache/couch.py
2
from datetime import datetime, timedelta from django.utils.encoding import smart_unicode, smart_str from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError class CacheClass(BaseCache): def add(self, key, value, timeout=0): if isinstance(value, unicode): value = value.en...
ahb0327/intellij-community
refs/heads/master
python/testData/mover/continueBreak_afterUp.py
83
test() continue for item in range(10): pass test1()
buhe/ssbc
refs/heads/master
search/migrations/0003_auto_20150511_0316.py
36
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('search', '0002_filelist_hash_statusreport'), ] operations = [ migrations.AlterField( model_name='statusreport', ...
spasovski/zamboni
refs/heads/master
mkt/developers/management/commands/exclude_games.py
3
import logging from django.core.management.base import BaseCommand import amo import mkt log = logging.getLogger('z.task') class Command(BaseCommand): help = ('Exclude pre-IARC unrated public games in Brazil/Germany.') def handle(self, *args, **options): # Avoid import error. from mkt.we...
ReactiveX/RxPY
refs/heads/master
examples/autocomplete/bottle_autocomplete.py
1
""" The automcomplete example rewritten for bottle / gevent. - Requires besides bottle and gevent also the geventwebsocket pip package - Instead of a future we create the inner stream for flat_map_latest manually """ from bottle import request, Bottle, abort import gevent from geventwebsocket import WebSocketError from...
eve-val/evemail-bridge
refs/heads/master
evelink/eve.py
2
from evelink import api class EVE(object): """Wrapper around /eve/ of the EVE API.""" @api.auto_api def __init__(self, api=None): self.api = api def certificate_tree(self): """Returns a list of certificates in eve.""" api_result = self.api.get('eve/CertificateTree') r...
ShipleyCollege/ViPteam1
refs/heads/master
ExtractAndAnalyzeCode/ProcessKey.py
1
from Node import * from Pin import * from Utilities import getQuotedString ### # FUNCTION : Handle Branch nodes ### def processKey(lines, buildMode, nodeNumber, OUTPUT_FOLDER): node = Node("Key Event ", buildMode) for line in lines: line = line.strip(" ") if line.startswith("InputKey="): keyName = line[...
QLGu/django-oscar
refs/heads/master
src/oscar/apps/order/abstract_models.py
22
from collections import OrderedDict from decimal import Decimal as D import hashlib from django.conf import settings from django.db import models from django.db.models import Sum from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettex...
HBPNeurorobotics/nest-simulator
refs/heads/master
pynest/nest/tests/compatibility.py
19
# -*- coding: utf-8 -*- # # compatibility.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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, ...
uberamd/NGECore2
refs/heads/master
scripts/object/mobile/dressed_npe_imp_officer.py
85615
import sys def setup(core, object): return
ukanga/SickRage
refs/heads/master
lib/chardet/langbulgarianmodel.py
53
######################## 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...
kello711/linux
refs/heads/master
scripts/analyze_suspend.py
1540
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
whitepyro/debian_server_setup
refs/heads/master
lib/sqlalchemy/dialects/sybase/pyodbc.py
79
# sybase/pyodbc.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: sybase+pyodbc :name: PyODBC :dbapi: pyodbc :connectstrin...
ashishnitinpatil/vnitstudnotifs
refs/heads/master
djangoappengine/management/commands/runserver.py
45
import logging from optparse import make_option import sys from django.db import connections from django.core.management.base import BaseCommand from django.core.management.commands.runserver import BaseRunserverCommand from django.core.exceptions import ImproperlyConfigured from google.appengine.tools import dev_app...
RandyLowery/erpnext
refs/heads/develop
erpnext/hr/doctype/department/test_department.py
107
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals test_ignore = ["Leave Block List"] import frappe test_records = frappe.get_test_records('Department')
Stanford-Online/edx-platform
refs/heads/master
openedx/core/lib/api/__init__.py
199
""" Package for common functionality shared across various APIs. """
sbalde/edx-platform
refs/heads/master
common/djangoapps/student/tests/test_bulk_email_settings.py
113
""" Unit tests for email feature flag in student dashboard. Additionally tests that bulk email is always disabled for non-Mongo backed courses, regardless of email feature flag, and that the view is conditionally available when Course Auth is turned on. """ import unittest from django.conf import settings from django....
djeo94/CouchPotatoServer
refs/heads/master
libs/suds/mx/appender.py
200
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gangadhar-kadam/nassimapp
refs/heads/master
hr/doctype/leave_allocation/__init__.py
37694
from __future__ import unicode_literals
razvanphp/arangodb
refs/heads/devel
3rdParty/V8-3.31.74.1/tools/testrunner/server/main.py
111
# Copyright 2012 the V8 project authors. 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 conditi...