repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jamiefolsom/edx-platform | refs/heads/master | openedx/core/djangoapps/course_groups/management/commands/tests/test_remove_users_from_multiple_cohorts.py | 91 | """
Tests for cleanup of users which are added in multiple cohorts of a course
"""
from django.core.exceptions import MultipleObjectsReturned
from django.core.management import call_command
from django.test.client import RequestFactory
from openedx.core.djangoapps.course_groups.views import cohort_handler
from openedx... |
fata1ex/django-statsy | refs/heads/master | tests/urls.py | 2 | # coding: utf-8
from django.conf.urls import url
from tests.views import ViewFabric
def get_test_urlpatterns():
url_list, urlpatterns = [], []
for idx, (view, _) in enumerate(ViewFabric()):
url_part = r'^test_view_{0}'.format(idx)
url_name = url_part.strip('^')
urlpatterns.append(ur... |
o5k/openerp-oemedical-v0.1 | refs/heads/master | openerp/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py | 53 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
k3nnyfr/s2a_fr-nsis | refs/heads/master | s2a/Python/Lib/distutils/extension.py | 250 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" command, so it mig... |
abhijeet9920/python_project | refs/heads/master | develop/lib/python3.4/site-packages/pip/_vendor/requests/certs.py | 516 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests.certs
~~~~~~~~~~~~~~
This module returns the preferred default CA certificate bundle.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
... |
hernad/frappe | refs/heads/develop | frappe/custom/doctype/property_setter/__init__.py | 1829 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
godiard/sugar | refs/heads/master | tests/extensions/cpsection/webaccount/services/mock/service.py | 12 | # Copyright (C) 2013, Walter Bender - Raul Gutierrez Segales
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This ... |
iglpdc/nipype | refs/heads/master | nipype/pipeline/plugins/oar.py | 3 | """Parallel workflow execution via OAR http://oar.imag.fr
"""
import os
import stat
from time import sleep
import subprocess
import json
from .base import (SGELikeBatchManagerBase, logger, iflogger, logging)
from nipype.interfaces.base import CommandLine
class OARPlugin(SGELikeBatchManagerBase):
"""Execute usi... |
ZobairAlijan/osf.io | refs/heads/develop | website/addons/forward/tests/test_models.py | 44 | # -*- coding: utf-8 -*-
from nose.tools import * # PEP8 asserts
from modularodm.exceptions import ValidationError
from tests.base import OsfTestCase
from website.addons.forward.tests.factories import ForwardSettingsFactory
class TestSettingsValidation(OsfTestCase):
def setUp(self):
super(TestSettings... |
JizhouZhang/SDR | refs/heads/master | gr-blocks/python/blocks/qa_hier_block2.py | 16 | #!/usr/bin/env python
from gnuradio import gr, gr_unittest, blocks
import numpy
class add_ff(gr.sync_block):
def __init__(self):
gr.sync_block.__init__(
self,
name = "add_ff",
in_sig = [numpy.float32, numpy.float32],
out_sig = [numpy.float32],
)
... |
SunnyRao/python3-webapp | refs/heads/master | www/markdown2.py | 59 | #!/usr/bin/env python
# Copyright (c) 2012 Trent Mick.
# Copyright (c) 2007-2008 ActiveState Corp.
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
from __future__ import generators
r"""A fast and complete Python implementation of Markdown.
[from http://daringfireball.net/projects/markdown/]
> Mar... |
aerickson/ansible | refs/heads/devel | lib/ansible/plugins/lookup/url.py | 26 | # (c) 2015, Brian Coca <[email protected]>
#
# 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.... |
fitermay/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/au/forms.py | 309 | """
Australian-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
PHONE_DIGITS_RE ... |
saguas/frappe | refs/heads/develop | frappe/email/doctype/bulk_email/__init__.py | 1829 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
vallsv/pyqtgraph | refs/heads/develop | pyqtgraph/graphicsItems/ButtonItem.py | 52 | from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
__all__ = ['ButtonItem']
class ButtonItem(GraphicsObject):
"""Button graphicsItem displaying an image."""
clicked = QtCore.Signal(object)
def __init__(self, imageFile=None, width=None, parentItem=None, pixmap=None):
... |
jougs/nest-simulator | refs/heads/master | pynest/nest/lib/hl_api_types.py | 1 | # -*- coding: utf-8 -*-
#
# hl_api_types.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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, o... |
rschnapka/odoo | refs/heads/7.0 | addons/sale_mrp/__init__.py | 445 | # -*- 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... |
saurabh6790/test_final_med_app | refs/heads/master | patches/june_2013/p02_update_project_completed.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
def execute():
webnotes.reload_doc("projects", "doctype", "project")
for p in webnotes.conn.sql_list("""select name from tabProject"""):
webnotes.bean("Project", p).mak... |
CompassionCH/bank-payment | refs/heads/10.0-payment-cancel | account_payment_partner/models/__init__.py | 1 | # -*- coding: utf-8 -*-
from . import res_partner
from . import account_invoice
from . import account_move_line
from . import account_payment_mode
|
AtsushiSakai/PythonRobotics | refs/heads/master | AerialNavigation/rocket_powered_landing/rocket_powered_landing.py | 1 | """
A rocket powered landing with successive convexification
author: Sven Niederberger
Atsushi Sakai
Ref:
- Python implementation of 'Successive Convexification for 6-DoF Mars Rocket Powered Landing with Free-Final-Time' paper
by Michael Szmuk and Behcet Acıkmese.
- EmbersArc/SuccessiveConvexificationFreeFi... |
semonte/intellij-community | refs/heads/master | python/testData/intentions/PyConvertMethodToPropertyIntentionTest/simple_after.py | 167 | class MyClass(object):
"""
My class to show intention.
"""
def __init__(self):
self._x = None
@property
def x(self):
return self._x
x = MyClass().x |
getlantern/lantern-java | refs/heads/master | install/linux_x86_64/pt/fteproxy/Crypto/Hash/RIPEMD.py | 124 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... |
patrickcurl/ztruck | refs/heads/master | dj/lib/python2.7/site-packages/localflavor/ch/ch_states.py | 17 | # -*- coding: utf-8 -*
from django.utils.translation import ugettext_lazy as _
#: An alphabetical list of states
STATE_CHOICES = (
('AG', _('Aargau')),
('AI', _('Appenzell Innerrhoden')),
('AR', _('Appenzell Ausserrhoden')),
('BS', _('Basel-Stadt')),
('BL', _('Basel-Land')),
('BE', _('Berne')),... |
mwpackage/mvp-loader | refs/heads/master | node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py | 260 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# By Yusuke Suzuki <[email protected]>
# Modified by Mathias Bynens <http://mathiasbynens.be/>
# http://code.google.com/p/esprima/issues/detail?id=110
import sys
import string
import re
class RegExpGenerator(object):
def __init__(self, detector):
self.detector = det... |
newville/scikit-image | refs/heads/master | skimage/transform/radon_transform.py | 1 | # -*- coding: utf-8 -*-
"""
radon.py - Radon and inverse radon transforms
Based on code of Justin K. Romberg
(http://www.clear.rice.edu/elec431/projects96/DSP/bpanalysis.html)
J. Gillam and Chris Griffin.
References:
-B.R. Ramesh, N. Srinivasa, K. Rajgopal, "An Algorithm for Computing
the Discrete Radon Trans... |
dpaleino/new-osm-stats | refs/heads/master | plot.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2010, David Paleino <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... |
henry-gobiernoabierto/geomoose | refs/heads/master | sphinx-docs/doc_config_js.py | 1 | #!/usr/bin/env python
#
# Convert geomoose/config.js into an RST document.
#
#
# Copyright (c) 2009-2014, Dan "Ducky" Little & GeoMOOSE.org
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software ... |
raccoongang/edx-platform | refs/heads/ginkgo-rg | lms/djangoapps/teams/models.py | 5 | """Django models related to teams functionality."""
from datetime import datetime
from uuid import uuid4
import pytz
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.dispatch import receiver
from django.utils.translation import ... |
tjsavage/djangononrel-starter | refs/heads/master | django/contrib/sessions/tests.py | 16 | import base64
from datetime import datetime, timedelta
import pickle
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DatabaseSession
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.session... |
sayoun/workalendar | refs/heads/master | workalendar/africa/south_africa.py | 1 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import timedelta, date
from workalendar.core import WesternCalendar
from workalendar.core import SUN, MON
from workalendar.core import ChristianMixin
class SouthAfrica(Wes... |
rfloca/MITK | refs/heads/master | Build/Tools/Python/renameClass.py | 4 | #!/usr/bin/python
# mitk c++ class rename script by Marco Nolden and Michael Mueller
#
# There are two ways to use this:
#
# 1. renameClass <dir> <oldClassName> <newClassName>
#
# 2. renameClass <dir> <csvFileOfClassNameReplaces>
#
#
# Always backup your code before using this! It has only been tested on a few case... |
Jgarcia-IAS/Fidelizacion_odoo | refs/heads/master | openerp/addons/l10n_pl/__openerp__.py | 277 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 - now Grzegorz Grzelak [email protected]
# All Rights Reserved
# $Id$
#
# This program is free software: you can redistrib... |
sudosurootdev/external_chromium_org | refs/heads/L5 | tools/auto_bisect/builder.py | 25 | # 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.
"""Classes and functions for building Chrome.
This includes functions for running commands to build, as well as
specific rules about which targets to build.... |
QLGu/django-oscar | refs/heads/master | src/oscar/management/commands/oscar_fork_statics.py | 32 | import logging
import os
import shutil
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
Copy Oscar's statics into local project so they can be used as a base for
styling a new site.
... |
ataylor32/django | refs/heads/master | django/contrib/postgres/forms/ranges.py | 393 | from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
from django import forms
from django.core import exceptions
from django.forms.widgets import MultiWidget
from django.utils.translation import ugettext_lazy as _
__all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField... |
googleapis/python-bigquery-storage | refs/heads/master | google/cloud/bigquery_storage_v1beta2/types/avro.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
350dotorg/Django | refs/heads/master | django/core/files/temp.py | 536 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... |
kkauffman/CourseWatcher | refs/heads/master | app/__init__.py | 1 | from threading import Thread
from celery import Celery
from flask import Flask, current_app
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.mail import Mail, Message
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
mail = Mail(app)
default_error = '<b>Opps, it appears something... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/homematic/notify.py | 14 | """Notification support for Homematic."""
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
import homeassistant.helpers.config_validation as cv
import homeassistant.helpers.template as template_helper
from .const import (
ATT... |
andreif/django | refs/heads/master | tests/forms_tests/models.py | 261 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
callable_default_counter = itertools.count()
def callab... |
kaiix/depot_tools | refs/heads/master | third_party/pylint/checkers/format.py | 59 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# This progr... |
Thraxis/pymedusa | refs/heads/master | lib/sqlalchemy/testing/__init__.py | 34 | # testing/__init__.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .warnings import assert_warnings
from . import config
from .exclusions i... |
axinging/chromium-crosswalk | refs/heads/master | tools/android/loading/prefetch_view.py | 10 | # Copyright 2016 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.
"""Models the effect of prefetching resources from a loading trace.
For example, this can be used to evaluate NoState Prefetch
(https://goo.gl/B3nRUR).
Whe... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/plugins/lookup/grafana_dashboard.py | 12 | # (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'... |
martinrotter/textilosaurus | refs/heads/master | src/libtextosaurus/3rd-party/scintilla-lt/scripts/Face.py | 4 | # Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson [email protected]
# Released to the public domain.
# Requires Python 2.5 or later
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if line.find("##") != -1:
line = line[:line.find("##")]
line = line.... |
I2Cvb/hyper_learn | refs/heads/master | src/sampling_strategy/data_base.py | 1 | """random thoughts - sampling_strategy, support code"""
import collections
import numpy as np
# from data_class_instance import *
# from i_data_model import *
DataClassInstance = collections.namedtuple('DataClassInstance', 'name color')
"""DataClassInstance defininition as a namedtuple to store data identifying
in... |
Permutatrix/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/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... |
sheep7/leopard-lavatory | refs/heads/master | leopard_lavatory/celery/celery_factory.py | 1 | from celery import Celery
def make_celery(app):
celery = Celery(
app.import_name,
backend=app.config['CELERY_RESULT_BACKEND'],
broker=app.config['CELERY_BROKER_URL']
)
celery.conf.update(app.config)
class ContextTask(celery.Task):
def __call__(self, *args, **kwargs):
... |
andreadean5/python-hpOneView | refs/heads/master | tests/unit/test_connection.py | 1 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2016) Hewlett Packard Enterprise Development LP
#
# 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 limitatio... |
levigross/pyscanner | refs/heads/master | mytests/django/contrib/gis/tests/geoapp/feeds.py | 308 | from __future__ import absolute_import
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
Yong-Lee/decode-Django | refs/heads/master | Django-1.5.1/tests/regressiontests/m2m_through_regress/__init__.py | 45382 | |
Mattze96/youtube-dl | refs/heads/master | youtube_dl/downloader/rtsp.py | 119 | from __future__ import unicode_literals
import os
import subprocess
from .common import FileDownloader
from ..utils import (
check_executable,
encodeFilename,
)
class RtspFD(FileDownloader):
def real_download(self, filename, info_dict):
url = info_dict['url']
self.report_destination(file... |
yaii/yai | refs/heads/alpha | share/extensions/grid_polar.py | 3 | #!/usr/bin/env python
'''
Copyright (C) 2007 John Beard [email protected]
##This extension allows you to draw a polar grid in Inkscape.
##There is a wide range of options including subdivision and labels.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General ... |
dstockwell/catapult | refs/heads/master | tracing/third_party/closure_linter/closure_linter/requireprovidesorter_test.py | 135 | #!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#... |
irwinlove/django | refs/heads/master | django/core/management/commands/test.py | 267 | import logging
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
help = 'Discover and run tests in the specified modules or the current directory.'
requires_system_checks = False
... |
jackkiej/SickRage | refs/heads/master | lib/tornado/platform/twisted.py | 16 | # Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... |
rombr/dev-hub-test-task | refs/heads/master | blog/admin.py | 1 | # -*- coding: utf-8 -*-
from django.contrib import admin
from models import Post, Subscribe
class PostAdmin(admin.ModelAdmin):
list_display = ('author', 'created', 'title',)
search_fields = ('title', 'body', )
class SubscribeAdmin(admin.ModelAdmin):
list_display = ('author', 'reader', 'date_joined',)
... |
lconceicao/son-cli | refs/heads/master | src/son/package/tests/test_unit_Packager.py | 5 | # Copyright (c) 2015 SONATA-NFV, UBIWHERE
# 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... |
SteveDiamond/cvxpy | refs/heads/master | examples/expr_trees/inpainting.py | 2 | """
Copyright 2013 Steven Diamond
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... |
AndreyPopovNew/asuswrt-merlin-rt-n | refs/heads/master | release/src/router/samba36/lib/testtools/testtools/tests/test_spinner.py | 20 | # Copyright (c) 2010 Jonathan M. Lange. See LICENSE for details.
"""Tests for the evil Twisted reactor-spinning we do."""
import os
import signal
from testtools import (
skipIf,
TestCase,
)
from testtools.helpers import try_import
from testtools.matchers import (
Equals,
Is,
MatchesException,... |
lextoumbourou/plugin.video.thenewboston | refs/heads/master | resources/lib/tnb.py | 1 | import requests
from BeautifulSoup import BeautifulSoup
from urlparse import urlparse
BASE_URL = 'https://www.thenewboston.com/videos.php'
def get_lesson_id(url):
return int(url.split('=')[-1])
def get_categories():
"""Scrape categories from homepage."""
page = requests.get(BASE_URL, verify=False)
... |
ucsd-ccbb/Oncolist | refs/heads/master | src/server/Pubmed/AuthorPrinter.py | 1 | __author__ = 'guorongxu'
import sys
import os
import json
#To build the JSON file for author and gene.
def output(output_file, author_list):
# Open a file
filewriter = open(output_file, "a")
for author in author_list:
filewriter.write(author + "\tAuthor\n")
filewriter.close()
## To
def prin... |
MoritzS/django | refs/heads/master | django/contrib/auth/migrations/0006_require_contenttypes_0002.py | 134 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('auth', '0005_alter_user_last_login_null'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
# Ensure the contenttypes migration is applied before sending
# post_m... |
hfp/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/solvers/python/__init__.py | 959 | # 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... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/third_party/blink/web_tests/external/wpt/mimesniff/mime-types/resources/generated-mime-types.py | 47 | import json
def isHTTPTokenCodePoint(cp):
if cp in (0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2A, 0x2B, 0x2D, 0x2E, 0x5E, 0x5F, 0x60, 0x7C, 0x7E) or (cp >= 0x30 and cp <= 0x39) or (cp >= 0x41 and cp <= 0x5A) or (cp >= 0x61 and cp <= 0x7A):
return True
else:
return False
def isHTTPQuotedStringToken... |
ozamiatin/glance | refs/heads/master | glance/api/v3/router.py | 9 | # Copyright (c) 2015 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 by applicable law or agreed to in writin... |
karan1276/servo | refs/heads/master | tests/wpt/css-tests/tools/serve/__init__.py | 458 | import serve
|
praekelt/molo | refs/heads/develop | molo/core/apps.py | 1 | from django.apps import AppConfig
from django.db.utils import OperationalError, ProgrammingError
from django.conf import settings
from django.utils.timezone import activate
import logging
class MoloAppConfig(AppConfig):
name = 'molo.core'
def ready(self):
from molo.core.models import Site, CmsSettin... |
cypsun/FreeCAD | refs/heads/master | src/Mod/Start/InitGui.py | 19 | # Start gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web... |
geekboxzone/lollipop_external_chromium_org | refs/heads/geekbox | chrome/browser/resources/chromeos/braille_ime/PRESUBMIT.py | 100 | # 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.
"""Presubmit script for the Braille IME."""
def CheckChangeOnUpload(input_api, output_api):
def FileFilter(path):
return path.endswith('.js') or path.... |
deepsrijit1105/edx-platform | refs/heads/master | common/test/acceptance/tests/lms/test_lms_matlab_problem.py | 4 | # -*- coding: utf-8 -*-
"""
Test for matlab problems
"""
import time
from common.test.acceptance.pages.lms.matlab_problem import MatlabProblemPage
from common.test.acceptance.fixtures.course import XBlockFixtureDesc
from common.test.acceptance.fixtures.xqueue import XQueueResponseFixture
from common.test.acceptance.te... |
a358003542/python-guide-book | refs/heads/master | codes/ch12/select_get_poetry.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import datetime
import argparse
import socket
import selectors
sel = selectors.DefaultSelector()
def parse_args():
usage = """usage: %prog [options] [hostname]:port ...
python3 select_get_poetry3.py port1 port2 port3 ...
通过select I/O复用来建立一个异步诗歌下载客户端,可以同时面向多个诗歌服... |
zerobatu/edx-platform | refs/heads/master | lms/djangoapps/open_ended_grading/open_ended_notifications.py | 66 | import datetime
import json
import logging
from django.conf import settings
from xmodule.open_ended_grading_classes import peer_grading_service
from xmodule.open_ended_grading_classes.controller_query_service import ControllerQueryService
from courseware.access import has_access
from edxmako.shortcuts import render_... |
gymnasium/edx-platform | refs/heads/open-release/hawthorn.master | lms/djangoapps/grades/models.py | 2 | """
Models used for robust grading.
Robust grading allows student scores to be saved per-subsection independent
of any changes that may occur to the course after the score is achieved.
We also persist students' course-level grades, and update them whenever
a student's score or the course grading policy changes. As the... |
rolandovillca/python_basic_concepts | refs/heads/master | modules/database_module/__init__.py | 4 | # The __init__.py files are required to make Python treat the directories as containing packages;
# this is done to prevent directories with a common name, such as string,
# from unintentionally hiding valid modules that occur later on the module search path.
# In the simplest case, __init__.py can just be an empty fil... |
hyowon/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_encoding.py | 445 | from __future__ import absolute_import, division, unicode_literals
import os
import unittest
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual = unittest.TestCase.assertEquals
from .support import get_data_files, TestData, test_dir, errorMessage
from html5lib import HTML... |
tornadomeet/mxnet | refs/heads/master | example/ssd/tools/rand_sampler.py | 55 | # 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 u... |
obreitwi/yccp | refs/heads/master | setup.py | 1 |
from setuptools import setup
import os
import os.path as osp
versionfile = osp.join(
osp.dirname(osp.abspath(__file__)), "yccp", "version.py")
with open(versionfile) as f:
code = compile(f.read(), versionfile, 'exec')
exec(code, globals(), locals())
setup(
name="yccp",
version=".".join(m... |
guillecura/tttsite | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/web.py | 197 | # -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import copy
from pygments.lexer import RegexLexer, ExtendedReg... |
ljgabc/lfs | refs/heads/master | usr/lib/python2.7/test/test_fnmatch.py | 130 | """Test cases for the fnmatch module."""
from test import test_support
import unittest
from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache
from fnmatch import fnmatch, fnmatchcase, _MAXCACHE, _cache, _purge
class FnmatchTestCase(unittest.TestCase):
def tearDown(self):
_purge()
def check_ma... |
WhySoGeeky/DroidPot | refs/heads/master | modules/monitor/system_call/system_call.py | 1 | import os, sys, shutil
from lib.common.commands.adb import Adb
from lib.common.abstract import Monitor
from yapsy.IPlugin import IPlugin
adb = Adb()
class system_call(Monitor, IPlugin):
def __init__(self):
super(system_call, self).__init__()
self.compatible_device = []
def prepare(self, para... |
Mellthas/quodlibet | refs/heads/master | quodlibet/tests/test_qltk__editutils.py | 4 | # 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.
from tests import TestCase
from quodlibet.formats import DUMMY_SONG
fr... |
vrpolak/slowsort | refs/heads/master | mutable_stable_lazy_zigzag_pairing_weak_heap.py | 1 | """Module that defines mutable stable zigzag pairing weak heap."""
from weakref import ref
from pep_3140 import Deque
from pep_3140 import List
from sorted_using_weak_heap import sorted_using_mutable_stable_weak_heap
from mutable_priority_weak_queue import MutablePriorityWeakQueue
def _ref_or_none(item):
"""Ret... |
helldorado/ansible | refs/heads/devel | hacking/create_deprecated_issues.py | 17 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2017, Matt Martz <[email protected]>
#
# 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 Licens... |
byndcivilization/toy-infrastructure | refs/heads/master | flask-app/venv/lib/python3.6/site-packages/pip/_vendor/distro.py | 330 | # Copyright 2015,2016 Nir Cohen
#
# 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, s... |
ycsoft/FatCat-Server | refs/heads/master | LIBS/boost_1_58_0/libs/python/test/callbacks.py | 12 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from callbacks_ext import *
>>> def double(x):
... return x + x
...
>>> apply_int_int(double, 42)
84
>>> apply_v... |
blueshaedow/Polarbear | refs/heads/master | firmware/tmk_core/tool/mbed/mbed-sdk/workspace_tools/host_tests/udpecho_server.py | 52 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... |
esikachev/scenario | refs/heads/test_cases | sahara/plugins/hdp/versions/version_2_0_6/edp_engine.py | 8 | # Copyright (c) 2014 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 by applicable law or agreed to in writ... |
jbenden/ansible | refs/heads/devel | lib/ansible/modules/remote_management/foreman/katello.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Eric D Helms <[email protected]>
# 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.0',
... |
carmark/vbox | refs/heads/master | src/VBox/GuestHost/OpenGL/util/debug_opcodes.py | 22 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys;
import cPickle;
import string;
import re;
import apiutil
apiutil.CopyrightC()
print """
#include "cr_debugopcodes.h"
#include <stdio.h>
"""
print """void crDebu... |
nitely/http-lazy-headers | refs/heads/master | http_lazy_headers/shared/common/__init__.py | 803 | # -*- coding: utf-8 -*-
|
a-x-/httpie | refs/heads/master | httpie/compat.py | 46 | """
Python 2.6, 2.7, and 3.x compatibility.
"""
import sys
is_py2 = sys.version_info[0] == 2
is_py26 = sys.version_info[:2] == (2, 6)
is_py27 = sys.version_info[:2] == (2, 7)
is_py3 = sys.version_info[0] == 3
is_pypy = 'pypy' in sys.version.lower()
is_windows = 'win32' in str(sys.platform).lower()
if is_py2:
b... |
sungkim11/mhargadh | refs/heads/master | django/contrib/gis/gdal/tests/test_geom.py | 154 | from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
GDAL_VERSION
from django.utils import unittest
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests th... |
PaulAYoung/f2014_iolab | refs/heads/master | pymongoProject/venv/lib/python2.7/site-packages/flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py | 629 | from flask import Module, render_template
admin = Module(__name__, url_prefix='/admin')
@admin.route('/')
def index():
return render_template('admin/index.html')
@admin.route('/index2')
def index2():
return render_template('./admin/index.html')
|
vladmm/intellij-community | refs/heads/master | python/testData/inspections/PyProtectedMemberInspection/truePositive.py | 75 | __author__ = 'ktisha'
class A:
def __init__(self):
self._a = 1
def foo(self):
self.b= 1
print <weak_warning descr="Access to a protected member _a of a class">A()._a</weak_warning> |
zhouyao1994/incubator-superset | refs/heads/master | superset/connectors/sqla/__init__.py | 7 | # 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 u... |
Malthus/script.revolve.helper | refs/heads/master | resources/populatesubmenufromskinvariables.py | 1 | # * Function: Revolve/PopulateSubmenuFromSkinVariables
import sys
import xbmc
import baselibrary
import xbmclibrary
FUNCTIONNAME = 'Revolve/PopulateSubmenuFromSkinVariables'
DEFAULTTARGETMASK = 'MySubmenu%02dOption'
DEFAULTTARGETWINDOW = '0'
TOTALITEMS = 20
def copyProperties(sourcemask, targetmask, targetwindow):... |
yongxin1029/pywinauto | refs/heads/master | examples/notepad_item.py | 19 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at you... |
JetBrains/intellij-community | refs/heads/master | python/testData/formatter/blankLineBeforeFunction_after.py | 79 | class C:
x = 1
def foo(self): pass
|
credativUK/OCB | refs/heads/7.0-local | addons/sale/wizard/sale_line_invoice.py | 14 | # -*- 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.