repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
jpetto/bedrock
refs/heads/master
manage.py
39
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bedrock.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
DevMine/devmine-core
refs/heads/master
devmine/app/helpers/application_helper.py
1
import json from sqlalchemy.ext.declarative import DeclarativeMeta def obj_to_json(obj): """ Serialize an object to JSON. """ fields = {} attrs = [x for x in obj.__dict__.keys() if not x.startswith('_')] for field in attrs: data = obj.__getattribute__(field) if hasattr(data, 'i...
cheminfo/Visualizer-grunt
refs/heads/master
src/components/jit/serve.py
11
import web from web import template from tests import tests_model from build import Build urls = ( '/testcase/(RGraph|Treemap|Icicle|Hypertree|Spacetree|ForceDirected|ForceDirected3D|Sunburst|AreaChart|BarChart|PieChart|TimeGraph|HeatMap|Voronoi|Other)/([0-9]+)/?', 'testcase', ) app = web.application(urls, global...
eirki/script.module.pywin32
refs/heads/master
lib/x32/win32comext/bits/__init__.py
138
# This is a python package # __PackageSupportBuildPath__ not needed for distutil based builds, # but not everyone is there yet. import win32com win32com.__PackageSupportBuildPath__(__path__)
marknca/cling
refs/heads/master
dependencies/botocore/docs/bcdoc/docevents.py
24
# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/tensorflow/contrib/testing/python/framework/fake_summary_writer.py
75
# 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...
CloudBotIRC/CloudBot
refs/heads/master
plugins/karma.py
18
import time import re from sqlalchemy import Table, Column, Integer, String, PrimaryKeyConstraint from sqlalchemy import select from cloudbot import hook from cloudbot.util import timeformat, database CAN_DOWNVOTE = False TIME_LIMIT = 300.0 karma_table = Table( 'karma', database.metadata, Column('nick...
Ourinternet/website
refs/heads/master
commission/urls.py
1
from django.conf.urls import patterns, include, url from .views import PublicationPageView, WebCastPageView, EventPageView, \ VideoPageView, PressReleasePageView urlpatterns = patterns('', url(r'^release/(?P<slug>[-\w]+)/$', 'commission.views.press_release', name='press_release'), ...
Weihonghao/ECM
refs/heads/master
Vpy34/lib/python3.5/distutils/__init__.py
1211
import os import sys import warnings import imp import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory dirname = os.path.dirname distutils_path = o...
Fokko/incubator-airflow
refs/heads/master
tests/hooks/test_webhdfs_hook.py
1
# -*- 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 #...
circlespainter/FrameworkBenchmarks
refs/heads/master
frameworks/Python/asyncio/yocto_http/hello/__init__.py
53
import logging import asyncio import os import aiopg import jinja2 import psycopg2.extras import asyncio_redis from asyncio_redis.protocol import HiRedisProtocol import api_hour from . import endpoints from . import servers from .utils import yocto_http LOG = logging.getLogger(__name__) class Container(api_hour.Co...
schleichdi2/OpenNfr_E2_Gui-6.0
refs/heads/master
lib/python/Plugins/Extensions/MediaPortal/additions/porn/realgfporn.py
1
# -*- coding: utf-8 -*- ############################################################################################### # # MediaPortal for Dreambox OS # # Coded by MediaPortal Team (c) 2013-2017 # # This plugin is open source but it is NOT free software. # # This plugin may only be distributed to and executed...
landrito/api-client-staging
refs/heads/master
generated/python/gapic-google-cloud-dlp-v2beta1/google/cloud/gapic/privacy/dlp/v2beta1/dlp_service_client.py
7
# Copyright 2017, 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 ...
Zhongqilong/mykbengineer
refs/heads/master
kbe/res/scripts/common/Lib/test/test_mmap.py
68
from test.support import (TESTFN, run_unittest, import_module, unlink, requires, _2G, _4G, gc_collect, cpython_only) import unittest import os import re import itertools import socket import sys import weakref # Skip test if we can't import mmap. mmap = import_module('mmap') PAGESIZE = mmap....
STMicroelectronics/cmsis_core
refs/heads/master
DSP/PythonWrapper/example.py
1
import cmsisdsp as dsp import numpy as np from scipy import signal from pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show,semilogx, semilogy # Data file from https://www.physionet.org/pn3/ecgiddb/Person_87/rec_2.dat def q31sat(x): if x > 0x7FFFFFFF: return(np.int32(0x7F...
macs03/demo-cms
refs/heads/master
cms/lib/python2.7/site-packages/django/core/management/commands/sqlflush.py
242
from __future__ import unicode_literals from optparse import make_option from django.core.management.base import NoArgsCommand from django.core.management.sql import sql_flush from django.db import connections, DEFAULT_DB_ALIAS class Command(NoArgsCommand): help = "Returns a list of the SQL statements required t...
jendap/tensorflow
refs/heads/master
tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py
27
# Copyright 2016 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...
davidsims9t/itis-graphql
refs/heads/master
venv/lib/python3.4/site-packages/pip/models/__init__.py
918
from pip.models.index import Index, PyPI __all__ = ["Index", "PyPI"]
kittiu/odoo
refs/heads/8.0
addons/gamification/models/challenge.py
92
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
tjcsl/ion
refs/heads/master
intranet/middleware/dark_mode.py
1
class DarkModeMiddleware: """ Set the 'dark-mode-enabled' cookie if the user is logged in and has enabled dark mode """ def __init__(self, get_response): self.get_response = get_response def __call__(self, request): response = self.get_response(request) if request.user is n...
agry/NGECore2
refs/heads/master
scripts/buffs/invis_sp_buff_invis_1.py
2
import sys def setup(core, actor, buff): return def add(core, actor, buff): actor.playEffectObject('clienteffect/npe_smoke_bomb.cef', '') actor.setInStealth(True) actor.setRadarVisible(False) core.combatService.endCombat(actor) if actor.getSkillMod('expertise_sp_without_a_trace_1'): core.buffService.addBu...
shsingh/ansible
refs/heads/devel
lib/ansible/modules/network/junos/junos_user.py
19
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
holmes/intellij-community
refs/heads/master
python/lib/Lib/imghdr.py
91
"""Recognize image file formats based on their first few bytes.""" __all__ = ["what"] #-------------------------# # Recognize image headers # #-------------------------# def what(file, h=None): if h is None: if type(file) == type(''): f = open(file, 'rb') h = f.read(32) el...
wskplho/sl4a
refs/heads/master
python/src/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py
356
from lib2to3.fixer_base import BaseFix class FixFirst(BaseFix): run_order = 1 def match(self, node): return False
tylertian/Openstack
refs/heads/master
openstack F/cinder/cinder/tests/test_nexenta.py
4
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2011 Nexenta Systems, 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 # # ...
freeworldxbmc/pluging.video.Jurassic.World.Media
refs/heads/master
resources/lib/libraries/downloader.py
7
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 Blazetamer Copyright (C) 2015 lambda Copyright (C) 2015 spoyser Copyright (C) 2015 crzen 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 ...
xHeliotrope/injustice_dropper
refs/heads/master
env/lib/python3.4/site-packages/phonenumbers/data/region_AS.py
9
"""Auto-generated file, do not edit by hand. AS metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_AS = PhoneMetadata(id='AS', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[5689]\\d{9}', possible_number_pattern='\...
zodiac/incubator-airflow
refs/heads/master
tests/contrib/operators/ssh_execute_operator.py
10
# -*- 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 ...
johnardavies/scrapy
refs/heads/master
tests/test_http_headers.py
161
import unittest import copy from scrapy.http import Headers class HeadersTest(unittest.TestCase): def assertSortedEqual(self, first, second, msg=None): return self.assertEqual(sorted(first), sorted(second), msg) def test_basics(self): h = Headers({'Content-Type': 'text/html', 'Content-Length...
internetmosquito/flask-scheduler
refs/heads/master
tests/test_appointments.py
1
__author__ = 'mosquito' import os import unittest from project import app, db, bcrypt from project._config import basedir from project.models import Appointment, User TEST_DB = 'test.db' class AppointmentsTests(unittest.TestCase): ############################ #### setup and teardown #### #############...
dagwieers/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_ssl_certificate.py
16
# -*- 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, ...
ajayuranakar/django-blog
refs/heads/master
lib/python2.7/site-packages/django/core/serializers/__init__.py
347
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
willzhang05/postgrestesting1
refs/heads/master
postgrestesting1-env/lib/python3.5/site-packages/pkg_resources/_vendor/packaging/version.py
439
# Copyright 2014 Donald Stufft # # 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, so...
Einstein2150/lg-remote
refs/heads/master
tvserver/webserver.py
1
""" Implement an HTTP web server in Python that knows how to run server-side CGI scripts coded in Python; serves files and scripts from current working dir; Python scripts must be stored in webdir\cgi-bin or webdir\htbin; """ import os, sys from http.server import HTTPServer, CGIHTTPRequestHandler webdir = '/home/o...
MjAbuz/foundation
refs/heads/master
manage.py
3
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foundation.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
msincenselee/vnpy
refs/heads/vnpy2
vnpy/api/xtp/generator/xtp_constant.py
4
XTP_VERSION_LEN = 16 XTP_TRADING_DAY_LEN = 9 XTP_TICKER_LEN = 16 XTP_TICKER_NAME_LEN = 64 XTP_LOCAL_ORDER_LEN = 11 XTP_ORDER_EXCH_LEN = 17 XTP_EXEC_ID_LEN = 18 XTP_BRANCH_PBU_LEN = 7 XTP_ACCOUNT_NAME_LEN = 16 XTP_CREDIT_DEBT_ID_LEN = 33 XTP_SIDE_BUY = 1 XTP_SIDE_SELL = 2 XTP_SIDE_PURCHASE = 7 XTP_SIDE_REDEMPTION = 8 XT...
jyt109/gensim
refs/heads/develop
gensim/similarities/__init__.py
69
""" This package contains implementations of pairwise similarity queries. """ # bring classes directly into package namespace, to save some typing from .docsim import Similarity, MatrixSimilarity, SparseMatrixSimilarity
A-deLuna/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/sslutils/base.py
449
def get_logger(name="ssl"): logger = structured.get_default_logger(name) if logger is None: logger = structured.structuredlog.StructuredLogger(name) return logger class NoSSLEnvironment(object): ssl_enabled = False def __init__(self, *args, **kwargs): pass def __enter__(self):...
woodscn/scipy
refs/heads/master
scipy/weave/tests/scxx_timings.py
96
from __future__ import absolute_import, print_function import time from scipy import weave force = 0 N = 1000000 def list_append_scxx(a,Na): code = """ for(int i = 0; i < Na;i++) a.append(i); """ weave.inline(code,['a','Na'],force=force,verbose=2,compiler='gcc') def ...
iabdalkader/micropython
refs/heads/master
tests/multi_bluetooth/perf_gatt_char_write.py
5
# Write characteristic from central to peripheral and time data rate. from micropython import const import time, machine, bluetooth TIMEOUT_MS = 2000 _IRQ_CENTRAL_CONNECT = const(1) _IRQ_CENTRAL_DISCONNECT = const(2) _IRQ_GATTS_WRITE = const(3) _IRQ_PERIPHERAL_CONNECT = const(7) _IRQ_PERIPHERAL_DISCONNECT = const(8)...
kstilwell/tcex
refs/heads/master
tests/datastore/test_cache.py
2
"""Test the TcEx DataStore Module.""" # standard library import time class TestCache: """Test the TcEx DataStore Module.""" data_type = None def setup_class(self): """Configure setup before all tests.""" self.data_type = 'pytest' @staticmethod def expired_data_callback(rid): # ...
chispita/epiwork
refs/heads/master
apps/count/views.py
2
from django.contrib.auth.models import User from django.template import Context, Template, RequestContext from django.http import HttpResponse from django.shortcuts import render_to_response from django.db import connection, transaction def counter(request): def country_count(country): cursor = connection....
gjost/foxtabs
refs/heads/master
foxtabs/__init__.py
1
# -*- coding: utf-8 -*- __author__ = 'Geoffrey Jost' __email__ = 'geoffrey@jostwebwerks.com' __version__ = '0.1.0' DESCRIPTION = """Lists titles and URLs of current Firefox tabs""" EPILOG = "" import codecs from ConfigParser import ConfigParser from datetime import datetime from htmlentitydefs import codepoint2na...
lychyi/color-tools
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
148
# 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
eoncloud-dev/eonboard
refs/heads/master
eoncloud_web/frontend/forms.py
2
#coding=utf-8 from django.conf import settings from django.contrib.auth.models import User from django import forms from django.contrib.auth.forms import UserCreationForm from django.utils.translation import ugettext_lazy as _ from captcha.fields import CaptchaField, CaptchaTextInput as CaptchaTextInput_ from biz.ac...
rickerc/neutron_audit
refs/heads/cis-havana-staging
neutron/services/firewall/agents/varmour/varmour_router.py
6
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 vArmour Networks 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.apa...
dacracker/Nyx
refs/heads/master
nx/sdl2/sdlimage.py
2
import os from ctypes import POINTER, c_int, c_char_p from .dll import DLL from .version import SDL_version from .surface import SDL_Surface from .rwops import SDL_RWops from .render import SDL_Texture, SDL_Renderer from .error import SDL_SetError, SDL_GetError __all__ = ["SDL_IMAGE_MAJOR_VERSION", "SDL_IMAGE_MINOR_VE...
blue236/ardupilot
refs/heads/master
Tools/LogAnalyzer/tests/TestVCC.py
218
from LogAnalyzer import Test,TestResult import DataflashLog import collections class TestVCC(Test): '''test for VCC within recommendations, or abrupt end to log in flight''' def __init__(self): Test.__init__(self) self.name = "VCC" def run(self, logdata, verbose): self.result = ...
akozumpl/yum
refs/heads/master
yum/metalink.py
1
#!/usr/bin/python -t # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it...
gomiero/PTVS
refs/heads/master
Python/Product/PyKinect/SkeletalViewer/Program.py
18
import pykinect from pykinect import nui pykinect.nui.NuiInitialize( nui.NUI_INITIALIZE_FLAG_USES_DEPTH_AND_PLAYER_INDEX | nui.NUI_INITIALIZE_FLAG_USES_SKELETON | nui.NUI_INITIALIZE_FLAG_USES_COLOR) from pykinect.nui impo...
rschnapka/odoo
refs/heads/7.0
openerp/tests/addons/test_limits/models.py
435
# -*- coding: utf-8 -*- import time import openerp class m(openerp.osv.osv.Model): """ This model exposes a few methods that will consume between 'almost no resource' and 'a lot of resource'. """ _name = 'test.limits.model' def consume_nothing(self, cr, uid, context=None): return True...
nzavagli/UnrealPy
refs/heads/master
UnrealPyEmbed/Source/Python/Lib/python27/plat-mac/Carbon/Qd.py
82
from _Qd import *
ccastell/Transfer-System
refs/heads/master
Website/env/lib/python3.5/site-packages/django/utils/dates.py
590
"Commonly-used date structures" from django.utils.translation import pgettext_lazy, ugettext_lazy as _ WEEKDAYS = { 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'), 5: _('Saturday'), 6: _('Sunday') } WEEKDAYS_ABBR = { 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),...
kartikluke/cron
refs/heads/master
lib/markupsafe/tests.py
674
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
veger/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_compute_backend_bucket.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gautamMalu/rootfs_xen_arndale
refs/heads/master
usr/lib/python3.4/sqlite3/__init__.py
192
# pysqlite2/__init__.py: the pysqlite2 package. # # Copyright (C) 2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software...
ArcherSys/ArcherSys
refs/heads/master
Lib/site-packages/win32/Demos/security/setuserobjectsecurity.py
40
import win32security,win32api,win32con, win32process new_privs = ((win32security.LookupPrivilegeValue('',win32security.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivilegeValue('',win32security.SE_TCB_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32security.LookupPrivil...
ujenmr/ansible
refs/heads/devel
lib/ansible/plugins/cliconf/dellos6.py
16
# # (c) 2017 Red Hat Inc. # # (c) 2017 Dell EMC. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
1Server/OneServer
refs/heads/master
oneserver/plugin/interface.py
1
from manager import OneServerManager from entry import Entry import sys try: from pyutilib.component.core import Interface except ImportError: OneServerManager().log.error('pyutilib.component.core not found') sys.exit() ## # class OneServerPlugin(Interface): ## # This function is called when the plugin is enab...
calmjs/calmjs
refs/heads/master
src/calmjs/tests/test_artifact.py
1
# -*- coding: utf-8 -*- import unittest import sys import os import warnings from os.path import basename from os.path import dirname from os.path import exists from os.path import isfile from os.path import join from os.path import normcase from types import ModuleType from pkg_resources import Distribution from pkg_...
waneric/PyMapLib
refs/heads/master
src/gabbs/layers/Map.py
1
# -*- coding: utf-8 -*- """ map.py - map layer file for gabbs maps ====================================================================== AUTHOR: Wei Wan, Purdue University EMAIL: rcac-help@purdue.edu Copyright (c) 2016 Purdue University See the file "license.terms" for information on usage and redistributio...
swprojects/The-wxPython-Community-Workshop
refs/heads/master
wxsw/__init__.py
6
""" <PyRoboTool Alarm & Countdown Timer - execute tasks on scheduled time> Copyright (C) 2016, Simon Wu, <swprojects@gmx.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the ...
WhatDo/FlowFairy
refs/heads/master
examples/denoise_reg/nets/d2s_unet.py
1
import tensorflow as tf import tensorflow.contrib.slim as slim from flowfairy.conf import settings from util import lrelu, conv2d, maxpool2d batch_size = settings.BATCH_SIZE samplerate = sr = settings.SAMPLERATE dropout = settings.DROPOUT learning_rate = settings.LEARNING_RATE discrete_class = settings.DISCRETE_CLASS ...
nvoron23/socialite
refs/heads/master
jython/Lib/test/test_doctest2.py
77
# -*- coding: utf-8 -*- u"""A module to test whether doctest recognizes some 2.2 features, like static and class methods. >>> print 'yup' # 1 yup We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ """ from test import test_support class C(object): ...
DazWorrall/ansible
refs/heads/devel
lib/ansible/modules/notification/irc.py
10
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jan-Piet Mens <jpmens () gmail.com> # 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', ...
sorenh/cc
refs/heads/master
vendor/Twisted-10.0.0/twisted/test/plugin_basic.py
61
# Copyright (c) 2005 Divmod, Inc. # Copyright (c) 2007 Twisted Matrix Laboratories. # See LICENSE for details. # Don't change the docstring, it's part of the tests """ I'm a test drop-in. The plugin system's unit tests use me. No one else should. """ from zope.interface import classProvides from twisted.plugin imp...
avedaee/DIRAC
refs/heads/integration
ResourceStatusSystem/test/fake_Logger.py
10
################################################################################ # $HeadURL $ ################################################################################ __RCSID__ = "$Id$" """ fake gLogger Every function can simply return S_OK() (or nothing) """ class Logger: def __init__(self): ...
wjlei1990/pyflex
refs/heads/master
src/pyflex/stalta.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The same STA/LTA as used in Flexwin. :copyright: Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014 :license: GNU General Public License, Version 3 (http://www.gnu.org/copyleft/gpl.html) """ from __future__ import (absolute_import, division, print_fun...
diydrones/MissionPlanner
refs/heads/master
ExtLibs/UAVCAN/canard_dsdlc/canard_dsdlc_helpers.py
3
import os import uavcan import errno import em import math import copy def get_empy_env_request(msg): assert msg.kind == msg.KIND_SERVICE msg_underscored_name = msg.full_name.replace('.','_')+'_req' msg_resp_underscored_name = msg.full_name.replace('.','_')+'_res' return { 'msg_underscored_name...
ummahusla/codecademy-exercise-answers
refs/heads/master
Language Skills/Python/Unit 12 File Input and Output/01 Introduction to file I-O/4-Reading.py
2
my_file = open("output.txt", "r") print my_file.read() my_file.close()
Endika/server-tools
refs/heads/8.0
auth_supplier/__openerp__.py
21
# -*- coding: utf-8 -*- # (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel # (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': "Auth Supplier", 'category': 'Tools', 'version': '8.0.1.0.0', 'depends': [ 'auth_signup', ],...
Kiiv/CouchPotatoServer
refs/heads/develop
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/criterion.py
138
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor class CriterionIE(InfoExtractor): _VALID_URL = r'https?://www\.criterion\.com/films/(?P<id>[0-9]+)-.+' _TEST = { 'url': 'http://www.criterion.com/films/184-le-samourai', 'md5': 'bc51be...
willingc/zulip
refs/heads/master
zerver/lib/initial_password.py
121
from __future__ import absolute_import from django.conf import settings import hashlib import base64 def initial_password(email): """Given an email address, returns the initial password for that account, as created by populate_db.""" if settings.INITIAL_PASSWORD_SALT is not None: digest = has...
tsdmgz/ansible
refs/heads/devel
lib/ansible/plugins/lookup/hiera.py
9
# (c) 2017, Juan Manuel Parrilla <jparrill@redhat.com> # (c) 2012-17 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 = ''' author: - Juan Manuel P...
adamjoniec/cmdline
refs/heads/master
@scripts/adb-sendkeys.py
1
#!/usr/bin/python __author__ = 'nixCraft' import sys from subprocess import call adbDevice = None def callADBShell(arguments): callArguments = ["adb"] + (["shell"] if adbDevice == None else [adbDevice, "shell"]) callArguments += arguments if len(arguments) == 3: print (" ... sending %s:%s:'%s'" % (arguments[0], ...
jrha/aquilon
refs/heads/master
tests/broker/test_add_city.py
2
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2010,2011,2012,2013 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma...
coldnew-gp-revolution/gp-revolution-kernel
refs/heads/official
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...
thedixieflatline/mGameController
refs/heads/master
pygame/tests/run_tests__tests/all_ok/fake_3_test.py
270
if __name__ == '__main__': import sys import os pkg_dir = (os.path.split( os.path.split( os.path.split( os.path.abspath(__file__))[0])[0])[0]) parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and ...
teemulehtinen/a-plus
refs/heads/master
exercise/migrations/0005_auto_20150625_1821.py
2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('exercise', '0004_auto_20150617_1033'), ] operations = [ migrations.AlterField( mode...
lidiamcfreitas/FenixScheduleMaker
refs/heads/master
ScheduleMaker/brython/www/src/Lib/encodings/cp865.py
37
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors=...
dssg/givinggraph
refs/heads/master
givinggraph/companycause/company_cause_svm.py
3
#!/usr/bin/env python # # Description: This runs a support vector machine (SVM) on the # labelled dataset (company summary, donation cause). # import pickle import string import re import numpy as np from nltk.corpus import stopwords from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import cros...
ShiYw/Sigil
refs/heads/master
3rdparty/python/Lib/test/test_flufl.py
179
import __future__ import unittest class FLUFLTests(unittest.TestCase): def test_barry_as_bdfl(self): code = "from __future__ import barry_as_FLUFL; 2 {0} 3" compile(code.format('<>'), '<BDFL test>', 'exec', __future__.CO_FUTURE_BARRY_AS_BDFL) self.assertRaises(SyntaxError, ...
raviparekh/webapp-error-handler
refs/heads/master
app_error_handler/root_exception.py
1
from logging import CRITICAL, ERROR, WARN import string class RootException(Exception): def __init__(self, app_err_code, warning_messages_mapping, error_messages_mapping, fatal_error_messages_mapping, status_code=500, **kwargs): error_message = warning_messages_mapping.get(app_err_code) o...
xfournet/intellij-community
refs/heads/master
python/helpers/py2only/docutils/parsers/rst/directives/admonitions.py
126
# $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Admonition directives. """ __docformat__ = 'reStructuredText' from docutils.parsers.rst import Directive from docutils.parsers.rst import states, di...
jamesbdunlop/Nebula
refs/heads/master
nebula_libs/nconstants.py
2
## QPUSHBUTTON COLORS QPB_GREEN = "#006600" QPB_RED = "#900000" QPB_HOVER = "#787878" QPB_BORDER = "#686868" ICONPATH = "T:/software/Nebula/icons/" VIS = ['visibility'] TRANS = ['translateX', 'translateY', 'translateZ'] ROT = ['rotateX', 'rotateY', 'rotateZ'] SCALE = ['scaleX', 'scaleY', 'scaleZ'] TRANSROT = TRANS + ...
vsoch/deepdive
refs/heads/master
examples/spouse_example/postgres/ddlog/udf/ext_people.py
15
#! /usr/bin/env python # Sample input data (piped into STDIN): ''' 118238@10 Sen.~^~Barack~^~Obama~^~and~^~his~^~wife~^~,~^~Michelle~^~Obama~^~,~^~have~^~released~^~eight~^~years~^~of~^~joint~^~returns~^~. O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~DURATION~^~DURATION~^~O~^~O~^~O~^~O 118238@12...
woutersmet/Molmodsummer
refs/heads/master
lib/molmod/volume.py
1
# MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of MolMod. # # MolMod 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...
Ebag333/Pyfa
refs/heads/master
eos/effects/covertopscloakcpupercentbonus1.py
1
# covertOpsCloakCpuPercentBonus1 # # Used by: # Ships from group: Covert Ops (5 of 6) type = "passive" runTime = "early" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Cloaking"), "cpu", ship.getModifiedItemAttr("eliteBonusCover...
CMPUT410W15T02/CMPUT410W15-project
refs/heads/master
testenv/lib/python2.7/site-packages/django/core/signing.py
82
""" Functions for creating and restoring url-safe signed JSON objects. The format used looks like this: >>> signing.dumps("hello") 'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk' There are two components here, separated by a ':'. The first component is a URLsafe base64 encoded JSON of the object passed to dumps(). T...
137io/adb
refs/heads/master
79.py
1
""" Euler 79 ->Sample Output: Inet time: 0.384672880173 Real run time 0.000158071517944 73162890 -> Why this problem: I like security stuff in general. Also, I was able to solve this by hand faster and writing an algorithm for it was not resolved in a few brain cycles,which made it interesting. -> A description of t...
lmotta/Roam
refs/heads/master
src/roam/editorwidgets/listwidget.py
1
from PyQt4.QtGui import QComboBox, QStandardItem, QStandardItemModel, QIcon, QListView from PyQt4.QtCore import QSize, Qt, QEvent from qgis.core import QgsMessageLog, QgsMapLayerRegistry, QgsExpression, QgsFeatureRequest import qgis.core import roam.utils from roam.api import RoamEvents from roam.editorwidgets.core im...
d40223223/2015cdb_g6-team
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/pwd.py
730
def getpwuid(): pass
o3project/ryu-oe
refs/heads/master
ryu/contrib/ovs/dirs.py
49
import os PKGDATADIR = os.environ.get("OVS_PKGDATADIR", """/usr/share/openvswitch""") RUNDIR = os.environ.get("OVS_RUNDIR", """/var/run/openvswitch""") LOGDIR = os.environ.get("OVS_LOGDIR", """/var/log/openvswitch""") BINDIR = os.environ.get("OVS_BINDIR", """/usr/bin""") DBDIR = os.environ.get("OVS_DBDIR") if not DBDI...
yongshengwang/hue
refs/heads/master
build/env/lib/python2.7/site-packages/South-1.0.2-py2.7.egg/south/management/commands/migrationcheck.py
129
from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command, CommandError from django.core.management.base import BaseCommand from django.conf import settings from django.db.models import loading from django.test import simple from south.migration import Migrations from sout...
jpic/django-form-builder
refs/heads/master
form_builder/urls.py
1
from django.conf.urls.defaults import patterns, url from django.views.decorators import csrf import views urlpatterns = patterns('', url(r'form/create/$', views.FormCreateView.as_view(), name='form_builder_form_create'), url(r'form/(?P<pk>\d+)/update/$', csrf.csrf_exempt( views.FormUpdateView....
beylsp/appletea
refs/heads/master
appletea/gcalendar/models.py
1
"""Google Calendar Events object model. Events object model for Google Calendar API responses. """ from appletea.exceptions import HTTPError from appletea.utils import UnicodeMixin class GCalendarEvents(UnicodeMixin): """GCalendarEvents data object. Google Calendar Events data object includes a list of even...
frederick-masterton/django
refs/heads/master
tests/utils_tests/test_text.py
25
# -*- coding: utf-8 -*- from __future__ import unicode_literals from unittest import skipUnless import warnings from django.test import SimpleTestCase from django.utils import six, text from django.utils.deprecation import RemovedInDjango19Warning IS_WIDE_BUILD = (len('\U0001F4A9') == 1) class TestUtilsText(Simple...
mrknow/filmkodi
refs/heads/master
plugin.video.fanfilm/resources/lib/libraries/f4mproxy/utils/compat.py
144
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Miscellaneous functions to mask Python version differences.""" import sys import os import math import binascii if sys.version_info >= (3,0): def compat26Str(x): return x # Python 3 requires bytes instea...
winningsix/hive
refs/heads/trunk
service/src/gen/thrift/gen-py/TCLIService/TCLIService.py
26
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
porduna/weblabdeusto
refs/heads/master
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment36/server_config.py
968
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...