repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
ahmetdaglarbas/e-commerce
refs/heads/tez
oscar/apps/dashboard/pages/config.py
58
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class PagesDashboardConfig(AppConfig): label = 'pages_dashboard' name = 'oscar.apps.dashboard.pages' verbose_name = _('Pages dashboard')
DemocracyLab/CivicTechExchange
refs/heads/master
oauth2/app_settings.py
11
class AppSettings(object): def __init__(self, prefix): self.prefix = prefix def _setting(self, name, dflt): from django.conf import settings getter = getattr(settings, 'ALLAUTH_SETTING_GETTER', lambda name, dflt: getattr(settings, name,...
MatthewWilkes/django
refs/heads/master
django/contrib/gis/db/models/sql/aggregates.py
298
from django.db.models.sql import aggregates from django.db.models.sql.aggregates import * # NOQA __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] + aggregates.__all__ warnings.warn( "django.contrib.gis.db.models.sql.aggregates is deprecated. Use " "django.contrib.gis.db.models.aggregates ins...
idea4bsd/idea4bsd
refs/heads/idea4bsd-master
python/testData/inspections/PyUnresolvedReferencesInspection/percentStringKeywordTupleArgument.py
8
"%(<warning descr="Unresolved reference 'foo'">foo</warning>)s" % (1,2,3)
lucafavatella/intellij-community
refs/heads/cli-wip
python/testData/refactoring/introduceVariable/py2862.after.py
70
a = '/import/' + urllib.quote(projectId) + '/issues?' + urllib.urlencode({'assigneeGroup': assigneeGroup}) response = self._reqXml('PUT', a, xml, 400).toxml().encode('utf-8')
frippe12573/geonode
refs/heads/master
geonode/layers/__init__.py
396
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
ledtvavs/repository.ledtv
refs/heads/master
script.module.liveresolver/lib/liveresolver/modules/f4mproxy/utils/openssl_aes.py
202
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """OpenSSL/M2Crypto AES implementation.""" from .cryptomath import * from .aes import * if m2cryptoLoaded: def new(key, mode, IV): return OpenSSL_AES(key, mode, IV) class OpenSSL_AES(AES): def ...
Scoppio/agazeta-rest
refs/heads/master
arquivo/services/tobTokenServices.py
1
# This service captures the data using Dora R. as base # coding: utf-8 import os import json import logging import requests from arquivo.dao import tobTokenDAO from django.db.utils import IntegrityError from settings.base import MINNING_URLS logger = logging.getLogger('sentry.errors') def createTobToken(username, to...
Big-B702/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/test/test_netrc.py
63
import netrc, os, unittest, sys, textwrap from test import support temp_filename = support.TESTFN class NetrcTestCase(unittest.TestCase): def tearDown(self): os.unlink(temp_filename) def make_nrc(self, test_data): test_data = textwrap.dedent(test_data) mode = 'w' if sys.platf...
devaha/archagent
refs/heads/master
node_modules/grunt-plugin/node_modules/npm/node_modules/node-gyp/gyp/test/win/gyptest-link-entrypointsymbol.py
342
#!/usr/bin/env python # 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. """ Make sure entrypointsymbol setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp....
alexallah/django
refs/heads/master
tests/migrations2/test_migrations_2/0001_initial.py
149
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("migrations", "0002_second")] operations = [ migrations.CreateModel( "OtherAuthor", [ ("id", models.AutoField(primary_key=True)), ("name", models....
Vassy/odoo
refs/heads/master
addons/web_kanban_gauge/__openerp__.py
428
{ 'name': 'Gauge Widget for Kanban', 'category': 'Hidden', 'description': """ This widget allows to display gauges using justgage library. """, 'version': '1.0', 'depends': ['web_kanban'], 'data' : [ 'views/web_kanban_gauge.xml', ], 'qweb': [ ], 'auto_install': True, }
pylixm/sae-django-demo
refs/heads/master
django1.7-sae/site-packages/django/contrib/comments/moderation.py
60
""" A generic comment-moderation system which allows configuration of moderation options on a per-model basis. To use, do two things: 1. Create or import a subclass of ``CommentModerator`` defining the options you want. 2. Import ``moderator`` from this module and register one or more models, passing the model...
ThirdProject/android_external_chromium_org
refs/heads/cm-11.0
tools/android/find_unused_resources.py
146
#!/usr/bin/python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Lists unused Java strings and other resources.""" import optparse import re import subprocess import sys def GetLibraryResources(...
adrianholovaty/django
refs/heads/master
django/contrib/gis/gdal/tests/test_geom.py
11
from binascii import b2a_hex try: import cPickle as pickle except ImportError: import pickle from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType, OGRException, OGRIndexError, SpatialReference, CoordTransform, GDAL_VERSION) from django.contrib.gis.gdal.prototypes.geom import GEOJSON from django.co...
163gal/Time-Line
refs/heads/master
libs/wxPython/lib/ClickableHtmlWindow.py
6
## This file imports items from the wx package into the wxPython package for ## backwards compatibility. Some names will also have a 'wx' added on if ## that is how they used to be named in the old wxPython package. import wx.lib.ClickableHtmlWindow __doc__ = wx.lib.ClickableHtmlWindow.__doc__ wxPyClickableHtmlWin...
Distrotech/qtwebkit
refs/heads/distrotech-qtwebkit
Tools/Scripts/webkitpy/common/editdistance.py
138
# Copyright (c) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
saghul/gyn
refs/heads/master
test/win/gyptest-link-incremental.py
344
#!/usr/bin/env python # 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. """ Make sure incremental linking setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestG...
jorik041/scrapy
refs/heads/master
scrapy/core/downloader/handlers/http.py
144
from scrapy import optional_features from .http10 import HTTP10DownloadHandler if 'http11' in optional_features: from .http11 import HTTP11DownloadHandler as HTTPDownloadHandler else: HTTPDownloadHandler = HTTP10DownloadHandler # backwards compatibility class HttpDownloadHandler(HTTP10DownloadHandler): ...
isrohutamahopetechnik/MissionPlanner
refs/heads/master
Lib/site-packages/numpy/fft/fftpack_lite.py
53
import sys if sys.platform == 'cli': import clr clr.AddReference("fftpack_lite") from numpy__fft__fftpack_cython import *
antoinecarme/pyaf
refs/heads/master
tests/croston/test_croston_fpp2_counts_example.py
1
import pandas as pd def create_dataset(): lCounts = "0 2 0 1 0 11 0 0 0 0 2 0 6 3 0 0 0 0 0 7 0 0 0 0 0 0 0 3 1 0 0 1 0 1 0 0".split() lCounts = [float(c) for c in lCounts] N = len(lCounts) lDates = pd.date_range(start="2000-01-01", periods=N, freq='m') df = pd.DataFrame({"Date" : lDates, "Signal"...
skosukhin/spack
refs/heads/esiwace
lib/spack/docs/tutorial/examples/Cmake/0.package.py
1
############################################################################## # Copyright (c) 2013-2017, 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...
Ali-aqrabawi/ezclinic
refs/heads/master
lib/django/forms/models.py
27
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) fro...
pschwartz/ansible
refs/heads/devel
test/units/plugins/action/__init__.py
7690
# (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...
voriux/Flexget
refs/heads/develop
flexget/plugins/__init__.py
44
"""Standard plugin package."""
snoopycrimecop/openmicroscopy
refs/heads/merge_ci
components/tools/OmeroPy/manualtests/populate_roi_test.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ... """ # # Copyright (C) 2009 University of Dundee. All rights reserved. # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either versio...
kennedyshead/home-assistant
refs/heads/dev
tests/components/deconz/test_binary_sensor.py
2
"""deCONZ binary sensor platform tests.""" from unittest.mock import patch from homeassistant.components.binary_sensor import ( DEVICE_CLASS_MOTION, DEVICE_CLASS_PROBLEM, DEVICE_CLASS_VIBRATION, ) from homeassistant.components.deconz.const import ( CONF_ALLOW_CLIP_SENSOR, CONF_ALLOW_NEW_DEVICES, ...
lamby/live-studio
refs/heads/master
contrib/django/contrib/sessions/models.py
146
from django.db import models from django.utils.translation import ugettext_lazy as _ class SessionManager(models.Manager): def encode(self, session_dict): """ Returns the given session dictionary pickled and encoded as a string. """ return SessionStore().encode(session_dict) d...
frouty/odoogoeen
refs/heads/prod
addons/portal_stock/__openerp__.py
437
# -*- 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...
mccarrmb/moztrap
refs/heads/master
moztrap/view/runtests/finders.py
5
""" Finder for running tests. """ from django.core.urlresolvers import reverse from ... import model from ..lists import finder class RunTestsFinder(finder.Finder): template_base = "runtests/finder" columns = [ finder.Column( "products", "_products.html", model....
rprata/boost
refs/heads/master
libs/python/pyste/tests/infosUT.py
54
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to 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) import sys from Pyste.infos import * from Pyste.policies import * from Pyste.exporterutil...
a13m/ansible
refs/heads/devel
v2/ansible/module_utils/gce.py
305
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
40223212/2015cdbg4_6-22
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/_weakrefset.py
766
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of the # weak container, such ...
lombritz/odoo
refs/heads/8.0
addons/account/wizard/account_chart.py
271
# -*- 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...
cbeloni/pychronesapp
refs/heads/master
backend/venv/lib/python2.7/site-packages/pip/basecommand.py
392
"""Base Command class, and related routines""" import os import sys import tempfile import traceback import time import optparse from pip import cmdoptions from pip.locations import running_under_virtualenv from pip.log import logger from pip.download import PipSession from pip.exceptions import (BadCommand, Installa...
hlj2722/flasky
refs/heads/master
app/api_1_0/users.py
104
from flask import jsonify, request, current_app, url_for from . import api from ..models import User, Post @api.route('/users/<int:id>') def get_user(id): user = User.query.get_or_404(id) return jsonify(user.to_json()) @api.route('/users/<int:id>/posts/') def get_user_posts(id): user = User.query.get_or...
rgommers/statsmodels
refs/heads/master
statsmodels/iolib/tableformatting.py
12
""" Summary Table formating This is here to help keep the formating consistent across the different models """ gen_fmt = dict( data_fmts = ["%s", "%s", "%s", "%s", "%s"], empty_cell = '', colwidths = 7, #17, colsep=' ', row_pre = ' ', row_post = ' ', table_de...
perkinslr/pypyjs
refs/heads/master
website/js/pypy.js-0.2.0/lib/modules/test/outstanding_bugs.py
195
# # This file is for everybody to add tests for bugs that aren't # fixed yet. Please add a test case and appropriate bug description. # # When you fix one of the bugs, please move the test to the correct # test_ module. # import unittest from test import test_support # # No test cases for outstanding bugs at the mome...
azverkan/scons
refs/heads/master
test/Configure/CONFIGUREDIR.py
5
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
mapleoin/cuZmeura
refs/heads/master
ads/feeds.py
2
# -*- coding: utf-8 -*- # This file is part of cuZmeură. # Copyright (c) 2010 Ionuț Arțăriși # cuZmeură is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your opti...
dstrockis/outlook-autocategories
refs/heads/master
lib/rsa/asn1.py
97
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
openaid-IATI/OIPA
refs/heads/master
OIPA/api/chain/urls.py
2
from django.conf.urls import url import api.chain.views app_name = 'api' urlpatterns = [ url(r'^$', api.chain.views.ChainList.as_view(), name='chain-list'), url(r'^aggregations/', api.chain.views.ChainAggregations.as_view(), name='chain-aggregations'), url(r'^nodes/', ...
opcode0x90/pyew
refs/heads/master
vstruct/defs/macho/loader.py
18
import vstruct from vstruct.primitives import * from vstruct.defs.macho.const import * vm_prot_t = v_uint32 cpu_type_t = v_uint32 cpu_subtype_t = v_uint32 lc_str = v_uint32 class mach_header(vstruct.VStruct): def __init__(self): vstruct.VStruct.__init__(self) self.magic = v_uint32() # mach ...
qwefi/nova
refs/heads/master
nova/vnc/xvp_proxy.py
4
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
chauhanhardik/populo
refs/heads/master
common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py
114
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.country' db.add_column('auth_userprofile', 'country', self...
praveen-pal/edx-platform
refs/heads/master
cms/djangoapps/contentstore/course_info_model.py
9
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore import Location from xmodule.modulestore.django import modulestore from lxml import html, etree import re from django.http import HttpResponseBadRequest import logging import django.utils # # TODO store as array of { date, content } ...
diagramsoftware/odoo
refs/heads/8.0
addons/l10n_be_coda/__openerp__.py
260
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
pombredanne/pulp
refs/heads/master
server/pulp/server/db/manage.py
6
""" This module's main() function becomes the pulp-manage-db.py script. """ from gettext import gettext as _ from optparse import OptionParser import logging import os import sys import traceback from pulp.plugins.loader.api import load_content_types from pulp.plugins.loader.manager import PluginManager from pulp.serv...
outlierbio/ob-pipelines
refs/heads/master
ob_pipelines/apps/multiqc/test_aws_batch.py
1
import os.path as op import ob_pipelines from ob_pipelines.batch import BatchClient module_dir = op.dirname(ob_pipelines.__file__) # __file__ is __init__.py, have to get parent folder bc = BatchClient() # thin wrapper for boto3.client('batch') # assuming job definition is already registered parameters = { 'a...
nadley/Sick-Beard
refs/heads/development
sickbeard/search_queue.py
29
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
dchaplinsky/pep.org.ua
refs/heads/master
pepdb/core/migrations/0093_declaration_nacp_declaration.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('core', '0092_auto_20160804_1555'), ] operations = [ migrations.AddField( model_name='declaration', n...
kmatzen/ansible
refs/heads/devel
lib/ansible/plugins/lookup/indexed_items.py
127
# (c) 2012, 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) any lat...
Lekanich/intellij-community
refs/heads/master
python/testData/mover/emptyLine_afterDown.py
83
if True: a = 1 b = 2
ledtvavs/repository.ledtv
refs/heads/master
script.mrknow.urlresolver/lib/urlresolver9/plugins/grifthost.py
4
""" grifthost urlresolver plugin Copyright (C) 2015 tknorris 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 d...
woest85/PokemonGo-Map-1
refs/heads/develop
pogom/fakePogoApi.py
15
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests import struct from time import time from .utils import get_args class FakePogoApi: def __init__(self, mock): # Fake a 24 hour auth token self._auth_provider = type('', (object,), {"_ticket_expire": (time() + (3600 * 24)) * 1000})() ...
midonet/python-midonetclient
refs/heads/master
src/midonetclient/neutron/bgp.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014 Midokura Europe SARL, All Rights Reserved. # 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://w...
tdhopper/scikit-learn
refs/heads/master
sklearn/metrics/cluster/tests/test_unsupervised.py
230
import numpy as np from scipy.sparse import csr_matrix from sklearn import datasets from sklearn.metrics.cluster.unsupervised import silhouette_score from sklearn.metrics import pairwise_distances from sklearn.utils.testing import assert_false, assert_almost_equal from sklearn.utils.testing import assert_raises_regexp...
jagguli/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/db/models/base.py
71
import types import sys from itertools import izip import django.db.models.manager # Imported to register signal handler. from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS from django.core import validators from django.db.models.fields impo...
avinashkunuje/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/zipfileset_mock.py
167
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
dev-zzo/pwn-tools
refs/heads/master
embedded/stm32bldr.py
1
""" STM32 Bootloader tool See the following STMicro application notes: * AN2606 for the general description * AN3155 for the protocol Dependencies: * pySerial """ import binascii import struct import serial def log(text): print(text) # AN2606: 3.2 Bootloader identification __bl_interfaces = [ (), ( 'u...
Joergen/olympia
refs/heads/master
apps/amo/urls.py
1
from waffle.views import wafflejs from django.conf.urls import include, patterns, url from django.views.decorators.cache import never_cache from . import install, views services_patterns = patterns( '', url('^monitor(.json)?$', never_cache(views.monitor), name='amo.monitor'), url('^loaded$', nev...
Jonekee/chromium.src
refs/heads/nw12
tools/telemetry/telemetry/page/page_set.py
11
# Copyright 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. import csv import inspect import os from telemetry.page import page as page_module from telemetry.user_story import user_story_set from telemetry.util impor...
noba3/KoTos
refs/heads/master
addons/plugin.video.mega/resources/lib/platform_libraries/Linux/64bit/Crypto/Cipher/__init__.py
271
"""Secret-key encryption algorithms. Secret-key encryption algorithms transform plaintext in some way that is dependent on a key, producing ciphertext. This transformation can easily be reversed, if (and, hopefully, only if) one knows the key. The encryption modules here all support the interface described in PEP 272...
alianmohammad/gem5-linux-kernel
refs/heads/master
tools/perf/scripts/python/sctop.py
11180
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
TheWardoctor/Wardoctors-repo
refs/heads/master
script.extendedinfo/resources/lib/dialogs/BaseClasses.py
2
# -*- coding: utf8 -*- # Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv> # This program is Free Software see LICENSE file for details import xbmcgui class WindowXML(xbmcgui.WindowXML): def __init__(self, *args, **kwargs): xbmcgui.WindowXML.__init__(self) self.window_type = "window" ...
Wyn10/Cnchi
refs/heads/master
cnchi/ui/html/pages/_04_location/location.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # location.py # # Copyright © 2016 Antergos # # This file is part of The Antergos Build Server, (AntBS). # # AntBS 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 Fou...
dd00/commandergenius
refs/heads/dd00
project/jni/python/src/Lib/test/test_dis.py
58
# Minimal tests for dis module from test.test_support import run_unittest import unittest import sys import dis import StringIO def _f(a): print a return 1 dis_f = """\ %-4d 0 LOAD_FAST 0 (a) 3 PRINT_ITEM 4 PRINT_NEWLINE %-4d 5 LOAD_CONST ...
75651/kbengine_cloud
refs/heads/master
kbe/res/scripts/common/Lib/idlelib/PyShell.py
59
#! /usr/bin/env python3 import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import traceback import types import io import linecache from code import InteractiveInterpreter from platform import python_version, system try: from t...
trek10inc/awsume
refs/heads/master
awsume/configure/autocomplete.py
1
import os, pathlib BASH_AUTOCOMPLETE_SCRIPT = """ _awsume() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts=$(awsume-autocomplete) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 } complete -F _awsume awsume """ ZSH_AUTOCO...
skython/eXe
refs/heads/master
twisted/web/rewrite.py
14
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # from twisted.web import resource class RewriterResource(resource.Resource): def __init__(self, orig, *rewriteRules): resource.Resource.__init__(self) self.resource = orig self.rewriteRules = list(rewriteRules) ...
comiconomenclaturist/Airtime
refs/heads/2.5.x
dev_tools/compare_cc_files_to_fs.py
10
import os import time import shutil import sys import logging from configobj import ConfigObj from subprocess import Popen, PIPE from api_clients import api_client as apc """ The purpose of this script is that you can run it, and it will compare what the database has to what your filesystem has. It will then report i...
zachjanicki/osf.io
refs/heads/develop
framework/utils.py
65
from __future__ import absolute_import import re from werkzeug.utils import secure_filename as werkzeug_secure_filename def iso8601format(dt): """Given a datetime object, return an associated ISO-8601 string""" return dt.strftime('%Y-%m-%dT%H:%M:%SZ') if dt else '' def secure_filename(filename): """Ret...
LeBarbouze/tunacell
refs/heads/master
docs/conf.py
1
# -*- coding: utf-8 -*- # # tuna documentation build configuration file, created by # sphinx-quickstart on Sun May 7 19:17:53 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
TheTypoMaster/my-vim-set-mac
refs/heads/master
.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/tests/gmock/scripts/generator/cpp/gmock_class_test.py
51
#!/usr/bin/env python # # Copyright 2009 Neal Norwitz All Rights Reserved. # Portions Copyright 2009 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 # # ...
streamlink/streamlink
refs/heads/master
tests/plugins/test_rtve.py
3
from streamlink.plugins.rtve import Rtve from tests.plugins import PluginCanHandleUrl class TestPluginCanHandleUrlRtve(PluginCanHandleUrl): __plugin__ = Rtve should_match = [ 'http://www.rtve.es/directo/la-1', 'http://www.rtve.es/directo/la-2/', 'http://www.rtve.es/directo/teledeporte...
bionomicron/Redirector
refs/heads/master
core/reader/FluxModelParser.py
1
#!/usr/bin/env python ''' @author: Graham Rockwell @organization: Church Lab Harvard Genetics @version: 03/04/2013 --Rename to metabolic-model parser ''' from core.do.FluxModel import FluxModel, MetabolicNetwork, Reaction, Objective, FluxLimit from core.do.FluxModelTools import ReactionParser from util.FlatFileParser ...
cg31/tensorflow
refs/heads/master
tensorflow/python/training/session_manager_test.py
11
# 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...
merivercap/bitshares-2-ui
refs/heads/bitshares
docs/conf.py
11
# -*- coding: utf-8 -*- # # Graphene UI documentation build configuration file, created by # sphinx-quickstart on Mon Feb 8 19:12:18 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
enthought/etsproxy
refs/heads/master
enthought/chaco/lasso_overlay.py
1
# proxy module from __future__ import absolute_import from chaco.lasso_overlay import *
jhuapl-marti/marti
refs/heads/master
crits/comments/urls.py
17
from django.conf.urls import patterns urlpatterns = patterns('crits.comments.views', (r'^remove/(?P<obj_id>\S+)/$', 'remove_comment'), (r'^(?P<method>\S+)/(?P<obj_type>\S+)/(?P<obj_id>\S+)/$', 'add_update_comment'), (r'^activity/$', 'activity'), (r'^activity/(?P<atype>\S+)/(?P<value>\S+)/$', 'activity'...
jollaman999/jolla-kernel_G_Gen3-Stock
refs/heads/test1
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
YunoHost/apps
refs/heads/master
i18n-tools/generate_translation_file.py
3
import os import sys import json if __name__ == '__main__': if os.path.exists("locales/en.json"): print "This script should be run only once, the first time to generate locales/, after that you should use update_translations.py" print "Abort" sys.exit(1) other_langs = {} keys = [...
tedelhourani/ansible
refs/heads/devel
examples/scripts/uptime.py
17
#!/usr/bin/env python from collections import namedtuple from ansible.executor.task_queue_manager import TaskQueueManager from ansible.inventory.manager import InventoryManager from ansible.parsing.dataloader import DataLoader from ansible.playbook.play import Play from ansible.plugins.callback import CallbackBase fr...
goliveirab/odoo
refs/heads/8.0
addons/hr_holidays/report/hr_holidays_report.py
341
# -*- 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...
CCI-MOC/nova
refs/heads/k2k-liberty
nova/spice/__init__.py
72
#!/usr/bin/env python # Copyright (c) 2012 Red Hat, 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 ...
Eziohao/DV-router
refs/heads/master
node_modules/bellman-ford/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
231
#!/usr/bin/env python # 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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ from ctypes imp...
pedrobaeza/odoo
refs/heads/master
addons/mass_mailing/models/mail_thread.py
65
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
hackBCA/missioncontrol
refs/heads/master
application/mod_admin/controllers.py
1
from application import CONFIG, app from application.mod_user.models import * from application.mod_user.controllers import get_user import re import sendgrid import bcrypt import time UserExistsError = Exception("UserExistsError", "Email already exists in database") sg = sendgrid.SendGridClient(CONFIG["SENDGRID_API_K...
HenriWahl/Nagstamon
refs/heads/master
Nagstamon/Servers/__init__.py
1
# encoding: utf-8 # Nagstamon - Nagios status monitor for your desktop # Copyright (C) 2008-2021 Henri Wahl <henri@nagstamon.de> et al. # # 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 ...
ujenmr/ansible
refs/heads/devel
lib/ansible/module_utils/docker/common.py
5
# # Copyright 2016 Red Hat | Ansible # # 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 version. # # ...
andersroos/rankedftw
refs/heads/master
main/migrations/0014_add_on_delete_property.py
1
# Generated by Django 2.2 on 2019-04-07 17:04 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0013_fixing_indices'), ] operations = [ migrations.AlterField( model_name='player', ...
zstackio/zstack-woodpecker
refs/heads/master
integrationtest/vm/multihosts/multi_shared_ps/test_san_vm_other_ps_volume_sp.py
1
''' New Integration Test for multiple shared primary storage @author: Legion ''' import os import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_operations as res_ops test_obj_dict = te...
javiplx/cobbler-2.x
refs/heads/master
cobbler/codes.py
2
""" various codes and constants used by Cobbler Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.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 License...
cpaulik/scipy
refs/heads/master
scipy/_lib/_numpy_compat.py
71
"""Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings import numpy as np from scipy._lib._version import NumpyVersion if NumpyVersion(np.__version__) > '1.7.0.dev': _assert_warns = np.testing.assert_warns else: def _assert...
nycholas/ask-undrgz
refs/heads/master
src/ask-undrgz/django/contrib/gis/gdal/srs.py
30
""" The Spatial Reference class, represensents OGR Spatial Reference objects. Example: >>> from django.contrib.gis.gdal import SpatialReference >>> srs = SpatialReference('WGS84') >>> print srs GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORI...
Argon-Zhou/django
refs/heads/master
tests/m2m_and_m2o/models.py
128
""" Many-to-many and many-to-one relationships to the same table Make sure to set ``related_name`` if you use relationships to the same table. """ from __future__ import unicode_literals from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class Use...
philippeowagner/django-background-tasks-example
refs/heads/master
project/manage.py
404
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
rapilabs/django
refs/heads/master
django/forms/widgets.py
106
""" HTML Widget classes """ from __future__ import unicode_literals import copy import datetime import re from itertools import chain from django.conf import settings from django.forms.utils import flatatt, to_current_timezone from django.utils import datetime_safe, formats, six from django.utils.datastructures impo...
ForcerKing/ShaoqunXu-mysql5.7
refs/heads/master
storage/ndb/mcc/tst/unittest2/suite.py
166
"""TestSuite""" import sys import unittest from unittest2 import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests(tests) ...
40223125/40223125-2
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/antigravity.py
917
import webbrowser import hashlib webbrowser.open("http://xkcd.com/353/") def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(d...