repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
SaleJumper/android-source-browsing.git-repo
refs/heads/master
subcmds/abandon.py
82
# # Copyright (C) 2008 The Android Open Source Project # # 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...
xinjiguaike/edx-platform
refs/heads/master
common/djangoapps/embargo/models.py
53
""" Models for embargoing visits to certain courses by IP address. WE'RE USING MIGRATIONS! If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py lms schemamigration embargo --...
monmonmon/eh
refs/heads/master
eh.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: set fileencoding=utf-8 # # E-H***** DOWNLOADER # # Usage: ./eh.py <PAGE URL> import os import os.path import re import sys import urllib import urllib2 import time import glob import random from optparse import OptionParser from pyquery import PyQuery as pq options...
tungvx/deploy
refs/heads/master
.google_appengine/lib/django_0_96/django/views/static.py
33
from django.template import loader from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified from django.template import Template, Context, TemplateDoesNotExist import mimetypes import os import posixpath import re import rfc822 import stat import urllib def serve(request, path, docu...
watchdogpolska/poradnia.siecobywatelska.pl
refs/heads/master
poradnia/users/tests.py
3
import json from atom.mixins import AdminTestCaseMixin from django.core import mail from django.test import RequestFactory from django.utils import timezone from guardian.shortcuts import assign_perm, get_perms from test_plus.test import TestCase from poradnia.cases.factories import CaseFactory from poradnia.cases.mo...
pombredanne/http-repo.gem5.org-gem5-
refs/heads/master
ext/ply/test/yacc_sr.py
174
# ----------------------------------------------------------------------------- # yacc_sr.py # # A grammar with shift-reduce conflicts # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.yacc as yacc from calclex import...
madflow/weblate
refs/heads/master
weblate/trans/util.py
4
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
chirilo/ephace12345
refs/heads/master
node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
542
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
unicef/un-partner-portal
refs/heads/develop
backend/unpp_api/apps/notification/admin.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from notification.models import Notification, NotifiedUser class NotificationAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'source') list_filter = ('source', ) class NotifiedUserAdmin(admin.ModelAdmin...
wkennington/rethinkdb
refs/heads/next
test/rql_test/connections/http_support/flask/__init__.py
425
# -*- coding: utf-8 -*- """ flask ~~~~~ A microframework based on Werkzeug. It's extensively documented and follows best practice patterns. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ __version__ = '0.10.1' # utilities we import from Werkzeug and...
0lidaxiang/WeArt
refs/heads/master
book/view/createBook.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- from django.http import JsonResponse from django.shortcuts import render import paramiko import sys import json import os import datetime import subprocess from django.conf import settings from git import Repo from book.models import book def createABook(request): contex...
matiasb/django
refs/heads/master
django/conf/locale/th/formats.py
575
# -*- 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 = 'j F Y' TIME_FORMAT = 'G:i' DATETI...
drpngx/tensorflow
refs/heads/master
tensorflow/python/ops/control_flow_ops.py
2
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Epirex/android_external_chromium_org
refs/heads/cm-11.0
tools/cr/cr/config.py
25
# 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. """Configuration variable management for the cr tool. This holds the classes that support the hierarchical variable management used in the cr tool to provid...
rvalyi/OpenUpgrade
refs/heads/master
addons/base_report_designer/plugin/openerp_report_designer/bin/script/modify.py
384
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
jimbobhickville/libcloud
refs/heads/trunk
libcloud/compute/drivers/voxel.py
58
# 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 ...
TNT-Samuel/Coding-Projects
refs/heads/master
DNS Server/Source - Copy/Lib/site-packages/dask/dataframe/io/parquet.py
2
from __future__ import absolute_import, division, print_function import re import copy import json import warnings import os from distutils.version import LooseVersion import numpy as np import pandas as pd from ..core import DataFrame, Series from ..utils import (clear_known_categories, strip_unknown_categories, ...
jmwenda/geonode
refs/heads/master
geonode/api/resourcebase_api.py
2
import re from django.db.models import Q from django.http import HttpResponse from django.conf import settings from tastypie.constants import ALL, ALL_WITH_RELATIONS from tastypie.resources import ModelResource from tastypie import fields from tastypie.utils import trailing_slash from guardian.shortcuts import get_ob...
pilotopirx/pirxconnect
refs/heads/master
python-twitter-master/twitter/doc/conf.py
6
# -*- coding: utf-8 -*- # # python-twitter documentation build configuration file, created by # sphinx-quickstart on Fri Aug 30 14:37:05 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
RudoCris/horizon
refs/heads/master
openstack_dashboard/dashboards/project/data_processing/clusters/panel.py
48
# 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 the...
aYukiSekiguchi/ACCESS-Chromium
refs/heads/master
third_party/mesa/MesaLib/src/mapi/glapi/gen-es/gl_parse_header.py
34
#!/usr/bin/python # # Copyright (C) 2009 Chia-I Wu <olv@0xlab.org> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, ...
jaafarbarek/pyrtos
refs/heads/master
micropython-1.5/tests/basics/for_return.py
117
# test returning from within a for loop def f(): for i in [1, 2, 3]: return i print(f())
mgit-at/ansible
refs/heads/devel
test/runner/lib/util.py
7
"""Miscellaneous utility functions and classes.""" from __future__ import absolute_import, print_function import atexit import contextlib import errno import fcntl import inspect import json import os import pipes import pkgutil import random import re import shutil import socket import stat import string import subp...
sbrown345/iod3js
refs/heads/es2
neo/openal/idal.py
63
#!/usr/bin/env python # create win32 source for OpenAL on-demand loading from AL API definitions # a set of defines al* -> idal* # typedefs and code pointer functions definition # 1: get linking with no OpenAL DLL link in anymore # i.e. have the defines and the code pointer working # 2: do the load code import time ...
tmenjo/cinder-2015.1.0
refs/heads/master
cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Foggalong/Animal-Crossing-Text-Adventure
refs/heads/master
modules/dev.py
2
#!/usr/bin/python3 # Module Information # ---------------------- # This module contains all the function which are used in # the development process. These will only be used in the # game until it's final beta then they will be removed ( # appart from the snapshot releases) def error(code, message): """The dev. er...
tatataufik/flask-security
refs/heads/develop
flask_security/forms.py
5
# -*- coding: utf-8 -*- """ flask.ext.security.forms ~~~~~~~~~~~~~~~~~~~~~~~~ Flask-Security forms module :copyright: (c) 2012 by Matt Wright. :license: MIT, see LICENSE for more details. """ import inspect from flask import request, current_app, flash from flask_wtf import Form as BaseForm from...
linkedin/dr-elephant
refs/heads/master
scripts/pso/restartable_pso.py
1
import collections import copy import inspyred from inspyred.ec import Bounder, Individual class restartable_pso(inspyred.ec.EvolutionaryComputation): """Represents a basic particle swarm optimization algorithm. This class is built upon the ``EvolutionaryComputation`` class making use of an external arc...
exv1p3r/PyScripts
refs/heads/master
NtpLib.py
1
#!/usr/bin/env python2 #-*- coding: utf-8 -*- import ntplib from time import ctime def print_time(): ntp_client = ntplib.NTPClient() response = ntp_client.request('pool.ntp.org') print ctime(response.tx_time) if __name__ == '__main__': print_time()
jpadilla/textract
refs/heads/master
tests/test_txt.py
3
import unittest import base class TxtTestCase(base.BaseParserTestCase, unittest.TestCase): extension = 'txt'
marchdf/dg1d
refs/heads/master
dg1d/dg.py
1
# ======================================================================== # # Imports # # ======================================================================== import numpy as np # ======================================================================== # # Function definitions # # ================================...
tokyo-jesus/tamactiluya
refs/heads/master
tamactiluya/views/user.py
3
# -*- coding: utf-8 -*- from flask import Blueprint, Response from flask import request, flash, render_template, redirect, url_for, current_app from flask_login import login_user, logout_user, current_user, fresh_login_required from tamactiluya import forms from tamactiluya.models import User mod = Blueprint('user'...
yangxiaohua1977/sound-linux-4.5.7
refs/heads/master
tools/perf/scripts/python/event_analyzing_sample.py
4719
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
ad-m/foundation-manager
refs/heads/master
foundation/cases/admin.py
13848
from django.contrib import admin # Register your models here.
sdague/home-assistant
refs/heads/dev
tests/components/dynalite/common.py
13
"""Common functions for tests.""" from homeassistant.components import dynalite from homeassistant.helpers import entity_registry from tests.async_mock import AsyncMock, Mock, call, patch from tests.common import MockConfigEntry ATTR_SERVICE = "service" ATTR_METHOD = "method" ATTR_ARGS = "args" def create_mock_devi...
Qalthos/ansible
refs/heads/devel
lib/ansible/modules/network/fortios/fortios_firewall_ipmacbinding_setting.py
24
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
k0001/mediasancion
refs/heads/master
mediasancion/api0/congreso/urls.py
1
# coding: utf-8 # MediaSanción, aplicación web para acceder a los datos públicos de la # actividad legislativa en Argentina. # Copyright (C) 2010,2011,2012 Renzo Carbonara <renzo @carbonara .com .ar> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General...
IceflowRE/MR-eBook-Downloader
refs/heads/master
unidown/static_data.py
1
""" Static and important data which is needed by the program and do not need any third party libraries. (this is important because it is used inside the setup.py **| do not edit**. """ #: name of this program NAME = "unidown" #: long name of this program LONG_NAME = "Universal Downloader" #: version in PEP440 format V...
XeCycle/indico
refs/heads/master
indico/core/db/sqlalchemy/util/queries.py
2
# This file is part of Indico. # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
seaotterman/tensorflow
refs/heads/master
tensorflow/contrib/tensorboard/__init__.py
189
# 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...
mysql/mysql-utilities
refs/heads/master
mysql-test/suite/replication/t/rpl_admin_gtid_loopbackIPv6.py
1
# # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. # # 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; version 2 of the License. # # This program is distributed in th...
shelper/pypeline
refs/heads/master
pypeline/impl/misc/__init__.py
2
# -*- coding: utf-8 -*- # below imports enables python 2 and 3 compatible codes # requires python-future, install by `pip install future` from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * """ this package contains standard functions for...
xcbat/vnpy
refs/heads/master
vnpy/data/shcifco/vnshcifco.py
4
# encoding: UTF-8 import requests HTTP_OK = 200 PERIOD_1MIN = '1m' PERIOD_5MIN = '5m' PERIOD_15MIN = '15m' PERIOD_60MIN = '60m' PERIOD_1DAY = '1d' ######################################################################## class ShcifcoApi(object): """数据接口""" #-----------------------------------------------...
CivicTechTO/open-cabinet
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py
853
try: from urllib.parse import urlencode except ImportError: from urllib import urlencode from .filepost import encode_multipart_formdata __all__ = ['RequestMethods'] class RequestMethods(object): """ Convenience mixin for classes who implement a :meth:`urlopen` method, such as :class:`~urllib3....
jortel/pulp_puppet
refs/heads/master
pulp_puppet_extensions_admin/pulp_puppet/extensions/admin/repo/units_display.py
8
""" Methods to handle the rendering of a unit list returned from either the copy or remove units commands. """ from gettext import gettext as _ from pulp_puppet.common.constants import TYPE_PUPPET_MODULE MODULE_ID_TEMPLATE = '%(author)s-%(name)s-%(version)s' def get_formatter_for_type(type_id): """ Return a...
r0h4n/commons
refs/heads/master
tendrl/commons/objects/cluster/atoms/configure_monitoring/__init__.py
1
import json import netifaces import socket import subprocess from tendrl.commons import objects from tendrl.commons.objects import AtomExecutionFailedError from tendrl.commons.utils import log_utils as logger from tendrl.commons.utils.service import Service NODE_PLUGINS = { 'collectd', 'cpu', 'mount_poi...
abenzbiria/clients_odoo
refs/heads/master
addons/l10n_be_coda/__openerp__.py
12
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
maheshakya/scikit-learn
refs/heads/master
examples/feature_stacker.py
246
""" ================================================= Concatenating multiple feature extraction methods ================================================= In many real-world examples, there are many ways to extract features from a dataset. Often it is beneficial to combine several methods to obtain good performance. Th...
GauravSahu/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py
384
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
wangjun/chendian
refs/heads/master
parser.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import codecs import ConfigParser import datetime import logging import os import re from StringIO import StringIO import sys __version__ = '0.3.0' encoding = sys.stdout.encoding or 'utf8' logger = l...
xiangel/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/tests/geoapp/test_regress.py
47
# -*- encoding: utf-8 -*- from __future__ import absolute_import, unicode_literals from datetime import datetime from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.tests.utils import no_mysql, no_spatialite from django.contrib.gis.shortcuts import render_to_kmz from django.contrib.gis.tests.utils im...
amyspark/mitsuba
refs/heads/add-license-and-readme
data/scons/detect_python.py
1
# Detect present Python & Boost-python libraries on Linux import os, struct class PkgConfig(dict): _paths = [ '/usr/lib/pkgconfig', '/usr/lib/%s-linux-gnu/pkgconfig' % (os.uname()[4]), '/usr/lib%i/pkgconfig' % (struct.calcsize('P')*8) ] def __init__(self, name): for path in...
rizumu/deploymachine
refs/heads/master
kokki-cookbooks/busket/metadata.py
2
__description__ = "Service monitoring" __config__ = { "busket.path": dict( description = "Install path for busket", default = "/usr/local/busket", ) }
mars-knowsnothing/amos-bot
refs/heads/master
src/Lib/encodings/ascii.py
858
""" Python 'ascii' Codec Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
mustafat/odoo-1
refs/heads/8.0
addons/project_timesheet/report/task_report.py
336
# -*- 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...
olemoudi/tweetdigest
refs/heads/master
tweepy/tweepy/models.py
13
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. from tweepy.error import TweepError from tweepy.utils import parse_datetime, parse_html_value, parse_a_href, \ parse_search_datetime, unescape_html class ResultSet(list): """A list like object that holds results from a Twitter API...
dulems/hue
refs/heads/master
desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0001_a.py
2088
from south.db import db from django.db import models class Migration: def forwards(self): pass def backwards(self): pass
imsparsh/python-for-android
refs/heads/master
python-modules/twisted/twisted/web/server.py
50
# -*- test-case-name: twisted.web.test.test_web -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ This is a web-server which integrates with the twisted.internet infrastructure. """ # System Imports import warnings import string import types import copy import os from urllib ...
Serg09/socorro
refs/heads/master
alembic/versions/4aacaea3eb48_adding_duration.py
14
"""Adding duration Revision ID: 4aacaea3eb48 Revises: 477e1c6e6df3 Create Date: 2013-11-07 11:33:42.125557 """ # revision identifiers, used by Alembic. revision = '4aacaea3eb48' down_revision = '477e1c6e6df3' from alembic import op from socorro.lib import citexttype, jsontype from socorro.lib.migrations import fix_...
zulip/django
refs/heads/master
tests/urlpatterns_reverse/included_named_urls.py
452
from django.conf.urls import include, url from .views import empty_view urlpatterns = [ url(r'^$', empty_view, name="named-url3"), url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url4"), url(r'^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$', empty_view), url(r'^included/', include('urlpatterns_reverse.inc...
tinkerinestudio/Tinkerine-Suite
refs/heads/master
TinkerineSuite/pypy/lib-python/2.7/lib2to3/tests/data/fixers/myfixes/fix_first.py
356
from lib2to3.fixer_base import BaseFix class FixFirst(BaseFix): run_order = 1 def match(self, node): return False
kawamon/hue
refs/heads/master
desktop/core/ext-py/boto-2.46.1/boto/manage/__init__.py
271
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
Dangetsu/vnr
refs/heads/master
Frameworks/Sakura/py/apps/downloader/__main__.py
1
# coding: utf8 # __main__.py # 10/5/2012 jichi # # Top-level root objects (root object = object that do not have parent) # - app.Application # - main.MainObject: Root of all non-widget qobject def print_help(): print """\ usage: python . location vid1 ... Launch the app. options: --debug Print debug output -...
JCBarahona/edX
refs/heads/master
lms/djangoapps/branding/tests/test_models.py
134
""" Tests for the Video Branding configuration. """ from django.test import TestCase from django.core.exceptions import ValidationError from nose.plugins.attrib import attr from branding.models import BrandingInfoConfig @attr('shard_1') class BrandingInfoConfigTest(TestCase): """ Test the BrandingInfoConfig ...
sh4t/Sick-Beard
refs/heads/development
bs4/tests/test_soup.py
272
# -*- coding: utf-8 -*- """Tests of Beautiful Soup as a whole.""" import logging import unittest import sys import tempfile from bs4 import ( BeautifulSoup, BeautifulStoneSoup, ) from bs4.element import ( CharsetMetaAttributeValue, ContentMetaAttributeValue, SoupStrainer, NamespacedAttribute, ...
gandrewstone/bitcoinxt
refs/heads/master
qa/rpc-tests/proxy_test.py
53
#!/usr/bin/env python2 # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import socket import traceback, sys from binascii import hexlify import time, os from test_framework.socks5 im...
jdelight/django
refs/heads/master
django/contrib/messages/storage/base.py
526
from __future__ import unicode_literals from django.conf import settings from django.contrib.messages import constants, utils from django.utils.encoding import force_text, python_2_unicode_compatible LEVEL_TAGS = utils.get_level_tags() @python_2_unicode_compatible class Message(object): """ Represents an ac...
robbiet480/home-assistant
refs/heads/dev
homeassistant/components/system_log/__init__.py
5
"""Support for system log.""" from collections import OrderedDict, deque import logging import re import traceback import voluptuous as vol from homeassistant import __path__ as HOMEASSISTANT_PATH from homeassistant.components.http import HomeAssistantView from homeassistant.const import EVENT_HOMEASSISTANT_STOP impo...
mwhudson/qemu
refs/heads/qemu-kvm-arches
scripts/tracetool/format/events_c.py
97
#!/usr/bin/env python # -*- coding: utf-8 -*- """ trace/generated-events.c """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi"...
dmitriy0611/django
refs/heads/master
tests/migrations2/test_migrations_2_first/0002_second.py
427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("migrations2", "0001_initial")] operations = [ migrations.CreateModel( "Bookstore", [ ("id", mode...
Broadcom/linux-rdma-nxt
refs/heads/master
Documentation/networking/cxacru-cf.py
14668
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
ptrompeter/data-structures
refs/heads/master
src/heap.py
1
# -*- coding: utf-8 -*-a class Heap(object): """Return.""" def __init__(self, values=[]): """Return.""" self.root = None self.size = 0 self.heapList = [None] for i in values: self.push(i) # def swap_down(self, root): # pass def pop(self): ...
frodrigo/navitia
refs/heads/dev
source/tyr/migrations/versions/1414da92b3ca_add_end_point_and_host.py
9
"""add end_points and hosts tables Revision ID: 1414da92b3ca Revises: 42185d6d93cb Create Date: 2015-04-20 11:49:17.783924 """ # revision identifiers, used by Alembic. revision = '1414da92b3ca' down_revision = '42185d6d93cb' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto gener...
smart-solution/christiana
refs/heads/master
christiana_custom/__openerp__.py
1
# -*- encoding: utf-8 -*- { "name" : "Christiana Customizations", "version" : "1.0", "author" : "Smart Solution", "description" : '''This module extends OpenERP for the needs of Boekbedrijf Christiana''', "website" : "http://", "category" : "product", "depends" : ["product","sale","account","warning","stock","ch...
drjova/zenodo
refs/heads/master
zenodo/modules/accessrequests/receivers.py
2
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
JohnReid/biopsy
refs/heads/master
Python/biopsy/analyse_remos/paths.py
1
# # Copyright John Reid 2007 # import biopsy.pssm_paths, biopsy.entrez try: paths = biopsy.pssm_paths.PssmPaths.get() except: import warnings warnings.warn('Could not get shortest protein paths between PSSMs') def shortest_paths( seq_1, seq_2, max_length ): "Yields the shortest protein interaction pa...
erikdejonge/youtube-dl
refs/heads/master
youtube_dl/extractor/reverbnation.py
64
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( qualities, str_or_none, ) class ReverbNationIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?reverbnation\.com/.*?/song/(?P<id>\d+).*?$' _TESTS = [{ 'url': 'http://www.reverbnation.com/alkilad...
raghavtan/youtube-dl
refs/heads/master
youtube_dl/extractor/playtvak.py
80
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_urlparse, compat_urllib_parse, ) from ..utils import ( ExtractorError, int_or_none, parse_iso8601, qualities, ) class PlaytvakIE(InfoExtractor): IE_DESC = 'Playtvak.cz, ...
campbe13/openhatch
refs/heads/master
vendor/packages/kombu/funtests/__init__.py
59
import os import sys sys.path.insert(0, os.pardir) sys.path.insert(0, os.getcwd())
Spriz/crud
refs/heads/master
docs/conf.py
5
# -*- coding: utf-8 -*- # # crud documentation build configuration file, created by # sphinx-quickstart on Tue Feb 18 16:24:32 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
40423143/2017springcd_hw
refs/heads/gh-pages
plugin/liquid_tags/soundcloud.py
273
""" Soundcloud Tag -------------- This implements a Liquid-style soundcloud tag for Pelican. It asks the official Soundcloud-API for the widget html code. Syntax ------ `{% soundcloud track_url %}` Example ------- `{% soundcloud https://soundcloud.com/luftmentsh/hakotel %}` Output ------ `<iframe width="100%" heigh...
chubbymaggie/pysmt
refs/heads/master
pysmt/environment.py
2
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
procamora/Testeador-de-Red
refs/heads/master
Complilar_Py2exe.py
1
#!/bin/env python # -*- coding: utf-8 -*- import os os.system('python.exe .\setup.py build')
newvem/pytz
refs/heads/master
pytz/zoneinfo/Asia/Dili.py
9
'''tzinfo timezone information for Asia/Dili.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Dili(DstTzInfo): '''Asia/Dili timezone definition. See datetime.tzinfo for details''' zone = 'Asia/Dili' _utc_transition_t...
aavanian/bokeh
refs/heads/master
bokeh/command/subcommands/html.py
5
''' To generate a standalone HTML page for a Bokeh application from a single Python script, pass the script name to ``bokeh html`` on the command line: .. code-block:: sh bokeh html app_script.py The generated HTML will be saved in the current working directory with the name ``app_script.html``. It is also poss...
aestrivex/mne-python
refs/heads/master
mne/tests/test_event.py
7
import os.path as op import os from nose.tools import assert_true, assert_raises import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal import warnings from mne import (read_events, write_events, make_fixed_length_events, find_events, pick_events, find_stim_steps, ...
krafczyk/spack
refs/heads/develop
var/spack/repos/builtin/packages/root/package.py
5
############################################################################## # Copyright (c) 2013-2018, 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...
ViennaRNA/forgi
refs/heads/master
forgi/threedee/classification/_training/__init__.py
1
""" Code used for training the classifiers in the parent folder. """
cecep-edu/edx-platform
refs/heads/eucalyptus.2
openedx/core/djangoapps/site_configuration/admin.py
22
""" Django admin page for Site Configuration models """ from django.contrib import admin from .models import ( SiteConfiguration, SiteConfigurationHistory, ) class SiteConfigurationAdmin(admin.ModelAdmin): """ Admin interface for the SiteConfiguration object. """ list_display = ('site', 'enab...
ASCrookes/django
refs/heads/master
tests/aggregation_regress/models.py
75
# -*- coding: utf-8 -*- from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Author(models.Mode...
PetrDlouhy/django
refs/heads/master
tests/migrations/test_autodetector.py
12
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AbstractBaseUser from django.db import connection, models from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.graph import MigrationGraph from django.db.migrations.loader import Migr...
bjko/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
117
# Copyright (c) 2009, 2010, 2011 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 reta...
surdy/dcos
refs/heads/master
release/storage/azure.py
11
from typing import Optional import azure.storage.blob import requests from retrying import retry from release.storage import AbstractStorageProvider class AzureBlockBlobStorageProvider(AbstractStorageProvider): name = 'azure' def __init__(self, account_name, account_key, container, download_url): a...
minhphung171093/GreenERP
refs/heads/master
openerp/addons/website_links/controller/main.py
47
# -*- coding: utf-8 -*- import werkzeug from openerp.addons.web import http from openerp.http import request class Website_Url(http.Controller): @http.route('/website_links/new', type='json', auth='user', methods=['POST']) def create_shorten_url(self, **post): if 'url' not in post or post['url'] == '...
CTSRD-SOAAP/chromium-42.0.2311.135
refs/heads/master
native_client_sdk/PRESUBMIT.py
36
# 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. """Top-level presubmit script for native_client_sdk. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the...
Alphadelta14/ansible
refs/heads/devel
lib/ansible/plugins/cache/memory.py
275
# (c) 2014, Brian Coca, Josh Drake, et al # # 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. ...
maestro-hybrid-cloud/heat
refs/heads/master
heat/tests/test_common_param_utils.py
16
# # 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 # ...
mccheung/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_xml_etree_c.py
80
# xml.etree test for cElementTree import sys, struct from test import support from test.support import import_fresh_module import types import unittest cET = import_fresh_module('xml.etree.ElementTree', fresh=['_elementtree']) cET_alias = import_fresh_module('xml.etree.cElementTree', ...
mtils/ems
refs/heads/master
ems/typehint.py
1
from __future__ import print_function from types import FunctionType, MethodType import inspect class _MethodDecoratorAdaptor(object): def __init__(self, decorator, func): self.decorator = decorator self.func = func def __call__(self, *args, **kwargs): f = self.decorator(self.func)(...
clar/gyp
refs/heads/master
test/msvs/filters/gyptest-filters-2008.py
166
#!/usr/bin/env python # Copyright (c) 2014 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. """ Verifies that extra filters are pruned correctly for Visual Studio 2008. """ import re import TestGyp def strip_ws(str): return r...