repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
ClearCorp-dev/odoo
refs/heads/8.0
addons/point_of_sale/__init__.py
378
# -*- 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...
runt18/nupic
refs/heads/master
examples/opf/experiments/anomaly/spatial/2fields_many_skewed/description.py
160
# ---------------------------------------------------------------------- # 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...
lemon-pi/linux-3.x
refs/heads/master
tools/perf/tests/attr.py
3174
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
StephenHamilton/gini
refs/heads/master
backend/src/gloader/xml/marshal/__init__.py
10
"""Converting Python objects to XML and back again. xml.marshal.generic Marshals simple Python data types into a custom XML format. The Marshaller and Unmarshaller classes can be subclassed in order to implement marshalling into a different XML DTD. xml.marshal.wddx Marshals Python data types into the WDDX D...
jeromecc/doctoctocbot
refs/heads/master
src/status/tests.py
35
from django.test import TestCase # Create your tests here.
pitch-sands/i-MPI
refs/heads/master
flask/Lib/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/structures.py
279
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
nightism/addressbook-level4
refs/heads/master
pandoc/latexfigure.py
4
#!/usr/bin/env python3 from panflute import * import re import bs4 """ Converts images represented in HTML blocks of <figure> <img src="..."> <figcaption>Figure caption</figcaption> </figure> into proper LaTeX figures. """ def latex_figure(elem, doc): if type(elem) != RawBlock or elem.format != 'html': r...
FocusTheOne/Qomolangma
refs/heads/master
Qomolangma/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/actions/src/subdir2/make-file.py
973
#!/usr/bin/env python # Copyright (c) 2009 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. import sys contents = "Hello from make-file.py\n" open(sys.argv[1], 'wb').write(contents)
smmribeiro/intellij-community
refs/heads/master
python/testData/resolve/multiFile/resolveQualifiedSuperClassInPackage/foo/baz.py
83
class SuperDuper(object): def copy(self): print "duper"
sammcveety/incubator-beam
refs/heads/master
sdks/python/apache_beam/examples/complete/autocomplete_test.py
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 "License"); you may not us...
Tong-Chen/scikit-learn
refs/heads/master
sklearn/datasets/california_housing.py
11
"""California housing dataset. The original database is available from StatLib http://lib.stat.cmu.edu/ The data contains 20,640 observations on 9 variables. References ---------- Pace, R. Kelley and Ronald Barry, Sparse Spatial Autoregressions, Statistics and Probability Letters, 33 (1997) 291-297. """ # Au...
CodeDJ/qt5-hidpi
refs/heads/master
qt/qtwebkit/Tools/QueueStatusServer/model/queues_unittest.py
123
# Copyright (C) 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 ...
kikong/electron
refs/heads/master
tools/coffee2c.py
5
#!/usr/bin/env python import os import subprocess import sys SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__)) def main(): natives = sys.argv[1] coffee_source_files = sys.argv[2:] output_dir = os.path.dirname(natives) js_source_files = compile_coffee(coffee_source_files, output_dir) call_js2c(nat...
santileortiz/Order-type-viewer
refs/heads/master
mkpy/pymk.py
1
# THIS IS NOT PYTHON CODE, it's BASH code installed into /usr/share/bash-completion/completions/ # to enable tab completions. _pymk() { local cur prev words cword _init_completion || return res="$(./pymk.py --get_completions "$COMP_POINT $COMP_LINE")" COMPREPLY=( $( compgen -W '$res' -- "$cur" ) ) ...
itsjeyd/edx-platform
refs/heads/master
common/djangoapps/util/memcache.py
251
""" This module provides a KEY_FUNCTION suitable for use with a memcache backend so that we can cache any keys, not just ones that memcache would ordinarily accept """ from django.utils.encoding import smart_str import hashlib import urllib def fasthash(string): """ Hashes `string` into a string representatio...
miludmann/trainstalker
refs/heads/master
trainstalker/sncfdata_rt/tests.py
24123
from django.test import TestCase # Create your tests here.
bfagundez/apex_paperboy
refs/heads/master
test/tooling_tests.py
1
#TO RUN: joey2 project_create_tests.py # OR TO RUN SPECIFIC METHODS: # joey2 -m unittest project_tests.TestProjectCreate.test_create_project_via_package_xml_file # joey2 -m unittest project_tests.TestProjectCreate.test_create_project_via_package_dict import sys import os import unittest import shutil import requests ...
lamdnhan/osf.io
refs/heads/master
website/addons/base/exceptions.py
23
""" Custom exceptions for add-ons. """ class AddonError(Exception): pass class HookError(AddonError): pass class AddonEnrichmentError(AddonError): @property def can_delete(self): return False @property def can_download(self): return False @property def renderable...
MihaiMoldovanu/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/os_keystone_endpoint.py
25
#!/usr/bin/python # Copyright: (c) 2017, VEXXHOST, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['pr...
quinot/ansible
refs/heads/devel
lib/ansible/plugins/connection/lxd.py
44
# (c) 2016 Matt Clay <matt@mystile.com> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ author: Matt Clay <matt@mystile.com> conne...
JulienMcJay/eclock
refs/heads/master
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/test/test_pywintypes.py
15
import sys import unittest import pywintypes import time from pywin32_testutil import str2bytes, ob2memory import datetime import operator class TestCase(unittest.TestCase): def testPyTimeFormat(self): struct_current = time.localtime() pytime_current = pywintypes.Time(struct_current) # try ...
tombstone/models
refs/heads/master
research/object_detection/builders/optimizer_builder.py
1
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
fengliu2014/audfprint
refs/heads/master
profile_audfprint.py
5
import audfprint import cProfile import pstats argv = ["audfprint", "new", "-d", "tmp.fpdb", "--density", "200", "Nine_Lives/01-Nine_Lives.mp3", "Nine_Lives/02-Falling_In_Love.mp3", "Nine_Lives/03-Hole_In_My_Soul.mp3", "Nine_Lives/04-Taste_Of_India.mp3", "Nine_Lives/05-Full_Circle.mp3", "Nine_Lives/06-Something_s_Gott...
alu042/edx-platform
refs/heads/master
lms/djangoapps/django_comment_client/tests/unicode.py
206
# coding=utf-8 class UnicodeTestMixin(object): def test_ascii(self): self._test_unicode_data(u"This post contains ASCII.") def test_latin_1(self): self._test_unicode_data(u"Thís pøst çòñtáins Lätin-1 tæxt") def test_CJK(self): self._test_unicode_data(u"イんノ丂 アo丂イ co刀イムノ刀丂 cフズ") ...
neiudemo1/django
refs/heads/master
django/contrib/admindocs/tests/test_fields.py
638
from __future__ import unicode_literals import unittest from django.contrib.admindocs import views from django.db import models from django.db.models import fields from django.utils.translation import ugettext as _ class CustomField(models.Field): description = "A custom field type" class DescriptionLackingFi...
germanponce/pos-addons
refs/heads/8.0
pos_multi_session/__init__.py
9
import pos_multi_session_models import controllers
mcloudv/fuel-ostf
refs/heads/master
fuel_health/tests/smoke/test_create_volume.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Mirantis, 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...
SteveHNH/ansible
refs/heads/devel
lib/ansible/modules/cloud/misc/rhevm.py
17
#!/usr/bin/python # (c) 2016, Timothy Vandenbrande <timothy.vandenbrande@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.1', ...
CodeJuan/scrapy
refs/heads/master
scrapy/http/response/text.py
21
""" This module implements the TextResponse class which adds encoding handling and discovering (through HTTP headers) to base Response class. See documentation in docs/topics/request-response.rst """ from six.moves.urllib.parse import urljoin from w3lib.encoding import html_to_unicode, resolve_encoding, \ html_b...
cryptobanana/ansible
refs/heads/devel
lib/ansible/modules/system/user.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Stephen Fromm <sfromm@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': ...
JunhwanPark/TizenRT
refs/heads/artik
external/iotivity/iotivity_1.3-rel/build_common/iotivityconfig/__init__.py
1
# ------------------------------------------------------------------------ # Copyright 2015 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/li...
Mortal/aiotkinter
refs/heads/master
aiotkinter/loop.py
1
import asyncio import tkinter class _TkinterSelector(asyncio.selectors._BaseSelectorImpl): def __init__(self): super().__init__() self._tk = tkinter.Tk(useTk=0) self._ready = [] def register(self, fileobj, events, data=None): key = super().register(fileobj, events, data) ...
mdhunter/twitter-to-wordcloud
refs/heads/master
twitter_to_corpus.py
1
#!/usr/bin/env python3 # Converts one or more Twitter archives into a combined corpus. This script # performs no filtering. # # Copyright 2016 Mathew Hunter import argparse import json import nltk import re import zipfile # Processes the referenced archives to produce a corpus def generate_corpus(archive_filenames...
LeoXu92/AppleSampleSpider
refs/heads/master
AppleSampleSpider.py
1
#coding: utf-8 import requests import json import sys import datetime import os from contextlib import closing def all_sample_code(): ''' library.json来源于https://developer.apple.com/library/content/navigation/library.json "columns": { "name" : 0, "id" : 1, "type" : 2...
Sorsly/subtle
refs/heads/master
google-cloud-sdk/lib/third_party/pygments/formatters/html.py
27
# -*- coding: utf-8 -*- """ pygments.formatters.html ~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for HTML output. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os import sys import StringIO from pygments.formatter import Formatter fr...
vileopratama/vitech
refs/heads/master
src/addons/mrp/report/bom_structure.py
15
## -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv from openerp.report import report_sxw class bom_structure(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(bom_structure, self).__init__(cr, uid, name, c...
paulrouget/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/pywebsocket/mod_pywebsocket/http_header_util.py
23
# Copyright 2011, 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...
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_3/tests/modeltests/model_inheritance/tests.py
51
from operator import attrgetter from django.core.exceptions import FieldError from django.test import TestCase from models import (Chef, CommonInfo, ItalianRestaurant, ParkingLot, Place, Post, Restaurant, Student, StudentWorker, Supplier, Worker, MixinModel) class ModelInheritanceTests(TestCase): def test_a...
ntymtsiv/tempest
refs/heads/master
tempest/api/object_storage/test_object_expiry.py
1
# Copyright 2012 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...
ISEAGE-ISU/cdc2-2015-www
refs/heads/master
cdc/tests.py
24123
from django.test import TestCase # Create your tests here.
40223150/2015cd_midterm
refs/heads/master
static/Brython3.1.0-20150301-090019/Lib/xml/dom/xmlbuilder.py
873
"""Implementation of the DOM Level 3 'LS-Load' feature.""" import copy import xml.dom from xml.dom.NodeFilter import NodeFilter __all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] class Options: """Features object that has variables set for each DOMBuilder feature. The DOMBuilder class uses a...
MrMC/mrmc
refs/heads/master
tools/EventClients/examples/python/example_mouse.py
262
#!/usr/bin/python # This is a simple example showing how you can send mouse movement # events to XBMC. # NOTE: Read the comments in 'example_button1.py' for a more detailed # explanation. import sys sys.path.append("../../lib/python") from xbmcclient import * from socket import * def main(): import time im...
Galexrt/zulip
refs/heads/master
zerver/migrations/0049_userprofile_pm_content_in_desktop_notifications.py
3
# -*- coding: utf-8 -*- from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0048_enter_sends_default_to_false'), ] operations = [ migrations.AddField( model_name='userprofile', name='pm_content_in_desktop_n...
MarcosCommunity/odoo
refs/heads/marcos-8.0
addons/l10n_in_hr_payroll/report/payment_advice_report.py
340
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
EricMuller/mywebmarks-backend
refs/heads/master
requirements/twisted/Twisted-17.1.0/src/twisted/internet/reactor.py
63
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The reactor is the Twisted event loop within Twisted, the loop which drives applications using Twisted. The reactor provides APIs for networking, threading, dispatching events, and more. The default reactor depends on the platform and will be...
zhujzhuo/openstack-trove
refs/heads/master
trove/tests/api/mgmt/instances_actions.py
4
# Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
Nekmo/django-categories
refs/heads/master
categories/south_migrations/0006_auto__add_categoryrelation.py
14
# encoding: 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 model 'CategoryRelation' db.create_table('categories_categoryrelation', ( ('id', self...
nopoolcoin/p2pool-mom
refs/heads/master
SOAPpy/Types.py
289
from __future__ import nested_scopes """ ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
chuckbasstan123/pyTorch_project
refs/heads/master
mnist_hogwild/train.py
1
import os import torch import torch.optim as optim import torch.nn.functional as F from torch.autograd import Variable from torchvision import datasets, transforms def train(rank, args, model): torch.manual_seed(args.seed + rank) for param in model.parameters(): # Break gradient sharing param.g...
Atheros1/PyBitmessage
refs/heads/master
src/bitmessageqt/newaddressdialog.py
19
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'newaddressdialog.ui' # # Created: Sun Sep 15 23:53:31 2013 # by: PyQt4 UI code generator 4.10.2 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exce...
jtattermusch/grpc
refs/heads/master
tools/run_tests/lb_interop_tests/gen_build_yaml.py
13
#!/usr/bin/env python2.7 # Copyright 2015 gRPC 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 la...
rchand31/django-haystack
refs/heads/master
haystack/__init__.py
3
import logging from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core import signals from haystack.constants import DEFAULT_ALIAS from haystack.utils import loading __author__ = 'Daniel Lindsley' __version__ = (2, 0, 0, 'alpha') __all__ = ['backend'] # Setup defaul...
anntzer/scikit-learn
refs/heads/main
examples/linear_model/plot_bayesian_ridge.py
43
""" ========================= Bayesian Ridge Regression ========================= Computes a Bayesian Ridge Regression on a synthetic dataset. See :ref:`bayesian_ridge_regression` for more information on the regressor. Compared to the OLS (ordinary least squares) estimator, the coefficient weights are slightly shift...
TsinghuaX/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/progress.py
127
''' Progress class for modules. Represents where a student is in a module. Useful things to know: - Use Progress.to_js_status_str() to convert a progress into a simple status string to pass to js. - Use Progress.to_js_detail_str() to convert a progress into a more detailed string to pass to js. In particular...
ipld/py-cid
refs/heads/master
cid/cid.py
1
# -*- coding: utf-8 -*- import base58 import multibase import multihash as mh from morphys import ensure_bytes, ensure_unicode import multicodec class BaseCID(object): __hash__ = object.__hash__ def __init__(self, version, codec, multihash): """ Creates a new CID object. This class should...
RPI-OPENEDX/edx-platform
refs/heads/RPI-DEV
openedx/core/djangoapps/credit/verification_access.py
105
""" Create in-course reverification access groups in a course. We model the rules as a set of user partitions, one for each verification checkpoint in a course. For example, suppose that a course has two verification checkpoints, one at midterm A and one at the midterm B. Then the user partitions would look like thi...
ppiotr/Bibedit-some-refactoring
refs/heads/bibedit-hp-change-to-field-with-many-instances
modules/websubmit/web/publiline.py
3
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 ## License, or (...
drmrd/ansible
refs/heads/devel
lib/ansible/plugins/terminal/asa.py
52
# # (c) 2016 Red Hat 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 # (at your option) any later version. # # Ansible is d...
xen0l/ansible
refs/heads/devel
lib/ansible/modules/cloud/amazon/ec2_customer_gateway_facts.py
33
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- module: ec2_cus...
mic4ael/indico
refs/heads/master
indico/migrations/versions/20180423_1602_66ecbb1c0ddd_add_natsort_function.py
7
"""Add natsort function Revision ID: 66ecbb1c0ddd Revises: 813ea74ce8dc Create Date: 2018-04-23 16:02:35.682560 """ from alembic import op from indico.core.db.sqlalchemy.custom.natsort import SQL_FUNCTION_NATSORT # revision identifiers, used by Alembic. revision = '66ecbb1c0ddd' down_revision = '813ea74ce8dc' bran...
adityamadhu20/Calculator
refs/heads/master
calculator_as_plugin/lib/calculator_as_plugin/utils/__init__.py
1
# from .testcase import TestCase, main
jpaugh/braille-converter
refs/heads/master
braille/tests/__init__.py
2
# Copyright 2012 Jonathan Paugh # See COPYING for license details from braille import convert, dots, util from braille.options import opt import unittest class BrTestCase(unittest.TestCase): ''' Super-test class. All tests of the actual text translated should be based on this class. The subclasses call super(sel...
MahdiZareie/VersionMonitoring
refs/heads/master
project/migrations/0004_auto_20160417_1737.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-17 17:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project', '0003_auto_20160417_1735'), ] operations = [ migrations.AlterField...
sunils34/buffer-django-nonrel
refs/heads/master
tests/modeltests/m2m_through/models.py
91
from django.db import models from datetime import datetime # M2M described on one of the models class Person(models.Model): name = models.CharField(max_length=128) class Meta: ordering = ('name',) def __unicode__(self): return self.name class Group(models.Model): name = models.CharFi...
sergei-maertens/django
refs/heads/master
tests/reverse_lookup/__init__.py
12133432
Aptitudetech/ERPNext
refs/heads/master
erpnext/accounts/report/asset_depreciation_ledger/__init__.py
12133432
siosio/intellij-community
refs/heads/master
python/testData/packaging/PyPackageUtil/CollectingPackageNamesIgnoresChildrenOfDirectoriesWithoutInitPy/project/pkg/__init__.py
12133432
sammyshj/gci
refs/heads/master
modules/ClimateDataPortal/DSL/Stringification.py
53
from . import * def Months__str__(month_filter): return "Months(%s)" % ( ", ".join( Months.sequence[month_number + 1] for month_number in month_filter.month_numbers ) ) Months.__str__ = Months__str__ def From__str__(from_date): original_args = [from_date.year] ...
anton-golubkov/Garland
refs/heads/master
src/ipf/ipfblock/__init__.py
1
#------------------------------------------------------------------------------- # Copyright (c) 2011 Anton Golubkov. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Lesser Public License v2.1 # which accompanies this distribution, and is available at #...
mumax/2
refs/heads/master
tests/delta.py
1
# -*- coding: utf-8 -*- from mumax2 import * from math import * eps = 1e-7 # number of cells Nx = 32 Ny = 32 Nz = 32 setgridsize(Nx, Ny, Nz) # physical size in meters sizeX = 32e-9 sizeY = 32e-9 sizeZ = 32e-9 setcellsize(sizeX/Nx, sizeY/Ny, sizeZ/Nz) load('micromagnetism') m = [[[[1.0]]], [[[1.0]]], [[[1.0]]]] s...
kinglyduck/hackerspace
refs/heads/master
src/badges/models.py
1
from datetime import time, date, datetime from django.contrib.auth.models import User from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.db.models import Max, Sum, Count from django.templatetags.static import static from django.utils import timezone ...
baroquebobcat/pants
refs/heads/master
src/python/pants/backend/jvm/subsystems/shader.py
1
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
Gadal/sympy
refs/heads/master
bin/coverage_doctest.py
83
#!/usr/bin/env python """ Program to test that all methods/functions have at least one example doctest. Also checks if docstrings are imported into Sphinx. For this to work, the Sphinx docs need to be built first. Use "cd doc; make html" to build the Sphinx docs. Usage: ./bin/coverage_doctest.py sympy/core or ./...
atuljain/odoo
refs/heads/master
addons/base_gengo/__openerp__.py
68
# -*- 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...
voidabhi/cricinfo
refs/heads/master
cricinfo/my_bot.py
1
#!/usr/bin/python import requests from bs4 import BeautifulSoup import xmltodict import click from ConfigParser import SafeConfigParser def get_config(key): """ Fetch config from config file """ parser = SafeConfigParser() parser.read('../.config') return parser.get(key) class Match(object): """ Represen...
JDShu/SCOPE
refs/heads/master
askbot/forms.py
1
"""Forms, custom form fields and related utility functions used in AskBot""" import re from django import forms from askbot import const from askbot.const import message_keys from django.forms.util import ErrorList from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_la...
mxOBS/deb-pkg_trusty_chromium-browser
refs/heads/master
tools/cygprofile/symbolize.py
9
#!/usr/bin/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. """Symbolize log file produced by cypgofile instrumentation. Given a log file and the binary being profiled (e.g. executable, shared libra...
pipsiscool/audacity
refs/heads/master
lib-src/lv2/serd/waflib/TaskGen.py
62
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import copy,re,os from waflib import Task,Utils,Logs,Errors,ConfigSet,Node feats=Utils.defaultdict(set) class task_gen(object): mappings={} prec=Utils.defaultdict(list) def...
ericdill/scikit-xray
refs/heads/master
skbeam/core/fitting/tests/test_lineshapes.py
7
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: Li Li (lili@bnl.g...
WendellDuncan/or-tools
refs/heads/master
examples/python/debruijn_binary.py
5
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 ...
cjmcgraw/xhtml2pdf
refs/heads/master
demo/tgpisa/tgpisa/json.py
180
# A JSON-based API(view) for your app. # Most rules would look like: # @jsonify.when("isinstance(obj, YourClass)") # def jsonify_yourclass(obj): # return [obj.val1, obj.val2] # @jsonify can convert your objects to following types: # lists, dicts, numbers and strings from turbojson.jsonify import jsonify
h-j-13/MyNote
refs/heads/master
Programming language/Python/File_IO/main_t.py
1
# encoding:utf-8 """ 基于faiss的海量高维域名相似度计算 多进程队列通信的异步获取 author : h-j-13 time : 2018-6-28 """ import time from multiprocessing import Process, Value, Queue import numpy import faiss import File_IO_new as File_IO # faiss相关设置 D = 300 K = 50 INDEX_STR = "OPQ20_80,IVF100,PQ20" TRAIN_FILE_SIZE = 2 # 文件I/O设置 INPUT...
ArtezGDA/Algorithmic-Nature
refs/heads/master
Luc/sketches & libs/supershape/supershape-example1.py
1
from math import sin, cos try: supershape = ximport("supershape") except: supershape = ximport("__init__") reload(supershape) speed(100) size(400, 400) def setup(): global x, y, w, h, m, n1, n2, n3, i x, y = 200, 200 w, h = 100, 100 m = 6.0 n1 = 1.0 n2 = 1.0 n3 = 1.0 ...
neumerance/cloudloon2
refs/heads/master
.venv/lib/python2.7/site-packages/yaml/cyaml.py
538
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): def __init__(...
marcoscastro/pygraph
refs/heads/master
tests/test4.py
1
#-*- coding:utf-8 -*- from pygraph import * graph = Graph() graph.add_edge(Edge(Node(0), Node(1))) graph.add_edge(Edge(Node(0), Node(2))) graph.add_edge(Edge(Node(1), Node(2))) graph.add_edge(Edge(Node(2), Node(0))) graph.add_edge(Edge(Node(2), Node(3))) graph.add_edge(Edge(Node(3), Node(3))) def run_test_directed(...
xu6148152/Binea_Python_Project
refs/heads/master
FluentPython/object_reference_mutability_recycling/weakref_test.py
1
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- import weakref a_set = {0, 1} wref = weakref.ref(a_set) print(wref) print(wref()) a_set = {2, 3, 4} print(wref()) print(wref() is None) print(wref() is None) class Cheese: def __init__(self, kind): self.kind = kind def __repr__(self): return...
mcoavoux/wiki_parse
refs/heads/master
word_count.py
1
#encoding:utf8 import os import os.path import bz2 import sys import argparse from joblib import Parallel, delayed from collections import defaultdict ID, FORM, LEMMA, CPOS, FPOS, MORPH, HEAD, REL, PHEAD, PREL=range(10) def get_conll_files(path): sys.stderr.write("Entering {}\n".format(path)) dirs = [] ...
murphy-wang/aws-ec2
refs/heads/master
lib/boto-2.34.0/boto/glacier/vault.py
153
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # Copyright (c) 2012 Robie Basak <robie@justgohome.co.uk> # # 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 Softw...
mancoast/CPythonPyc_test
refs/heads/master
fail/341_test_nis.py
88
from test import support import unittest import sys # Skip test if nis module does not exist. nis = support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error as msg: # NIS is probably not active, so this te...
britcey/ansible
refs/heads/devel
lib/ansible/modules/files/copy.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
Mause/pytransperth
refs/heads/master
docs/source/quickstart.py
1
import os import sys sys.path.insert( 0, os.path.join(os.path.dirname(__file__), '..', '..') ) # create the Location object you wish to resolve; from transperth.jp.location import ( Location, ResolvedLocation, determine_location ) from_location = Location.from_location('Curtin University, Perth')...
efortuna/AndroidSDKClone
refs/heads/master
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_types.py
113
# Python test set -- part 6, built-in types from test.test_support import run_unittest, have_unicode, run_with_locale, \ check_py3k_warnings import unittest import sys import locale class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is...
untitaker/mysteryshack
refs/heads/master
scripts/make_staticfiles.py
1
#!/usr/bin/python import mimetypes import os static_path = './src/static/' output_file = "./src/mysteryshack/web/staticfiles.rs" f = open(output_file, "w") def w(s=''): if s: f.write(s) f.write('\n') w("// Generated using scripts/make_static.py. Do NOT edit directly!") w() w('use router::Router;') ...
adrian/feed2me
refs/heads/master
fix_path.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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. ...
2014c2g23/2015cda-w17
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py
693
# # Support for the API of the multiprocessing package using threads # # multiprocessing/dummy/__init__.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
40223117cda/2015_w11
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
hgl888/blink-crosswalk-efl
refs/heads/efl/crosswalk-10/39.0.2171.19
Source/bindings/scripts/code_generator_v8.py
9
# Copyright (C) 2013 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 ...
ales-erjavec/scipy
refs/heads/master
scipy/optimize/tests/test__root.py
127
""" Unit tests for optimization routines from _root.py. """ from __future__ import division, print_function, absolute_import from numpy.testing import assert_ import numpy as np from scipy.optimize import root class TestRoot(object): def test_tol_parameter(self): # Check that the minimize() tol= argumen...
houseurmusic/my-swift
refs/heads/master
swift/__init__.py
4
import gettext class Version(object): def __init__(self, canonical_version, final): self.canonical_version = canonical_version self.final = final @property def pretty_version(self): if self.final: return self.canonical_version else: return '%s-dev' ...
abinashk-inf/AstroBox
refs/heads/master
src/astroprint/__init__.py
5
# coding=utf-8 __author__ = "Daniel Arroyo <daniel@astroprint.com>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'