repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
alphapapa/youtube-dl
refs/heads/master
youtube_dl/extractor/neteasemusic.py
87
# coding: utf-8 from __future__ import unicode_literals from hashlib import md5 from base64 import b64encode from datetime import datetime import re from .common import InfoExtractor from ..compat import ( compat_urllib_request, compat_urllib_parse, compat_str, compat_itertools_count, ) class NetEas...
ChenJunor/hue
refs/heads/master
desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/constants/ER.py
118
"""MySQL ER Constants These constants are error codes for the bulk of the error conditions that may occur. """ HASHCHK = 1000 NISAMCHK = 1001 NO = 1002 YES = 1003 CANT_CREATE_FILE = 1004 CANT_CREATE_TABLE = 1005 CANT_CREATE_DB = 1006 DB_CREATE_EXISTS = 1007 DB_DROP_EXISTS = 1008 DB_DROP_DELETE = 1009 DB_DROP_RMDIR =...
siosio/intellij-community
refs/heads/master
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/__init__.py
2547
# Dummy file to make this directory a package.
tbabej/astropy
refs/heads/master
astropy/nddata/tests/test_utils.py
2
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from numpy.testing import assert_allclose from ...tests.helper import pytest, assert_quantity_allclose from ..utils import (extr...
imsparsh/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/encodings/iso2022_jp.py
816
# # iso2022_jp.py: Python Unicode Codec for ISO2022_JP # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncod...
mapr/hue
refs/heads/hue-3.9.0-mapr
desktop/core/ext-py/Django-1.6.10/django/core/mail/backends/console.py
90
""" Email backend that writes messages to console instead of sending them. """ import sys import threading from django.core.mail.backends.base import BaseEmailBackend from django.utils import six class EmailBackend(BaseEmailBackend): def __init__(self, *args, **kwargs): self.stream = kwargs.pop('stream', ...
hortonworks/hortonworks-sandbox
refs/heads/master
desktop/core/ext-py/Django-1.2.3/tests/regressiontests/forms/localflavor/pt.py
14
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ PT form fields. tests = r""" # PTZipCodeField ############################################################# PTZipCodeField validates that the data is a valid PT zipcode. >>> from django.contrib.localflavor.pt.forms import PTZipCodeField >>> f = PTZipCodeFie...
tsgit/invenio
refs/heads/prod
modules/bibformat/lib/bibformat_utils_unit_tests.py
16
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011, 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 yo...
amonapp/amon
refs/heads/7.0
amon/templatetags/__init__.py
2
# from django.template.base import add_to_builtins # from amon.settings import AUTOLOAD_TAGS # for tag in AUTOLOAD_TAGS: # add_to_builtins(tag)
jedie/djangocms-find_and_replace
refs/heads/master
runtests.py
1
#!/usr/bin/env python # coding: utf-8 """ run unittests ~~~~~~~~~~~~~ run all tests: ./runtests.py run only some tests, e.g.: ./runtests.py tests.test_file ./runtests.py tests.test_file.test_class ./runtests.py tests.test_file.test_class.test_method :copyleft: 2015 by the find&...
home-assistant/home-assistant
refs/heads/dev
homeassistant/components/compensation/__init__.py
4
"""The Compensation integration.""" import logging import warnings import numpy as np import voluptuous as vol from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.const import ( CONF_ATTRIBUTE, CONF_SOURCE, CONF_UNIQUE_ID, CONF_UNIT_OF_MEASUREMENT, ) from homeassista...
virgree/odoo
refs/heads/8.0
addons/hr_holidays/wizard/__init__.py
442
# -*- 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...
lamby/live-studio
refs/heads/master
contrib/django_extensions/management/commands/runscript.py
5
from django.core.management.base import BaseCommand from django.core.management.color import no_style from optparse import make_option import sys import os try: set except NameError: from sets import Set as set # Python 2.3 fallback def vararg_callback(option, opt_str, opt_value, parser): parser.rargs....
KonradIT/gopro-py-api
refs/heads/master
examples/opencv_gopro/gopro_opencv_photo.py
1
import cv2 import numpy as np from goprocam import GoProCamera from goprocam import constants import urllib.request cascPath="/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml" eyePath="/usr/share/opencv/haarcascades/haarcascade_eye.xml" eye_cascade = cv2.CascadeClassifier(eyePath) face_cascade = cv2.C...
JetBrains/intellij-community
refs/heads/master
python/testData/addImport/relativeImportFromSamePackage/foo/baz.py
36
def baz_func(): pass
jasonxmueller/gcc-python-plugin
refs/heads/master
tests/cpychecker/refcounts/PySequence_SetItem/correct/script.py
206
# -*- coding: utf-8 -*- # Copyright 2011 David Malcolm <dmalcolm@redhat.com> # Copyright 2011 Red Hat, Inc. # # This 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, o...
klokan/googlecrisismap
refs/heads/master
legend_item_extractor_test.py
4
#!/usr/bin/python # Copyright 2012 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 applic...
ujjvala-addsol/addsol_hr
refs/heads/master
openerp/addons/mail/mail_followers.py
62
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
Remiii/remiii-ffmpeg-filters
refs/heads/master
titles.py
1
#! /usr/bin/env python3 import json import os import sys import time from urllib import request from filter import Filter, FilterChain, Position, TimeRange from filters import DrawBox, DrawText, Overlay from resource import Resource, Resources TMP_DIR = '/tmp' FILTER_TYPES = { 'box': DrawBox, 'text': DrawTex...
tboyce021/home-assistant
refs/heads/dev
homeassistant/components/egardia/alarm_control_panel.py
21
"""Interfaces with Egardia/Woonveilig alarm control panel.""" import logging import requests import homeassistant.components.alarm_control_panel as alarm from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOME, ) from homeassistant.const import ( STA...
rv816/wagtail
refs/heads/master
wagtail/tests/snippets/apps.py
35
from django.apps import AppConfig class WagtailSnippetsTestsAppConfig(AppConfig): name = 'wagtail.tests.snippets' label = 'snippetstests' verbose_name = "Wagtail snippets tests"
scarvalhojr/ntlmaps
refs/heads/master
lib/logger.py
11
# This file is part of 'NTLM Authorization Proxy Server' # Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru> # # NTLM APS 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 Licens...
mfherbst/spack
refs/heads/develop
var/spack/repos/builtin/packages/py-fastaindex/package.py
5
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
rizumu/django
refs/heads/master
django/db/backends/postgresql_psycopg2/introspection.py
465
from ..postgresql.introspection import * # NOQA
ptisserand/ansible
refs/heads/devel
lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py
102
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
dinkelk/redo-python
refs/heads/master
builder.py
2
import sys, os, errno, stat import vars, jwack, state from helpers import unlink, close_on_exec, join from log import log, log_, debug, debug2, err, warn def _default_do_files(filename): l = filename.split('.') for i in range(1,len(l)+1): basename = join('.', l[:i]) ext = join('.', l[i:]) ...
muntasirsyed/intellij-community
refs/heads/master
python/testData/inspections/PyUnusedVariableTupleUnpacking/test.py
40
def foo(): for x, y in [(1, 2)]: print x def test_vlu(): <error descr="Python versions < 3.0 do not support starred expressions as assignment targets">*<weak_warning descr="Local variable 'h' value is not used">h</weak_warning></error>, <weak_warning descr="Local variable 't' value is not used">t</weak...
ssorgatem/pulsar
refs/heads/master
pulsar/client/transport/__init__.py
2
from .standard import Urllib2Transport from .curl import PycurlTransport import os from .ssh import rsync_get_file, scp_get_file from .ssh import rsync_post_file, scp_post_file from .curl import curl_available from .requests import requests_multipart_post_available if curl_available: from .curl import get_file ...
hackerbot/DjangoDev
refs/heads/master
tests/fixtures/tests.py
6
from __future__ import unicode_literals import os import tempfile import warnings from django.apps import apps from django.contrib.sites.models import Site from django.core import management from django.db import IntegrityError, connection from django.test import ( TestCase, TransactionTestCase, ignore_warnings, ...
nvoron23/statsmodels
refs/heads/master
statsmodels/stats/tests/test_nonparametric.py
33
# -*- coding: utf-8 -*- """ Created on Fri Jul 05 14:05:24 2013 Author: Josef Perktold """ from statsmodels.compat.python import lzip, range import numpy as np from numpy.testing import assert_allclose, assert_almost_equal from statsmodels.sandbox.stats.runs import (mcnemar, cochrans_q, Runs, ...
vmindru/ansible
refs/heads/devel
test/units/modules/network/fortimanager/test_fmgr_device_config.py
21
# Copyright 2018 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
emonty/ansible
refs/heads/devel
test/support/integration/plugins/inventory/aws_ec2.py
47
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: aws_ec2 plugin_type: inventory short_description: EC2 inventor...
thomasrstorey/recipesfordisaster
refs/heads/master
render_and_export.py
1
''' render_and_export.py open dish.blend gather all objects together into one object, named <title> (provided as arg) uv unwrap bake all textures to one texture set up three cameras and three-point lighting render three images export dish to <title>.obj + <title>.mtl + <title>_color.jpg (path provided as arg) Thomas...
tracierenea/gnuradio
refs/heads/master
gr-digital/python/digital/utils/gray_code.py
75
#!/usr/bin/env python # # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) ...
chromium/chromium
refs/heads/master
media/tools/constrained_network_server/cns.py
8
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # [VPYTHON:BEGIN] # wheel: < # name: "infra/python/wheels/pytz-py2_py3" # version: "version:2018.4" # > # wheel: < # name: "...
alexallah/django
refs/heads/master
tests/validation/test_unique.py
46
import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import ( CustomPKModel, FlexibleDatePost, ModelToValidate, Post, UniqueErrorsModel, UniqueFieldsModel, UniqueForDa...
tricoder42/python-ariadne
refs/heads/master
tests/context/test_base.py
1
# coding: utf-8 from __future__ import unicode_literals from ariadne.context import StaticContext def test_static_context(): processor = StaticContext(key='value') context = processor.run({}) assert context['key'] == 'value'
shujaatak/UAV_MissionPlanner
refs/heads/master
Lib/symbol.py
105
#! /usr/bin/env python """Non-terminal symbols of Python grammar (from "graminit.h").""" # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # python Lib/symbol.py...
IronLanguages/ironpython2
refs/heads/master
Src/StdLib/Lib/mimetypes.py
2
"""Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=1) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=1) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list of fil...
agentzh/gdb
refs/heads/master
gdb/testsuite/gdb.perf/lib/perftest/measure.py
46
# Copyright (C) 2013-2015 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
sabi0/intellij-community
refs/heads/master
python/testData/inspections/PyUnresolvedReferencesInspection/StubWithGetAttr/incomplete.py
19
def c(): return 1 def d(): return ""
akhilpm/Masters-Project
refs/heads/master
UMKL/textData/add_kernels.py
1
#!/usr/bin/env python -W ignore::DeprecationWarning ''' KPCA based feature engineering for 20-newsgroup document classification with combination of kernels in each layers Author : Akhil P M Kernel used : Arc-cosine Kernel, Gaussian Kernel, Polynomial kernel ''' import kernel from settings import * from umkl_new impo...
nck0405/MyOwn
refs/heads/master
modules/geopy/units.py
84
import math from geopy import util # Angles def degrees(radians=0, arcminutes=0, arcseconds=0): deg = 0. if radians: deg = math.degrees(radians) if arcminutes: deg += arcminutes / arcmin(degrees=1.) if arcseconds: deg += arcseconds / arcsec(degrees=1.) return deg def radia...
zstyblik/infernal-twin
refs/heads/master
build/pip/pip/status_codes.py
1002
from __future__ import absolute_import SUCCESS = 0 ERROR = 1 UNKNOWN_ERROR = 2 VIRTUALENV_NOT_FOUND = 3 PREVIOUS_BUILD_DIR_ERROR = 4 NO_MATCHES_FOUND = 23
log2timeline/l2tscaffolder
refs/heads/main
utils/check_dependencies.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script to check for the availability and version of dependencies.""" from __future__ import print_function from __future__ import unicode_literals import sys # Change PYTHONPATH to include dependencies. sys.path.insert(0, '.') import utils.dependencies # pylint: dis...
fpy171/django
refs/heads/master
tests/foreign_object/models/person.py
182
import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Country(models.Model): # Table Column Fields name = models.CharField(max_length=50) def __str__(self): return self.name @python_2_unicode_compatible cla...
ogrisel/keras
refs/heads/master
keras/datasets/mnist.py
37
# -*- coding: utf-8 -*- import gzip from .data_utils import get_file import six.moves.cPickle import sys def load_data(path="mnist.pkl.gz"): path = get_file(path, origin="https://s3.amazonaws.com/img-datasets/mnist.pkl.gz") if path.endswith(".gz"): f = gzip.open(path, 'rb') else: f = open...
EventGhost/EventGhost
refs/heads/master
lib27/site-packages/websocket/server.py
8
import sys import traceback from os.path import abspath, dirname, join, basename from socket import error from hashlib import md5 from datetime import datetime from gevent.pywsgi import WSGIHandler, WSGIServer from websocket.policyserver import FlashPolicyServer from websocket import WebSocket import gevent assert ge...
jart/tensorflow
refs/heads/master
tensorflow/contrib/tpu/python/tpu/datasets_test.py
25
# 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...
jmontoyam/mne-python
refs/heads/master
mne/io/ctf/constants.py
10
"""CTF constants""" # Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from ..constants import BunchConst CTF = BunchConst() # ctf_types.h CTF.CTFV_MAX_AVERAGE_BINS = 8 CTF.CTFV_MAX_COILS = 8 CTF.CTFV_MAX_BALANCING = 50 CTF.CTFV_SENSOR_LABEL = 31 CTF.CTFV_COIL_LPA = 1 CTF.CTFV_COIL_RPA = ...
cyyyary/marioai
refs/heads/master
new/agent_class.py
17
__author__ = "Vrubel Dmitrii" __date__ = "$${date} ${time}$" import sys import os from datetime import datetime from zipfile import ZipFile, is_zipfile from shutil import move class AgentZip(ZipFile): '''Class for zip file with agent for MarioAi: two new methods and some new attributes. Required zipfile and os mod...
cataliniordache/Human-Computer-Interaction-Project
refs/heads/master
RestfulServices/flask/lib/python2.7/site-packages/sqlalchemy/schema.py
33
# schema.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 """Compatibility namespace for sqlalchemy.sql.schema and related. """ from .sql.base imp...
Ted1993/Flasky
refs/heads/master
venv/lib/python2.7/site-packages/sqlalchemy/engine/threadlocal.py
59
# engine/threadlocal.py # Copyright (C) 2005-2015 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 """Provides a thread-local transactional wrapper around the root Engine class....
mollstam/UnrealPy
refs/heads/master
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Cython-0.22.1/tests/run/duplicate_keyword_in_call.py
26
# mode: run # tag: kwargs, call # ticket: 717 def f(**kwargs): return sorted(kwargs.items()) def test_call(kwargs): """ >>> kwargs = {'b' : 2} >>> f(a=1, **kwargs) [('a', 1), ('b', 2)] >>> test_call(kwargs) [('a', 1), ('b', 2)] >>> kwargs = {'a' : 2} >>> f(a=1, **kwargs) # doct...
Tigerwhit4/taiga-back
refs/heads/master
taiga/users/gravatar.py
17
# 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> # Copyright (C) 2014 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
ElettraSciComp/STP-Core
refs/heads/master
STP-Core/preprocess/gdei.py
1
########################################################################### # (C) 2016 Elettra - Sincrotrone Trieste S.C.p.A.. All rights reserved. # # # # # # This file is p...
MQQiang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/lib2to3/tests/test_pytree.py
93
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Unit tests for pytree.py. NOTE: Please *don't* add doc strings to individual test methods! In verbose mode, printing of the module, class and method name is much more helpful than printing of (the first line of) the...
paweljasinski/ironpython3
refs/heads/master
Src/StdLib/Lib/unittest/test/dummy.py
1061
# Empty module for testing the loading of modules
SimonSapin/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/monkeypatch.py
32
""" monkeypatching and mocking functionality. """ from __future__ import absolute_import, division, print_function import os import sys import re from contextlib import contextmanager import six from _pytest.fixtures import fixture RE_IMPORT_ERROR_NAME = re.compile("^No module named (.*)$") @fixture def monkeypat...
dims/nova
refs/heads/master
nova/tests/functional/notification_sample_tests/test_service_update.py
1
# 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 agreed to in...
akosel/incubator-airflow
refs/heads/master
tests/contrib/sensors/test_hdfs_sensor.py
4
# -*- coding: utf-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 #...
ekivemark/bbofuser
refs/heads/master
accounts/views/other.py
1
""" Developer views (c) 2015 - Mark Scrimshire - @ekivemark """ __author__ = 'Mark Scrimshire:@ekivemark' # DONE Activate Account # DONE: accounts/profile Landing Page. import ast import json from collections import OrderedDict from django.core import serializers from django.core.urlresolvers import reverse_lazy fr...
ejpbruel/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pytest/_pytest/helpconfig.py
180
""" version info, help messages, tracing configuration. """ import py import pytest import os, sys def pytest_addoption(parser): group = parser.getgroup('debugconfig') group.addoption('--version', action="store_true", help="display pytest lib version and import information.") group._addoption(...
TaiSakuma/AlphaTwirl
refs/heads/v0.9.x
tests/unit/binning/test_Round.py
1
import unittest from alphatwirl.binning import Round ##__________________________________________________________________|| class TestRound(unittest.TestCase): def test_init(self): obj = Round() def test__repr(self): obj = Round() repr(obj) def test_call(self): obj = Rou...
spadae22/odoo
refs/heads/chris_master_8
addons/account_budget/report/budget_report.py
18
# -*- 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...
pepetreshere/odoo
refs/heads/patch-2
addons/mail/wizard/mail_compose_message.py
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import ast import base64 import re from odoo import _, api, fields, models, tools from odoo.exceptions import UserError # main mako-like expression pattern EXPRESSION_PATTERN = re.compile('(\$\{.+?\})') def _reopen(...
Nocsaron/Sol
refs/heads/master
src/Tiff.py
2
import os import sys import re from math import pow, floor from subprocess import Popen, PIPE class Tiff: ##--DAYMET Default Data DAYMET_proj="+proj=lcc +lat_1=25 +lat_2=60 +lat_0=42.5 +lon_0=-100 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs" stLat=50 stLon=-132 stTile=12625 ##--PRISM Default Data ...
antoniodemora/git-cola
refs/heads/master
test/compat_test.py
3
#!/usr/bin/env python # encoding: utf-8 from __future__ import absolute_import, division, unicode_literals import os import unittest from cola import compat class CompatTestCase(unittest.TestCase): """Tests the compat module""" def test_setenv(self): """Test the core.decode function """ ...
learningequality/kolibri
refs/heads/develop
kolibri/plugins/registry.py
3
""" How plugins work ---------------- From a user's perspective, plugins are enabled and disabled through the command line interface or through a UI. Users can also configure a plugin's behavior through the main Kolibri interface. From a developer's perspective, plugins are wrappers around Django applications, listed...
ideascube/ideascube
refs/heads/master
ideascube/blog/tests/test_views.py
1
from datetime import date, datetime import pytest from django.core.urlresolvers import reverse from django.utils import translation, timezone from ..views import Index from ..models import Content from .factories import ContentFactory pytestmark = pytest.mark.django_db def test_anonymous_should_access_index_page(...
raoulbq/scipy
refs/heads/master
scipy/io/matlab/tests/test_streams.py
109
""" Testing """ from __future__ import division, print_function, absolute_import import os import sys import zlib from io import BytesIO if sys.version_info[0] >= 3: cStringIO = BytesIO else: from cStringIO import StringIO as cStringIO from tempfile import mkstemp import numpy as np from numpy.testing i...
jasonbot/django
refs/heads/master
django/contrib/gis/maps/google/__init__.py
287
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
xiangke/pycopia
refs/heads/master
mibs/pycopia/mibs/__init__.py
1
#!/usr/bin/python """ A package repository for compiled mibs. All of the files in this package are generated by SMI.Compile module. The mib2py program is the top level script that when run, will automatically place compiled mibs into this package directory. """ import sys import os # TODO get from some config. USE...
philiptzou/clincoded
refs/heads/dev
src/contentbase/elasticsearch/cached_views.py
4
""" Cached views used when model was pulled from elasticsearch. """ from itertools import chain from pyramid.httpexceptions import HTTPForbidden from pyramid.view import view_config from .interfaces import ICachedItem def includeme(config): config.scan(__name__) @view_config(context=ICachedItem, request_method...
Zeken/audacity
refs/heads/master
lib-src/lv2/lv2/waflib/Tools/ar.py
330
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib.Configure import conf @conf def find_ar(conf): conf.load('ar') def configure(conf): conf.find_program('ar',var='AR') conf.env.ARFLAGS='rcs'
AustinStoneProjects/Founderati-Server
refs/heads/master
project/json_rest.py
1
from flask.json import JSONEncoder from datetime import datetime from bson.objectid import ObjectId class CustomJSONEncoder(JSONEncoder): def default(self, obj): if isinstance(obj, datetime): return obj.isoformat() elif isinstance(obj, ObjectId): return str(obj) re...
JavML/django
refs/heads/master
tests/utils_tests/test_decorators.py
319
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
klim-/uc_algorithm
refs/heads/master
examples/dist_reduction_klippel.py
2
# -*- coding: utf-8 -*- # enable true divison import sympy as sp import symbtools as st k, m, R_m, R_e, b, L_x, L = sp.symbols("k, m, R_m, R_e, b, L_x, L") x1, x2, x3 = xx = sp.symbols("x1:4") vec_x = sp.Matrix([x1, x2, x3]) vec_xdot = st.time_deriv(vec_x, vec_x) xdot1, xdot2, xdot3 = vec_xdot F_eq = sp.Matrix([ [...
sublime1809/django
refs/heads/master
django/contrib/staticfiles/__init__.py
802
default_app_config = 'django.contrib.staticfiles.apps.StaticFilesConfig'
luther07/dak
refs/heads/master
dak/rm.py
2
#!/usr/bin/env python """ General purpose package removal tool for ftpmaster """ # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup <james@nocrew.org> # Copyright (C) 2010 Alexander Reichle-Schmehl <tolimar@debian.org> # This program is free software; you can redistribute it and/or modify # it under the ...
CMU-Robotics-Club/roboticsclub.org
refs/heads/master
gallery/models.py
2
from django.db import models from ordered_model.models import OrderedModel from easy_thumbnails.fields import ThumbnailerImageField class Photo(OrderedModel): title = models.CharField(max_length=60, null=True, blank=True) description = models.TextField(null=True, blank=True) def image_upload_to(instance, file...
adazey/Muzez
refs/heads/master
libs/youtube_dl/extractor/sportschau.py
55
# coding: utf-8 from __future__ import unicode_literals from .wdr import WDRBaseIE from ..utils import get_element_by_attribute class SportschauIE(WDRBaseIE): IE_NAME = 'Sportschau' _VALID_URL = r'https?://(?:www\.)?sportschau\.de/(?:[^/]+/)+video-?(?P<id>[^/#?]+)\.html' _TEST = { 'url': 'http://...
noahingham/IPS-Server
refs/heads/master
IPS-Server/src/libxbee/serial/pyserial-2.7-parent/examples/tcp_serial_redirect.py
25
#!/usr/bin/env python # (C) 2002-2009 Chris Liechti <cliechti@gmx.net> # redirect data from a TCP/IP connection to a serial port and vice versa # requires Python 2.2 'cause socket.sendall is used import sys import os import time import threading import socket import codecs import serial try: True except NameErro...
chriskmanx/qmole
refs/heads/master
QMOLEDEV/boost_1_49_0/libs/mpl/doc/src/docutils/writers/html4_refdoc/__init__.py
59
# Copyright Aleksey Gurtovoy 2004-2009 # # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) from docutils.writers import html4_frames from docutils.writers import html4css1 from docutils import nodes import re imp...
rsc/kubernetes
refs/heads/master
cluster/juju/return-node-ips.py
583
#!/usr/bin/env python # Copyright 2015 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
mfleming/bits
refs/heads/master
python/init.py
1
# Copyright (c) 2014, Intel Corporation # 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 condit...
20uf/ansible
refs/heads/devel
contrib/inventory/apache-libcloud.py
73
#!/usr/bin/env python # (c) 2013, Sebastien Goasguen <runseb@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 ...
landism/pants
refs/heads/master
tests/python/pants_test/backend/jvm/tasks/jvm_compile/scala/test_scalac_plugin_integration.py
6
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants_test.back...
peterbraden/tensorflow
refs/heads/master
tensorflow/contrib/skflow/__init__.py
13
# Copyright 2016 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 a...
ericawright/bedrock
refs/heads/master
lib/l10n_utils/management/commands/_fluent_templater.py
6
# 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 ._fluent import ( get_migration_context, strip_whitespace, trans_to_lang, GETTEXT_RE, TRANS_BLO...
chrxr/wagtail
refs/heads/master
wagtail/wagtailimages/migrations/0002_initial_data.py
13
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.db import migrations def add_image_permissions_to_admin_groups(apps, schema_editor): ContentType = apps.get_model('contenttypes.ContentType') Permission = apps.get_model('auth.Permission')...
kamyu104/django
refs/heads/master
django/contrib/gis/sitemaps/views.py
341
from __future__ import unicode_literals from django.apps import apps from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.functions import AsKML, Transform from django.contrib.gis.shortcuts import render_to_kml, render_to_kmz from django.core.exceptions import FieldDoesNotExi...
ronghanghu/vqa-mcb
refs/heads/tensorflow
train/v4/train_v4.py
1
import matplotlib matplotlib.use('Agg') import os import numpy as np import json import caffe from caffe import layers as L from caffe import params as P from vqa_data_provider_layer import VQADataProvider from visualize_tools import drawgraph, exec_validation import config def qlstm(mode, batchsize, max_words_in_ques...
atnak/graphite-web
refs/heads/master
webapp/graphite/metrics/urls.py
11
"""Copyright 2009 Chris Davis 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 ...
Shinseeker/is210-week-05-warmup
refs/heads/master
task_02.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """Week 5 warmup task 02.""" import task_01.peanut TIME = task_01.peanut.BUTTER
kremerben/websockets-and-django
refs/heads/master
gameoflife/urls.py
4
from django.conf.urls import patterns, url urlpatterns = patterns('gameoflife.views', url(r'^$', 'watch'), url(r'^watcher/$', 'watcher'), url(r'^reset/$', 'reset'), url(r'^worker/$', 'worker'), )
davidtimmons/python-study
refs/heads/master
google-python-exercises/basic/list1.py
1
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Completed by David Timmons. # Basic list exercises # Fill in the code for the function...
synergeticsedx/deployment-wipro
refs/heads/oxa/master.fic
openedx/core/djangoapps/theming/tests/test_helpers.py
7
""" Test helpers for Comprehensive Theming. """ import unittest from mock import patch, Mock from django.test import TestCase, override_settings from django.conf import settings from openedx.core.djangoapps.theming.tests.test_util import with_comprehensive_theme from openedx.core.djangoapps.site_configuration import ...
emgerner-msft/azure-storage-python
refs/heads/master
azure/storage/table/tablebatch.py
3
#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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.apa...
eflowbeach/draw-your-taf
refs/heads/master
Pmw/Pmw_1_3/tests/ComboBox_test.py
3
# Based on iwidgets2.2.0/tests/combobox.test code. import Tkinter import Test import Pmw Test.initialise() if Tkinter.TkVersion >= 8.4: expected1 = 'TclError: bad relief "bogus": must be ' expected2 = 'TclError: bad state "bogus": must be ' + \ 'disabled, normal, or readonly' elif Tkinter.TkVersion >= 8.3:...