repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
GitHublong/hue
refs/heads/master
desktop/core/ext-py/MySQL-python-1.2.5/tests/test_MySQLdb_nonstandard.py
41
import unittest import _mysql import MySQLdb from MySQLdb.constants import FIELD_TYPE from configdb import connection_factory import warnings warnings.simplefilter("ignore") class TestDBAPISet(unittest.TestCase): def test_set_equality(self): self.assertTrue(MySQLdb.STRING == MySQLdb.STRING) def test_...
kxxoling/fabric
refs/heads/chs
tests/Python26SocketServer.py
21
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
tinkhaven-organization/odoo
refs/heads/8.0
addons/hw_posbox_homepage/controllers/main.py
112
# -*- coding: utf-8 -*- import logging import os import time from os import listdir import openerp from openerp import http from openerp.http import request from openerp.tools.translate import _ _logger = logging.getLogger(__name__) index_template = """ <!DOCTYPE HTML> <html> <head> <title>Odoo's PosBox<...
imtapps/django-class-registry
refs/heads/master
class_registry/tests/demo/__init__.py
1
from . import actions from class_registry.auto_import import AutoImport AutoImport(actions).setup()
ZerpaTechnology/AsenZor
refs/heads/master
static/js/brython/Lib/encodings/mac_croatian.py
37
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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_table) def de...
napalm-automation/napalm-yang
refs/heads/develop
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/interfaces/interface/levels/level/packet_counters/iih/state/__init__.py
1
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
dOpensource/dsiprouter
refs/heads/master
gui/globals.py
1
# # TODO: this module shadows globals() builtin, which is a bad practice # and may have unintended consequences elsewhere, we need to find a better implementation # # Also, we lose the state of global required if dsiprouter restarts # which means kamailio may not have reloaded memory at all # We should track the state ...
Tejal011089/paypal_erpnext
refs/heads/develop
erpnext/stock/doctype/stock_settings/stock_settings.py
63
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cint from frappe.model.document import Do...
dimasad/numpy
refs/heads/master
numpy/tests/test_ctypeslib.py
69
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.ctypeslib import ndpointer, load_library from numpy.distutils.misc_util import get_shared_lib_extension from numpy.testing import * try: cdll = load_library('multiarray', np.core.multiarray.__file__) _HA...
Jgarcia-IAS/localizacion
refs/heads/master
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/multi_store/__openerp__.py
9
# -*- coding: utf-8 -*- { 'name': 'Multi Store', 'version': '1.0', 'category': 'Accounting', 'sequence': 14, 'summary': '', 'description': """ Multi Store =========== The main purpose of this module is to restrict journals access for users on different stores. This module add a new concept "st...
willbittner/datto-php-test-polymer
refs/heads/master
node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSNew.py
601
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
SahilTikale/switchHaaS
refs/heads/haas-as-a-switch
tests/unit/config.py
3
from haas.test_common import config_set from haas import config import sys def test_load_extension(): """Check that putting modules in [extensions] results in importing them.""" config_set({ 'extensions': { # These modules are chosen because: # # 1. They are in the ...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/numpy/core/tests/test_scalarmath.py
21
from __future__ import division, absolute_import, print_function import sys import itertools import warnings import operator import numpy as np from numpy.testing.utils import _gen_alignment_data from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, assert_almost_equal,...
unho/pootle
refs/heads/master
pootle/core/views/base.py
5
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from collections import OrderedDict from dj...
bowang/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/distributions/exponential_test.py
76
# 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...
snehasi/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/docroot/test_tuple_3.py
467
def main(request, response): return (202, "Giraffe"), [("Content-Type", "text/html"), ("X-Test", "PASS")], "PASS"
sunjerry019/photonLauncher
refs/heads/master
micron/project_guimicro/guimicro.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # final level Graphical User Interface for stagecontrol.py # Swapped to PyQt5 from Tkinter, because the former is more powerful/intuitive to implement features # microgui will pair functions with commands imported from stagecontrol.py which uses raster in turn # I'm sorr...
srluge/SickRage
refs/heads/master
lib/sqlalchemy/orm/properties.py
79
# orm/properties.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 """MapperProperty implementations. This is a private module which defines the behav...
proversity-org/edx-platform
refs/heads/master
common/lib/calc/setup.py
19
from setuptools import setup setup( name="calc", version="0.2", packages=["calc"], install_requires=[ "pyparsing==2.0.7", "numpy==1.6.2", "scipy==0.14.0", ], )
madformuse/client
refs/heads/develop
runtests.py
4
#! /usr/bin/env python sources = """ eNrsvWmX40hyINijPWbFWY2kXa32nHlo5qYAVDKYkVnV6hanWKXqrEwppbpeHurSi4phIghEBDpI gAmAGRHTar39Ebuf50fsj9i/tXb5CQfJyKrq1r632V1BEnA3dzc3NzczNzf7P/7gt29/krz+k83t dLGqL6aLRVmV3WLx9l+9/rvxeBzBs4uyuog+++Z5lMSbps63y6Jp4yir8ihe1lW7XdNv+FoVy67I o3dlFl0Vt9d1k7dpBEBGo7d/8PpfYwttl7/9L17953/1k5+U603...
resmo/ansible
refs/heads/devel
lib/ansible/modules/network/f5/bigip_dns_cache_resolver.py
38
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
jaesivsm/Radicale
refs/heads/master
radicale/tests/__init__.py
1
# This file is part of Radicale Server - Calendar Server # Copyright © 2012-2017 Guillaume Ayoub # # This library 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 ...
mvfsilva/bootcamp
refs/heads/master
bootcamp/questions/urls.py
12
from django.conf.urls import patterns, include, url urlpatterns = patterns('bootcamp.questions.views', url(r'^$', 'questions', name='questions'), url(r'^answered/$', 'answered', name='answered'), url(r'^unanswered/$', 'unanswered', name='unanswered'), url(r'^all/$', 'all', name='all'), url(r'^ask/$...
pcdocker/pcdocker
refs/heads/master
pcdocker/users/tests/test_admin.py
264
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user() def test_clean_username_success(self): # Instantiate the form with a new username form = MyUserCreationForm({ ...
Hybrid-Cloud/cinder
refs/heads/master
cinder/db/sqlalchemy/migrate_repo/manage.py
50
#!/usr/bin/env python # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
Darkmer/masterchief
refs/heads/master
CourseBuilderenv/lib/python2.7/site-packages/setuptools/command/rotate.py
125
import os from setuptools import Command from setuptools.compat import basestring from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N new...
RandyLowery/erpnext
refs/heads/develop
erpnext/stock/doctype/stock_settings/__init__.py
12133432
aleksandra-tarkowska/django
refs/heads/master
tests/multiple_database/__init__.py
12133432
tungvx/deploy
refs/heads/master
.google_appengine/lib/django_1_2/tests/regressiontests/special_headers/__init__.py
12133432
ncliam/serverpos
refs/heads/master
openerp/addons/l10n_hn/__init__.py
27
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc> # (http://salvatoreweb.co.cc) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU G...
xiaoxiamii/scikit-learn
refs/heads/master
sklearn/metrics/cluster/tests/test_bicluster.py
394
"""Testing for bicluster metrics module""" import numpy as np from sklearn.utils.testing import assert_equal, assert_almost_equal from sklearn.metrics.cluster.bicluster import _jaccard from sklearn.metrics import consensus_score def test_jaccard(): a1 = np.array([True, True, False, False]) a2 = np.array([T...
ColinIanKing/autotest
refs/heads/master
frontend/shared/common.py
20
import os, sys try: import autotest.client.setup_modules as setup_modules dirname = os.path.dirname(setup_modules.__file__) autotest_dir = os.path.join(dirname, "..") except ImportError: dirname = os.path.dirname(sys.modules[__name__].__file__) autotest_dir = os.path.abspath(os.path.join(dirname, '....
pronto/dotfiles
refs/heads/master
.vim/pylibs/ropevim.py
1
"""ropevim, a vim mode for using rope refactoring library""" import glob import os import tempfile import re from pylibs.ropemode import decorators from pylibs.ropemode import environment from pylibs.ropemode import interface import vim # Gobal var to be able to shutup output _rope_quiet = False class VimUtils(env...
interlegis/sigi
refs/heads/master
sigi/apps/servidores/migrations/0005_auto_20210423_0904.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('servidores', '0004_auto_20210422_1907'), ] operations = [ migrations.AlterModelOptions( name='servico', ...
40223247/2015_w11
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/browser/timer.py
610
from browser import window def wrap(func): # Transforms a function f into another function that prints a # traceback in case of exception def f(*args, **kw): try: return func(*args, **kw) except Exception as exc: sys.stderr.write(exc) return f clear_interval = w...
dockerera/func
refs/heads/master
func/yaml/dump.py
2
""" pyyaml legacy Copyright (c) 2001 Steve Howell and Friends; All Rights Reserved (see open source license information in docs/ directory) """ import types import string from types import StringType, UnicodeType, IntType, FloatType from types import DictType, ListType, TupleType, InstanceType from klass import hasMe...
AfricaChess/lichesshub
refs/heads/master
player/views.py
138
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render # Create your views here.
MattsFleaMarket/python-for-android
refs/heads/master
python-build/python-libs/xmpppy/xmpp/auth.py
196
## auth.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later version. ##...
louietsai/python-for-android
refs/heads/master
python3-alpha/python3-src/Doc/includes/sqlite3/executemany_2.py
45
import sqlite3 def char_generator(): import string for c in string.letters[:26]: yield (c,) con = sqlite3.connect(":memory:") cur = con.cursor() cur.execute("create table characters(c)") cur.executemany("insert into characters(c) values (?)", char_generator()) cur.execute("select c from characters")...
gdimitris/FleetManagerBackend
refs/heads/master
virtual_env/lib/python2.7/site-packages/wtforms/ext/appengine/ndb.py
174
""" Form generation utilities for App Engine's new ``ndb.Model`` class. The goal of ``model_form()`` is to provide a clean, explicit and predictable way to create forms based on ``ndb.Model`` classes. No malabarism or black magic should be necessary to generate a form for models, and to add custom non-model related fi...
mementum/backtrader
refs/heads/master
samples/talib/talibtest.py
1
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015-2020 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
Mellthas/quodlibet
refs/heads/master
quodlibet/quodlibet/player/xinebe/__init__.py
4
# Copyright 2013 Christoph Reiter # # 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. from .player import init init = in...
NotToday/musicbox
refs/heads/master
NEMbox/api.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: omi # @Date: 2014-08-24 21:51:57 # @Last Modified by: omi # @Last Modified time: 2015-02-28 13:03:11 ''' 网易云音乐 Api ''' import re import json import requests import hashlib from bs4 import BeautifulSoup import logger # list去重 def uniq(arr): arr2 = lis...
infoxchange/ixdjango
refs/heads/master
ixdjango/management/commands/clear_app.py
1
""" Management command to clear specified app's models of data. .. moduleauthor:: Infoxchange Development Team <development@infoxchange.net.au> """ from __future__ import print_function from django.apps import apps from django.core.management.base import BaseCommand from django.core.management.color import no_style...
Antiun/carrier-delivery
refs/heads/8.0
delivery_carrier_label_postlogistics/tests/__init__.py
4
# -*- coding: utf-8 -*- from . import test_postlogistics
stevenewey/django
refs/heads/master
django/contrib/sessions/backends/cached_db.py
24
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
rbieb/Pymodoro
refs/heads/experimentalSplit
messages.py
2
#!/usr/bin/python3 import variables # These messages are shown at the beginning of each new phase def workMessage(): return("Start working! Your Pause begins in {} minutes".format(variables.workDuration)) def shortPauseMessage(): return("Well done! Have a break. It ends in {} minutes".format(variables.shor...
intip/django-cms
refs/heads/develop
cms/tests/views.py
6
from __future__ import with_statement from copy import copy import re import sys from django.core.cache import cache from django.conf import settings from django.contrib.auth.models import Permission from django.core.urlresolvers import clear_url_caches from django.http import Http404 from django.template import Vari...
nikhilsingh291/zeroclickinfo-fathead
refs/heads/master
lib/fathead/sass/parse_reference.py
7
from bs4 import BeautifulSoup SASS_DOC_BASE_URL = 'http://sass-lang.com/documentation/file.SASS_REFERENCE.html' DOWNLOADED_HTML_PATH = 'download/file.SASS_REFERENCE.html' class Data(object): """ Object responsible for loading raw HTML data from Sass Reference """ def __init__(self, file): """...
erochest/threepress-rdfa
refs/heads/master
bookworm/django_authopenid/views.py
7
# -*- coding: utf-8 -*- # Copyright (c) 2007, 2008, Benoît Chesneau # Copyright (c) 2007 Simon Willison, original work on django-openid # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
luthfii/xsched
refs/heads/master
tools/python/xen/xm/getpolicy.py
49
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
tadebayo/myedge
refs/heads/master
myvenv/Lib/site-packages/sqlparse/lexer.py
9
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Andi Albrecht, albrecht.andi@gmail.com # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause """SQL Lexer""" # This code is based on the SqlLexer in pygments. # http://pygments.org/ # It's separat...
google-code-export/epubia
refs/heads/master
scraper/naver_scraper.py
3
# -*- encoding: utf-8 -*- # Book Info using Naver OpenAPI import urllib from xml.dom.minidom import parseString import re MARKUP_PTN = re.compile(r'</?[a-z]+>') class book_scraper: key = '' # my key srch_url = 'http://openapi.naver.com/search?key={0:s}&query={1:s}&display=1&target=book' is...
ryfeus/lambda-packs
refs/heads/master
Tensorflow/source/setuptools/command/install_scripts.py
454
from distutils import log import distutils.command.install_scripts as orig import os import sys from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): ...
chriskiehl/Gooey
refs/heads/master
gooey/gui/components/widgets/radio_group.py
1
import wx from gooey.gui.components.widgets.bases import BaseWidget from gooey.gui.lang.i18n import _ from gooey.gui.util import wx_util from gooey.gui.components.widgets import CheckBox from gooey.util.functional import getin, findfirst, merge class RadioGroup(BaseWidget): def __init__(self, parent, w...
xxshutong/openerp-7.0
refs/heads/master
openerp/addons/sale_mrp/__openerp__.py
60
# -*- 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...
ua-snap/geonode
refs/heads/master
geonode/services/views.py
6
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
h3biomed/ansible-modules-extras
refs/heads/devel
cloud/ovirt/__init__.py
12133432
ETegro/ETConf
refs/heads/master
sessioner/__init__.py
12133432
Argon-Zhou/django
refs/heads/master
tests/choices/__init__.py
12133432
flumotion-mirror/flumotion
refs/heads/master
flumotion/component/producers/checks.py
3
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
SohKai/ChronoLogger
refs/heads/master
web/flask/lib/python2.7/site-packages/sqlalchemy/dialects/sybase/__init__.py
34
# sybase/__init__.py # Copyright (C) 2005-2012 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 from sqlalchemy.dialects.sybase import base, pysybase, pyodbc from base import CH...
williamluke4/Examenable
refs/heads/master
node_modules/sitemap/env/src/node-v0.12.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
benpatterson/edx-platform
refs/heads/master
common/djangoapps/enrollment/tests/fake_data_api.py
104
""" A Fake Data API for testing purposes. """ import copy import datetime _DEFAULT_FAKE_MODE = { "slug": "honor", "name": "Honor Code Certificate", "min_price": 0, "suggested_prices": "", "currency": "usd", "expiration_datetime": None, "description": None } _ENROLLMENTS = [] _COURSES = [...
aajanki/youtube-dl
refs/heads/master
youtube_dl/extractor/udn.py
10
# coding: utf-8 from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( js_to_json, ExtractorError, ) from ..compat import compat_urlparse class UDNEmbedIE(InfoExtractor): _VALID_URL = r'https?://video\.udn\.com/(?:embed|play)/news/(?P<id>\d+)' _TES...
akosyakov/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/utils/regex_helper.py
361
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ # Mapping of an escape character to a r...
hzlf/openbroadcast
refs/heads/master
website/filer/admin/imageadmin.py
35
#-*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext as _ from filer import settings as filer_settings, settings from filer.admin.fileadmin import FileAdmin from filer.models import Image class ImageAdminForm(forms.ModelForm): subject_location = forms.CharField( ...
Thoshh/wapad
refs/heads/master
lib/python2.7/site-packages/django/db/models/sql/query.py
24
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
iabdalkader/micropython
refs/heads/master
tests/basics/class_misc.py
17
# converting user instance to buffer class C: pass c = C() try: d = bytes(c) except TypeError: print('TypeError')
maciek263/django2
refs/heads/master
myvenv/Lib/site-packages/django/contrib/admin/templatetags/admin_list.py
49
from __future__ import unicode_literals import datetime from django.contrib.admin.templatetags.admin_static import static from django.contrib.admin.templatetags.admin_urls import add_preserved_filters from django.contrib.admin.utils import ( display_for_field, display_for_value, label_for_field, lookup_field, ) f...
macmanes-lab/MCBS913
refs/heads/master
code/Junhong Chen/samTobamAllInOne.py
1
""" Author: Junhong Chen """ import os import sys import subprocess rootDir = sys.argv[1] for dirName, subdirList, fileList in os.walk(rootDir): print('Found directory: %s' % dirName) for fname in fileList: if fname.endswith("sam"): print "sam file: ",fname filename = dirNam...
damianmoore/django-cms
refs/heads/develop
cms/utils/mail.py
21
# -*- coding: utf-8 -*- from django.core.mail import EmailMultiAlternatives from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from django.contrib.sites.models import Site from cms.utils.urlutils import urljoin def s...
Endika/c2c-rd-addons
refs/heads/8.0
chricar_top/wizard/stock_location_realestate.py
4
# -*- 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...
parttimenerd/temci
refs/heads/master
temci/utils/sudo_utils.py
1
import logging import os import sys from io import TextIOWrapper, BufferedRandom, BufferedRWPair, BufferedWriter, IOBase from pwd import getpwnam from typing import Union, Tuple, Dict from temci.utils.settings import Settings def get_bench_user() -> str: user = Settings()["env"]["USER"] return os.getenv("USE...
msegado/edx-platform
refs/heads/master
common/djangoapps/embargo/migrations/0002_data__add_countries.py
26
# -*- coding: utf-8 -*- from __future__ import unicode_literals # Converted from the original South migration 0003_add_countries.py from django.db import migrations, models from django_countries import countries def create_embargo_countries(apps, schema_editor): """Populate the available countries with all 2-ch...
RaresO/test
refs/heads/master
node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py
1835
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
amohanta/miasm
refs/heads/master
miasm2/ir/translators/python.py
7
from miasm2.ir.translators.translator import Translator class TranslatorPython(Translator): """Translate a Miasm expression to an equivalent Python code Memory is abstracted using the unimplemented function: int memory(int address, int size) """ # Implemented language __LANG__ = "Python" ...
GunnerJnr/_CodeInstitute
refs/heads/master
Stream-3/Full-Stack-Development/19.Djangos-Testing-Framework/2.How-To-Test-Views-And-Urls/we_are_social/polls/migrations/__init__.py
12133432
uestcxl/OnlineJudge
refs/heads/master
account/__init__.py
12133432
hosseinmh/jango_learning
refs/heads/master
.venv/lib/python2.7/site-packages/django/contrib/gis/maps/__init__.py
12133432
libracore/erpnext
refs/heads/v12
erpnext/support/web_form/issues/__init__.py
12133432
fabiobatalha/SciELO-Manager
refs/heads/master
scielomanager/maintenancewindow/migrations/0001_initial.py
3
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Event' db.create_table('maintenancewindow_event', ( ...
ualikhansars/Gwent
refs/heads/master
lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py
346
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
kobejean/tensorflow
refs/heads/master
tensorflow/contrib/opt/python/training/ggt_test.py
25
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
savoirfairelinux/django
refs/heads/master
django/contrib/syndication/views.py
9
from calendar import timegm from contextlib import suppress from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import TemplateDoesNotE...
kaushik94/sympy
refs/heads/master
sympy/external/importtools.py
3
"""Tools to assist importing optional external modules.""" from __future__ import print_function, division import sys from distutils.version import LooseVersion # Override these in the module to change the default warning behavior. # For example, you might set both to False before running the tests so that # warnings...
Mirantis/mos-horizon
refs/heads/master
openstack_dashboard/contrib/developer/theme_preview/views.py
20
# Copyright 2015 Cisco Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.2/django/utils/daemonize.py
452
import os import sys if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=022): "Robustly turn into a UNIX daemon, running in our_home_dir." # First fork try: if os.fork() > 0: sys.exit(0...
h2educ/scikit-learn
refs/heads/master
examples/cluster/plot_ward_structured_vs_unstructured.py
320
""" =========================================================== Hierarchical clustering: structured vs unstructured ward =========================================================== Example builds a swiss roll dataset and runs hierarchical clustering on their position. For more information, see :ref:`hierarchical_clus...
boriel/zxbasic
refs/heads/master
src/symbols/typecast.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: ts=4:et:sw=4: # ---------------------------------------------------------------------- # Copyleft (K), Jose M. Rodriguez-Rosa (a.k.a. Boriel) # # This program is Free Software and is released under the terms of # the GNU General License # ------------...
flodolo/bedrock
refs/heads/master
tests/functional/test_home.py
4
# 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/. import pytest from pages.home import HomePage @pytest.mark.skip_if_firefox(reason='Download button is displayed only ...
EdgarSun/Django-Demo
refs/heads/master
django/contrib/auth/management/__init__.py
104
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
dcroc16/skunk_works
refs/heads/master
google_appengine/lib/django-1.5/django/bin/django-2to3.py
211
#!/usr/bin/env python # This works exactly like 2to3, except that it uses Django's fixers rather # than 2to3's built-in fixers. import sys from lib2to3.main import main sys.exit(main("django.utils.2to3_fixes"))
mancoast/CPythonPyc_test
refs/heads/master
cpython/213_test_userstring.py
8
#!/usr/bin/env python import sys from test_support import verbose import string_tests # UserString is a wrapper around the native builtin string type. # UserString instances should behave similar to builtin string objects. # The test cases were in part derived from 'test_string.py'. from UserString import UserString i...
andyzsf/django
refs/heads/master
django/db/migrations/state.py
15
from __future__ import unicode_literals from django.apps import AppConfig from django.apps.registry import Apps, apps as global_apps from django.db import models from django.db.models.options import DEFAULT_NAMES, normalize_together from django.db.models.fields.related import do_pending_lookups from django.db.models.f...
mims2707/bite-project
refs/heads/master
deps/mrtaskman/server/handlers/packages.py
16
# 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 # distributed under th...
ojengwa/oh-mainline
refs/heads/master
mysite/search/migrations/0043_allow_null_answer_titles.py
17
# This file is part of OpenHatch. # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
rkawale/Internalhr-frappe
refs/heads/develop
frappe/memc.py
34
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import memcache, frappe class MClient(memcache.Client): """memcache client that will automatically prefix conf.db_name""" def n(self, key): return (frappe.conf.db_name + ...
Abi1ity/uniclust2.0
refs/heads/master
SQLAlchemy-0.9.9/examples/inheritance/joined.py
30
"""Joined-table (table-per-subclass) inheritance example.""" from sqlalchemy import Table, Column, Integer, String, \ ForeignKey, create_engine, inspect, or_ from sqlalchemy.orm import relationship, Session, with_polymorphic from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class ...
pjdelport/django
refs/heads/master
tests/modeltests/select_related/tests.py
57
from __future__ import absolute_import, unicode_literals from django.test import TestCase from .models import Domain, Kingdom, Phylum, Klass, Order, Family, Genus, Species class SelectRelatedTests(TestCase): def create_tree(self, stringtree): """ Helper to create a complete tree. """ ...