repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
acsone/odoo
refs/heads/8.0
addons/email_template/tests/test_mail.py
190
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
beatrizjesus/my-first-blog
refs/heads/master
pasta/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py
87
import functools from pip._vendor.requests.adapters import HTTPAdapter from .controller import CacheController from .cache import DictCache from .filewrapper import CallbackFileWrapper class CacheControlAdapter(HTTPAdapter): invalidating_methods = set(['PUT', 'DELETE']) def __init__(self, cache=None, ...
jesonyang001/qarepo
refs/heads/master
askbot/management/commands/askbot_build_solr_schema.py
4
from optparse import make_option import sys from django.utils.translation import activate as activate_language from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.template import loader, Context from haystack.backends.solr_backend import SolrSearchBac...
2014c2g12/c2g12
refs/heads/master
c2wp/exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/test/__init__.py
2547
# Dummy file to make this directory a package.
adammenges/statsmodels
refs/heads/master
statsmodels/iolib/stata_summary_examples.py
39
""". regress totemp gnpdefl gnp unemp armed pop year Source | SS df MS Number of obs = 16 -------------+------------------------------ F( 6, 9) = 330.29 Model | 184172402 6 30695400.3 Prob > F = 0.0000 Residual | 836424.129 ...
hanlind/nova
refs/heads/master
nova/conf/ephemeral_storage.py
5
# Copyright 2015 Huawei Technology corp. # Copyright 2015 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.or...
vxvinh1511/djangoproject.com
refs/heads/master
dashboard/models.py
6
import ast import calendar import datetime import xmlrpc.client import feedparser import requests from django.conf import settings from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import connections, mod...
gfneto/bitcoin-abe
refs/heads/master
build/lib.linux-x86_64-2.7/Abe/Chain/Namecoin.py
28
# Copyright(C) 2014 by Abe developers. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero 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 dist...
patgmiller/django-guardian
refs/heads/devel
guardian/templatetags/guardian_tags.py
14
""" ``django-guardian`` template tags. To use in a template just put the following *load* tag inside a template:: {% load guardian_tags %} """ from __future__ import unicode_literals from django import template from django.contrib.auth.models import Group, AnonymousUser try: # Django < 1.8 from django.tem...
EUDAT-B2SHARE/b2share
refs/heads/master
b2share/modules/upgrade/api.py
1
# -*- coding: utf-8 -*- # # This file is part of EUDAT B2Share. # Copyright (C) 2017 CERN. # # B2Share 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...
CG-F16-24-Rutgers/steersuite-rutgers
refs/heads/master
steerstats/tools/deap/gp.py
8
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
sergio-teruel/bank-payment
refs/heads/8.0
__unported__/account_banking/banking_import_transaction.py
13
############################################################################## # # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>). # (C) 2011 Therp BV (<http://therp.nl>). # (C) 2011 Smile (<http://smile.fr>). # # All other contributions are (C) by their respective contributor...
GaetanCambier/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/_base/providers/nzb/binnewz/nzbclub.py
20
from bs4 import BeautifulSoup from nzbdownloader import NZBDownloader from nzbdownloader import NZBGetURLSearchResult from couchpotato.core.helpers.encoding import toUnicode,tryUrlencode from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.helpers.rss impo...
pacificIT/linux-udoo
refs/heads/4.0.8
arch/ia64/scripts/unwcheck.py
13143
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
BrianGallew/cassandra_range_repair
refs/heads/master
tests/test_ranges.py
1
#! /usr/bin/env python from __future__ import print_function import os, sys, unittest, pkg_resources, mock, logging sys.path.insert(0, '..') sys.path.insert(0, '.') sys.path.insert(0,os.path.abspath(__file__+"/../../src")) import range_repair def fake_init(self, options): '''Initialize the Token Container by ge...
anbangleo/NlsdeWeb
refs/heads/master
Python-3.6.0/Lib/lib2to3/pytree.py
30
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
andyfaff/scipy
refs/heads/master
scipy/stats/kde.py
7
#------------------------------------------------------------------------------- # # Define classes for (uni/multi)-variate kernel density estimation. # # Currently, only Gaussian kernels are implemented. # # Written by: Robert Kern # # Date: 2004-08-09 # # Modified: 2005-02-10 by Robert Kern. # Contr...
love436053/repos
refs/heads/master
python/wxpython/grid_create.py
1
#!/usr/bin/python # coding:utf-8 import wx import os import sys import wx.grid class GridWindow(wx.Frame): def __init__(self, parent, title): ''' wx.DEFAULT_FRAME_STYLE : 这是每个窗口的缺省风格,包含标题、可调节大小的边框,最大最小化按钮、关闭按钮和系统菜单。 wx.CAPTION : 在框架上增加一个标题栏,它显示该框架的标题属性。 wx.CLOSE_BO...
ifduyue/tornado
refs/heads/master
maint/test/redbot/red_test.py
6
#!/usr/bin/env python import logging from redbot.resource import HttpResource import redbot.speak as rs import thor import threading from tornado import gen from tornado.options import parse_command_line from tornado.testing import AsyncHTTPTestCase from tornado.web import RequestHandler, Application, asynchronous imp...
petwitter/petwitter
refs/heads/master
thesite/manage.py
2
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "thesite.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
calancha/DIRAC
refs/heads/rel-v6r12
DataManagementSystem/Agent/FTSSubmitAgent.py
3
######################################################################## # $HeadURL$ ######################################################################## """ :mod: FTSSubmitAgent ==================== FTS Submit Agent takes files from the TransferDB and submits them to the FTS using FTSRequest helper cl...
andresriancho/boto
refs/heads/develop
boto/datapipeline/layer1.py
14
# 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 ...
executive-consultants-of-los-angeles/rsum
refs/heads/master
rsum/home/apps.py
1
"""Home apps module.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class HomeConfig(AppConfig): """Home Config class.""" name = 'home'
kevinthesun/mxnet
refs/heads/master
example/reinforcement-learning/dqn/utils.py
52
# 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...
dgjustice/ansible
refs/heads/devel
lib/ansible/module_utils/_text.py
62
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
dymkowsk/mantid
refs/heads/master
Framework/PythonInterface/test/python/plugins/algorithms/CorrectTOFTest.py
3
from __future__ import (absolute_import, division, print_function) import unittest from mantid.simpleapi import CreateSampleWorkspace, CloneWorkspace, GroupWorkspaces, AddSampleLogMultiple, CreateEmptyTableWorkspace from testhelpers import run_algorithm from mantid.api import AnalysisDataService, WorkspaceGroup from s...
dwighthubbard/explorer-hat
refs/heads/master
explorerhat/captouch.py
1
"""Cap-touch Driver Library for Microchip CAP1xxx ICs Supports communication over i2c only. Currently supported ICs: CAP1208 - 8 Inputs CAP1188 - 8 Inputs, 8 LEDs """ from smbus import SMBus import atexit import signal import sys import threading import time # DEVICE MAP DEFAULT_ADDR = 0x28 # Supported devices PID_...
Terae/sujet_info
refs/heads/master
write_words/sample_frozen.py
1
# -*- coding: utf-8 -*- """ Created on Thu Feb 23 20:25:16 2017 @author: memo demonstrates inference with frozen graph def same as sample.py, but: - instead of loading model + checkpoint, loads frozen graph - instead of calling model.sample() function, uses own sample() function with named ops """ import numpy as np i...
Jgarcia-IAS/localizacion
refs/heads/master
openerp/addons-extra/odoo-pruebas/odoo-server/addons/payment_buckaroo/tests/test_buckaroo.py
321
# -*- coding: utf-8 -*- from lxml import objectify import urlparse import openerp from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_buckaroo.controllers.main import BuckarooController from opener...
skywin/p2pool
refs/heads/master
SOAPpy/URLopener.py
294
"""Provide a class for loading data from URL's that handles basic authentication""" ident = '$Id: URLopener.py 541 2004-01-31 04:20:06Z warnes $' from version import __version__ from Config import Config from urllib import FancyURLopener class URLopener(FancyURLopener): username = None passwd = None d...
chengjf/database-interface-doc-management
refs/heads/master
flask-demo/flask/Lib/collections/__main__.py
213
################################################################################ ### Simple tests ################################################################################ # verify that instances can be pickled from collections import namedtuple from pickle import loads, dumps Point = namedtuple('Point', 'x, y'...
damdam-s/purchase-workflow
refs/heads/8.0
__unported__/product_by_supplier/__init__.py
15
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2010-2013 Elico Corp. All Rights Reserved. # Author: Yannick Gouin <yannick.gouin@elico-corp.com> # # This program is free software: you can red...
Bitl/RBXLegacy-src
refs/heads/stable
Cut/RBXLegacyDiscordBot/lib/youtube_dl/extractor/restudy.py
62
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class RestudyIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)' _TEST = { 'url': 'https://www.restudy.dk/video/play/id/1637', 'info_dict': { 'id': ...
akosyakov/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/StubsOfNestedClasses/b.py
79
from c import Class1 class Class2(Class1): class SubClass2(Class1.SubClass1): def __init__(self, foo): Class1.SubClass1.__init__(self, foo)
SirEdvin/Pandas-Pipe
refs/heads/master
tests/converter_test.py
1
import pandas as pd from base import converter_test, ConstantDataSource def test_simple_converter(): df = pd.DataFrame( { 't1': [1, 2, 3], 't2': [-1, -2, -3] } ) result_df = pd.DataFrame( { 't1': [2, 4, 6], 't2': [-1, -2, -3] ...
thaumos/ansible
refs/heads/devel
lib/ansible/modules/network/netscaler/netscaler_service.py
36
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Citrix Systems # 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', ...
google/contentbox
refs/heads/master
third_party/django/core/mail/backends/locmem.py
227
""" Backend for test environment. """ from django.core import mail from django.core.mail.backends.base import BaseEmailBackend class EmailBackend(BaseEmailBackend): """A email backend for use during test sessions. The test connection stores email messages in a dummy outbox, rather than sending them out o...
drexly/tonginBlobStore
refs/heads/master
lib/django/db/models/fields/related.py
25
from __future__ import unicode_literals import warnings from functools import partial from django import forms from django.apps import apps from django.core import checks, exceptions from django.db import connection, router from django.db.backends import utils from django.db.models.deletion import CASCADE, SET_DEFAUL...
2014cdag2/w17x1
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/version.py
607
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (...
Yen-Chung-En/w16b_test
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/jqueryui/__init__.py
603
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
dennybaa/st2
refs/heads/master
st2common/st2common/persistence/keyvalue.py
4
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
andim27/magiccamp
refs/heads/master
django/contrib/gis/tests/relatedapp/tests.py
25
import os, unittest from django.contrib.gis.geos import * from django.contrib.gis.db.models import Collect, Count, Extent, F, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.tests.utils import mysql, oracle, postgis, spatialite, no_mysql, no_oracle, no_spatialite from django.conf ...
v4l3r10/goingxincoin
refs/heads/master
share/qt/make_spinner.py
4415
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/isosurface/hoverlabel/_namelengthsrc.py
1
import _plotly_utils.basevalidators class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="namelengthsrc", parent_name="isosurface.hoverlabel", **kwargs ): super(NamelengthsrcValidator, self).__init__( plotly_name=plotly_name, ...
jazzabeanie/python_koans
refs/heads/master
python2/koans/about_new_style_classes.py
81
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutNewStyleClasses(Koan): class OldStyleClass: "An old style class" # Original class style have been phased out in Python 3. class NewStyleClass(object): "A new style class" # Introduced in Python...
Venturi/cms
refs/heads/master
env/lib/python2.7/site-packages/unidecode/x06c.py
252
data = ( 'Lu ', # 0x00 'Mu ', # 0x01 'Li ', # 0x02 'Tong ', # 0x03 'Rong ', # 0x04 'Chang ', # 0x05 'Pu ', # 0x06 'Luo ', # 0x07 'Zhan ', # 0x08 'Sao ', # 0x09 'Zhan ', # 0x0a 'Meng ', # 0x0b 'Luo ', # 0x0c 'Qu ', # 0x0d 'Die ', # 0x0e 'Shi ', # 0x0f 'Di ', # 0x10 'Min...
aprefontaine/TMScheduler
refs/heads/master
tests/modeltests/m2m_recursive/models.py
18
""" 28. Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can...
steinam/teacher
refs/heads/master
jup_notebooks/data-science-ipython-notebooks-master/scikit-learn/fig_code/linear_regression.py
63
import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression def plot_linear_regression(): a = 0.5 b = 1.0 # x from 0 to 10 x = 30 * np.random.random(20) # y = a*x + b with noise y = a * x + b + np.random.normal(size=x.shape) # create a linear reg...
camptocamp/ngo-addons-backport
refs/heads/master
addons/process/__openerp__.py
65
# -*- 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...
sjev/ibpy
refs/heads/master
ib/sym/__init__.py
15
#!/usr/bin/env python # -*- coding: utf-8 -*- def durationMethod(k): def m(cls, val): return '%s %s' % (val, k) return classmethod(m) class HDDuration: seconds = durationMethod('S') days = durationMethod('D') weeks = durationMethod('W') months = durationMethod('M') years = durati...
longman694/youtube-dl
refs/heads/mod
youtube_dl/extractor/esri.py
64
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, parse_filesize, unified_strdate, ) class EsriVideoIE(InfoExtractor): _VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]...
NL66278/OCB
refs/heads/8.0
addons/analytic/analytic.py
110
# -*- 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...
songmonit/CTTMSONLINE_V8
refs/heads/master
addons/sale_design/wizard/__init__.py
2
# -*- 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...
consultit/Ely
refs/heads/master
ely/direct/data_structures_and_algorithms/ch12/merge_queue.py
1
# Copyright 2013, Michael H. Goldwasser # # Developed for use with the book: # # Data Structures and Algorithms in Python # Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser # John Wiley & Sons, 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of...
Salat-Cx65/python-for-android
refs/heads/master
python3-alpha/python3-src/Tools/pybench/Strings.py
92
from pybench import Test import sys try: intern except NameError: intern = sys.intern class ConcatStrings(Test): version = 2.0 operations = 10 * 5 rounds = 100000 def test(self): # Make sure the strings are *not* interned s = ''.join(map(str,range(100))) t = ''.join...
cvegaj/ElectriCERT
refs/heads/master
venv3/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/version.py
1151
# 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 collections import itertools import re from ._structures import In...
linjeffrey/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/mac.py
113
# Copyright (C) 2011 Google Inc. All rights reserved. # Copyright (C) 2012, 2013 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: # # * Redistributions of source code must retain the...
jaduse/pocket-on-term
refs/heads/master
pot/reader.py
1
# -*- coding: utf-8 -*- import urllib.request import urllib.parse import urllib.error import json import sys import os import urwid from subprocess import Popen from subprocess import PIPE from subprocess import SubprocessError from bs4 import BeautifulSoup from .pocketapi import PocketUtils class Reader: PA...
WillisXChen/django-oscar
refs/heads/master
oscar/lib/python2.7/site-packages/django/core/cache/backends/filebased.py
428
"File-based cache backend" import errno import glob import hashlib import io import os import random import tempfile import time import zlib from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache from django.core.files.move import file_move_safe from django.utils.encoding import force_bytes try: f...
costadorione/purestream
refs/heads/master
lib/requests/packages/chardet/sjisprober.py
1776
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
AnishShah/tensorflow
refs/heads/master
tensorflow/python/platform/app_test.py
201
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
dhuang/incubator-airflow
refs/heads/master
airflow/utils/state.py
3
# -*- 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 ...
amenonsen/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_remote_role.py
22
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks 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 import os import json import pytest import sys if sys.version_info < (2...
kernc/scikit-learn
refs/heads/master
sklearn/neighbors/nearest_centroid.py
34
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
yacneyac/gevent-socketio
refs/heads/master
examples/django_chat/chat/views.py
11
from socketio import socketio_manage from django.http import HttpResponse from django.contrib.auth.decorators import user_passes_test from django.shortcuts import get_object_or_404, render, redirect from chat.models import ChatRoom from chat.sockets import ChatNamespace def rooms(request, template="rooms.html"): ...
harshilasu/GraphicMelon
refs/heads/master
y/google-cloud-sdk/lib/requests/packages/urllib3/contrib/ntlmpool.py
714
# urllib3/contrib/ntlmpool.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 """ NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://co...
ThinkOpen-Solutions/odoo
refs/heads/stable
addons/l10n_si/__init__.py
439
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright: (C) 2012 - Mentis d.o.o., Dravograd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affe...
krzysztof/invenio-openaire
refs/heads/master
invenio_openaire/fetchers.py
1
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016 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, or (at your option) any later...
tectronics/mythbox
refs/heads/master
resources/lib/simplejson/simplejson/tests/test_check_circular.py
414
from unittest import TestCase import simplejson as json def default_iterable(obj): return list(obj) class TestCheckCircular(TestCase): def test_circular_dict(self): dct = {} dct['a'] = dct self.assertRaises(ValueError, json.dumps, dct) def test_circular_list(self): lst = [...
jesseditson/rethinkdb
refs/heads/next
scripts/compile-web-assets.py
34
#!/usr/bin/env python from __future__ import print_function, division import os import sys import itertools def main(): try: assets_root = sys.argv[1] assert os.path.isdir(assets_root) except: print("Error: First argument must be a directory", file=sys.stderr) sys.exit(1) ...
makinacorpus/rdiff-backup
refs/heads/master
rdiff_backup/compilec.py
4
#!/usr/bin/env python import sys, os from distutils.core import setup, Extension assert len(sys.argv) == 1 sys.argv.append("build") setup(name="CModule", version="0.9.0", description="rdiff-backup's C component", ext_modules=[Extension("C", ["cmodule.c"]), Extension("_librsync", ["_librsyncmodule.c"]...
eunchong/build
refs/heads/master
third_party/cherrypy/_cpdispatch.py
82
"""CherryPy dispatchers. A 'dispatcher' is the object which looks up the 'page handler' callable and collects config for the current request based on the path_info, other request attributes, and the application architecture. The core calls the dispatcher as early as possible, passing it a 'path_info' argument. The de...
brunocanning/release
refs/heads/master
src/annotations2html/bin/build-doc.py
5
#!/usr/bin/env python2 import os import re import sys import errno import tempfile from subprocess import Popen, PIPE import shutil import time from time import ctime import argparse import logging from collections import defaultdict from operator import itemgetter from lxml import etree from mako.lookup import Templ...
SiennaStellar/linux-3.10.20_kelleni
refs/heads/master
tools/perf/scripts/python/net_dropmonitor.py
2669
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
anasazi/POP-REU-Project
refs/heads/master
pkgs/libs/libxml2/src/python/tests/reader2.py
87
#!/usr/bin/python -u # # this tests the DTD validation with the XmlTextReader interface # import sys import glob import string import StringIO import libxml2 # Memory debug specific libxml2.debugMemory(1) err="" expect="""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute...
Jannes123/inasafe
refs/heads/develop
safe/impact_functions/generic/classified_polygon_building/test/__init__.py
229
__author__ = 'akbar'
ralphbean/raptorizemw
refs/heads/master
examples/tg2-raptorized/tg2raptorized/config/environment.py
1
# -*- coding: utf-8 -*- """WSGI environment setup for tg2-raptorized.""" from tg2raptorized.config.app_cfg import base_config __all__ = ['load_environment'] #Use base_config to setup the environment loader function load_environment = base_config.make_load_environment()
yongtang/tensorflow
refs/heads/master
tensorflow/tools/docs/base_dir.py
5
# Lint as: python3 # Copyright 2018 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 ...
sabi0/intellij-community
refs/heads/master
python/testData/codeInsight/smartEnter/docstring.py
83
"""<caret>some text"
T-002/obd2datacollectorpi
refs/heads/master
logwatcher/logwatcher.py
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- #The MIT License (MIT) # #Copyright (c) 2013-2014 Christian Schwarz # #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, includin...
jbkkd/django-taggit
refs/heads/master
taggit/views.py
24
from __future__ import unicode_literals from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404 from django.views.generic.list import ListView from taggit.models import Tag, TaggedItem def tagged_object_list(request, slug, queryset, **kwargs): if callable(querys...
2013Commons/HUE-SHARK
refs/heads/master
desktop/core/ext-py/Pygments-1.3.1/build/lib.linux-i686-2.7/pygments/filter.py
75
# -*- coding: utf-8 -*- """ pygments.filter ~~~~~~~~~~~~~~~ Module that implements the default filter. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ def apply_filters(stream, filters, lexer=None): """ Use this method to app...
emrehayirci/deps
refs/heads/master
posts/urls.py
1
from django.conf.urls import url from .views import details, index, create_post, create_comment, remove_comment urlpatterns = [ url(r'^(?P<post_id>[0-9])/comments/(?P<comment_id>[0-9])/$', remove_comment, name='remove-comment'), url(r'^(?P<post_id>[0-9])/comments/$', create_comment, name='create-comment'), ...
googleads/googleads-python-lib
refs/heads/master
googleads/ad_manager.py
1
# Copyright 2013 Google 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 applicable law or ...
SCOAP3/invenio
refs/heads/master
invenio/modules/sequencegenerator/models.py
18
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2014 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, or (at your option) any...
Ubuntu-Solutions-Engineering/conjure
refs/heads/master
conjureup/controllers/base/showsteps/tui.py
9
from conjureup import controllers class ShowStepsController: def render(self): controllers.use('configapps').render() _controller_class = ShowStepsController
googlearchive/big-rig
refs/heads/master
app/src/thirdparty/telemetry/internal/backends/facebook_credentials_backend.py
31
# Copyright 2013 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. from telemetry.internal.backends import form_based_credentials_backend class FacebookCredentialsBackend( form_based_credentials_backend.FormBasedCreden...
tobikausk/nest-simulator
refs/heads/master
pynest/examples/gap_junctions_two_neurons.py
13
# -*- coding: utf-8 -*- # # gap_junctions_two_neurons.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 t...
postrational/django
refs/heads/master
tests/reserved_names/models.py
109
""" 18. Using SQL reserved names Need to use a reserved SQL name as a column name or table name? Need to include a hyphen in a column or table name? No problem. Django quotes names appropriately behind the scenes, so your database won't complain about reserved-name usage. """ from django.db import models from django....
neilh10/micropython
refs/heads/master
tests/basics/getattr1.py
105
class A: var = 132 def __init__(self): self.var2 = 34 def meth(self, i): return 42 + i a = A() print(getattr(a, "var")) print(getattr(a, "var2")) print(getattr(a, "meth")(5)) print(getattr(a, "_none_such", 123)) print(getattr(list, "foo", 456)) print(getattr(a, "va" + "r2"))
OpenDMM/bitbake
refs/heads/master
lib/bb/fetch2/perforce.py
1
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 Chris Larson # # This program is free software; you can redistribute it and/or modify # it u...
XhmikosR/mpc-hc
refs/heads/develop
src/mpc-hc/mpcresources/UpdateISPO.py
21
# (C) 2013, 2015 see Authors.txt # # This file is part of MPC-HC. # # MPC-HC 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. # # MPC-HC...
lianliuwei/gyp
refs/heads/master
pylib/gyp/generator/make.py
1
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in fr...
damoti/pyjx-gwt
refs/heads/master
gwt/pyjamas/gmaps/Marker.py
7
# Copyright (C) 2009 Daniel Carvalho <idnael@gmail.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 la...
zulip/zulip
refs/heads/master
zerver/migrations/0268_add_userpresence_realm_timestamp_index.py
5
# Generated by Django 1.11.28 on 2020-02-08 20:34 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("zerver", "0267_backfill_userpresence_realm_id"), ] operations = [ migrations.AlterField( model...
adit-chandra/tensorflow
refs/heads/master
tensorflow/python/ops/ragged/ragged_constant_value_op_test.py
9
# Copyright 2018 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...
android-ia/platform_external_chromium_org
refs/heads/master
chrome/tools/webforms_extractor.py
185
#!/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. """Extracts registration forms from the corresponding HTML files. Used for extracting forms within HTML files. This script is use...
HEG-Arc/paleo-2015-gestionair-remote
refs/heads/master
remote_control.py
1
import threading import RPi.GPIO as GPIO #from GPIOEmulator.EmulatorGUI import GPIO import time import requests import json import logging API_URL = 'http://192.168.1.1' class Led(object): def __init__(self, gpio): self.gpio = gpio self._stop = None self.blinking = False def blink(se...
Stavitsky/nova
refs/heads/master
nova/api/openstack/compute/plugins/v3/image_size.py
36
# Copyright 2013 Rackspace Hosting # 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 require...
yokose-ks/edx-platform
refs/heads/gacco3/master
common/lib/xmodule/xmodule/templates.py
231
""" This module handles loading xmodule templates These templates are used by the CMS to provide content that overrides xmodule defaults for samples. ``Template``s are defined in x_module. They contain 2 attributes: :metadata: A dictionary with the template metadata :data: A JSON value that defines the templat...