repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ar7z1/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_compute_forwarding_rule_facts.py | 8 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
jasonwee/asus-rt-n14uhp-mrtg | refs/heads/master | src/lesson_developer_tools/doctest_hashed_values.py | 1 | keys = ['a', 'aa', 'aaa']
print('dict:', {k: len(k) for k in keys})
print('set :', set(keys))
|
pfnet/chainer | refs/heads/master | chainerx_build_helper.py | 4 | # This script is based on pybind11's example script. See the original via the
# following URL: https://github.com/pybind/cmake_example/blob/master/setup.py
import distutils
import os
import platform
import re
import subprocess
import sys
import setuptools
from setuptools.command import build_ext
def emit_build_info... |
freeflightsim/ffs-app-engine | refs/heads/master | _freeflightsim.appspot.com.1/gdata/Crypto/Hash/MD5.py | 226 |
# Just use the MD5 module from the Python standard library
__revision__ = "$Id: MD5.py,v 1.4 2002/07/11 14:31:19 akuchling Exp $"
from md5 import *
import md5
if hasattr(md5, 'digestsize'):
digest_size = digestsize
del digestsize
del md5
|
michealcarrerweb/LHVent_app | refs/heads/master | hourly/models.py | 1 | from __future__ import unicode_literals
from django.db import models
class Hourly(models.Model):
hourly_base = models.IntegerField()
def __str__(self):
return str(self.hourly_base)
|
vipulkanade/EventbriteDjango | refs/heads/master | lib/python2.7/site-packages/django/test/html.py | 220 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html_parser import HTMLParseError, HTMLParser
WHITESPACE = re.compile('\s+')
def normalize_whitespace(str... |
ChopChopKodi/pelisalacarta | refs/heads/master | python/main-classic/lib/sambatools/pyasn1/debug.py | 10 | import logging
from pyasn1 import __version__
from pyasn1 import error
from pyasn1.compat.octets import octs2ints
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Printer:
de... |
vrbala/timeseries-analysis | refs/heads/master | fib.py | 1 | #! /usr/bin/python
import sys
import time
from threading import Thread
import psutil
import random
def fib(n):
if n <= 1: return n
else: return fib(n-1) + fib(n-2)
if __name__ == "__main__":
fib(int(sys.argv[1]))
time.sleep(float(sys.argv[2]))
|
tempbottle/Firefly | refs/heads/master | firefly/_version.py | 8 | #coding:utf8
'''
Created on 2013-10-21
@author: lan (www.9miao.com)
'''
from twisted.python import versions
version = versions.Version('firefly', 1, 3, 3) |
jjyycchh/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/stack_utils.py | 215 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
dsprenkels/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/mod_pywebsocket/mux.py | 636 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
mtunique/knows | refs/heads/master | algorithm/Bayes/naive_testing.py | 1 | __author__ = 'mxunique'
# coding: utf-8
from bayes_text import NaiveBayesClassifier
from basic_analyse import *
from std_settings import *
def train():
nbc = NaiveBayesClassifier()
nbc.set_tags_list()
nbc.set_classes_dict()
nbc.all_in_one_train(src_training_dirpath)
def predict():
nbc = Naive... |
hassaanm/stock-trading | refs/heads/master | pybrain-pybrain-87c7ac3/pybrain/rl/explorers/explorer.py | 3 | __author__ = "Thomas Rueckstiess, ruecksti@in.tum.de"
from pybrain.structure.modules.module import Module
class Explorer(Module):
""" An Explorer object is used in Agents, receives the current state
and action (from the controller Module) and returns an explorative
action that is executed instea... |
jfterpstra/bluebottle | refs/heads/develop | bluebottle/payments_voucher/models.py | 1 | from django.conf import settings
from django.db import models
from decimal import Decimal
from bluebottle.payments.models import Payment
from djchoices.choices import DjangoChoices, ChoiceItem
from django.utils.translation import ugettext as _
from django_extensions.db.fields import ModificationDateTimeField, \
Cre... |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/grizzled/grizzled/file/__init__.py | 19 | """
This module contains file- and path-related methods, classes, and modules.
"""
from __future__ import with_statement, absolute_import
__docformat__ = "restructuredtext en"
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------... |
USGSDenverPychron/pychron | refs/heads/develop | pychron/canvas/designer/__init__.py | 82 | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... |
natefoo/pulsar | refs/heads/master | pulsar/client/staging/up.py | 2 | from io import open
from logging import getLogger
from os import sep
from os.path import (
abspath,
basename,
exists,
join,
relpath,
)
from re import escape, findall
from ..action_mapper import FileActionMapper
from ..action_mapper import MessageAction
from ..action_mapper import path_type
from ..j... |
tartavull/google-cloud-python | refs/heads/master | monitoring/tests/unit/test_label.py | 3 | # Copyright 2016 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, ... |
sahana/Turkey | refs/heads/master | modules/s3db/disease.py | 5 | # -*- coding: utf-8 -*-
""" Sahana Eden Disease Tracking Models
@copyright: 2014-2015 (c) Sahana Software Foundation
@license: MIT
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 Soft... |
tempbottle/ironpython3 | refs/heads/master | Src/StdLib/Lib/venv/__main__.py | 124 | import sys
from . import main
rc = 1
try:
main()
rc = 0
except Exception as e:
print('Error: %s' % e, file=sys.stderr)
sys.exit(rc)
|
mariansoban/ardupilot | refs/heads/Copter-4.0.x-sobi-phl-8m | libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32F745xx.py | 10 | #!/usr/bin/env python
'''
these tables are generated from the STM32 datasheets for the
STM32F74x
'''
# additional build information for ChibiOS
build = {
"CHIBIOS_STARTUP_MK" : "os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f7xx.mk",
"CHIBIOS_PLATFORM_MK" : "os/hal/ports/STM32/STM32F7xx/platform.mk"
... |
gnowledge/ISON | refs/heads/master | objectapp/urls/sitemap.py | 3 | # Copyright (c) 2011, 2012 Free Software Foundation
# 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 later vers... |
ramitalat/odoo | refs/heads/8.0 | addons/l10n_fr_rib/bank.py | 335 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Numérigraphe SARL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... |
meredith-digops/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/s3_bucket.py | 40 | #!/usr/bin/python
#
# This is a 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.
#
# This Ansible library is distributed in the hope that i... |
elainenaomi/sciwonc-dataflow-examples | refs/heads/master | dissertation2017/Experiment 1B/instances/11_1_workflow_full_10files_secondary_w1_3sh_3rs_with_annot_with_proj_3s_hash/calculateratio_8/ConfigDB_Calc_TEInfo_8.py | 36 | HOST = "ip-172-31-29-102.us-west-2.compute.internal:27017,ip-172-31-29-103.us-west-2.compute.internal:27017,ip-172-31-29-104.us-west-2.compute.internal:27017,ip-172-31-29-105.us-west-2.compute.internal:27017,ip-172-31-29-101.us-west-2.compute.internal:27017,ip-172-31-29-106.us-west-2.compute.internal:27017,ip-172-31-29... |
geekboxzone/mmallow_external_protobuf | refs/heads/geekbox | python/google/protobuf/internal/api_implementation_default_test.py | 73 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... |
gioman/QGIS | refs/heads/master | tests/src/python/test_qgspointdisplacementrenderer.py | 1 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgspointdisplacementrenderer.py
-----------------------------
Date : September 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at... |
kisna72/django | refs/heads/master | tests/model_package/tests.py | 380 | from __future__ import unicode_literals
from django.db import connection, models
from django.db.backends.utils import truncate_name
from django.test import TestCase
from .models.article import Article, Site
from .models.publication import Publication
class Advertisement(models.Model):
customer = models.CharFiel... |
coursemdetw/2014c2 | refs/heads/master | wsgi/static/reeborg/src/libraries/brython/Lib/logging/__init__.py | 733 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
aviaryan/open-event-orga-server | refs/heads/development | app/helpers/invoicing.py | 8 | from datetime import datetime
from app.helpers.cache import cache
from app.helpers.data import save_to_db
from app.helpers.helpers import get_count, represents_int
from app.helpers.payment import StripePaymentsManager, PayPalPaymentsManager
from app.models.discount_code import DiscountCode, EVENT
from app.models.event... |
hexlism/xx_net | refs/heads/master | gae_proxy/server/lib/google/appengine/api/yaml_errors.py | 19 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
FluidityProject/fluidity | refs/heads/testharnessClean | tests/mms_rans_p2p1_keps_linearmomentum_cv/function_printer.py | 6 | from mms_rans_p2p1_keps_tools import *
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
import sys
'''
run using:
python function_printer.py AA BB CC DD .. n_rows
where:
AA, BB, CC, DD are names of functions in mms_rans_p2p1_keps_tools.py (any number can be entered)
n_rows is the number of rows ... |
lixiangning888/whole_project | refs/heads/master | modules/signatures/stealth_timelimit.py | 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Accuvant, Inc. (bspengler@accuvant.com)
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class StealthTimeout(Signature):
name = "stealth_timeout... |
translate/virtaal | refs/heads/master | virtaal/models/basemodel.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/sleepiq/const.py | 21 | """Define constants for the SleepIQ component."""
DOMAIN = "sleepiq"
IS_IN_BED = "is_in_bed"
SLEEP_NUMBER = "sleep_number"
SENSOR_TYPES = {SLEEP_NUMBER: "SleepNumber", IS_IN_BED: "Is In Bed"}
LEFT = "left"
RIGHT = "right"
SIDES = [LEFT, RIGHT]
|
drawks/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 15 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... |
paolodedios/tensorflow | refs/heads/master | tensorflow/python/debug/examples/v1/debug_fibonacci.py | 22 | # 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... |
bob-the-hamster/kivy | refs/heads/master | kivy/uix/selectableview.py | 52 | from kivy.properties import NumericProperty, BooleanProperty
class SelectableView(object):
'''The :class:`SelectableView` mixin is used with list items and other
classes that are to be instantiated in a list view or other classes
which use a selection-enabled adapter such as ListAdapter. select() and
... |
neiudemo1/django | refs/heads/master | tests/generic_relations_regress/models.py | 269 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.deletion import ProtectedError
from django.utils.encoding import python_2_unicode_compatible
__all__ = ('Link', 'Place... |
manuelep/openshift_v3_test | refs/heads/master | wsgi/web2py/gluon/contrib/plural_rules/he.py | 44 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# Plural-Forms for he (Hebrew)
nplurals=2 # Hebrew language has 2 forms:
# 1 singular and 1 plural
# Determine plural_id for number *n* as sequence of positive
# integers: 0,1,...
# NOTE! For singular form ALWAYS return plural_id = 0
get_plural_id = lambda n: ... |
gmacchi93/serverInfoParaguay | refs/heads/master | apps/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... |
yawnosnorous/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/multiprocessing/forking.py | 45 | #
# Module for starting a process object using os.fork() or CreateProcess()
#
# multiprocessing/forking.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... |
pdufour/sqlalchemy | refs/heads/master | lib/sqlalchemy/sql/ddl.py | 57 | # sql/ddl.py
# Copyright (C) 2009-2015 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
"""
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/py2exe-0.6.8/test/setup_win32com_shell.py | 3 | import sys
# ModuleFinder can't handle runtime changes to __path__, but win32com uses them
try:
import modulefinder
import win32com
for p in win32com.__path__[1:]:
modulefinder.AddPackagePath("win32com", p)
for extra in ["win32com.shell"]: #,"win32com.mapi"
__import__(extra)
m ... |
darolt/ndnSIMQoS | refs/heads/master | src/tap-bridge/bindings/modulegen_customizations.py | 203 | import os
def post_register_types(root_module):
enabled_features = os.environ['NS3_ENABLED_FEATURES'].split(',')
if 'TapBridge' not in enabled_features:
for clsname in ['TapBridge', 'TapBridgeHelper', 'TapBridgeFdReader']:
root_module.classes.remove(root_module['ns3::%s' % clsname])
... |
xindus40223115/w17_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/time.py | 601 | class _clock():
def __init__(self):
pass
def tick(self, framerate):
pass
def Clock():
return _clock()
def get_ticks(t):
pass
|
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/createsuperuser/models.py | 12133432 | |
cloudbase/nova | refs/heads/master | nova/tests/unit/objects/test_instance_device_metadata.py | 4 | # 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... |
dhuang/incubator-airflow | refs/heads/master | airflow/api/common/experimental/__init__.py | 1049 | # -*- coding: utf-8 -*-
#
# 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
... |
jordanpina/Hax | refs/heads/master | node_modules/nodemon/travis_after_all.py | 229 | import os
import sys
import json
import time
import logging
try:
from functools import reduce
except ImportError:
pass
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
... |
memtoko/django | refs/heads/master | django/contrib/auth/__init__.py | 387 | import inspect
import re
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.middleware.csrf import rotate_token
from django.utils.crypto import constant_time_compare
from django.utils.module_loading import i... |
sgaist/django-haystack | refs/heads/master | haystack/backends/__init__.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
from copy import deepcopy
from time import time
from django.conf import settings
from django.db.models import Q
from django.db.models.base import ModelBase
from django.utils import six
from django.utils import tree
from django.utils.encoding im... |
sigmunau/nav | refs/heads/master | python/nav/smidumps/cisco_ietf_ip_mib.py | 4 | # python version 1.0 DO NOT EDIT
#
# Generated by smidump version 0.4.7:
#
# smidump -f python CISCO-IETF-IP-MIB
FILENAME = "/home/magnusme/mibs/v2/CISCO-IETF-IP-MIB.my"
MIB = {
"moduleName" : "CISCO-IETF-IP-MIB",
"CISCO-IETF-IP-MIB" : {
"nodetype" : "module",
"language" : "SMIv2",
... |
ajack13/tournament | refs/heads/master | tournament_test.py | 20 | #!/usr/bin/env python
#
# Test cases for tournament.py
from tournament import *
def testDeleteMatches():
deleteMatches()
print "1. Old matches can be deleted."
def testDelete():
deleteMatches()
deletePlayers()
print "2. Player records can be deleted."
def testCount():
deleteMatches()
d... |
Y3K/django | refs/heads/master | tests/context_processors/views.py | 346 | from django.shortcuts import render
from .models import DebugObject
def request_processor(request):
return render(request, 'context_processors/request_attrs.html')
def debug_processor(request):
context = {'debug_objects': DebugObject.objects}
return render(request, 'context_processors/debug.html', cont... |
Vogtinator/micropython | refs/heads/nspire | tests/import/pkg3/mod2.py | 103 | print("mod2 __name__:", __name__)
print("in mod2")
def foo():
print("mod2.foo()")
|
raymondxyang/tensorflow | refs/heads/master | tensorflow/python/ops/init_ops.py | 32 | # 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... |
moio/spacewalk | refs/heads/master | client/tools/rhncfg/config_common/file_utils.py | 1 | #
# Copyright (c) 2008--2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
comepradz/pybrain | refs/heads/master | pybrain/rl/environments/twoplayergames/tasks/handicaptask.py | 25 | from __future__ import print_function
__author__ = 'Tom Schaul, tom@idsia.ch'
from .capturetask import CaptureGameTask
from pybrain.rl.environments.twoplayergames.capturegameplayers.captureplayer import CapturePlayer
from pybrain.rl.environments.twoplayergames.capturegameplayers import ModuleDecidingPlayer
from pybr... |
wangxuan007/flasky | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/build_ext.py | 314 | from distutils.command.build_ext import build_ext as _du_build_ext
from distutils.file_util import copy_file
from distutils.ccompiler import new_compiler
from distutils.sysconfig import customize_compiler
from distutils.errors import DistutilsError
from distutils import log
import os
import sys
import itertools
from s... |
geometalab/OSM-Crosswalk-Detection | refs/heads/master | tests/data/osm/__init__.py | 12133432 | |
jonathonwalz/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/baz1/__init__.py | 12133432 | |
jfietkau/Streets4MPI | refs/heads/master | settings.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# settings.py
# Copyright 2012 Julian Fietkau <http://www.julian-fietkau.de/>,
# Joachim Nitschke
#
# This file is part of Streets4MPI.
#
# Streets4MPI is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
dustymabe/ansible-modules-core | refs/heads/devel | network/openswitch/ops_template.py | 7 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
HydrelioxGitHub/home-assistant | refs/heads/dev | tests/components/air_quality/test_air_quality.py | 11 | """The tests for the Air Quality component."""
from homeassistant.components.air_quality import (
ATTR_ATTRIBUTION, ATTR_N2O,
ATTR_OZONE, ATTR_PM_10)
from homeassistant.setup import async_setup_component
async def test_state(hass):
"""Test Air Quality state."""
config = {
'air_quality': {
... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/paste/util/finddata.py | 50 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Note: you may want to copy this into your setup.py file verbatim, as
# you can't import this from another package, when you don't know if
# that pack... |
louisdorard/papiseval | refs/heads/master | BigmlKfold.py | 1 | import GenericKfold
from bigml.api import BigML
from bigml.model import Model
from bigml.api import check_resource
import numpy as np
import os
## Class for doing a k-fold cross validation test over BigML
class BigmlKfold(GenericKfold.GenericKfold):
def __init__(self, api):
self.api = api
## ... |
truongdq/chainer | refs/heads/master | chainer/functions/evaluation/accuracy.py | 18 | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
class Accuracy(function.Function):
def check_type_forward(self, in_types):
type_check.expect(in_types.size() == 2)
x_type, t_type = in_types
type_check.expect(
x_type.dtyp... |
praba230890/frappe | refs/heads/develop | frappe/website/doctype/web_form/test_web_form.py | 49 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.website.render import build_page
from frappe.website.doctype.web_form.web_form import accept
test_records = frappe.get_test_records('Web Form')
cla... |
huang195/kubernetes | refs/heads/master | hack/update_owners.py | 40 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... |
iivic/BoiseStateX | refs/heads/master | common/lib/xmodule/xmodule/tests/test_import.py | 27 | # -*- coding: utf-8 -*-
import datetime
import ddt
import unittest
from fs.memoryfs import MemoryFS
from lxml import etree
from mock import Mock, patch
from django.utils.timezone import UTC
from xmodule.xml_module import is_pointer_tag
from opaque_keys.edx.locations import Location
from xmodule.modulestore import o... |
sbfnk/epiwork-website | refs/heads/master | apps/pollster/management/commands/epiweb_migrate_intake.py | 1 | from optparse import make_option
from django.core.management.base import CommandError, BaseCommand
import cPickle as pickle
import MySQLdb
def yearmonth(date):
if not date:
return ''
return "%d/%02d" % (date.year, date.month)
def setmulti(intake, dest, data, src, index):
if src not in data:
... |
chafique-delli/OpenUpgrade | refs/heads/master | addons/website_forum_doc/models/documentation.py | 52 | # -*- coding: utf-8 -*-
import openerp
from openerp.osv import osv, fields
class Documentation(osv.Model):
_name = 'forum.documentation.toc'
_description = 'Documentation ToC'
_inherit = ['website.seo.metadata']
_order = "parent_left"
_parent_order = "sequence, name"
_parent_store = True
d... |
Balachan27/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex_multi_apps/app1/4_auto.py | 385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "3_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
RudolfCardinal/crate | refs/heads/master | crate_anon/crateweb/research/migrations/0004_auto_20170212_0137.py | 1 | #!/usr/bin/env python
"""
crate_anon/crateweb/research/migrations/0004_auto_20170212_0137.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribu... |
code4hk/hk-news-scrapper | refs/heads/master | parsers/baseparser.py | 1 | from bs4 import BeautifulSoup
from util import logger
import asyncio
import aiohttp
import re
log = logger.get(__name__)
@asyncio.coroutine
def grab_url(url, max_retry=5):
text = None
retry = False
try:
# todo:
# TimeoutError: [Errno 60] Operation timed out
# Fatal read error on ... |
ArmandSyah/AnimeMessengerBot | refs/heads/master | reddit/message.py | 2 | import os
from anime.mal import mal_search_methods
from anime.mal.mal_anime import MalAnime
from anime.anilist import anilist_search_methods
from anime.anidb import anidb_search_methods
from anime.streams import stream_search_methods
def make_message(title):
"""Constructs message to be sent to reddit user"""
... |
kaffeel/oppia | refs/heads/develop | core/controllers/cron.py | 15 | # Copyright 2014 The Oppia 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 applicable ... |
DorRosenblum/tf_flstm_f-lm | refs/heads/master | language_model.py | 1 | import tensorflow as tf
from model_utils import sharded_variable, getdtype, variable_summaries
from common import assign_to_gpu, average_grads, find_trainable_variables,print_debug
from hparams import HParams
from tensorflow.contrib.rnn import LSTMCell
from factorized_lstm_cells import GLSTMCell, ResidualWrapper, FLST... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/refactoring/changeSignature/switchPositionalParam.after.py | 83 | def bar(b, a):
pass
bar(2, 1) |
ImaginationForPeople/sockjs-tornado | refs/heads/master | sockjs/tornado/transports/jsonp.py | 9 | # -*- coding: utf-8 -*-
"""
sockjs.tornado.transports.jsonp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JSONP transport implementation.
"""
import logging
from tornado.web import asynchronous
from sockjs.tornado import proto
from sockjs.tornado.transports import pollingbase
from sockjs.tornado.util import bytes_to_s... |
AltSchool/django | refs/heads/master | tests/auth_tests/test_management.py | 4 | from __future__ import unicode_literals
import locale
import sys
from datetime import date
from django.apps import apps
from django.contrib.auth import management
from django.contrib.auth.checks import check_user_model
from django.contrib.auth.management import create_permissions
from django.contrib.auth.management.c... |
jamesblunt/nodeenv | refs/heads/master | nodeenv.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
nodeenv
~~~~~~~
Node.js virtual environment
:copyright: (c) 2014 by Eugene Kalinin
:license: BSD, see LICENSE for more details.
"""
import contextlib
import io
import sys
import os
import re
import stat
import logging
import operator
import optpar... |
ford-prefect/cerbero | refs/heads/openwebrtc | cerbero/errors.py | 16 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... |
Aasmi/scikit-learn | refs/heads/master | sklearn/neighbors/__init__.py | 306 | """
The :mod:`sklearn.neighbors` module implements the k-nearest neighbors
algorithm.
"""
from .ball_tree import BallTree
from .kd_tree import KDTree
from .dist_metrics import DistanceMetric
from .graph import kneighbors_graph, radius_neighbors_graph
from .unsupervised import NearestNeighbors
from .classification impo... |
guedou/scapy-codecov | refs/heads/master | scapy/arch/__init__.py | 2 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Operating system specific functionality.
"""
import socket
from scapy.arch.consts import LINUX, OPENBSD, FREEBSD, N... |
basnijholt/holoviews | refs/heads/master | holoviews/tests/plotting/plotly/testscatterplot.py | 2 | import numpy as np
from holoviews.element import Scatter
from .testplot import TestPlotlyPlot
class TestScatterPlot(TestPlotlyPlot):
def test_scatter_state(self):
scatter = Scatter([3, 2, 1])
state = self._get_plot_state(scatter)
self.assertEqual(state['data'][0]['y'], np.array([3, 2, 1... |
markeTIC/OCB | refs/heads/8.0 | addons/website_sale/__openerp__.py | 299 | {
'name': 'eCommerce',
'category': 'Website',
'summary': 'Sell Your Products Online',
'website': 'https://www.odoo.com/page/e-commerce',
'version': '1.0',
'description': """
OpenERP E-Commerce
==================
""",
'author': 'OpenERP SA',
'depends': ['website', 'sale', 'paymen... |
jirutka/ssh-ldap-pubkey | refs/heads/master | ssh_ldap_pubkey/exceptions.py | 1 | # -*- coding: utf-8 -*-
class Error(Exception):
def __init__(self, msg, code=1):
self.msg = msg
self.code = code
def __str__(self):
return self.msg
class ConfigError(Error): pass
class InsufficientAccessError(Error): pass
class InvalidCredentialsError(Error): pass
class InvalidPubKe... |
globz-eu/infrastructure | refs/heads/master | chef-repo/cookbooks/install_scripts/files/scripts/tests/test_commandfileutils.py | 1 | from unittest import TestCase
from unittest.mock import call
from unittest import mock
import os
import re
import shutil
import stat
import datetime
from utilities.commandfileutils import CommandFileUtils
from tests.conf_tests import DIST_VERSION, LOG_FILE, TEST_DIR, LOG_LEVEL
from tests.runandlogtest import RunAndLogT... |
ceache/treadmill | refs/heads/master | lib/python/treadmill/runtime/__init__.py | 2 | """Treadmill runtime framework.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import glob
import itertools
import logging
import os
import random
import socket
import tarfile
import six
if os.nam... |
nuuuboo/odoo | refs/heads/8.0 | addons/account/wizard/account_state_open.py | 341 | # -*- 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... |
Nukesor/Pueuew | refs/heads/master | pueue/client/factories.py | 1 | import pickle
from pueue.client.socket import connect_socket, receive_data, process_response
def command_factory(command):
"""A factory which returns functions for direct daemon communication.
This factory will create a function which sends a payload to the daemon
and returns the unpickled object which ... |
40223136/2015cdag1man | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/xml/dom/xmlbuilder.py | 873 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... |
anielsen001/scipy | refs/heads/master | scipy/sparse/dia.py | 34 | """Sparse DIAgonal format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['dia_matrix', 'isspmatrix_dia']
import numpy as np
from .base import isspmatrix, _formats, spmatrix
from .data import _data_matrix
from .sputils import (isshape, upcast_cha... |
IRI-Research/django | refs/heads/master | tests/utils_tests/test_dateparse.py | 25 | from __future__ import unicode_literals
from datetime import date, time, datetime
import unittest
from django.utils.dateparse import parse_date, parse_time, parse_datetime
from django.utils.timezone import get_fixed_timezone
class DateParseTests(unittest.TestCase):
def test_parse_date(self):
# Valid in... |
saumishr/django | refs/heads/master | django/contrib/gis/tests/layermap/models.py | 239 | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... |
JioCloud/oslo.log | refs/heads/master | oslo_log/tests/unit/test_log.py | 3 | # Copyright (c) 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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
# ... |
cccfran/sympy | refs/heads/master | examples/intermediate/coupled_cluster.py | 23 | #!/usr/bin/env python
"""
Calculates the Coupled-Cluster energy- and amplitude equations
See 'An Introduction to Coupled Cluster Theory' by
T. Daniel Crawford and Henry F. Schaefer III.
http://www.ccc.uga.edu/lec_top/cc/html/review.html
"""
from sympy.physics.secondquant import (AntiSymmetricTensor, wicks,
F,... |
sourcefabric/airtime | refs/heads/2.5.x | python_apps/media-monitor/mm2/tests/test_listeners.py | 12 | import os, shutil
import time
import pyinotify
import unittest
from pydispatch import dispatcher
from media.monitor.listeners import OrganizeListener
from media.monitor.events import OrganizeFile
from os.path import join, normpath, abspath
def create_file(p):
with open(p, 'w') as f: f.write(" ")
class TestOrgan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.