repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
calculuscowboy/cookiecutter-django | refs/heads/master | docs/conf.py | 9 | # -*- coding: utf-8 -*-
#
# cookiecutter-django documentation build configuration file.
#
# 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 configuration values have a default; values tha... |
rhyolight/nupic.research | refs/heads/master | projects/location_layer/single_layer_2d_experiment/logging.py | 9 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
stianvi/ansible-modules-core | refs/heads/devel | network/vyos/vyos_command.py | 11 | #!/usr/bin/python
#
# 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.
#
# Ansible is distribut... |
egelor/node-gyp | refs/heads/master | gyp/pylib/gyp/generator/make.py | 372 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... |
xiaojunwu/crosswalk-test-suite | refs/heads/master | webapi/tct-pagevisibility-w3c-tests/inst.apk.py | 903 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/django/core/management/templates.py | 35 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
from os import path
import django
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import handle_extensions
from django.template import C... |
iut-ibk/P8-WSC-GUI | refs/heads/master | 3dparty/Editra/src/extern/pygments/util.py | 14 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import codecs
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(... |
webu/django-star-ratings | refs/heads/master | star_ratings/migrations/0001_initial.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from decimal import Decimal
import model_utils.fields
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depend... |
ecular/qemu_seamless | refs/heads/master | scripts/tracetool.py | 111 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Command-line wrapper for the tracetool machinery.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__... |
puttarajubr/commcare-hq | refs/heads/master | custom/opm/tests/test_consistency.py | 2 | from ..constants import *
from .case_reports import *
class TestConsistency(OPMCaseReportTestBase):
def assertConsistent(self, row):
self.assertEqual(row.total_cash, row.cash_amt)
if not row.all_conditions_met:
self.assertEqual(0, row.month_amt)
self.assertEqual(0, row.bp1_... |
fedorpatlin/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_vlan.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# 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
# ... |
tiansiyuan/zulip | refs/heads/master | bots/jabber_mirror_backend.py | 115 | #!/usr/bin/python
#
# Copyright (C) 2013 Permabit, Inc.
# Copyright (C) 2013--2014 Zulip, Inc.
#
# 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 limit... |
shahankhatch/aurora | refs/heads/master | src/main/python/apache/thermos/monitoring/process.py | 14 | #
# 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 ... |
bolkedebruin/airflow | refs/heads/master | airflow/contrib/operators/gcs_to_gcs_transfer_operator.py | 1 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
googleapis/googleapis-gen | refs/heads/master | google/maps/roads/v1op/roads-v1op-py/google/maps/roads_v1/services/__init__.py | 962 | # -*- coding: utf-8 -*-
# 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... |
agilgur5/LTLMoP | refs/heads/development | src/lib/handlers/nao/NaoActuatorHandler.py | 7 | #!/usr/bin/env python
"""
===============================================
naoActuator.py - Nao Actuator Handler
===============================================
Control predefined Nao motion besides walking
"""
import time
import threading
import lib.handlers.handlerTemplates as handlerTemplates
class NaoActuatorHan... |
sub77/android_kernel_samsung_matissewifi | refs/heads/cm-11.0 | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... |
qedsoftware/commcare-hq | refs/heads/master | custom/uth/urls.py | 1 | from django.conf.urls import url
from custom.uth.views import vscan_upload, sonosite_upload, pending_exams
urlpatterns = [
url(r'^vscan_upload', vscan_upload, name='vscan_upload'),
url(r'^sonosite_upload', sonosite_upload, name='sonosite_upload'),
url(r'^pending_exams/(?P<scanner_serial>[\w-]+)/$', pendin... |
scrapinghub/dateparser | refs/heads/master | dateparser/data/date_translation_data/pl.py | 1 | info = {
"name": "pl",
"date_order": "DMY",
"january": [
"sty",
"styczeń",
"stycznia",
"Styczeń",
"Styczen",
"Stycznia",
"Styczniu",
"Sty"
],
"february": [
"lut",
"lutego",
"luty",
"Luty",
"Lutego... |
EmuxEvans/Wox | refs/heads/master | PythonHome/Lib/site-packages/pip/commands/list.py | 393 | from pip.basecommand import Command
from pip.exceptions import DistributionNotFound, BestVersionAlreadyInstalled
from pip.index import PackageFinder
from pip.log import logger
from pip.req import InstallRequirement
from pip.util import get_installed_distributions, dist_is_editable
from pip.cmdoptions import make_option... |
wreckJ/intellij-community | refs/heads/master | python/testData/joinLines/StringTripleQuotesDifferent-after.py | 79 | '''This doc comment is quite separate'''
"""from the literal below"""
|
nparley/mylatitude | refs/heads/master | lib/future/backports/email/parser.py | 82 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ['Par... |
Tranzystorek/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/py/py/_path/svnurl.py | 192 | """
module defining a subversion path object based on the external
command 'svn'. This modules aims to work with svn 1.3 and higher
but might also interact well with earlier versions.
"""
import os, sys, time, re
import py
from py import path, process
from py._path import common
from py._path import svnwc as svncommon... |
codylerum/FrameworkBenchmarks | refs/heads/master | toolset/utils/output_helper.py | 22 | # -*- coding: utf-8 -*-
import os, sys, re
from colorama import Style
from contextlib import contextmanager
# RegExp for stripping color codes
seq = re.compile(r'\x1B\[\d+m')
FNULL = open(os.devnull, 'w')
# To prevent the entire disk from being consumed, refuse to
# append more lines to a log file once it's grown t... |
vinodkc/spark | refs/heads/master | python/pyspark/mllib/util.py | 22 | #
# 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 us... |
cyandream-devices/neak-n7100-jb | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
knowledge-retrieval/relretrieval | refs/heads/master | setup.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
DISTNAME = "relretrieval"
DESCRIPTION = "A set of python modules to retrieve related relationships"
LONG_DESCRIPTION = open("README.rst").read()
AUTHOR = "Sosuke Kato"
AUTHOR_... |
hfp/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/eager/python/examples/revnet/ops.py | 33 | # 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... |
lidaobing/itcc | refs/heads/master | itcc/tinker/optimizes.py | 1 | # $Id$
import getopt, sys
from itcc.tinker import tinker
__revision__ = '$Rev$'
def usage():
print >> sys.stderr, 'Usage: %s [-c converge] xyzfname ...' % sys.argv[0]
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hc:", ["help"])
except getopt.GetoptError:
# print help informa... |
TorontoMedia/fail2ban | refs/heads/master | fail2ban/server/filtergamin.py | 1 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... |
botswana-harvard/edc-dispatch | refs/heads/develop | edc_dispatch/doc/conf.py | 1 | # -*- coding: utf-8 -*-
#
# bhp_dispatch documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 17 15:03:55 2012.
#
# 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.
#
... |
Yuriy-Leonov/python-novaclient | refs/heads/master | novaclient/v1_1/contrib/migrations.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... |
msiedlarek/wiring | refs/heads/master | tests/scanning/testmodule/plain_register.py | 1 | from wiring import FactoryProvider, InstanceProvider
from wiring.scanning import register
@register.register(FactoryProvider)
class PlainRegisterFactory(object):
pass
@register.register(FactoryProvider, 'plain_register_named_factory')
class PlainRegisterNamedFactory(object):
pass
@register.register(Factor... |
samstav/satori | refs/heads/master | satori/tests/test_common_logging.py | 3 | # 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
# distrib... |
vikitripathi/MB-MessApp-API | refs/heads/master | messApp/env/lib/python2.7/site-packages/setuptools/lib2to3_ex.py | 907 | """
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactorin... |
tqtran7/horizon | refs/heads/master | horizon/test/tests/base.py | 1 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... |
aleGpereira/libcloud | refs/heads/trunk | docs/examples/dns/create_record_custom_ttl.py | 31 | from libcloud.dns.providers import get_driver
from libcloud.dns.types import Provider, RecordType
CREDENTIALS_ZERIGO = ('email', 'api key')
cls = get_driver(Provider.ZERIGO)
driver = cls(*CREDENTIALS_ZERIGO)
zone = [z for z in driver.list_zones() if z.domain == 'example.com'][0]
extra = {'ttl': 900}
record = zone.c... |
natefoo/starforge | refs/heads/master | build.py | 3 | #!/usr/bin/env python
import glob
import subprocess
import shutil
import re
import yaml
import sys
import os
import argparse
def main(package, version='default', image=None, dryrun=False, clone=False, quiet=False):
parent_dir = os.path.dirname(os.path.abspath(__file__))
build_dir = os.path.join(parent_dir, pa... |
mlperf/inference_results_v0.5 | refs/heads/master | closed/NVIDIA/code/resnet/tensorrt/ResNet50.py | 1 | #!/usr/bin/env python3
# Copyright (c) 2019, NVIDIA CORPORATION. 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
#
# U... |
ChristosChristofidis/h2o-3 | refs/heads/master | h2o-py/tests/testdir_hdfs/pyunit_NOPASS_HDFS_kmeans_airlines_large.py | 1 | #----------------------------------------------------------------------
# Purpose: This test runs k-means on the full airlines dataset.
#----------------------------------------------------------------------
import sys
sys.path.insert(1, "../../")
import h2o
def hdfs_kmeans_airlines(ip, port):
h2o.init(ip, port)... |
saikrishnar/Mozi | refs/heads/master | mozi/utils/mnist_utils.py | 3 | """Low-level utilities for reading in raw MNIST files."""
__author__ = "David Warde-Farley"
__copyright__ = "Copyright 2012, Universite de Montreal"
__credits__ = ["David Warde-Farley"]
__license__ = "3-clause BSD"
__email__ = "wardefar@iro"
__maintainer__ = "David Warde-Farley"
import struct
import numpy
import gzi... |
airspeedswift/swift | refs/heads/master | utils/update_checkout/update_checkout/update_checkout.py | 7 | # utils/update_checkout.py - Utility to update local checkouts --*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.tx... |
kernc/scikit-learn | refs/heads/master | sklearn/pipeline.py | 2 | """
The :mod:`sklearn.pipeline` module implements utilities to build a composite
estimator, as a chain of transforms and estimators.
"""
# Author: Edouard Duchesnay
# Gael Varoquaux
# Virgile Fritsch
# Alexandre Gramfort
# Lars Buitinck
# Licence: BSD
from collections import defaultdict... |
google/contentbox | refs/heads/master | third_party/django/templatetags/future.py | 130 | from django.template import Library
from django.template import defaulttags
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return defaulttags.ssi(parser, token)
@register.tag
def url(parser, token):
# Used for deprecation pa... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/food/dessert_puffcake.py | 85615 | import sys
def setup(core, object):
return |
ThomasBollmeier/bovinus | refs/heads/master | src/parser_gen/output.py | 1 | #! coding=UTF-8
# Copyright 2012 Thomas Bollmeier <tbollmeier@web.de>
# 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 app... |
tiy1807/PythonUtils | refs/heads/master | PythonUtils/live_info/live_traffic.py | 1 | import requests
from PythonUtils.live_info.display_item import DisplayItem
class TrafficInfo(DisplayItem):
# Put your own API key here
GOOGLE_MAPS_API_KEY = 'INVALID'
GOOGLE_DIST_MATRIX_URL = 'https://maps.googleapis.com/maps/api/distancematrix/json'
def __init__(self, expiry_duration, origin, destina... |
ekoeppen/panstamp-python | refs/heads/master | pluginHouseAgentSWAP/XmlDevices.py | 1 | #########################################################################
#
# XmlDevices
#
# Copyright (c) 2011 Daniel Berenguer <dberenguer@usapiens.com>
#
# This file is part of the panStamp project.
#
# panStamp is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... |
katrid/django | refs/heads/master | django/contrib/flatpages/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FlatPagesConfig(AppConfig):
name = 'django.contrib.flatpages'
verbose_name = _("Flat Pages")
|
tralamazza/micropython | refs/heads/master | tests/basics/builtin_hex_intbig.py | 45 | # test builtin hex function
print(hex(12345678901234567890))
print(hex(0x12345678901234567890))
|
carthagecollege/django-djforms | refs/heads/master | djforms/languages/tle/forms.py | 2 | # -*- coding: utf-8 -*-
from django import forms
from djforms.core.models import BINARY_CHOICES, GENDER_CHOICES, MARITAL_CHOICES, SEMESTER_CHOICES
import datetime
NOW = datetime.datetime.now()
YEAR= int(NOW.year)
DEGREE_CHOICES = (
('Degree Seeking', 'Degree Seeking'),
('Non-Degree Seeking', 'No... |
tangentstorm/blackmail | refs/heads/master | fo.py | 1 | """
http://www.brokestream.com/fo.py.html
Copyright (C) 2007 Ivan Tikhonov
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software f... |
clebergnu/avocado-vt | refs/heads/master | virttest/libvirt_xml/devices/input.py | 4 | """
input device support class(es)
http://libvirt.org/formatdomain.html#elementsInput
"""
from virttest.libvirt_xml import accessors
from virttest.libvirt_xml.devices import base, librarian
class Input(base.TypedDeviceBase):
__slots__ = ('input_bus', 'model', 'address', 'source_evdev')
def __init__(self, t... |
Fusxfaranto/Robcxjo | refs/heads/master | plugins/resetenables.py | 1 | import pickle
name = 'resetenables'
enabled = False
operator = True
def cmd(self, c, e, line, message_source, target):
if len(line) > 1:
self.enabled_commands[line[1].lower()] = self.default_enables.copy()
try:
with open('enabled_commands.txt', 'wb') as f:
... |
pchauncey/ansible | refs/heads/devel | lib/ansible/modules/system/getent.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Brian Coca <brian.coca+dev@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.... |
handspring/bite-project | refs/heads/master | deps/gdata-python-client/samples/apps/create_update_group.py | 23 | #!/usr/bin/python
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
vincentbernat/feedhq | refs/heads/master | feedhq/profiles/migrations/0007_auto__add_field_user_endless_pages.py | 1 | # -*- 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 'User.endless_pages'
db.add_column('auth_user', 'endless_pages',
self.g... |
drivefast/pycipherwallet | refs/heads/master | cipherwallet/tmpstore_memcached.py | 1 | import random
import json
import pylibmc
from constants import MCD_CONFIG, CW_SESSION_TIMEOUT, ALPHABET, H_METHOD
import db_interface as db
#### temporary storage facility using memcached ####
K_NONCE = "CQR_NONCE_{0}_{1}" # + user, nonce
K_CW_SESSION = "CW_SESSION_{0}" # + cipherwallet session id
K_USER... |
gkarlin/django-jenkins | refs/heads/master | build/Django/tests/regressiontests/views/tests/__init__.py | 49 | from __future__ import absolute_import
from .debug import (DebugViewTests, ExceptionReporterTests,
ExceptionReporterTests, PlainTextReportTests, ExceptionReporterFilterTests,
AjaxResponseExceptionReporterFilter)
from .defaults import DefaultsTests
from .i18n import JsI18NTests, I18NTests, JsI18NTestsMultiPacka... |
ArcEye/machinekit-testing | refs/heads/master | configs/sim/gscreen/gscreen_custom/tester_handler.py | 18 | import hal
# This is a handler file for using Gscreen's infrastructure
# to load a completely custom glade screen.
# The only things that really matters is that it's saved as a GTK builder project,
# the toplevel window is caller window1 (The default name) and you connect a destroy
# window signal else you can't close... |
pipcet/binutils-gdb | refs/heads/asmjs | gdb/testsuite/gdb.perf/gmonster-ptype-string.py | 7 | # Copyright (C) 2015-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... |
duqiao/django | refs/heads/master | tests/model_inheritance_regress/models.py | 243 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... |
aaronelliotross/django-tastypie | refs/heads/master | tests/gis/urls.py | 16 | from django.conf.urls import include, url
urlpatterns = [
url(r'^api/', include('gis.api.urls')),
]
|
Yen-Chung-En/2015cdb_g1_0420 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/urllib/request.py | 616 | from browser import ajax
class FileIO:
def __init__(self, data):
self._data=data
def read(self):
return self._data
def urlopen(url, data=None, timeout=None):
global result
result=None
def on_complete(req):
global result
result=req
_ajax=ajax.ajax()
_ajax.bind('co... |
enkiv2/popcorn_maker | refs/heads/master | vendor-local/lib/python/requests/packages/urllib3/packages/six.py | 119 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... |
jfinkels/PADS | refs/heads/master | pads/util.py | 1 | """Util.py
Simple utility functions for PADS library.
D. Eppstein, April 2004.
"""
def arbitrary_item(S):
"""
Select an arbitrary item from set or sequence S.
Avoids bugs caused by directly calling iter(S).next() and
mysteriously terminating loops in callers' code when S is empty.
"""
try:
... |
desertofunknown/Fallout-13-EN | refs/heads/master | tools/dmm2tgm/Source/dmm2tgm.py | 149 |
import sys
# .dmm format converter, by RemieRichards
# Version 2.0
# Converts the internal structure of a .dmm file to a syntax
# that git can better handle conflicts-wise, it's also fairly human readable!
# Processes Boxstation (tgstation.2.1.3) almost instantly
def convert_map(map_file):
#CHECK FOR PREVIO... |
woobe/h2o | refs/heads/master | py/testdir_single_jvm/test_GLM2_basic.py | 1 | import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_exec, h2o_glm, h2o_jobs
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global localhost
... |
perlygatekeeper/glowing-robot | refs/heads/master | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py | 70 | from __future__ import division
from datetime import datetime
from pip._vendor.cachecontrol.cache import BaseCache
class RedisCache(BaseCache):
def __init__(self, conn):
self.conn = conn
def get(self, key):
return self.conn.get(key)
def set(self, key, value, expires=None):
if n... |
ghchinoy/tensorflow | refs/heads/master | tensorflow/contrib/autograph/examples/benchmarks/cartpole_benchmark.py | 16 | # 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... |
guozhangwang/kafka | refs/heads/trunk | tests/kafkatest/services/trogdor/process_stop_fault_spec.py | 17 | # 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 use ... |
Toshakins/wagtail | refs/heads/master | wagtail/wagtailadmin/decorators.py | 6 | from __future__ import absolute_import, unicode_literals
from django.contrib.auth.views import redirect_to_login as auth_redirect_to_login
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from wagtail.utils.compat import user_is_anonymous
from wagtail.wagtailadmin import... |
tvalacarta/tvalacarta | refs/heads/master | python/main-classic/lib/youtube_dl/extractor/ccc.py | 14 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
try_get,
url_or_none,
)
class CCCIE(InfoExtractor):
IE_NAME = 'media.ccc.de'
_VALID_URL = r'https?://(?:www\.)?media\.ccc\.de/v/(?P<id>[^/?#&]+)'
_T... |
Rdbaker/Mealbound | refs/heads/master | ceraon/utils.py | 1 | # -*- coding: utf-8 -*-
"""Helper utilities and decorators."""
from datetime import timedelta as td
from datetime import tzinfo
from threading import Thread
import requests
from flask import Blueprint, current_app, flash, request
def get_fb_access_token():
"""Get an access token from facebook for graph API calls... |
Yannig/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_epg_to_domain.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
Metaswitch/pjsip-upstream | refs/heads/master | tests/pjsua/scripts-recvfrom/301_timer_good_retry_after_422.py | 57 | # $Id: 301_timer_good_retry_after_422.py 3287 2010-08-18 14:30:17Z nanang $
import inc_sip as sip
import inc_sdp as sdp
# Session timers retry after 422
pjsua = "--null-audio sip:127.0.0.1:$PORT --timer-min-se 100 --timer-se 1000"
# First INVITE with timer rejected with 422
req1 = sip.RecvfromTransaction("INVITE wi... |
ehsan/airmozilla | refs/heads/master | airmozilla/manage/tests/views/test_approvals.py | 9 | import datetime
from nose.tools import eq_, ok_
from django.contrib.auth.models import User, Group
from django.utils import timezone
from django.core.files import File
from funfactory.urlresolvers import reverse
from airmozilla.main.models import Approval, Event, SuggestedEvent, Picture
from .base import ManageTest... |
miyakz1192/neutron | refs/heads/master | neutron/scheduler/base_scheduler.py | 46 | # Copyright (c) 2015 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/licenses/LICENSE-2.0
#
# Unless... |
maas/maas | refs/heads/master | src/maasserver/migrations/maasserver/0109_bmc_names_unique.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("maasserver", "0108_generate_bmc_names")]
operations = [
migrations.AlterField(
model_name="bmc",
name="name",
... |
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/httpclient/socketutil.py | 1 | # Copyright 2010, 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... |
geminiyellow/PokemonGo-Bot | refs/heads/master | pokemongo_bot/api_wrapper.py | 17 | import time
import logging
from pgoapi.exceptions import (ServerSideRequestThrottlingException,
NotLoggedInException, ServerBusyOrOfflineException,
NoPlayerPositionSetException, EmptySubrequestChainException,
UnexpectedResponseException)
from pgoapi.pgoapi import PGoApi, PGoApiRequest, RpcApi
from pgoapi.p... |
pdellaert/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_system_network_visibility.py | 13 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
asheniam/azure-quickstart-templates | refs/heads/master | ansible-advancedlinux/GetSSHFromPrivateStorageAccount.py | 231 | #!/usr/bin/python
import sys,os
print ("Getting %s file from Storage Account Name: %s to %s" % (str(sys.argv[3]), str(sys.argv[1]), os.path.join(os.getcwd(),str(sys.argv[3]))))
from azure.storage.blob import BlockBlobService
blob_service = BlockBlobService(account_name=str(sys.argv[1]), account_key=str(sys.argv[2])... |
wuhengzhi/chromium-crosswalk | refs/heads/master | build/android/pylib/content_settings.py | 35 | # Copyright 2014 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.
class ContentSettings(dict):
"""A dict interface to interact with device content settings.
System properties are key/value pairs as exposed by adb she... |
goerz/pelican-plugins | refs/heads/master | touch/__init__.py | 69 | from pelican import signals
import logging
import os
import time
logger = logging.getLogger(__name__)
def set_file_utime(path, datetime):
mtime = time.mktime(datetime.timetuple())
logger.info('touching %s', path)
os.utime(path, (mtime, mtime))
def touch_file(path, context):
content = context.get(... |
kumar303/zamboni | refs/heads/master | mkt/reviewers/tests/test_views_api.py | 10 | # -*- coding: utf-8 -*-
import json
from datetime import datetime, timedelta
from django.conf import settings
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
import mock
from cache_nuggets.lib import Token
from nose.tools import eq_, ok_
... |
aldian/tensorflow | refs/heads/master | tensorflow/python/tools/strip_unused_lib.py | 104 | # pylint: disable=g-bad-file-header
# 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/LICENS... |
altsen/diandiyun-platform | refs/heads/master | common/lib/xmodule/xmodule/gst_module.py | 188 | """
Graphical slider tool module is ungraded xmodule used by students to
understand functional dependencies.
"""
import json
import logging
from lxml import etree
from lxml import html
import xmltodict
from xmodule.editing_module import XMLEditingDescriptor
from xmodule.xml_module import XmlDescriptor
from xmodule.x_... |
kaplun/invenio | refs/heads/master | modules/bibsort/lib/bibsort_washer.py | 6 | ## -*- mode: python; coding: utf-8; -*-
##
## This file is part of Invenio.
## Copyright (C) 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
## Li... |
MicroPyramid/micro-finance | refs/heads/master | micro_admin/migrations/0018_loanrepaymentevery.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-24 10:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('micro_admin', '0017_auto_20160823_1341'),
]
operations = [
migrations.Create... |
kuri65536/python-for-android | refs/heads/master | python-modules/twisted/twisted/persisted/crefutil.py | 61 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility classes for dealing with circular references.
"""
from twisted.python import log, reflect
try:
from new import instancemethod
except:
from org.python.core impo... |
noironetworks/neutron | refs/heads/master | neutron/agent/common/resource_processing_queue.py | 1 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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 requir... |
tiancj/emesene | refs/heads/master | emesene/e3/papylib/papyon/papyon/msnp/__init__.py | 6 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Ali Sabil <ali.sabil@gmail.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, or
# (at your option) any later... |
nagarjung/kubernetes | refs/heads/master | third_party/htpasswd/htpasswd.py | 897 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# 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://trac.edge... |
town-hall-pinball/project-omega | refs/heads/master | pin/service/switch_single_test.py | 1 | # Copyright (c) 2014 - 2016 townhallpinball.org
#
# 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, p... |
cselis86/edx-platform | refs/heads/installer | cms/djangoapps/course_creators/models.py | 183 | """
Table for storing information about whether or not Studio users have course creation privileges.
"""
from django.db import models
from django.db.models.signals import post_init, post_save
from django.dispatch import receiver, Signal
from django.contrib.auth.models import User
from django.utils import timezone
from... |
JulyKikuAkita/PythonPrac | refs/heads/master | cs15211/StrobogrammaticNumberIII.py | 1 | __source__ = 'https://leetcode.com/problems/strobogrammatic-number-iii/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/strobogrammatic-number-iii.py
# Time: O(5^(n/2))
# Space: O(n)
#
# Description: Leetcode # 248. Strobogrammatic Number III
#
# A strobogrammatic number is a number that looks the same when... |
ashwoods/django-allauth | refs/heads/master | allauth/socialaccount/providers/douban/views.py | 66 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import DoubanProvider
class DoubanOAuth2Adapter(OAuth2Adapt... |
Mhynlo/SickRage | refs/heads/master | lib/html5lib/ihatexml.py | 1727 | from __future__ import absolute_import, division, unicode_literals
import re
import warnings
from .constants import DataLossWarning
baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-... |
ifduyue/sentry | refs/heads/master | tests/sentry/utils/test_cursors.py | 3 | from __future__ import absolute_import
import math
from mock import Mock
from sentry.utils.cursors import build_cursor, Cursor
def build_mock(**attrs):
obj = Mock()
for key, value in attrs.items():
setattr(obj, key, value)
obj.__repr__ = lambda x: repr(attrs)
return obj
def test_build_cur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.