repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jotes/pontoon | refs/heads/master | pontoon/localizations/urls.py | 3 | from django.urls import include, path, re_path
from pontoon.projects import views as projects_views
from pontoon.teams import views as teams_views
from . import views
urlpatterns = [
path(
"<locale:code>/<slug:slug>/",
include(
[
# Localization page
pat... |
salamer/NotesOfDjangoBook | refs/heads/master | mysite/mysite/foobar_view.py | 2 | from django.shortcuts import render
from books.models import Book
def foo_view(request):
books = Book.objects.filter(title__icontains='world')
return render(request,'foobar/foo.html',{'books':books})
def bar_view(request):
books = Book.objects.filter(title__icontains='the')
return render(request,'foob... |
MTASZTAKI/ApertusVR | refs/heads/0.9 | plugins/physics/bulletPhysics/3rdParty/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/agents/__init__.py | 386048 | |
rrrene/django | refs/heads/master | tests/template_tests/filter_tests/test_timesince.py | 161 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.template.defaultfilters import timesince_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class Timesinc... |
frouty/odoo_oph | refs/heads/dev_70 | addons/account/wizard/account_report_common.py | 37 | # -*- 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... |
drnextgis/QGIS | refs/heads/master | python/ext-libs/requests/utils.py | 148 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import re
import socket
import struct
import warnings
from . import __ver... |
morenopc/edx-platform | refs/heads/ok-merge-from-master | lms/envs/cms/acceptance.py | 52 | """
This config file is a copy of dev environment without the Debug
Toolbar. I it suitable to run against acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .dev import *
# REMOVE DEBUG ... |
odejesush/tensorflow | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/install_lib.py | 431 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... |
gavinzbq/synonym | refs/heads/master | synonym/__init__.py | 1 | # -*- coding: utf-8 -*-
"""Top-level package for synonym."""
__author__ = """Shanyun Gao"""
__email__ = 'shanyun@g.clemson.edu'
__version__ = '0.1.3'
|
dalou/django-extended | refs/heads/master | django_extended/forms/geo.py | 5 | # # encoding: utf-8
# from django import forms
# from django.utils.translation import ugettext_lazy as _
# from ..widgets.geo import LocationInput
# class LocationField(forms.CharField):
# def __init__(self, *args, **kwargs):
# if 'widget' not in kwargs:
# kwargs['widget'] = LocationInput(... |
Panos512/invenio | refs/heads/prod | modules/websearch/web/admin/websearchadmin.py | 25 | ## This file is part of Invenio.
## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Lic... |
timblankers/inside-bgp | refs/heads/master | graph.py | 1 | #!/usr/bin/env python3
import datetime as dt
import sys
import operator
import subprocess
import glob
import os
import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from matplotlib.... |
techtonik/numpy | refs/heads/master | numpy/lib/tests/test_type_check.py | 6 | from __future__ import division, absolute_import, print_function
from numpy.lib import *
from numpy.core import *
from numpy.random import rand
from numpy.compat import asbytes, long
from numpy.testing import (
TestCase, assert_, assert_equal, assert_array_equal, run_module_suite)
try:
import ctypes
_HAS_... |
brownharryb/erpnext | refs/heads/develop | erpnext/hr/doctype/attendance/test_attendance.py | 113 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
test_records = frappe.get_test_records('Attendance')
class TestAttendance(unittest.TestCase):
pass
|
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/protobuf26/message.py | 57 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
colinbrislawn/scikit-bio | refs/heads/master | skbio/alignment/tests/__init__.py | 160 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
sertac/django | refs/heads/master | django/db/models/fields/subclassing.py | 265 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
import warnings
from django.utils.deprecation imp... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/django/utils/archive.py | 45 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/otp/__init__.py | 36 | """The otp component."""
|
0k/OpenUpgrade | refs/heads/8.0 | addons/subscription/__init__.py | 441 | # -*- 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... |
darkleons/BE | refs/heads/master | addons/l10n_be/wizard/l10n_be_vat_intra.py | 332 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/cost_center_asset/__init__.py | 7 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2013 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... |
mcdaniel67/sympy | refs/heads/master | sympy/plotting/pygletplot/plot_mode_base.py | 96 | from __future__ import print_function, division
from pyglet.gl import *
from plot_mode import PlotMode
from threading import Thread, Event, RLock
from color_scheme import ColorScheme
from sympy.core import S
from sympy.core.compatibility import is_sequence
from time import sleep
import warnings
class PlotModeBase(Pl... |
sung-su/crosswalk-tizen | refs/heads/master | tools/gyp/pylib/gyp/MSVSToolFile.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
class Writer(object):
"""Visual Studio XML tool file writer."""
... |
hradec/gaffer | refs/heads/master | python/GafferArnoldUITest/DocumentationTest.py | 8 | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... |
bankonmeOS/cjdns | refs/heads/master | node_build/dependencies/libuv/build/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... |
drusk/pml | refs/heads/master | pml/supervised/classifiers.py | 1 | # Copyright (C) 2012 David Rusk
#
# 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, distr... |
dpgeorge/micropython | refs/heads/master | tests/thread/mutate_set.py | 14 | # test concurrent mutating access to a shared set object
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
import _thread
# the shared set
se = set([-1, -2, -3, -4])
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
se.add(i)
... |
PavanGupta01/aerospike-admin | refs/heads/master | lib/controller.py | 1 | # Copyright 2013-2014 Aerospike, 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 writ... |
blooparksystems/odoo | refs/heads/9.0 | addons/hw_scanner/controllers/main.py | 158 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... |
CalebSLane/openelisglobal-core | refs/heads/develop | liquibase/OE2.9/testCatalogHT_LNSP/scripts/runAll.py | 44 | #! /usr/bin/python
import os
__author__="paulsc"
__date__ ="$May 29, 2012 1:17:54 PM$"
if __name__ == "__main__":
print("dictionary.py")
os.system( "python dictionary.py" )
print("\npanels.py")
os.system( "python panels.py" )
print("\nresultLimits.py")
os.system( "python resultLimits.py" )
... |
asimshankar/tensorflow | refs/heads/master | tensorflow/python/data/util/random_seed_test.py | 41 | # 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... |
wooga/airflow | refs/heads/master | airflow/providers/google/cloud/operators/gcs_to_bigquery.py | 1 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
e-democracy/edemsignups | refs/heads/master | lib/gdata/tlslite/utils/PyCrypto_RC4.py | 359 | """PyCrypto RC4 implementation."""
from cryptomath import *
from RC4 import *
if pycryptoLoaded:
import Crypto.Cipher.ARC4
def new(key):
return PyCrypto_RC4(key)
class PyCrypto_RC4(RC4):
def __init__(self, key):
RC4.__init__(self, key, "pycrypto")
self.context = ... |
eeshangarg/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/cmdline.py | 16 | from __future__ import with_statement
import sys
import os
import optparse
import cProfile
import inspect
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.xlib import lsprofcalltree
from scrapy.conf import settings
from scrapy.command import ScrapyCommand
from scrapy.exceptions import UsageError, S... |
dcsquared13/Diamond | refs/heads/master | src/collectors/diskusage/test/testdiskusage.py | 31 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from diskusage import Disk... |
yugangw-msft/azure-cli | refs/heads/dev | src/azure-cli/azure/cli/command_modules/dms/tests/latest/__init__.py | 1233 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
absperf/wagtailapproval | refs/heads/master | tests/app/migrations/__init__.py | 12133432 | |
arbrandes/edx-platform | refs/heads/master | openedx/core/djangoapps/crawlers/tests/__init__.py | 12133432 | |
endorphinl/horizon | refs/heads/master | openstack_dashboard/dashboards/project/routers/ports/__init__.py | 12133432 | |
tedi3231/openerp | refs/heads/master | build/lib/openerp/addons/document_webdav/cache.py | 67 | import time
import heapq
def memoize(maxsize):
"""decorator to 'memoize' a function - caching its results"""
def decorating_function(f):
cache = {} # map from key to value
heap = [] # list of keys, in LRU heap
cursize = 0 # because len() is slow
def wrapper(*args):
... |
tamsky/cloud-init | refs/heads/master | cloudinit/util.py | 3 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yaho... |
kutenai/django | refs/heads/master | tests/migrations/migrations_test_apps/with_package_model/__init__.py | 12133432 | |
cbrewster/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/more-itertools/more_itertools/tests/__init__.py | 12133432 | |
jasonbot/django | refs/heads/master | django/conf/locale/da/__init__.py | 12133432 | |
radoraykov/rating-gov-representatives | refs/heads/master | apps/website/dashboard/__init__.py | 12133432 | |
rohitwaghchaure/erpnext-receipher | refs/heads/master | erpnext/hr/doctype/upload_attendance/__init__.py | 12133432 | |
bobobox/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_service.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... |
clownhood/mbok | refs/heads/master | contrib/bitrpc/bitrpc.py | 2348 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... |
msmbuilder/osprey | refs/heads/master | basesetup.py | 4 | from __future__ import print_function, absolute_import
import os
import sys
import imp
import json
import string
import shutil
import subprocess
import tempfile
from distutils.dep_util import newer_group
from distutils.core import Extension
from distutils.errors import DistutilsExecError
from distutils.ccompiler import... |
junmin-zhu/chromium-rivertrail | refs/heads/v8-binding | third_party/mesa/MesaLib/src/gallium/tests/python/samples/gs.py | 32 | #!/usr/bin/env python
##########################################################################
#
# Copyright 2009 VMware
# All Rights Reserved.
#
# 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 Soft... |
cfig/Android_boot_image_editor | refs/heads/master | tools/free.py | 2 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
import subprocess
def run(cmd):
print(cmd)
subprocess.check_call(cmd, shell = True)
run("touch vbmeta.img")
run("gradle pull")
run("gradle unpack")
run('vim -u NONE -N build/unzip_boot/vbmeta.avb.json -c ":19s/0/2/g" -c ":wq"')
run("gradle pa... |
eptmp3/Sick-Beard | refs/heads/development | lib/imdb/Character.py | 128 | """
Character module (imdb package).
This module provides the Character class, used to store information about
a given character.
Copyright 2007-2010 Davide Alberani <da@erlug.linux.it>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
NeCTAR-RC/nova | refs/heads/nectar/mitaka | nova/pci/stats.py | 7 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 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
#
# http://www.apache.org/li... |
Vixionar/django | refs/heads/master | tests/template_tests/filter_tests/test_length.py | 521 | from django.template.defaultfilters import length
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LengthTests(SimpleTestCase):
@setup({'length01': '{{ list|length }}'})
def test_length01(self):
output = self.engine.render_to_string... |
Nictec/nictec_website2.0 | refs/heads/master | nictecsite/storage/migrations/0007_assignment_type.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-16 06:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('storage', '0006_auto_20160911_1944'),
]
operations = [
migrations.AddField(
... |
acislab/HuMaIN_Microservices | refs/heads/master | OCRopyServices/RecognitionService/ocrolib/sl.py | 16 | ################################################################
### utilities for lists of slices, treating them like rectangles
################################################################
import numpy
from pylab import mean
### inquiry functions
def is_slices(u):
for s in u:
if type(s)!=slice: ret... |
CYBAI/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/certifi/certifi/__init__.py | 59 | from .core import where, old_where
__version__ = "2018.04.16"
|
density215/d215-miniblog | refs/heads/master | django/contrib/webdesign/models.py | 12133432 | |
netfirms/erpnext | refs/heads/develop | erpnext/stock/report/stock_ageing/__init__.py | 12133432 | |
openiitbombayx/edx-platform | refs/heads/master | common/djangoapps/track/tests/test_util.py | 239 | from datetime import datetime
import json
from pytz import UTC
from django.test import TestCase
from track.utils import DateTimeJSONEncoder
class TestDateTimeJSONEncoder(TestCase):
def test_datetime_encoding(self):
a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000)
a_tz_datetime = dat... |
gregswift/ansible | refs/heads/devel | lib/ansible/compat/six/__init__.py | 82 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 later... |
mgilson/html5lib-python | refs/heads/master | html5lib/treebuilders/__init__.py | 1730 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... |
wzbozon/statsmodels | refs/heads/master | statsmodels/examples/ex_nearest_corr.py | 34 | # -*- coding: utf-8 -*-
"""Find near positive definite correlation and covariance matrices
Created on Sun Aug 19 15:25:07 2012
Author: Josef Perktold
TODO:
add examples for cov_nearest from script log
Notes
-----
We are looking at eigenvalues before and after the conversion to psd matrix.
As distance measure fo... |
wilsoncampusano/gae-boilerplate | refs/heads/master | bp_includes/external/babel/messages/extract.py | 54 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... |
hsaputra/tensorflow | refs/heads/master | tensorflow/python/debug/wrappers/local_cli_wrapper.py | 5 | # 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... |
kholidfu/django | refs/heads/master | django/conf/locale/bn/__init__.py | 12133432 | |
etos/django | refs/heads/master | tests/csrf_tests/__init__.py | 12133432 | |
keedio/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/ru/__init__.py | 12133432 | |
Astonex/Antelope | refs/heads/master | antelope/antelope/settings/__init__.py | 12133432 | |
TifaSky/zenoss_midrest | refs/heads/master | app/tests/__init__.py | 12133432 | |
erudit/zenon | refs/heads/master | eruditorg/core/metrics/management/commands/__init__.py | 12133432 | |
DavidNorman/tensorflow | refs/heads/master | tensorflow/python/saved_model/simple_save_test.py | 22 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
maartenq/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/import_role.py | 24 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': [... |
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/django/views/debug.py | 18 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.defaultfilters import force_escape, pprint
from django.urls impor... |
HackerEarth/cassandra-python-driver | refs/heads/cqlengine_multiplehosts | cassandra/io/geventreactor.py | 1 | # Copyright 2013-2015 DataStax, 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 writi... |
Ziqi-Li/bknqgis | refs/heads/master | pandas/pandas/plotting/_compat.py | 11 | # being a bit too dynamic
# pylint: disable=E1101
from __future__ import division
from distutils.version import LooseVersion
def _mpl_le_1_2_1():
try:
import matplotlib as mpl
return (str(mpl.__version__) <= LooseVersion('1.2.1') and
str(mpl.__version__)[0] != '0')
except Impo... |
JackDanger/sentry | refs/heads/master | src/sentry/south_migrations/0308_auto__add_versiondsymfile__add_unique_versiondsymfile_dsym_file_versio.py | 2 | # -*- 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 'VersionDSymFile'
db.create_table('sentry_versiondsymfile'... |
DirtyUnicorns/android_external_chromium_org | refs/heads/lollipop | chrome/common/extensions/docs/server2/github_file_system_test.py | 97 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import sys
import unittest
from appengine_wrappers import files
from fake_fetchers import ConfigureFakeFetch... |
silverbp/master-builder | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from setuptools import find_packages
from setuptools import setup
install_requires = [
'GitPython >= 2.0.8, < 2.1',
'MarkupSafe >= 0.23, < 1.0',
'PyYAML >= 3.11, < 4.0',
'decora... |
humbletim/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/_json.py | 296 | import json
from .. import constants
ROUND = constants.DEFAULT_PRECISION
## THREE override function
def _json_floatstr(o):
if ROUND is not None:
o = round(o, ROUND)
return '%g' % o
def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
_key_separator, _item_separator,... |
tskisner/pytoast | refs/heads/master | src/python/tests/map_satellite.py | 1 | # Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
from ..mpi import MPI
from .mpi import MPITestCase
import sys
import os
import shutil
import numpy as np
import numpy.testin... |
UK992/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/conftest.py | 40 | pytest_plugins = "tests.support.fixtures"
|
RedhawkSDR/integration-gnuhawk | refs/heads/master | components/vector_to_streams_cc_4o/tests/test_vector_to_streams_cc_4o.py | 1 | #!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... |
tkurnosova/selenium | refs/heads/master | py/test/selenium/webdriver/chrome/__init__.py | 2454 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
Francis-Liu/animated-broccoli | refs/heads/master | nova/db/sqlalchemy/models.py | 13 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (... |
cicku/fedmsg | refs/heads/develop | fedmsg.d/ssl.py | 5 | # This file is part of fedmsg.
# Copyright (C) 2012 - 2014 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ver... |
potatolondon/django-nonrel-1-4 | refs/heads/master | django/conf/global_settings.py | 29 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... |
CenterForOpenScience/osf.io | refs/heads/develop | osf/migrations/0013_auto_20170412_0957.py | 28 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-04-12 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('osf', '0012_auto_20170411_1548'),
]
operations = [
migrations.AlterField(
... |
dmsul/econtools | refs/heads/master | econtools/metrics/tests/data/src_atsls.py | 1 | import pandas as pd
import numpy as np
class regout(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
stat_names=['coeff', 'se', 't', 'p>t', 'CI_low', 'CI_high']
var_names=['mpg', 'length', ]
atsls_std = regout(
summary=pd.DataFrame(np.array([
[-49467.76193509437,
1937433.402520... |
40323144/2015cdb_g7 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/zipfile.py | 620 | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import io
import os
import re
import imp
import sys
import time
import stat
import shutil
import struct
import binascii
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib =... |
nitin-cherian/Webapps | refs/heads/master | SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/setuptools/windows_support.py | 1015 | import platform
import ctypes
def windows_only(func):
if platform.system() != 'Windows':
return lambda *args, **kwargs: None
return func
@windows_only
def hide_file(path):
"""
Set the hidden attribute on a file or directory.
From http://stackoverflow.com/questions/19622133/
`path` ... |
google/latexify_py | refs/heads/develop | tests/node_visitor_base_test.py | 1 | # Copyright 2020 Google LLC
#
# 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, ... |
mluo613/osf.io | refs/heads/develop | website/addons/box/tests/test_client.py | 36 | # -*- coding: utf-8 -*-
from nose.tools import * # noqa (PEP8 asserts)
from tests.base import OsfTestCase
from tests.factories import UserFactory
from website.addons.box.model import BoxUserSettings
class TestCore(OsfTestCase):
def setUp(self):
super(TestCore, self).setUp()
self.user = User... |
MrLoick/python-for-android | refs/heads/master | python-modules/twisted/twisted/mail/topfiles/setup.py | 54 | # Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
try:
from twisted.python import dist
except ImportError:
raise SystemExit("twisted.python.dist module not found. Make sure you "
"have installed the Twisted core package before "
... |
skycucumber/Messaging-Gateway | refs/heads/master | webapp/venv/lib/python2.7/site-packages/setuptools/tests/doctest.py | 332 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
try:
basestring
except NameError:
basestring = str
try:
enum... |
hojel/calibre | refs/heads/master | src/calibre/gui2/tweak_book/__init__.py | 2 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import string
from future_builtins import map
from calibre.utils.config imp... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/mobile/shared_gualama.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_gualama.iff"
result.attribute_template_id = 9
result.stfName(... |
Bitergia/allura | refs/heads/master | scripts/migrations/019-set-parent-only-troves.py | 3 | import logging
from tg import config
from ming.orm import ThreadLocalORMSession
import sfx
from allura import model as M
from allura.lib import helpers as h
from sfx.model import tables as T
log = logging.getLogger(__name__)
def main():
sfx.middleware.configure_databases(h.config_with_prefix(config, 'sfx.'))
... |
yajnab/android_kernel_htc_golfu | refs/heads/ics | tools/perf/scripts/python/sched-migration.py | 11215 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.