repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
saltduck/python-bitcoinlib | refs/heads/master | examples/spend-p2sh-txout.py | 19 | #!/usr/bin/env python3
# Copyright (C) 2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied, modified,
# ... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/build/lib.linux-i686-2.7/django/conf/locale/lv/formats.py | 35 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'Y. \g\a\d\a j. F'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'Y. \g\a\d\a j. F, H:i:s'
YEAR_MONTH_FORMAT = r'Y. \g. F'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = r'j.m.Y'
SHORT_DATETIME_FORMAT = 'j.m.Y... |
sampadsaha5/sympy | refs/heads/master | sympy/polys/tests/test_partfrac.py | 29 | """Tests for algorithms for partial fraction decomposition of rational
functions. """
from sympy.polys.partfrac import (
apart_undetermined_coeffs,
apart,
apart_list, assemble_partfrac_list
)
from sympy import (S, Poly, E, pi, I, Matrix, Eq, RootSum, Lambda,
Symbol, Dummy, factor, toget... |
kmoocdev2/edx-platform | refs/heads/real_2019 | lms/djangoapps/certificates/management/commands/regenerate_user.py | 15 | """Django management command to force certificate regeneration for one user"""
import copy
import logging
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from opaque_keys.edx.keys import CourseKey
from six import text_type
from badges.events.course_complete import get_c... |
FlorentChamault/My_sickbeard | refs/heads/master | lib/bencode/BTL.py | 278 | class BTFailure(Exception):
pass
|
2014c2g5/cd0505 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/suite.py | 748 | """TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
def __init__(se... |
IPVL/Arun-SocketExample | refs/heads/master | __init__.py | 1 | __author__ = 'arun'
|
allotria/intellij-community | refs/heads/master | python/testData/paramInfo/ReassignedInstanceMethod.py | 83 | class Foo:
def moo(self, a, b, c):
pass
foo = Foo()
qoo = foo
qoo.moo(<arg1>1, <arg2>2, <arg3>"bamboo")
|
google-research/language | refs/heads/master | language/labs/exemplar_decoding/__init__.py | 8 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... |
ybellavance/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/i18n/makelocalealias.py | 48 | #!/usr/bin/env python3
"""
Convert the X11 locale.alias file into a mapping dictionary suitable
for locale.py.
Written by Marc-Andre Lemburg <mal@genix.com>, 2004-12-10.
"""
import locale
# Location of the alias file
LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias'
def parse(filename):
f = open(... |
sandeepkoduri/GAE-html-to-pdf | refs/heads/master | libs/PIL/FpxImagePlugin.py | 14 | #
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library.
# $Id$
#
# FlashPix support for PIL
#
# History:
# 97-01-25 fl Created (reads uncompressed RGB images only)
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
fr... |
wangyum/tensorflow | refs/heads/master | tensorflow/python/ops/tensor_array_ops.py | 10 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
fontify/fontify | refs/heads/master | wsgi.py | 1 | from hello import app as application
if __name__ == "__main__":
application.run()
|
xmbcrios/xmbcrios.repository | refs/heads/master | plugin.video.SportsDevil/lib/utils/github/InputGitTreeElement.py | 7 | # -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... |
omni5cience/django-inlineformfield | refs/heads/master | .tox/py27/lib/python2.7/site-packages/IPython/core/magics/__init__.py | 23 | """Implementation of all the magic functions built into IPython.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distribu... |
SummaLabs/DLS | refs/heads/master | app/backend/core/models-keras-2x-api/lightweight_layers/layers_basic.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import keras.layers.merge
###############################################
# default_data_format = 'channels_last' #'th'
#FIXME: temporary Theano-channel ordering (channels_first), in feature needd merge to tensorflow ordering (channels_last)
default_data_forma... |
medixdev/electron | refs/heads/master | script/install-sysroot.py | 140 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install a Debian Wheezy sysroot for making official Google Chrome
# Linux builds.
# The sysroot is needed to make Chrom... |
MayankGo/ec2-api | refs/heads/stable/kilo | ec2api/tests/functional/scenario/base.py | 1 | # Copyright 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 requ... |
jmartu/testing | refs/heads/master | venv/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/__init__.py | 1178 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from .__about__ import (
__author__, __copyright__, __email__, __licen... |
BillKeenan/lets-encrypt-preview | refs/heads/master | letsencrypt/cli.py | 1 | """Let's Encrypt CLI."""
# TODO: Sanity check all input. Be sure to avoid shell code etc...
import argparse
import atexit
import functools
import logging
import logging.handlers
import os
import pkg_resources
import sys
import time
import traceback
import configargparse
import OpenSSL
import zope.component
import zop... |
luotao1/Paddle | refs/heads/develop | python/paddle/amp/grad_scaler.py | 1 | # Copyright (c) 2020 PaddlePaddle 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 app... |
da1z/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg1/_pkg1_0/_pkg1_0_0/_pkg1_0_0_1/_pkg1_0_0_1_0/_mod1_0_0_1_0_4.py | 30 | name1_0_0_1_0_4_0 = None
name1_0_0_1_0_4_1 = None
name1_0_0_1_0_4_2 = None
name1_0_0_1_0_4_3 = None
name1_0_0_1_0_4_4 = None |
thebigmunch/gmusicapi | refs/heads/develop | gmusicapi/_version.py | 1 | # -*- coding: utf-8 -*-
__version__ = u"11.0.4-rc.1"
|
procangroup/edx-platform | refs/heads/master | cms/djangoapps/contentstore/debug_file_uploader.py | 25 | import time
from django.core.files.uploadhandler import FileUploadHandler
class DebugFileUploader(FileUploadHandler):
def __init__(self, request=None):
super(DebugFileUploader, self).__init__(request)
self.count = 0
def receive_data_chunk(self, raw_data, start):
time.sleep(1)
... |
jacksonwilliams/arsenalsuite | refs/heads/master | cpp/lib/PyQt4/examples/designer/plugins/python/polygonwidgetplugin.py | 20 | #!/usr/bin/env python
"""
polygonwidgetplugin.py
A polygon widget custom widget plugin for Qt Designer.
Copyright (C) 2006 David Boddie <david@boddie.org.uk>
Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU... |
hack4impact/maps4all-jlc-sp2 | refs/heads/master | app/descriptor/__init__.py | 4 | from flask import Blueprint
descriptor = Blueprint('descriptor', __name__)
from . import views # noqa
|
noslenfa/tdjangorest | refs/heads/master | uw/lib/python2.7/site-packages/django/contrib/auth/forms.py | 59 | from __future__ import unicode_literals
from django import forms
from django.forms.util import flatatt
from django.template import loader
from django.utils.datastructures import SortedDict
from django.utils.html import format_html, format_html_join
from django.utils.http import int_to_base36
from django.utils.safestri... |
ryanbhayward/games-puzzles-algorithms | refs/heads/master | old/lib/games_puzzles_algorithms/games/fake_game_state.py | 1 | class FakeGameState(object):
def __init__(self):
self._player_to_act = 0
self._actions = []
def __str__(self):
return "FakeGameState:\n PTA: {},\n actions taken: {}".format(
self._player_to_act,
self._actions)
def num_legal_actions(self):
return l... |
MediaBrowser/Emby.Kodi | refs/heads/master | libraries/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
dojojon/pygame | refs/heads/master | week5/highscore.py | 1 |
def get_high_score():
# Default high score
high_score = 0
# Try to read the high score from a file
try:
high_score_file = open("high_score.txt", "r")
high_score = int(high_score_file.read())
high_score_file.close()
print("The high score is", high_score)
except IOErr... |
CMPUT410W15T02/CMPUT410W15-project | refs/heads/master | testenv/lib/python2.7/site-packages/django/contrib/messages/context_processors.py | 705 | from django.contrib.messages.api import get_messages
from django.contrib.messages.constants import DEFAULT_LEVELS
def messages(request):
"""
Returns a lazy 'messages' context variable.
"""
return {
'messages': get_messages(request),
'DEFAULT_MESSAGE_LEVELS': DEFAULT_LEVELS,
}
|
jaruba/chromium.src | refs/heads/nw12 | chrome/common/extensions/docs/server2/api_categorizer_test.py | 87 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from api_categorizer import APICategorizer
from compiled_file_system import CompiledFileSystem
from extensions_paths im... |
daajoe/doorbell | refs/heads/master | pjproject/tests/pjsua/scripts-pesq/200_codec_l16_16000_stereo.py | 59 | # $Id: 200_codec_l16_16000_stereo.py 2075 2008-06-27 16:18:13Z nanang $
#
from inc_cfg import *
ADD_PARAM = ""
if (HAS_SND_DEV == 0):
ADD_PARAM += "--null-audio"
# Call with L16/16000/2 codec
test_param = TestParam(
"PESQ defaults pjsua settings",
[
InstanceParam("UA1", ADD_PARAM + " --stereo --max-calls=1 -... |
gurneyalex/OpenUpgrade | refs/heads/master | addons/hr_evaluation/report/hr_evaluation_report.py | 44 | # -*- 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... |
leonty/ansible-modules-core | refs/heads/devel | cloud/openstack/os_server_actions.py | 54 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2015, Jesse Keating <jlk@derpops.bike>
#
# This module 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 opti... |
crlang/sublime-text---front-end-config | refs/heads/master | Data/Packages/WakaTime/packages/wakatime/packages/chardet/sbcsgroupprober.py | 273 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
jonathan-beard/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_checklists.py | 104 | """ Unit tests for checklist methods in views.py. """
from contentstore.utils import reverse_course_url
from contentstore.views.checklist import expand_checklist_action_url
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.django import modulestore
import json
from contentstore.tes... |
hoheinzollern/tracker | refs/heads/master | tests/functional-tests/600-applications-camera.py | 3 | #!/usr/bin/python
#
# Copyright (C) 2011, Nokia Corporation <ivan.frade@nokia.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 la... |
allendaicool/thrust | refs/heads/master | performance/build/testsuite.py | 28 | """functions that generate reports and figures using the .xml output from the performance tests"""
__all__ = ['TestSuite', 'parse_testsuite_xml']
class TestSuite:
def __init__(self, name, platform, tests):
self.name = name
self.platform = platform
self.tests = tests
def __repr__(self)... |
AOSPU/external_chromium_org_tools_gyp | refs/heads/android-5.0/py3 | test/small/gyptest-small.py | 205 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Runs small tests.
"""
import imp
import os
import sys
import unittest
import TestGyp
test = TestGyp.TestGyp()
# Add pylib to the im... |
nattayamairittha/MeanStack | refs/heads/master | MyProject/node_modules/node-sass-middleware/node_modules/node-sass/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... |
TRUFIL/erpnext | refs/heads/develop | erpnext/patches/v9_2/remove_company_from_patient.py | 12 | import frappe
def execute():
if frappe.db.exists("DocType", "Patient"):
if 'company' in frappe.db.get_table_columns("Patient"):
frappe.db.sql("alter table `tabPatient` drop column company")
|
rahul67/hue | refs/heads/master | apps/pig/src/pig/tests.py | 4 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
cherrygirl/micronaet7 | refs/heads/master | menuitem_project/__openerp__.py | 2 | # -*- coding: utf-8 -*-
###############################################################################
#
# ODOO (ex OpenERP)
# Open Source Management Solution
# Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>)
# Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>)
# This pro... |
darkobas/android_kernel_oneplus_msm8974 | refs/heads/n | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
michelesr/gasistafelice | refs/heads/master | gasistafelice/gf/settings.py | 2 | """
Django settings for gasistafelice project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import locale
import consts
from django.utils.translatio... |
ngc224/totransfer | refs/heads/master | totranslator/config.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
application_name = 'totranslator'
version = '0.0.1'
filepath_user = os.environ['HOME'] + '/.' + application_name
api_request_url = 'http://api.datamarket.azure.com/Bing/MicrosoftTranslator/v1/Translate'
|
cloudbase/nova-virtualbox | refs/heads/virtualbox_driver | nova/api/ec2/__init__.py | 2 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
dnozay/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/contenttypes/management.py | 315 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... |
yannrouillard/weboob | refs/heads/master | modules/indeed/__init__.py | 3 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob 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 opt... |
satanas/Turpial | refs/heads/development | ez_setup.py | 3 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... |
childehuang/ngoenzraiz | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import hashlib
import redis
REDIS_HOST = "localhost"
REDIS_PORT = 6379
ADMIN_PASSWORD = None
AUTH_VALUE = None
COOKIE_SECRET = None
if ADMIN_PASSWORD == None:
while True:
pswd = input("请输入12位管理密码:")
if len(pswd) < 12:
print("密码过于简单!")
continue
... |
kenshay/ImageScripter | refs/heads/master | Script_Runner/PYTHON/Lib/site-packages/pkg_resources/__init__.py | 20 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... |
flgiordano/netcash | refs/heads/master | +/google-cloud-sdk/lib/googlecloudsdk/command_lib/config/completers.py | 1 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
TeamTwisted/external_chromium_org | refs/heads/opti-5.1 | tools/telemetry/telemetry/timeline/counter.py | 33 | # 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.
import telemetry.timeline.event_container as event_container
# Doesn't inherit from TimelineEvent because its only a temporary wrapper of a
# counter sampl... |
40223125/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/sax/_exceptions.py | 625 | """Different kinds of SAX Exceptions"""
#in brython the 4 lines below causes an $globals['Exception'] error
#import sys
#if sys.platform[:4] == "java":
# from java.lang import Exception
#del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can con... |
seriouscamp/frbb | refs/heads/master | web/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flipside.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
75651/kbengine_cloud | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py | 1729 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
mcking49/apache-flask | refs/heads/master | Python/Lib/test/test_getargs2.py | 35 | import unittest
from test import test_support
# Skip this test if the _testcapi module isn't available.
test_support.import_module('_testcapi')
from _testcapi import getargs_keywords
import warnings
"""
> How about the following counterproposal. This also changes some of
> the other format codes to be a little more re... |
cainmatt/django | refs/heads/master | django/conf/locale/es_AR/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j N Y'
TIME_FORMAT = r'H:i'
DATE... |
GiggleLiu/poorman_nn | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import os
import sys
descr = """Python module for low abstraction neural network."""
DISTNAME = 'poornn'
DESCRIPTION = descr
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
LONG_DESCRIPTION = f.read()
MAINTAINER = 'Giggle Liu',
MAINTAINER_EMAIL = 'cacate0129@gmail.com',... |
juanalfonsopr/odoo | refs/heads/8.0 | addons/account_budget/tests/__init__.py | 327 | import test_theoreticalamount
|
RomanZWang/osf.io | refs/heads/develop | scripts/migration/migrate_profile_dates.py | 64 | """Changes existing profile education and employment dates from
YYYY-MM-DD formatted dates to "Month Year" format
Log:
Run on production by SL on 2014-10-14 at 19:11 EST. 269 users were migrated.
"""
import logging
from website.app import init_app
from website import models
from datetime import datetime
from tes... |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/tests/regressiontests/signals_regress/models.py | 92 | from django.db import models
class Author(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=20)
authors = models.ManyToManyField(Author)
def __unicode__(self):
return self.nam... |
weimingtom/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/cp037.py | 266 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.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 decode(self,input... |
mcollins12321/anita | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py | 180 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from six.moves import urllib_parse as urlparse
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
content_type_rgx = re.compile(r'''
^
... |
MortimerGoro/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/cache-storage/resources/fetch-status.py | 266 | def main(request, response):
return int(request.GET["status"]), [], ""
|
jelugbo/hebs_repo | refs/heads/master | common/lib/xmodule/xmodule/tests/test_editing_module.py | 27 | """ Tests for editing descriptors"""
import unittest
import os
import logging
from mock import Mock
from pkg_resources import resource_string
from opaque_keys.edx.locations import Location
from xmodule.editing_module import TabsEditingDescriptor
from xblock.field_data import DictFieldData
from xblock.fields import Sco... |
TrimBiggs/calico-docker | refs/heads/master | tests/st/no_orchestrator/test_container_to_host.py | 12 | # Copyright 2015 Metaswitch Networks
#
# 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 w... |
vitaly4uk/django | refs/heads/master | django/db/models/sql/constants.py | 633 | """
Constants specific to the SQL storage portion of the ORM.
"""
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = {
'exact', 'iexact', 'contains', 'icontains', 'gt', '... |
tsacha/rss2email | refs/heads/master | rss2email/__init__.py | 5 | # Copyright (C) 2012-2014 W. Trevor King <wking@tremily.us>
#
# This file is part of rss2email.
#
# rss2email 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... |
remcoboerma/w2p_redirector | refs/heads/master | languages/hu.py | 162 | # coding: utf8
{
'!langcode!': 'hu',
'!langname!': 'Magyar',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%s %%{row} deleted': '%s s... |
vitaly-krugl/haigha | refs/heads/master | setup.py | 3 | import haigha
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
requirements = map(str.strip, open('requirements.txt').readlines())
setup(
name='haigha',
version=haigha.__version__,
author='Vitaly Babiy, Aaron Westendorf',
author_email="vbabiy@a... |
treycucco/pynet-kvp | refs/heads/master | client.py | 1 | import argparse
import readline
from pynet import Encryptor, Node, MessageState
from pynet.util import send_data, to_bytes, to_address
class Client(object):
"""A client object holds the information needed to send data to a node."""
def __init__(self, private_key, name, server_address):
self.private_key = pri... |
mudithkr/zamboni | refs/heads/master | manage.py | 17 | #!/usr/bin/env python
import logging
import os
import sys
from django.core.management import execute_from_command_line
if 'DJANGO_SETTINGS_MODULE' not in os.environ:
if len(sys.argv) > 1 and sys.argv[1] == 'test':
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_test'
else:
os.environ.setdefau... |
coreboot/chrome-ec | refs/heads/master | extra/usb_power/convert_power_log_board.py | 2 | #!/usr/bin/env python
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Program to convert sweetberry config to servod config template.
"""
# Note: This is a py2/3 compatible file.
from __future__ i... |
pombredanne/pulp_ostree | refs/heads/master | plugins/setup.py | 2 | from setuptools import setup, find_packages
setup(
name='pulp_ostree_plugins',
version='1.1.0a1',
packages=find_packages(),
url='http://www.pulpproject.org',
license='GPLv2+',
author='Pulp Team',
author_email='pulp-list@redhat.com',
description='plugins for ostree support in pulp',
... |
stuliveshere/PySeis | refs/heads/master | examples/99.0_multistack_viewer.py | 2 | '''
displays multiple stacks
'''
import toolbox
import pylab
import numpy as np
filelist = ["1st_vels_stack.su",
#"1st_vels_stack_elev.su",
"fk_stack.su",
#"model.su",
"model_filtered.su",
#"trim_stack.su",
"trim_stack2.su",
]
dataset, params = toolbox.initialise(filelist[0])
dataset['fldr'] = 0
for index, file ... |
saulpw/visidata | refs/heads/stable | visidata/editor.py | 1 | import os
import signal
import subprocess
import tempfile
import curses
import visidata
class SuspendCurses:
'Context manager to leave windowed mode on enter and restore it on exit.'
def __enter__(self):
curses.endwin()
signal.signal(signal.SIGTSTP, visidata.vd.tstp_signal)
def __exit__(... |
calfonso/ansible | refs/heads/devel | lib/ansible/modules/storage/purestorage/purefa_facts.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... |
abhishekshanbhag/emotion_based_spotify | refs/heads/master | Emotify_Final_Files/classify_with_openCV.py | 1 | '''
This script performs emotion classification on the photo taken by the user. The
script performs the following steps:
1. Download photo from Amazon S3 storage bucket
2. Covert colored photo to grayscale
3. Loads trained convolutional neural network
4. Performs emotion prediction
'''
# Load required... |
codebhendi/scrapy | refs/heads/master | scrapy/pipelines/__init__.py | 142 | """
Item pipeline
See documentation in docs/item-pipeline.rst
"""
from scrapy.middleware import MiddlewareManager
from scrapy.utils.conf import build_component_list
class ItemPipelineManager(MiddlewareManager):
component_name = 'item pipeline'
@classmethod
def _get_mwlist_from_settings(cls, settings):
... |
tamsky/ansible-upstream | refs/heads/devel | lib/ansible/plugins/action/normal.py | 16 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
lengtche/beets | refs/heads/master | beetsplug/permissions.py | 18 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
"""Fixes file permissions after the file gets written on import. Put something
like the following in your config.yaml to configure:
permissions:
file: 644
dir: 755
"""
import os
from beets import conf... |
flacjacket/sympy | refs/heads/master | sympy/printing/pretty/pretty.py | 2 | from sympy.core import S, C, Basic, Interval
from sympy.core.function import _coeff_isneg
from sympy.utilities import group
from sympy.core.sympify import SympifyError
from sympy.printing.printer import Printer
from sympy.printing.str import sstr
from stringpict import prettyForm, stringPict
from pretty_symbology imp... |
mdesco/dipy | refs/heads/master | dipy/sims/tests/test_voxel.py | 3 | import numpy as np
from nose.tools import (assert_true, assert_false, assert_equal,
assert_almost_equal)
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_)
from dipy.sims.voxel import (SingleTensor, MultiTensor, multi_tensor_odf, all_t... |
GitAngel/django | refs/heads/master | django/contrib/gis/db/models/sql/__init__.py | 476 | from django.contrib.gis.db.models.sql.conversion import (
AreaField, DistanceField, GeomField, GMLField,
)
__all__ = [
'AreaField', 'DistanceField', 'GeomField', 'GMLField'
]
|
Qalthos/ansible | refs/heads/devel | lib/ansible/module_utils/common/text/formatters.py | 15 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import re
from ansible.module_utils.six import iteritems
SIZE_... |
zzzeek/sqlalchemy | refs/heads/master | test/orm/inheritance/test_abc_inheritance.py | 3 | from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm import mapper
from sqlalchemy.orm import polymorphic_union
from sqlalchemy.orm import relationship
from sqlalchemy.orm.interfaces impo... |
feigames/Odoo | refs/heads/master | addons/account/report/account_partner_balance.py | 95 | # -*- 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... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | instal/script.module.requests/lib/requests/packages/chardet/latin1prober.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
laurenrevere/osf.io | refs/heads/develop | api/actions/urls.py | 3 | from django.conf.urls import url
from . import views
app_name = 'osf'
urlpatterns = [
url(r'^reviews/$', views.ReviewActionListCreate.as_view(), name=views.ReviewActionListCreate.view_name),
url(r'^(?P<action_id>\w+)/$', views.ActionDetail.as_view(), name=views.ActionDetail.view_name),
]
|
pigate/mongo-python-driver | refs/heads/master | gridfs/errors.py | 61 | # Copyright 2009-2015 MongoDB, 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 writin... |
thanhacun/odoo | refs/heads/8.0 | openerp/tools/appdirs.py | 376 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | third_party/cython/src/pyximport/pyxbuild.py | 95 | """Build a Pyrex file from .pyx source to .so loadable module using
the installed distutils infrastructure. Call:
out_fname = pyx_to_dll("foo.pyx")
"""
import os
import sys
from distutils.dist import Distribution
from distutils.errors import DistutilsArgError, DistutilsError, CCompilerError
from distutils.extension i... |
opendatakosovo/undp-gsc-api | refs/heads/master | ugca/views/groupedanswers.py | 1 | from flask import Response
from flask.views import View
from bson import json_util
from ugca import utils
from ugca import mongo
class GroupedAnswers(View):
def dispatch_request(self, qid, group, disaggregate=None):
'''Get the answers to a question grouped by a given interviewee parameter
:param... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/models/firewall_rule_py3.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Microvellum/Fluid-Designer | refs/heads/master | win64-vc/2.78/python/lib/encodings/hex_codec.py | 202 | """Python 'hex_codec' Codec - 2-digit hex content transfer encoding.
This codec de/encodes from bytes to bytes.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import binascii
### Codec APIs
def hex_encode(input, errors='strict'):
assert errors == 'strict'
return (binascii.b2a_hex(input)... |
adfinis-sygroup/pyaptly | refs/heads/master | pyaptly/version.py | 1 | """Version module to be read from various places"""
__version__ = "1.2.0" # pragma: no cover
|
phenoxim/nova | refs/heads/master | nova/tests/functional/api_sample_tests/test_extension_info.py | 15 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.