repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
CYBAI/servo
refs/heads/master
tests/wpt/web-platform-tests/background-fetch/resources/upload.py
20
# Simply returns the request body to check if the upload succeeded. def main(request, response): return 200, [(b"Content-Type", request.headers[b'content-type'])], request.body
electronifie/pconfig
refs/heads/master
setup.py
1
#!/usr/bin/env python from distutils.core import setup setup(name='pconfig', version='0.1', description='Node.js cconfig port for Python', author='Anthony Schneider', author_email='anthony.schneider@electronifie.com', url='https://github.com/electronifie/pconfig' )
davisein/jitsudone
refs/heads/master
django/core/cache/backends/dummy.py
209
"Dummy cache backend" from django.core.cache.backends.base import BaseCache class DummyCache(BaseCache): def __init__(self, host, *args, **kwargs): BaseCache.__init__(self, *args, **kwargs) def add(self, key, value, timeout=None, version=None): key = self.make_key(key, version=version) ...
westinedu/wrgroups
refs/heads/master
django/contrib/localflavor/fr/fr_department.py
314
# -*- coding: utf-8 -*- DEPARTMENT_ASCII_CHOICES = ( ('01', '01 - Ain'), ('02', '02 - Aisne'), ('03', '03 - Allier'), ('04', '04 - Alpes-de-Haute-Provence'), ('05', '05 - Hautes-Alpes'), ('06', '06 - Alpes-Maritimes'), ('07', '07 - Ardeche'), ('08', '08 - Ardennes'), ('09', '09 - Ar...
creativcoder/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py
117
import imp import os def main(request, response): response.headers.set('Access-Control-Allow-Origin', request.headers.get("origin")); response.headers.set('Access-Control-Allow-Credentials', 'true'); response.headers.set('Access-Control-Allow-Methods', 'GET'); response.headers.set('Access-Control-Allow...
fhaoquan/kbengine
refs/heads/master
kbe/src/lib/python/PC/testpy.py
89
import sys # This is a test module for Python. It looks in the standard # places for various *.py files. If these are moved, you must # change this module too. try: import os except: print("""Could not import the standard "os" module. Please check your PYTHONPATH environment variable.""") sys.exit(1) ...
AWegnerGitHub/IRVING
refs/heads/master
irving/smart_selects/urls.py
1
from django.conf.urls.defaults import * urlpatterns = patterns('smart_selects.views', url(r'^all/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<value>[\w\-]+)/$', 'filterchain_all', name='chained_filter_all'), url(r'^filter/(?P<app>[\w\-]+)/(?P<model>[\w\-]+)/(?P<field>[\w\-]+)/(?P<value>[\w\-]+)/$...
throwable-one/lettuce
refs/heads/master
tests/integration/lib/Django-1.2.5/django/contrib/flatpages/middleware.py
641
from django.contrib.flatpages.views import flatpage from django.http import Http404 from django.conf import settings class FlatpageFallbackMiddleware(object): def process_response(self, request, response): if response.status_code != 404: return response # No need to check for a flatpage for non...
samthor/intellij-community
refs/heads/master
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/__init__.py
102
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
jbking/django-stdnet
refs/heads/master
tests/fields/datetime_field.py
2
from ..testcase import BaseTestCase class DateTimeFieldTestCase(BaseTestCase): def test_auto_now(self): from datetime import datetime from djangostdnet import models class AModel(models.Model): updated = models.DateTimeField(auto_now=True) class Meta: ...
cutefluffykittens/ScavengerHunt
refs/heads/master
Interface/apps.py
1
from django.apps import AppConfig class InterfaceConfig(AppConfig): name = 'Interface'
mohamed--abdel-maksoud/chromium.src
refs/heads/nw12
third_party/protobuf/python/google/protobuf/internal/message_listener.py
590
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
fevxie/odoo
refs/heads/8.0
addons/hr/res_users.py
303
from openerp import api from openerp.osv import fields, osv class res_users(osv.Model): """ Update of res.users class - if adding groups to an user, check if base.group_user is in it (member of 'Employee'), create an employee form linked to it. """ _name = 'res.users' _inherit = ['res....
enclose-io/compiler
refs/heads/master
current/tools/gyp/pylib/gyp/generator/eclipse.py
4
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
eayunstack/nova
refs/heads/develop
nova/tests/virt/baremetal/test_iboot_pdu.py
27
# Copyright 2013 Red Hat 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 ...
litchfield/django
refs/heads/master
django/conf/locale/de_CH/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i' DATE...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/googlecloudsdk/third_party/apis/sqladmin/v1beta3/sqladmin_v1beta3_messages.py
4
"""Generated message classes for sqladmin version v1beta3. Creates and configures Cloud SQL instances, which provide fully-managed MySQL databases. """ # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.protorpclite import message_types as _message_types from apitools.base.protorp...
aaltinisik/OCBAltinkaya
refs/heads/8.0
addons/website_crm/controllers/main.py
250
# -*- coding: utf-8 -*- import base64 import werkzeug import werkzeug.urls from openerp import http, SUPERUSER_ID from openerp.http import request from openerp.tools.translate import _ class contactus(http.Controller): def generate_google_map_url(self, street, city, city_zip, country_name): url = "http...
kieferbonk/xbmc-finnish-tv
refs/heads/master
plugin.video.ruutu/html5lib/treewalkers/etree.py
658
from __future__ import absolute_import, division, unicode_literals try: from collections import OrderedDict except ImportError: try: from ordereddict import OrderedDict except ImportError: OrderedDict = dict import gettext _ = gettext.gettext import re from six import text_type from . im...
proppy/protobuf-debian
refs/heads/master
gtest/scripts/fuse_gtest_files.py
314
#!/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...
pfgenyun/tamarin-redux
refs/heads/master
test/cmdline/testLanguage.py
8
#!/usr/bin/env python #!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from cmdutils import * import os def run(): r=RunTestLib() if ...
WangKaimin/sublime-evernote
refs/heads/master
lib/pygments/lexers/_vimbuiltins.py
57
# Split up in multiple functions so it's importable by jython, which has a # per-method size limit. def _getauto(): return [('BufAdd','BufAdd'),('BufCreate','BufCreate'),('BufDelete','BufDelete'),('BufEnter','BufEnter'),('BufFilePost','BufFilePost'),('BufFilePre','BufFilePre'),('BufHidden','BufHidden'),('BufLeave'...
Ex-Mente/auxi.0
refs/heads/develop
auxi/modelling/financial/reporting_test.py
1
#!/usr/bin/env python3 """ This module provides testing code for the auxi.modelling.financial.des module. """ import unittest from datetime import datetime from auxi.modelling.financial.reporting import GeneralLedgerStructure from auxi.modelling.financial.reporting import TransactionList from auxi.modelling.financial...
xxsergzzxx/python-for-android
refs/heads/master
python-build/python-libs/gdata/build/lib/gdata/oauth/rsa.py
225
#!/usr/bin/python """ requires tlslite - http://trevp.net/tlslite/ """ import binascii from gdata.tlslite.utils import keyfactory from gdata.tlslite.utils import cryptomath # XXX andy: ugly local import due to module name, oauth.oauth import gdata.oauth as oauth class OAuthSignatureMethod_RSA_SHA1(oauth.OAuthSign...
AthinaB/synnefo
refs/heads/feature-newui-pithos
snf-astakos-app/astakos/im/management/commands/user-list.py
10
# Copyright (C) 2010-2014 GRNET S.A. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
chirilo/remo
refs/heads/master
vendor-local/lib/python/docutils/parsers/rst/languages/cs.py
6
# $Id: cs.py 6460 2010-10-29 22:18:44Z milde $ # Author: Marek Blaha <mb@dat.cz> # 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 be # translated for each lan...
daodaoliang/bokeh
refs/heads/master
sphinx/source/docs/user_guide/source_examples/interaction_linked_brushing.py
44
from bokeh.models import ColumnDataSource from bokeh.plotting import figure, gridplot, output_file, show output_file("brushing.html") x = list(range(-20, 21)) y0 = [abs(xx) for xx in x] y1 = [xx**2 for xx in x] # create a column data source for the plots to share source = ColumnDataSource(data=dict(x=x, y0=y0, y1=y1...
kehao95/Wechat_LearnHelper
refs/heads/master
src/env/lib/python3.5/site-packages/flask/testsuite/test_apps/flaskext/oldext_simple.py
629
ext_id = 'oldext_simple'
jwren/intellij-community
refs/heads/master
python/helpers/pydev/pydev_tests_python/test_process_command_line.py
26
import unittest class Test(unittest.TestCase): def testProcessCommandLine(self): from _pydevd_bundle.pydevd_command_line_handling import process_command_line, setup_to_argv setup = process_command_line(['pydevd.py', '--port', '1', '--save-threading']) assert setup['save-threading'] ...
egabancho/invenio
refs/heads/pu
invenio/modules/jsonalchemy/jsonext/readers/json_reader.py
2
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 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, or (at your option) a...
orgito/ansible
refs/heads/devel
test/units/template/test_templar.py
29
# (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...
jaywreddy/django
refs/heads/master
tests/test_discovery_sample/tests_sample.py
466
import doctest from unittest import TestCase from django.test import SimpleTestCase, TestCase as DjangoTestCase from . import doctests class TestVanillaUnittest(TestCase): def test_sample(self): self.assertEqual(1, 1) class TestDjangoTestCase(DjangoTestCase): def test_sample(self): self....
biziwalker/mtasa
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/subdirectory/gyptest-top-all.py
261
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verifies building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
upsuper/servo
refs/heads/master
python/servo/testing_commands.py
7
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
davesteele/comitup
refs/heads/master
test/test_nm.py
1
import pytest # Copyright (c) 2017-2019 David Steele <dsteele@gmail.com> # # SPDX-License-Identifier: GPL-2.0-or-later # License-Filename: LICENSE from mock import Mock, patch from comitup import nm @pytest.fixture() def no_device_fxt(monkeypatch): monkeypatch.setattr("comitup.nm.nm.NetworkManager.GetDevices", ...
yangming85/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/django/contrib/sessions/tests.py
156
import base64 from datetime import datetime, timedelta import pickle import shutil import tempfile from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DatabaseSession from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.session...
myarjunar/inasafe
refs/heads/develop
safe/datastore/test/__init__.py
1054
# coding=utf-8
elpaso/QGIS
refs/heads/master
python/core/auto_additions/qgssnappingconfig.py
23
# The following has been generated automatically from src/core/qgssnappingconfig.h QgsSnappingConfig.SnappingMode.baseClass = QgsSnappingConfig QgsSnappingConfig.SnappingType.baseClass = QgsSnappingConfig
a-doumoulakis/tensorflow
refs/heads/master
tensorflow/contrib/remote_fused_graph/pylib/python/ops/remote_fused_graph_ops.py
88
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
migonzalvar/youtube-dl
refs/heads/master
youtube_dl/extractor/dhm.py
110
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import parse_duration class DHMIE(InfoExtractor): IE_DESC = 'Filmarchiv - Deutsches Historisches Museum' _VALID_URL = r'https?://(?:www\.)?dhm\.de/filmarchiv/(?:[^/]+/)+(?P<id>[^/]+)' _TESTS = [{ 'url': 'http:...
klmitch/keystone
refs/heads/master
keystone/identity/mapping_backends/base.py
1
# Copyright 2012 OpenStack Foundation # # 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...
OBIGOGIT/etch
refs/heads/master
binding-python/runtime/src/main/python/etch/binding/support/ObjSession.py
8
""" # 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...
SOKP/external_chromium_org
refs/heads/sokp-l5.1
third_party/closure_compiler/build/inputs.py
32
#!/usr/bin/python # Copyright 2014 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. import argparse import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) import processor def GetInputs(a...
aperigault/ansible
refs/heads/devel
contrib/inventory/cloudforms.py
37
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Copyright (C) 2016 Guido Günther <agx@sigxcpu.org> # # This script 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 ...
V155/qutebrowser
refs/heads/master
qutebrowser/browser/webengine/certificateerror.py
2
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
airbnb/airflow
refs/heads/master
tests/providers/amazon/aws/operators/test_emr_add_steps.py
5
# # 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...
xapi-project/sm
refs/heads/master
tests/test_SR.py
1
from __future__ import print_function import unittest import mock import SR from SR import deviceCheck import EXTSR import xs_errors class TestSR(unittest.TestCase): class deviceTest(object): def __init__(self, device=None): self.dconf = {} if device: self.dconf['...
tony5856/repository.tonysrepo
refs/heads/master
plugin.program.xmlerator/unidecode/x05d.py
252
data = ( 'Lang ', # 0x00 'Kan ', # 0x01 'Lao ', # 0x02 'Lai ', # 0x03 'Xian ', # 0x04 'Que ', # 0x05 'Kong ', # 0x06 'Chong ', # 0x07 'Chong ', # 0x08 'Ta ', # 0x09 'Lin ', # 0x0a 'Hua ', # 0x0b 'Ju ', # 0x0c 'Lai ', # 0x0d 'Qi ', # 0x0e 'Min ', # 0x0f 'Kun ', # 0x10 '...
munhyunsu/Hobby
refs/heads/master
DjangoPractice/mysite/polls/migrations/0001_initial.py
1
# Generated by Django 2.0.6 on 2018-06-12 01:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Choice', fields=[ ...
shubhamchopra/spark
refs/heads/master
python/pyspark/mllib/classification.py
34
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
ganeti/ganeti
refs/heads/master
test/py/ganeti.storage.filestorage_unittest.py
1
#!/usr/bin/python3 # # Copyright (C) 2013, 2016 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: # # 1. Redistributions of source code must retain the above copyright notice, # this ...
SRI-CSL/whole-program-llvm
refs/heads/master
wllvm/wllvm.py
2
#!/usr/bin/env python """This is a wrapper around the real compiler. It first invokes a real compiler to generate an object file. Then it invokes a bitcode compiler to generate a parallel bitcode file. It records the location of the bitcode in an ELF section of the object file so that it can be found later after all ...
mzp/iTerm2
refs/heads/master
tests/esctest/tests/decrqss.py
31
from esc import FF, NUL, blank import escargs import esccmd import escio from escutil import AssertEQ, AssertScreenCharsInRectEqual, GetCursorPosition, GetScreenSize, knownBug, optionRequired, vtLevel from esctypes import Point, Rect class DECRQSSTests(object): @knownBug(terminal="iTerm2", reason="Not implemented.")...
fergalbyrne/nupic
refs/heads/master
examples/opf/experiments/opfrunexperiment_test/simpleOPF/hotgym_no_agg/description.py
32
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
NProfileAnalysisComputationalTool/npact
refs/heads/master
pynpact/pynpact/executors.py
1
import string import random import logging log = logging.getLogger(__name__) def randomid(length=16): return ''.join( random.choice(string.lowercase) for i in range(length)) class InlineExecutor(object): "Does everything in line" pool = None tasks = None def __init__(self): se...
rohitranjan1991/home-assistant
refs/heads/dev
homeassistant/components/sensor/__init__.py
16
""" homeassistant.components.sensor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component to interface with various sensors that can be monitored. """ import logging from homeassistant.helpers.entity_component import EntityComponent from homeassistant.components import wink, zwave, isy994, verisure DOMAIN = 'sensor' DEPENDENCIES...
wheelcomplex/flatbuffers
refs/heads/master
tests/MyGame/Example/TestSimpleTableWithEnum.py
34
# automatically generated, do not modify # namespace: Example import flatbuffers class TestSimpleTableWithEnum(object): __slots__ = ['_tab'] # TestSimpleTableWithEnum def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos) # TestSimpleTableWithEnum def Color(self): ...
haad/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vca_fw.py
26
#!/usr/bin/python # Copyright (c) 2015 VMware, Inc. All Rights Reserved. # 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', ...
glimix/limix-inference
refs/heads/master
glimix_core/lmm/_kron2sum_scan.py
1
from numpy import asarray, block, clip, inf, kron, sqrt from numpy.linalg import pinv from glimix_core._util import rsolve, unvec, vec from .._util import cache, log2pi, safe_log class KronFastScanner: """ Approximated fast inference over several covariates. Specifically, it maximizes the log of the ma...
aeroxis/sultan
refs/heads/master
test/unit/sultan/test_result.py
1
import mock import unittest from sultan.result import Result class SultanResultTestCase(unittest.TestCase): def setUp(self): self.stdout = ''' drwxr-xr-x 3 davydany wheel 102 Sep 10 08:45 27D4E633-1477-40F6-AE3B-01AA85A6CBD9 prw-rw-rw- 1 davydany wheel 0 Sep 7 06:52 30B00D4E-939A-404E-B2E...
atitus5/MiniPlaces
refs/heads/master
vgg_D_bn_train.py
1
import os, datetime import numpy as np import tensorflow as tf from tensorflow.contrib.layers.python.layers import batch_norm from DataLoader import * # Dataset Parameters batch_size = 100 load_size = 128 fine_size = 100 c = 3 # Note: may want to actually recompute this, or just do away with it... data_mean = np.asar...
utopiaprince/micropython
refs/heads/master
tests/misc/rge_sm.py
101
# evolve the RGEs of the standard model from electroweak scale up # by dpgeorge import math class RungeKutta(object): def __init__(self, functions, initConditions, t0, dh, save=True): self.Trajectory, self.save = [[t0] + initConditions], save self.functions = [lambda *args: 1.0] + list(functi...
gladsonvm/haystackdemo
refs/heads/master
lib/python2.7/site-packages/django/conf/locale/ca/formats.py
99
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = r'j \d\e F \d\e...
ndemir/scrapy
refs/heads/master
scrapy/tests/test_contrib_spiderstate.py
29
import os from datetime import datetime from twisted.trial import unittest from scrapy.contrib.spiderstate import SpiderState from scrapy.spider import BaseSpider class SpiderStateTest(unittest.TestCase): def test_store_load(self): jobdir = self.mktemp() os.mkdir(jobdir) spider = BaseSpi...
RevolutionMC/Revolution
refs/heads/master
plugin.video.PsychoTV/resources/lib/resolvers/vidspot.py
6
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
roxyboy/bokeh
refs/heads/master
sphinx/source/docs/tutorials/exercises/boxplot.py
22
import numpy as np import pandas as pd from bokeh.plotting import figure, output_file, show # Generate some synthetic time series for six different categories cats = list("abcdef") score = np.random.randn(2000) g = np.random.choice(cats, 2000) for i, l in enumerate(cats): score[g == l] += i // 2 df = pd.DataFrame...
moijes12/oh-mainline
refs/heads/master
vendor/packages/Django/django/contrib/gis/utils/layermapping.py
98
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: http://geodjango.org/docs/layermapping.html """ impo...
OsoTech/appengine-mapreduce
refs/heads/master
python/src/mapreduce/lib/graphy/common.py
77
#!/usr/bin/env python # # Copyright 2008 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 ...
ptmr3/GalaxyNote3-Kernel-kk-
refs/heads/master
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
TeamRegular/android_kernel_madcatz_mojo
refs/heads/cm-13.0
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
frank10704/DF_GCS_W
refs/heads/master
MissionPlanner-master/Lib/pdb.py
42
#! /usr/bin/env python """A Python debugger.""" # (See pdb.doc for documentation.) import sys import linecache import cmd import bdb from repr import Repr import os import re import pprint import traceback class Restart(Exception): """Causes a debugger to be restarted for the debugged python ...
bnoordhuis/suv
refs/heads/master
deps/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py
260
#!/usr/bin/env python # Copyright (c) 2013 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. """ Verifies inclusion of $HOME/.gyp_new/include.gypi works when GYP_CONFIG_DIR is set. """ import os import TestGyp test = TestGyp.TestGy...
spookylukey/django-mailer
refs/heads/master
mailer/management/commands/retry_deferred.py
4
import logging from django.core.management.base import BaseCommand from django.db import connection from mailer.models import Message from mailer.management.helpers import CronArgMixin class Command(CronArgMixin, BaseCommand): help = "Attempt to resend any deferred mail." def handle(self, *args, **options)...
jeffdwyatt/taiga-back
refs/heads/master
taiga/users/serializers.py
6
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # 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 F...
ryancoleman/autodock-vina
refs/heads/master
boost_1_54_0/tools/build/v2/test/notfile.py
44
#!/usr/bin/python # Copyright (C) Vladimir Prus 2005. # 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) # Basic tests for the 'notfile' rule. import BoostBuild import os t = BoostBuild.Tester() t.write("jamroot.j...
croniccorey/WIP-8x50
refs/heads/CAF-3.0
tools/perf/scripts/python/netdev-times.py
11271
# Display a process of packets and processed time. # It helps us to investigate networking or network device. # # options # tx: show only tx chart # rx: show only rx chart # dev=: show only thing related to specified device # debug: work with debug mode. It shows buffer status. import os import sys sys.path.append(os...
simon-pepin/scikit-learn
refs/heads/master
examples/mixture/plot_gmm_sin.py
248
""" ================================= Gaussian Mixture Model Sine Curve ================================= This example highlights the advantages of the Dirichlet Process: complexity control and dealing with sparse data. The dataset is formed by 100 points loosely spaced following a noisy sine curve. The fit by the GMM...
njmube/erpnext
refs/heads/develop
erpnext/hr/doctype/vehicle_service/vehicle_service.py
54
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class VehicleService(Document): pass
ifduyue/django
refs/heads/master
tests/model_meta/test_removedindjango21.py
50
import warnings from django.test import SimpleTestCase from .models import Person class HasAutoFieldTests(SimpleTestCase): def test_get_warns(self): with warnings.catch_warnings(record=True) as warns: warnings.simplefilter('always') Person._meta.has_auto_field self.asser...
greenoaktree/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/numarray/nd_image.py
102
try: from ndimage import * except ImportError: try: from scipy.ndimage import * except ImportError: msg = \ """The nd_image package is not installed It can be downloaded by checking out the latest source from http://svn.scipy.org/svn/scipy/trunk/Lib/ndimage or by downloading and installing ...
isajhon/tuconsejocomunal
refs/heads/master
usuarios_venezuela/modelos/__init__.py
6
# -*- 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...
vivekhaldar/fetch_rss
refs/heads/master
output.py
1
# Copyright (C) 2012 Vivek Haldar # # Generic superclass for outputting RSS data. # # Author: Vivek Haldar <vh@vivekhaldar.com> class Output(object): def __init__(self, articles): self._articles = articles def output(self): pass
indictranstech/tele-frappe
refs/heads/develop
frappe/website/doctype/website_slideshow_item/website_slideshow_item.py
73
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class WebsiteSlideshowItem(Document): pass
dqnykamp/sympy
refs/heads/master
sympy/core/benchmarks/bench_assumptions.py
121
from __future__ import print_function, division from sympy.core import Symbol, Integer x = Symbol('x') i3 = Integer(3) def timeit_x_is_integer(): x.is_integer def timeit_Integer_is_irrational(): i3.is_irrational
dushu1203/chromium.src
refs/heads/nw12
third_party/pycoverage/coverage/results.py
160
"""Results of coverage measurement.""" import os from coverage.backward import iitems, set, sorted # pylint: disable=W0622 from coverage.misc import format_lines, join_regex, NoSource from coverage.parser import CodeParser class Analysis(object): """The results of analyzing a code unit.""" def __init...
FHannes/intellij-community
refs/heads/master
python/testData/inspections/AugmentAssignmentWithContext_after.py
83
class A: x = 3 a = A() a.x += 1
ProjectSWGCore/NGECore2
refs/heads/master
scripts/object/tangible/loot/misc/shisa_decorative_s01.py
85615
import sys def setup(core, object): return
CollabQ/CollabQ
refs/heads/master
administration/views.py
1
# Copyright 2010 http://www.collabq.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 law or agreed to i...
alicheh/imgigi
refs/heads/master
imgigi/imgigi/wsgi.py
1
""" WSGI config for imgigi project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTIN...
googlei18n/fontuley
refs/heads/master
src/third_party/fontTools/Lib/fontTools/subset.py
2
# Copyright 2013 Google, Inc. All Rights Reserved. # # Google Author(s): Behdad Esfahbod """Python OpenType Layout Subsetter. Later grown into full OpenType subsetter, supporting all standard tables. """ from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools...
alanjw/GreenOpenERP-Win-X86
refs/heads/7.0
python/Lib/site-packages/reportlab/graphics/barcode/qr.py
4
# QRCode for Python # # Ported from the Javascript library by Sam Curren # ReportLab module by German M. Bravo # # QRCode for Javascript # http://d-project.googlecode.com/svn/trunk/misc/qrcode/js/qrcode.js # # Copyright (c) 2009 Kazuhiko Arase # # URL: http://www.d-project.com/ # # Licensed under the MIT li...
tralamazza/micropython
refs/heads/master
ports/esp32/modules/flashbdev.py
10
import esp class FlashBdev: SEC_SIZE = 4096 START_SEC = esp.flash_user_start() // SEC_SIZE def __init__(self, blocks): self.blocks = blocks def readblocks(self, n, buf): #print("readblocks(%s, %x(%d))" % (n, id(buf), len(buf))) esp.flash_read((n + self.START_SEC) * self.SEC_S...
johndpope/tensorflow
refs/heads/master
tensorflow/contrib/rnn/python/ops/core_rnn_cell.py
44
# 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...
jacky-young/crosswalk-test-suite
refs/heads/master
webapi/tct-navigationtiming-w3c-tests/navigationtiming-py/w3c/resources/redirect.py
15
from urlparse import urlparse def main(request, response): """Simple handler that causes redirection. The request should typically have two query parameters: status - The status to use for the redirection. Defaults to 302. location - The resource to redirect to. """ try: status = 302 ...
shi2wei3/virt-test
refs/heads/master
virttest/utils_sasl.py
5
""" tools to manage sasl. """ import logging import aexpect import virsh from autotest.client import utils, os_dep from autotest.client.shared import error from virttest import propcan, remote class SASL(propcan.PropCanBase): """ Base class of a connection between server and client. """ __slots__ = ...
cod3monk/django-ciscoprime
refs/heads/master
ciscoprime/main/utils.py
1
from django.conf import settings import re import requests from .models import RogueAP, TrackedRogue def api_request(url): print 'api_request "%s"' % url out = dict() r = requests.get( url, verify=False, auth=(settings.API_USER, settings.API_PASSWORD)) try: out['json_...
initcron/ansible
refs/heads/devel
lib/ansible/__init__.py
18
# (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...
alexec/selenium
refs/heads/master
py/selenium/webdriver/edge/webdriver.py
43
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
mauropalumbo75/pyqha
refs/heads/master
pyqha/fitfreqgrun.py
1
#encoding: UTF-8 # Copyright (C) 2016 Mauro Palumbo # This file is distributed under the terms of the # MIT License. # See the file `License' in the root directory of the present distribution. """ This submodule groups all functions relevant for fitting phonon frequencies and computing Gruneisen parameters. """ imp...
stefanseefeld/synopsis
refs/heads/master
Synopsis/Formatters/HTML/Fragments/ClassHierarchySimple.py
1
# # Copyright (C) 2000 Stephen Davies # Copyright (C) 2000 Stefan Seefeld # All rights reserved. # Licensed to the public under the terms of the GNU LGPL (>= 2), # see the file COPYING for details. # from Synopsis.Formatters.HTML.Tags import * from Synopsis.Formatters.HTML.Fragment import Fragment class ClassHierarch...