repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
2015fallproject/2015fallcase1 | refs/heads/master | static/Brython3.2.0-20150701-214155/Lib/_markupbase.py | 891 | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... |
tysonclugg/django | refs/heads/master | tests/db_functions/test_cast.py | 16 | from django.db import models
from django.db.models.expressions import Value
from django.db.models.functions import Cast
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from .models import Author
class CastTests(TestCase):
@classmethod
def setUpTestData(self):
Author.objects.cre... |
featherweightweb/django-composer | refs/heads/master | demo/settings.py | 1 | """
Django settings for the demo project.
Generated by 'django-admin startproject' using Django 1.8.3.
"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '3#z7&hlb8@u=ufvu+1#5tuj--^noksa%$f&+3p#ic^eiq!*!uv'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = (
'dja... |
inversion/pylast | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup
import os
def get_build():
path = "./.build"
if os.path.exists(path):
fp = open(path, "r")
build = eval(fp.read())
if os.path.exists("./.increase_build"):
build += 1
fp.close()
else:
build = 1
fp = open(path, "w")
fp.write(str(build))
fp.clos... |
delftrobotics/keras-retinanet | refs/heads/master | keras_retinanet/utils/tf_version.py | 1 | """
Copyright 2017-2019 Fizyr (https://fizyr.com)
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... |
wikimedia/operations-debs-contenttranslation-hfst | refs/heads/upstream | test/tools/hfst-compose-intersect.py | 2 | import hfst
import hfst_commandline
options = hfst_commandline.hfst_getopt('1:2:',[],2)
istreams = hfst_commandline.get_two_hfst_input_streams(options)
istr1 = istreams[0][0]
istr2 = istreams[1][0]
if (istr1.get_type() != istr2.get_type()):
raise RuntimeError('Error: transducer types differ in ' + istreams[0][1] ... |
Brother-Simon/AutobahnTestSuite | refs/heads/master | autobahntestsuite/autobahntestsuite/case/case4_2_4.py | 14 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... |
jbradberry/dxr | refs/heads/master | dxr/plugins/clang/needles.py | 7 | from itertools import chain
from dxr.indexers import (iterable_per_line, with_start_and_end,
split_into_lines)
# TODO: Use.
def sig_needles(condensed):
"""Return needles ((c-sig, type), span)."""
return ((('c-sig', str(o['type'])), o['span']) for o in
condensed['function... |
elelinux/android_kernel_htc_pyramid | refs/heads/cm-10.1 | scripts/build-all.py | 308 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... |
double12gzh/nova | refs/heads/master | nova/api/openstack/compute/versions.py | 32 | # Copyright 2011 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... |
hwroitzsch/BikersLifeSaver | refs/heads/master | lib/python3.5/site-packages/numpy/distutils/command/build_ext.py | 149 | """ Modified version of build_ext that handles fortran source files.
"""
from __future__ import division, absolute_import, print_function
import os
import sys
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.errors impo... |
wwf5067/statsmodels | refs/heads/master | statsmodels/datasets/longley/data.py | 25 | """Longley dataset"""
__docformat__ = 'restructuredtext'
COPYRIGHT = """This is public domain."""
TITLE = __doc__
SOURCE = """
The classic 1967 Longley Data
http://www.itl.nist.gov/div898/strd/lls/data/Longley.shtml
::
Longley, J.W. (1967) "An Appraisal of Least Squares Programs for the
El... |
stefanv/scipy3 | refs/heads/master | scipy/ndimage/info.py | 2 | __doc__ = """
n-dimensional image package
===========================
This package contains various functions for multi-dimensional image processing.
"""
postpone_import = 1
depends = []
|
jordiclariana/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_ssl_certificate.py | 32 | #!/usr/bin/python
#
# (c) 2016, Kevin Coming (@waffie1)
#
# 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 l... |
brchiu/tensorflow | refs/heads/master | tensorflow/contrib/factorization/python/ops/kmeans.py | 13 | # 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... |
andrewgleave/whim | refs/heads/master | web/whim/settings_local.py | 1 | from .settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'whim',
'USER': 'whim',
'PASSWORD': 'whim',
'HOST': '127.0.0.1',
'PORT': '5432',
}
} |
damiansoriano/odoo | refs/heads/master | addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py | 23 | # -*- coding: utf-8 -*-
import logging
import base64
import os
from openerp.osv import osv
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
from openerp.addons.account_bank_statement_import import account_bank_statement_import as ibs
ibs.add_file_type(('ofx', 'OFX'))
try:
from ofxpar... |
alshedivat/tensorflow | refs/heads/master | tensorflow/python/ops/collective_ops.py | 25 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
skosukhin/spack | refs/heads/esiwace | var/spack/repos/builtin/packages/lndir/package.py | 1 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
rnestler/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/doc/en/example/costlysetup/sub1/test_quick.py | 235 |
def test_quick(setup):
pass
|
vladmm/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/Indent21.dst.py | 747 | class C:
def foo(self):
<caret>y = 2
|
osynge/pmpman | refs/heads/master | pmpmanager/initialise_db.py | 1 | import logging
import db_devices as model
def initial_data_add_job_state(session,name):
found = session.query(model.job_state).\
filter(name == model.job_state.name)
if found.count() == 0:
state_new = model.job_state()
state_new.name = name
session.add(state_new)
se... |
dongjiaqiang/hadoop-20 | refs/heads/master | src/contrib/hod/hodlib/Common/xmlrpc.py | 182 | #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 thi... |
bright-sparks/chromium-spacewalk | refs/heads/master | tools/perf/metrics/media.py | 43 | # 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 logging
import os
from metrics import Metric
from telemetry.value import list_of_scalar_values
from telemetry.value import scalar
class MediaMetric(... |
data-exp-lab/girder | refs/heads/master | plugins/hdfs_assetstore/server/__init__.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
gkwatson/lab | refs/heads/master | python/A3CEx.py | 1 | import deepmind_lab
import numpy as np
import tensorflow as tf
import threading
import multiprocessing
import tensorflow.contrib.slim as slim
#import scipy
import os
#from time import sleep
# Create action dictionary
ACTIONS = {
'look_left': np.array((-20, 0, 0, 0, 0, 0, 0), dtype=np.intc),
'look_right': np.array(... |
anubhav929/eden | refs/heads/eden | private/templates/Delphi/config.py | 3 | # -*- coding: utf-8 -*-
from gluon import current
from gluon.storage import Storage
from gluon.contrib.simplejson.ordered_dict import OrderedDict
settings = current.deployment_settings
T = current.T
"""
Template settings for Delphi Decision Maker
"""
settings.base.system_name = T("Delphi Decision Maker")
setting... |
rlbabyuk/integration_tests | refs/heads/master | scripts/update_rhel.py | 8 | #!/usr/bin/env python2
"""Run yum updates against a given repo
"""
import argparse
import sys
from utils.appliance import IPAppliance
def main():
parser = argparse.ArgumentParser(epilog=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('address', help='hostname or ip... |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | refs/heads/master | libs/guessit/transfo/guess_episode_info_from_position.py | 150 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
privateip/ansible | refs/heads/devel | contrib/inventory/openvz.py | 86 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# openvz.py
#
# Copyright 2014 jordonr <jordon@beamsyn.net>
#
# 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 ... |
lightcn/odoo | refs/heads/8.0 | addons/document/wizard/__init__.py | 444 | # -*- 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... |
massot/odoo | refs/heads/8.0 | addons/crm/ir_http.py | 306 | # -*- coding: utf-8 -*-
from openerp.http import request
from openerp.osv import orm
class ir_http(orm.AbstractModel):
_inherit = 'ir.http'
def get_utm_domain_cookies(self):
return request.httprequest.host
def _dispatch(self):
response = super(ir_http, self)._dispatch()
for var, ... |
avanov/django | refs/heads/master | tests/template_tests/test_smartif.py | 580 | import unittest
from django.template.smartif import IfParser
class SmartIfTests(unittest.TestCase):
def assertCalcEqual(self, expected, tokens):
self.assertEqual(expected, IfParser(tokens).parse().eval({}))
# We only test things here that are difficult to test elsewhere
# Many other tests are f... |
EliasTouil/simpleBlog | refs/heads/master | simpleBlog/Lib/encodings/mac_romanian.py | 593 | """ Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.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,inp... |
poppogbr/genropy | refs/heads/master | gnrpy/tests/sql/f_selection_test.py | 1 | #!/usr/bin/env python
# encoding: utf-8
# -*- coding: UTF-8 -*-
#--------------------------------------------------------------------------
# package : GenroPy core - see LICENSE for details
# module gnrbag : an advanced data storage system
# Copyright (c) : 2004 - 2007 Softwell sas - Milano
# Written by : Gi... |
highweb-project/highweb-webcl-html5spec | refs/heads/highweb-20160310 | gpu/command_buffer/build_gles2_cmd_buffer.py | 3 | #!/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.
"""code generator for GLES2 command buffers."""
import itertools
import os
import os.path
import sys
import re
import platform
fro... |
astrofrog/sedfitter | refs/heads/master | sedfitter/timer.py | 1 | from __future__ import print_function, division
import time
import numpy as np
class Timer(object):
def __init__(self):
self.time1 = time.time()
self.n = 0
self.step = 1
print(" # Sources CPU time (sec) Sources/sec ")
print(" ------------------------------------... |
hybrideagle/django | refs/heads/master | django/utils/functional.py | 234 | import copy
import operator
from functools import total_ordering, wraps
from django.utils import six
from django.utils.six.moves import copyreg
# You can't trivially replace this with `functools.partial` because this binds
# to classes and returns bound instances, whereas functools.partial (on
# CPython) is a type a... |
MrNuggles/HeyBoet-Telegram-Bot | refs/heads/master | temboo/Library/Zendesk/Attachments/__init__.py | 5 | from temboo.Library.Zendesk.Attachments.UploadAttachment import UploadAttachment, UploadAttachmentInputSet, UploadAttachmentResultSet, UploadAttachmentChoreographyExecution
|
nmercier/linux-cross-gcc | refs/heads/master | linux/lib/python2.7/encodings/koi8_u.py | 593 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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,errors='stri... |
PythonScientists/Shape | refs/heads/master | env/lib/python3.5/site-packages/gunicorn/pidfile.py | 24 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import errno
import os
import tempfile
class Pidfile(object):
"""\
Manage a PID file. If a specific name is provided
it and '"%s.oldpid" % name' will be used. Otherwise
we cr... |
probablytom/tomwallis.net | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/geos/tests/test_mutable_list.py | 92 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, http://www.aryehleib.com
# All rights reserved.
#
# Modified from original contribution by Aryeh Leib Taurog, which was
# released under the New BSD license.
import unittest
from django.contrib.gis.geos.mutable_list import ListMixin
from django.utils import six
class Use... |
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_Quantization/trend_MovingMedian/cycle_7/ar_12/test_artificial_1024_Quantization_MovingMedian_7_12_100.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "Quantization", sigma = 0.0, exog_count = 100, ar_order = 12); |
jmesteve/saas3 | refs/heads/master | openerp/addons_extra/ibeacon/pexpect-3.2/pexpect/ANSI.py | 13 | '''This implements an ANSI (VT100) terminal emulator as a subclass of screen.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DIS... |
developersociety/django-glitter | refs/heads/master | glitter/blocks/related_pages/views.py | 2 | import re
from django.contrib.syndication.views import add_domain
from django.template.loader import render_to_string
def related_pages_generator(request, related_pages):
for related_page in related_pages:
if related_page.page:
page_url = related_page.page.get_absolute_url()
url =... |
jianghuaw/nova | refs/heads/master | nova/api/openstack/compute/schemas/remote_consoles.py | 10 | # Copyright 2014 NEC 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
#
# Unless required ... |
vmware/pyvmomi-community-samples | refs/heads/master | samples/tools/pchelper.py | 1 | """
Property Collector helper module.
"""
import pyVmomi
# Shamelessly borrowed from:
# https://github.com/dnaeon/py-vconnector/blob/master/src/vconnector/core.py
def collect_properties(si, view_ref, obj_type, path_set=None,
include_mors=False):
"""
Collect properties for managed objec... |
jcasner/nupic | refs/heads/master | tests/unit/nupic/frameworks/opf/two_gram_model_test.py | 35 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
mzhaom/bcloud | refs/heads/master | bcloud/pcs.py | 3 |
# Copyright (C) 2013-2014 LiuLang <gsushzhsosgsu@gmail.com>
# Use of this source code is governed by GPLv3 license that can be found
# in http://www.gnu.org/licenses/gpl-3.0.html
'''
这个模块主要是网盘的文件操作接口.
'''
import json
import os
import re
from lxml import html
from lxml.cssselect import CSSSelector as CSS
from bclou... |
projectcalico/calico-nova | refs/heads/calico-readme | nova/tests/unit/virt/libvirt/test_config.py | 3 | # Copyright (C) 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
mgit-at/ansible | refs/heads/devel | lib/ansible/module_utils/network/dellos10/dellos10.py | 74 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# (c) 2017 Red Hat, Inc
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamica... |
Marsfan/GY88 | refs/heads/master | Accelerometer_gyroscope/mpu6050_base_Code.py | 1 | # mpu6050 library 1.0: basic data output. This file does not use the DMP system. Using that is complicated.
# the only existing code for that is either arduino, C++, or pre built by the manufacturer.
# if I can figure out more about using the DMP, i will release a new version
# import smbus for i2c and math for the tr... |
Lh4cKg/sl4a | refs/heads/master | python/src/Mac/Demo/applescript/Disk_Copy/Utility_Events.py | 34 | """Suite Utility Events: Commands that allow the user to select Disk Copy files
Level 1, version 1
Generated from Macintosh HD:Hulpprogramma's:Disk Copy
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'ddsk'
class Utility_Events_Events:
_argmap_select_disk_image = {... |
adaitche/luigi | refs/heads/master | luigi/contrib/hadoop_jar.py | 24 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
and2099/twister-core | refs/heads/master | twister-control.py | 14 | #!/usr/bin/env python2
#
# very simple wrapper for starting twisterd and launching the web browser
#
# generates a default rpcpassword, twister.conf file etc.
# may also setup automatic twisterd script on desktop login.
try:
from Tkinter import *
from tkMessageBox import *
except:
pass # we will fail later... |
sestrella/ansible | refs/heads/devel | test/units/modules/network/check_point/test_cp_mgmt_global_assignment_facts.py | 19 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... |
praekeltfoundation/mc2-freebasics | refs/heads/develop | freebasics/models.py | 1 | from django.db import models
from django.conf import settings
from mc2.controllers.docker.models import DockerController
class FreeBasicsController(DockerController):
postgres_db_url = models.TextField(null=True, blank=True)
def get_marathon_app_data(self):
data = super(FreeBasicsController, self).g... |
marissazhou/django | refs/heads/master | tests/migrations/test_migrations_squashed/0001_squashed_0002.py | 282 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [
("migrations", "0001_initial"),
("migrations", "0002_second"),
]
operations = [
migrations.CreateModel(
"Auth... |
jonathanverner/brython | refs/heads/master | www/tests/test_string_methods.py | 10 | x = "zer"
assert x.capitalize() == "Zer"
assert str.capitalize(x) == "Zer"
assert "center".center(30) == ' center '
y="center"
assert y.center(30) == ' center '
assert str.center(y,30) == ' center '
x = "azert$t y t"
assert x.count('t')==3
assert str.... |
EduPepperPD/pepper2013 | refs/heads/master | common/lib/calc/calc/functions.py | 279 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... |
tensorflow/tensor2tensor | refs/heads/master | tensor2tensor/layers/modalities.py | 1 | # coding=utf-8
# Copyright 2021 The Tensor2Tensor 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 applicable... |
suncycheng/intellij-community | refs/heads/master | python/lib/Lib/encodings/iso2022_jp.py | 816 | #
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncod... |
samthor/intellij-community | refs/heads/master | python/testData/inspections/AddGlobalExistingStatement_after.py | 83 | a = 1
def foo():
global b, a
print a
a = 2
print a
foo()
|
angelapper/odoo | refs/heads/9.0 | addons/sale/res_partner.py | 46 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields,osv
class res_partner(osv.osv):
_inherit = 'res.partner'
def _sale_order_count(self, cr, uid, ids, field_name, arg, context=None):
res = dict(map(lambda x: (x,0), ids))
... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python-build/python-libs/gdata/tests/all_tests_local.py | 87 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google 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... |
frewsxcv/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/_scons_UserString.py | 19 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
openstack/kolla | refs/heads/master | kolla/tests/test_build.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... |
wgcv/SWW-Crashphone | refs/heads/master | lib/python2.7/site-packages/django/test/testcases.py | 47 | from __future__ import unicode_literals
from copy import copy
import difflib
import errno
from functools import wraps
import json
import os
import posixpath
import re
import socket
import sys
import threading
import unittest
from unittest import skipIf # NOQA: Imported here for backward compatibility
from unit... |
leotsem/django-ios-notifications | refs/heads/master | ios_notifications/admin.py | 1 | # -*- coding: utf-8 -*-
try:
from django.conf.urls import patterns, url
except ImportError: # deprecated since Django 1.4
from django.conf.urls.defaults import patterns, url
from django.contrib import admin
from ios_notifications.models import Device, Notification, APNService, FeedbackService
from ios_notifi... |
Alpistinho/FreeCAD | refs/heads/master | src/Tools/fcbt/DistBin.py | 31 |
# shell and operating system
import os,sys
#sys.path.append( "E:\\Develop\\Projekte\\FreeCADWin\\src\\Tools" )
import DistTools, FileTools
# line seperator
ls = os.linesep
# path seperator
ps = os.pathsep
# dir seperator
ds = os.sep
DistName = DistTools.BuildDistName()
DistBin = DistName + "_bi... |
megaumi/django | refs/heads/master | django/conf/locale/fy/formats.py | 852 | # -*- 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 =
# TIME_FORMAT =
# DATETIME_FORMA... |
BackupGGCode/python-for-android | refs/heads/master | python-modules/twisted/twisted/trial/test/packages.py | 62 | import sys, os
from twisted.trial import unittest
testModule = """
from twisted.trial import unittest
class FooTest(unittest.TestCase):
def testFoo(self):
pass
"""
dosModule = testModule.replace('\n', '\r\n')
testSample = """
'''This module is used by test_loader to test the Trial test loading
function... |
doduytrung/odoo-8.0 | refs/heads/master | addons/base_import/models.py | 90 | import csv
import itertools
import logging
import operator
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import psycopg2
from openerp.osv import orm, fields
from openerp.tools.translate import _
FIELDS_RECURSION_LIMIT = 2
ERROR_PREVIEW_BYTES = 200
_logger = logging.ge... |
Denisolt/IEEE-NYIT-MA | refs/heads/master | local/lib/python2.7/site-packages/django/db/backends/oracle/operations.py | 86 | from __future__ import unicode_literals
import datetime
import re
import uuid
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.backends.utils import truncate_name
from django.utils import six, timezone
from django.utils.encoding import force_bytes, ... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/pyasn1-0.4.6/pyasn1/type/tag.py | 15 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
from pyasn1 import error
__all__ = ['tagClassUniversal', 'tagClassApplication', 'tagClassContext',
'tagClassPrivate', 'tagFormatSimple', 'tagFormatCons... |
Lyleo/nupic | refs/heads/master | nupic/regions/ImageSensorFilters/Thicken.py | 15 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... |
aasoliz/Bitcoin-Statistics | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/upload.py | 210 | import getpass
from distutils.command import upload as orig
class upload(orig.upload):
"""
Override default upload behavior to obtain password
in a variety of different ways.
"""
def finalize_options(self):
orig.upload.finalize_options(self)
# Attempt to obtain password. Short cir... |
Tchanders/socorro | refs/heads/master | socorro/external/postgresql/fakedata.py | 7 | #!/usr/bin/python
#
# Generate fake data for Socorro.
#
# Products, versions, number of days to generate data for, etc. are
# configurable, and test data is randomized using configurable probability
# but deterministic (within reason.)
import datetime
import uuid
import random
import json
crash_ids = []
def date_ra... |
redhatrises/freeipa | refs/heads/master | ipaserver/install/__init__.py | 14 | # Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
# see inline
#
# Copyright (C) 2007 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ... |
rajsadho/django | refs/heads/master | django/contrib/messages/storage/fallback.py | 704 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
me... |
40223123/raven | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/unittest/test/_test_warnings.py | 858 | # helper module for test_runner.Test_TextTestRunner.test_warnings
"""
This module has a number of tests that raise different kinds of warnings.
When the tests are run, the warnings are caught and their messages are printed
to stdout. This module also accepts an arg that is then passed to
unittest.main to affect the b... |
Grirrane/odoo | refs/heads/master | addons/pad_project/__init__.py | 8 | # -*- 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... |
balloob/home-assistant | refs/heads/dev | tests/components/upnp/test_config_flow.py | 6 | """Test UPnP/IGD config flow."""
from datetime import timedelta
from homeassistant import config_entries, data_entry_flow
from homeassistant.components import ssdp
from homeassistant.components.upnp.const import (
CONFIG_ENTRY_SCAN_INTERVAL,
CONFIG_ENTRY_ST,
CONFIG_ENTRY_UDN,
DEFAULT_SCAN_INTERVAL,
... |
vipul-sharma20/oh-mainline | refs/heads/master | mysite/customs/migrations/0021_copy_tracker_model_data_across.py | 17 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Migrate BugzillaTracker to BugzillaTrackerModel
for bt in orm['customs.Bu... |
PolicyStat/django | refs/heads/master | django/contrib/gis/geos/coordseq.py | 105 | """
This module houses the GEOSCoordSeq object, which is used internally
by GEOSGeometry to house the actual coordinates of the Point,
LineString, and LinearRing geometries.
"""
from ctypes import c_double, c_uint, byref
from django.contrib.gis.geos.base import GEOSBase, numpy
from django.contrib.gis.geos.error impo... |
mdsitton/fofix | refs/heads/master | fofix/core/Mesh.py | 6 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
JawneySwagg/omaha | refs/heads/master | site_scons/site_tools/omaha_builders.py | 62 | #!/usr/bin/python2.4
#
# Copyright 2009 Google 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 o... |
ajitsonlion/namebench | refs/heads/master | nb_third_party/jinja2/visitor.py | 1401 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... |
vponomaryov/manila | refs/heads/master | manila/tests/fake_compute.py | 3 | # Copyright 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/licenses/LICENSE-2.0
#
# Unless requi... |
pierreg/tensorflow | refs/heads/master | tensorflow/python/tools/print_selective_registration_header_test.py | 18 | # 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... |
mcking49/apache-flask | refs/heads/master | Python/Lib/site-packages/pip/basecommand.py | 79 | """Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import os
import sys
import optparse
import warnings
from pip import cmdoptions
from pip.index import PackageFinder
from pip.locations import running_under_virtualenv
from pip.download import PipSession
from pip.excep... |
Lana-B/Pheno4T | refs/heads/master | madanalysis/enumeration/uncertainty_type.py | 1 | ################################################################################
#
# Copyright (C) 2012-2013 Eric Conte, Benjamin Fuks
# The MadAnalysis development team, email: <ma5team@iphc.cnrs.fr>
#
# This file is part of MadAnalysis 5.
# Official website: <https://launchpad.net/madanalysis5>
#
# MadAnal... |
shashankbassi92/tornado | refs/heads/master | tornado/locks.py | 73 | # Copyright 2015 The Tornado 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 applicable law or agreed to in w... |
saurabhmathur96/clickbait-detector | refs/heads/master | fetch.py | 2 | import requests
import tqdm
import time
BASE_URL = "https://www.reddit.com/r/savedyouaclick/top.json"
params = {
"sort": "top",
"t": "all",
"after": ""
}
headers = {
"User-agent": "clickbait-detector scraper v1.0"
}
titles = list()
with open("clickbait-top-reddit.txt", "w") as outfile:
for i in tqd... |
befelix/GPy | refs/heads/devel | GPy/examples/non_gaussian.py | 14 | # Copyright (c) 2014, Alan Saul
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import GPy
import numpy as np
from GPy.util import datasets
try:
import matplotlib.pyplot as plt
except:
pass
def student_t_approx(optimize=True, plot=True):
"""
Example of regressing with a student t likelihoo... |
SPKian/Testing | refs/heads/master | erpnext/hr/utils.py | 103 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def set_employee_name(doc):
if doc.employee and not doc.employee_name:
doc.employee_name = frappe.db.get_value("E... |
macks22/scikit-learn | refs/heads/master | examples/ensemble/plot_voting_decision_regions.py | 230 | """
==================================================
Plot the decision boundaries of a VotingClassifier
==================================================
Plot the decision boundaries of a `VotingClassifier` for
two features of the Iris dataset.
Plot the class probabilities of the first sample in a toy dataset
pred... |
hxddh/thefuck | refs/heads/master | tests/rules/test_django_south_merge.py | 16 | import pytest
from thefuck.rules.django_south_merge import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''Running migrations for app:
! Migration app:0003_auto... should not have been applied before app:0002_auto__add_field_query_due_date_ but was.
Traceback (most ... |
shangwuhencc/scikit-learn | refs/heads/master | sklearn/datasets/tests/test_20news.py | 280 | """Test the 20news downloader, if the data is available."""
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import SkipTest
from sklearn import datasets
def test_20news():
try:
data = dat... |
redhat-openstack/django | refs/heads/epel7-patches | tests/generic_inline_admin/admin.py | 150 | from __future__ import absolute_import
from django.contrib import admin
from django.contrib.contenttypes import generic
from .models import (Media, PhoneNumber, Episode, EpisodeExtra, Contact,
Category, EpisodePermanent, EpisodeMaxNum)
site = admin.AdminSite(name="admin")
class MediaInline(generic.GenericTabul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.