repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tmm1/home-assistant | refs/heads/dev | homeassistant/components/device_sun_light_trigger.py | 17 | """
homeassistant.components.device_sun_light_trigger
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to turn on lights based on
the state of the sun and devices.
"""
import logging
from datetime import timedelta
from homeassistant.helpers.event import track_point_in_time, track_state_change
... |
rosenbrockc/dft | refs/heads/master | pydft/msg.py | 7 | """This module handles writing to the terminal or a log file with support
for coloring for warnings, errors, etc."""
from __future__ import print_function
from termcolor import cprint
verbosity = None
"""The verbosity level of messages being printed by the module."""
quiet = None
"""When in quiet mode, no text is ever ... |
pombredanne/SmartNotes | refs/heads/master | appengine_django/db/__init__.py | 68 | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
multidadosti-erp/multidadosti-addons | refs/heads/develop | calendar_event_timesheet/tests/__init__.py | 1 | from . import test_calendar_event_finish
|
endlessm/chromium-browser | refs/heads/master | ui/gfx/x/gen_xproto.py | 1 | # Copyright 2020 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.
# This script generates header/source files with C++ language bindings
# for the X11 protocol and its extensions. The protocol information
# is obtained fro... |
luo66/scikit-learn | refs/heads/master | sklearn/decomposition/kernel_pca.py | 207 | """Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from ..utils.arpack import eigsh
from ..utils.validation import check_is_fitted, NotFittedError
from ..base import BaseEstimator, TransformerMixin
from ..pre... |
lahosken/pants | refs/heads/master | contrib/scalajs/src/python/pants/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
Solinea/horizon | refs/heads/master | openstack_dashboard/dashboards/project/network_topology/views.py | 22 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
wikiteams/github-gender-studies | refs/heads/master | sources/namsor/unique.py | 3 | class NamesCollection:
#Define some static variables here
names = dict()
@classmethod
def init(self):
raise Exception('Don\'t create instances of NamesCollection')
return self
|
janrinze/snowballkernel | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
allotria/intellij-community | refs/heads/master | python/testData/resolve/multiFile/nestedPackageElement/foo/bar.py | 83 | def baz(): pass |
synconics/odoo | refs/heads/8.0 | addons/website_forum_doc/__init__.py | 598 | # -*- coding: utf-8 -*-
import controllers
import models
|
Voluntarynet/BitmessageKit | refs/heads/master | BitmessageKit/Vendor/static-python/Lib/test/test_ftplib.py | 1 | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import StringIO
import errno
import os
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase
from test import t... |
Shao-Feng/crosswalk-test-suite | refs/heads/master | apptools/apptools-android-tests/inst.apk.py | 49 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
PKG_NAME_DIR = os.path.basename(SCRIPT_DIR)
PKG_NAME = PKG_NAME_DIR.replace('-', '_')
ADB_CMD = "... |
jusdng/odoo | refs/heads/8.0 | addons/stock_dropshipping/tests/test_invoicing.py | 257 | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... |
aaniin/AliPhysics | refs/heads/dev | PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/TriggerPatchTHnSparse.py | 41 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... |
alxgu/ansible | refs/heads/devel | lib/ansible/modules/network/aci/mso_schema_template_contract_filter.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.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_ve... |
JohnKossa/pyNES | refs/heads/0.1.x | pynes/examples/slides.py | 28 | import pynes
from pynes.bitbag import *
palette = [
0x22,0x29, 0x1A,0x0F, 0x22,0x36,0x17,0x0F, 0x22,0x30,0x21,0x0F, 0x22,0x27,0x17,0x0F,
0x22,0x16,0x27,0x18, 0x22,0x1A,0x30,0x27, 0x22,0x16,0x30,0x27, 0x22,0x0F,0x36,0x17]
chr_asset = import_chr('mario.chr')
title = "pyNES"
subtitle = "Python Programmi... |
mlperf/inference_results_v0.7 | refs/heads/master | closed/Inspur/code/ssd-mobilenet/tensorrt/infer.py | 12 | #! /usr/bin/env python3
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/ship/crafted/shields/adv_deflector_shields.py | 85615 | import sys
def setup(core, object):
return |
t794104/ansible | refs/heads/devel | lib/ansible/modules/remote_management/manageiq/manageiq_group.py | 14 | #!/usr/bin/python
#
# (c) 2018, Evert Mulder <evertmulder@gmail.com> (base on manageiq_user.py by Daniel Korn <korndaniel1@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 So... |
systemovich/scrapy | refs/heads/master | scrapy/item.py | 12 | """
Scrapy Item
See documentation in docs/topics/item.rst
"""
from pprint import pformat
from UserDict import DictMixin
from scrapy.utils.trackref import object_ref
class BaseItem(object_ref):
"""Base class for all scraped items."""
pass
class Field(dict):
"""Container of field metadata"""
class It... |
Hawt-Lava/Charizard | refs/heads/master | tests/repository/__init__.py | 2 | """Handles interactions with the models"""
|
allenlavoie/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/segment_reduction_ops_test.py | 3 | # 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... |
shermanng10/superathletebuilder | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/flatpages/apps.py | 590 | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class FlatPagesConfig(AppConfig):
name = 'django.contrib.flatpages'
verbose_name = _("Flat Pages")
|
EntilZha/leaderboard | refs/heads/master | leaderboard/models.py | 1 |
from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.dispatch import receiver
from pytz import timezone
from scoring.abstract import get_class
COMPETITION_L... |
fp7-netide/Usecases | refs/heads/master | Usecase1/pyretic/Application/Firewall.py | 1 | #!/usr/bin/python
"""
Copyright (c) 2014, NetIDE Consortium (Create-Net (CN), Telefonica Investigacion Y Desarrollo SA (TID), Fujitsu
Technology Solutions GmbH (FTS), Thales Communications & Security SAS (THALES), Fundacion Imdea Networks (IMDEA),
Universitaet Paderborn (UPB), Intel Research & Innovation Ireland ... |
kynikos/wiki-scripts | refs/heads/master | ws/db/migrations/versions/5824cd5ed16d_remove_rc_ip.py | 2 | """remove rc_ip
Revision ID: 5824cd5ed16d
Revises: 11180a291e2c
Create Date: 2017-12-28 13:45:08.716463
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5824cd5ed16d'
down_revision = '11180a291e2c'
branch_labels = None
depends_on = None
def upgrade():
# #... |
sreecha/grpc | refs/heads/master | tools/profiling/bloat/bloat_diff.py | 5 | #!/usr/bin/env python2.7
#
# Copyright 2017 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 ... |
rvalyi/l10n-brazil | refs/heads/8.0 | setup/l10n_br_account_product_service/odoo_addons/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
watermelo/libcloud | refs/heads/trunk | libcloud/test/loadbalancer/test_brightbox.py | 46 | # 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 ... |
saradbowman/osf.io | refs/heads/develop | osf/migrations/0125_merge_20180824_1856.py | 14 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-24 18:56
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0124_merge_20180816_1229'),
('osf', '0121_remove_waffle_flags'),
]
operatio... |
smallsilver/linux | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
ericlink/adms-server | refs/heads/master | playframework-dist/play-1.1/python/Lib/msilib/sequence.py | 26 | AdminExecuteSequence = [
(u'InstallInitialize', None, 1500),
(u'InstallFinalize', None, 6600),
(u'InstallFiles', None, 4000),
(u'InstallAdminPackage', None, 3900),
(u'FileCost', None, 900),
(u'CostInitialize', None, 800),
(u'CostFinalize', None, 1000),
(u'InstallValidate', None, 1400),
]
AdminUISequence = [... |
hi-ogawa/hiogawa-blog-ghost | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/terminal256.py | 362 | # -*- coding: utf-8 -*-
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfg... |
avadacatavra/servo | refs/heads/master | tests/wpt/mozilla/tests/webgl/conformance-2.0.0/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py | 51 | #!/usr/bin/env python
# Copyright (c) 2016 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and/or associated documentation files (the
# "Materials"), to deal in the Materials without restriction, including
# without limitation the rights to use... |
radremedy/radremedy | refs/heads/master | remedy/rad/__init__.py | 3 | __author__ = 'wil'
|
JonathanStein/odoo | refs/heads/8.0 | addons/account_budget/__init__.py | 444 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
zonemercy/Kaggle | refs/heads/master | quora/solution/text_clean.py | 1 | import re
def abbr_clean(train):
#https://www.kaggle.com/life2short/data-processing-replace-abbreviation-of-word
punctuation='["\'?,\.]' # I will replace all these punctuation with ''
abbr_dict={
"what's":"what is",
"what're":"what are",
"who's":"who is",
"who're":"who are",... |
girving/tensorflow | refs/heads/master | tensorflow/python/keras/optimizer_v2/adagrad_test.py | 1 | # 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... |
Snifer/BurpSuite-Plugins | refs/heads/master | Sqlmap/lib/request/templates.py | 7 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
from lib.core.data import kb
from lib.request.connect import Connect as Request
def getPageTemplate(payload, place):
retVal = (kb.originalPage, kb.errorIsNone)
if pa... |
ctalbert/mozharness | refs/heads/master | mozharness/base/python.py | 1 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
'''Python usage, esp. virtualenv.... |
comesx4/twiproxy | refs/heads/master | client/client.py | 1 | from twisted.internet.protocol import ClientCreator, Protocol, Factory, ClientFactory
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
import sys, time, os, json, thread
from twisted.internet.tcp import Client
PORT = 1234
HOST = '192.168.100.24'
messages = []
class MessageQueue:
... |
TeamEpsilon/linux-3.8 | 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... |
janusnic/dj-21v | refs/heads/master | unit_11/mysite/home/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
awkspace/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/pip.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Matt Wright <matt@nobien.net>
# 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.... |
stephen144/odoo | refs/heads/9.0 | openerp/addons/base/ir/ir_autovacuum.py | 37 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from openerp import models
_logger = logging.getLogger(__name__)
class AutoVacuum(models.TransientModel):
""" Expose the vacuum method to the cron jobs mechanism. """
_name = 'ir.autovacuum'
... |
wrm2ja/GCParser | refs/heads/master | optimize.py | 3 | import sys
import re
if sys.argv[1] == "-":
file = sys.stdin
else:
file = open( sys.argv[1], 'r' )
valid = set()
int_re = re.compile("^-?[0-9]")
for line in file.xreadlines():
args = line.split()
if len(args) == 0:
continue
if args[0] == ".output":
valid.add( args[1] )
if arg... |
bartlwojcik/bartlwojcik.github.io | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... |
MartijnBraam/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/userscript/allocine.py | 81 | import traceback
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
log = CPLog(__name__)
autoload = 'AlloCine'
class AlloCine(UserscriptBase):
includes = ['http://www.allocine.fr/film/*']
def getMovie(self, url):
if not '... |
b-dollery/testing | refs/heads/devel | lib/ansible/module_utils/splitter.py | 372 | # (c) 2014 James Cammarata, <jcammarata@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... |
sda2b/youtube-dl | refs/heads/master | youtube_dl/extractor/mooshare.py | 128 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
)
from ..utils import (
ExtractorError,
)
class MooshareIE(InfoExtractor):
IE_NAME = 'mooshare'
IE_DESC = 'Mooshare.biz'
_VALID_URL = r'http:... |
dkodnik/arp | refs/heads/master | addons/auth_signup/res_users.py | 2 | # -*- 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 o... |
agry/NGECore2 | refs/heads/master | scripts/object/weapon/ranged/pistol/pistol_avatar_trando_special.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/static/structure/naboo/gungan_pillar_damaged_s01.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/azure_cabal_ms_trainer_f_01.py | 85615 | import sys
def setup(core, object):
return |
ericdill/bokeh | refs/heads/master | bokeh/tests/test_properties.py | 16 | from __future__ import absolute_import
import unittest
import numpy as np
from bokeh.properties import (
HasProps, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String,
Regex, List, Dict, Tuple, Array, Instance, Any, Interval, Either,
Enum, Color, Align, DashPattern, Size, Percent, Angle)
class Basic... |
yuewu001/sol | refs/heads/master | exp_mp/run_util.py | 4 | #This script is some utilities to run experiment automatically
#to test the performance of the algorithm
import sys
import os
import re
import exe_path
import platform
exe_name = exe_path.SOL_exe_name
def create_dir(name):
# windows
if platform.system() == 'Windows':
os.system('mkdir %s' %name)
... |
ctrlaltdel/neutrinator | refs/heads/master | vendor/pbr/find_package.py | 101 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... |
Zeacone/WeRoBot | refs/heads/develop | werobot/tests/test_parser.py | 13 | from werobot.parser import parse_user_msg
from werobot.utils import to_text
def test_none_message():
assert not parse_user_msg("")
def test_text_message():
message = parse_user_msg("""
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
... |
mattrobenolt/django | refs/heads/master | tests/flatpages_tests/test_views.py | 290 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... |
ujjwalwahi/odoo | refs/heads/8.0 | addons/delivery/__init__.py | 376 | # -*- 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... |
brijeshkesariya/odoo | refs/heads/8.0 | addons/website_blog/tests/__init__.py | 325 | # -*- coding: utf-8 -*-
from openerp.addons.website_blog.tests import test_ui
from openerp.addons.website_blog.tests import test_website_blog_flow
|
chengjf/database-interface-doc-management | refs/heads/master | flask-demo/flask/Lib/site-packages/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.... |
deanishe/alfred-fakeum | refs/heads/master | src/libs/faker/providers/profile/en_US/__init__.py | 22 | from .. import Provider as ProfileProvider
class Provider(ProfileProvider):
pass
|
rgerkin/neuroConstruct | refs/heads/master | pythonNeuroML/PyNNUtils/PyNNUtils.py | 5 | #
#
# A class to assist loading NetworkML networks into PyNN supporting simulators
#
# Author: Padraig Gleeson
#
# This file has been developed as part of the neuroConstruct project
# This work has been funded by the Medical Research Council and the Wellcome Trust
#
#
import sys
import os
import logging
from N... |
xmnlab/AlertaDengue | refs/heads/master | AlertaDengue/gis/management/commands/generate_meteorological_raster_cities.py | 3 | from django.core.management.base import BaseCommand
# local
from datetime import datetime
# local
from ... import geotiff
from ...settings import RASTER_METEROLOGICAL_DATA_RANGE, DEBUG
import os
class Command(BaseCommand):
help = 'Generate map files'
def generate_meteorological_cities_raster(self, date_sta... |
google/llvm-propeller | refs/heads/bb-clusters | lldb/test/API/python_api/default-constructor/sb_address.py | 15 | """
Fuzz tests an object after the default construction to make sure it does not crash lldb.
"""
import sys
import lldb
def fuzz_obj(obj):
obj.GetFileAddress()
obj.GetLoadAddress(lldb.SBTarget())
obj.SetLoadAddress(0xffff, lldb.SBTarget())
obj.OffsetAddress(sys.maxsize)
obj.GetDescription(lldb.SB... |
riseofthetigers/letsencrypt | refs/heads/master | letsencrypt-apache/setup.py | 13 | from setuptools import setup
from setuptools import find_packages
install_requires = [
'acme',
'letsencrypt',
'mock<1.1.0', # py26
'python-augeas',
'zope.component',
'zope.interface',
]
setup(
name='letsencrypt-apache',
packages=find_packages(),
install_requires=install_requires,... |
ingokegel/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/multiFileImports/child_module.after.py | 80 | from parent_module import Parent
from shared_module import module_function
class Child(Parent):
def should_be_pushed(self):
module_function() |
uberamd/NGECore2 | refs/heads/master | scripts/object/static/worldbuilding/furniture/cheap/frn_all_chep_chest_s01.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/buildout/event/empire_day_yoda_fountain.py | 85615 | import sys
def setup(core, object):
return |
indictranstech/tele-erpnext | refs/heads/develop | erpnext/hr/doctype/leave_block_list/leave_block_list.py | 45 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from erpnext.accounts.utils import validate_fiscal_year
from frappe import _
from frapp... |
wolflee/coreboot | refs/heads/master | util/dtd_parser/dtd_parser.py | 12 | #!/usr/bin/env python2
# dtd_parser.py - DTD structure parser
#
# Copyright (C) 2012 The ChromiumOS Authors. 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 ... |
registerguard/django-dox | refs/heads/master | dox/templatetags/adicio_widget.py | 1 | import random
from django import template
register = template.Library()
@register.simple_tag
def get_adicio_widget():
'''
Usage: {% adicio_widget %}
Returns Adicio widget <iframe></iframe>
'''
adicio_categories = (
"autos",
"homes",
"jobs",
)
random_categor... |
aweinstock314/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/utils/iana_parse.py | 437 | #!/usr/bin/env python
import sys
import urllib.request, urllib.error, urllib.parse
import codecs
def main():
encodings = []
f = urllib.request.urlopen(sys.argv[1])
for line in f:
if line.startswith("Name: ") or line.startswith("Alias: "):
enc = line.split()[1]
try:
... |
elkingtonmcb/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/jinja2/testsuite/inheritance.py | 414 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.inheritance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the template inheritance feature.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Env... |
carlohamalainen/nipype | refs/heads/master | nipype/interfaces/freesurfer/preprocess.py | 2 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Provides interfaces to various commands provided by freeusrfer
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ )... |
GNOME/gnome-lirc-properties | refs/heads/master | gnome_lirc_properties/backend.py | 1 | # Infrared Remote Control Properties for GNOME
# Copyright (C) 2008 Fluendo Embedded S.L. (www.fluendo.com)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or ... |
ixjlyons/fenril | refs/heads/master | fenril/ui/mainwindow.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'templates/mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... |
rizumu/django | refs/heads/master | tests/known_related_objects/models.py | 269 | """
Existing related object instance caching.
Test that queries are not redone when going back through known relations.
"""
from django.db import models
class Tournament(models.Model):
name = models.CharField(max_length=30)
class Organiser(models.Model):
name = models.CharField(max_length=30)
class Pool... |
OCA/event | refs/heads/12.0 | event_track_location_overlap/tests/test_overlap.py | 1 | # Copyright 2017 Tecnativa - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
from collections import namedtuple
from odoo.exceptions import ValidationError
from odoo.tests.common import SavepointCase
Sample = namedtuple(
"Sample",
("a_start", "a_duration", "b_start", "b_duratio... |
abramia/kaleo | refs/heads/master | kaleo/views.py | 3 | import json
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.views.decorators.http import require_POST
from django.contrib.auth.decorators import login_required
from django.con... |
peoplepower/botengine | refs/heads/master | com.ppc.Bot/devices/pictureframe/pictureframe_peoplepower_ios.py | 2 | '''
Created on September 10, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.pictureframe.pictureframe_peoplepower import PeoplePowerPictureFrameDevice
class PeoplePowerPictureFrameIosDevice(Peop... |
fjxhkj/PTVS | refs/heads/master | Python/Tests/TestData/VirtualEnv/env/Lib/encodings/cp1258.py | 93 | """ Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def d... |
asiersarasua/QGIS | refs/heads/master | tests/src/python/test_provider_shapefile.py | 5 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the OGR/Shapefile provider.
.. note:: 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 ver... |
yehnan/python_book_yehnan | refs/heads/master | ch13/ch13_argv_basic.py | 1 |
import sys
def main(infile, outfile):
print(infile, outfile)
def proc_argv(argv):
infile, outfile = None, None
infile = argv[0]
try:
outfile = argv[1]
except Exception:
outfile = infile + '.out'
print("Warning: output filename defaults to " + outfile)
r... |
mozilla/configman | refs/heads/master | configman/tests/test_namespace.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, division, print_function
import unittest
import datetime
import functools
impor... |
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/contrib/downloadermiddleware/chunked.py | 187 | from scrapy.utils.http import decode_chunked_transfer
class ChunkedTransferMiddleware(object):
"""This middleware adds support for chunked transfer encoding, as
documented in: http://en.wikipedia.org/wiki/Chunked_transfer_encoding
"""
def process_response(self, request, response, spider):
if ... |
zachjanicki/osf.io | refs/heads/develop | framework/auth/signing.py | 80 | # encoding: utf-8
import hmac
import json
import time
import base64
import collections
from website import settings
# Written by @jmcarp originally
def order_recursive(data):
"""Recursively sort keys of input data and all its nested dictionaries.
Used to ensure consistent ordering of JSON payloads.
"""
... |
ntuecon/server | refs/heads/master | pyenv/Lib/site-packages/twisted/application/runner/test/test_exit.py | 12 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.application.runner._exit}.
"""
from twisted.python.compat import NativeStringIO
from ...runner import _exit
from .._exit import exit, ExitStatus
import twisted.trial.unittest
class ExitTests(twisted.trial.unittest.Test... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/lair/base/shared_poi_all_lair_leaf_small_fog_gray.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_leaf_small_fog_gray.iff"
result.attri... |
wfleurant/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/escaping/gyptest-colon.py | 216 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests that filenames that contain colons are handled correctly.
(This is important for absolute paths on Windows.)
"""
import os
import... |
google/prettytensor | refs/heads/master | prettytensor/pretty_tensor_image_methods.py | 1 | # Copyright 2015 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed ... |
SaschaMester/delicium | refs/heads/master | ash/resources/PRESUBMIT.py | 45 | # 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.
"""Presubmit script for Chromium Ash resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the p... |
lerker/cupydle | refs/heads/master | cupydle/test/otros/dbn_MNIST.py | 1 | # -*- coding: utf-8 -*-
__author__ = "Ponzoni, Nelson"
__copyright__ = "Copyright 2015"
__credits__ = ["Ponzoni Nelson"]
__maintainer__ = "Ponzoni Nelson"
__contact__ = "npcuadra@gmail.com"
__email__ = "npcuadra@gmail.com"
__license__ = "GPL"
__version__ = "1.0.0"
__status__ = "Produ... |
laurent-george/weboob | refs/heads/master | weboob/applications/qcineoob/main_window.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Julien Veyssier
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... |
SanPen/GridCal | refs/heads/master | src/research/CIM/cim_to_matpower/PreProcess_CIM_files.py | 1 | """
The module ``PreProcess_CIM_files`` defines function to be used for preprocessing CIM files before they are parsed with
the ``PyCIM`` ``RDFXMLReader``. Most often it means fixing certain HTML tags.
.. seealso:: :py:func:`CIM2Matpower.cim_to_mpc` and the Matlab functions ``MPC_NODAL2BB`` and ``MPC_BB2NODAL``
:Date... |
MichaelDrogalis/ansible | refs/heads/devel | v1/ansible/utils/template.py | 82 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
rooshilp/CMPUT410Lab5 | refs/heads/master | env-lab5/lib/python2.7/site-packages/jinja2/optimizer.py | 1401 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.