repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
clobrano/personfinder | refs/heads/master | app/pytz/zoneinfo/America/Hermosillo.py | 9 | '''tzinfo timezone information for America/Hermosillo.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Hermosillo(DstTzInfo):
'''America/Hermosillo timezone definition. See datetime.tzinfo for details'''
zone = 'America/H... |
sxjzwq/gensim | refs/heads/develop | gensim/test/test_dtm.py | 37 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Automated tests for DTM/DIM model
"""
import logging
import gensim
import os
import sys
import unittest
from gensim import corpora
# needed because sample data files are located in the same folder
module_path = os.path.dirname(__file__)
datapath = lambda fname: os.... |
insiderr/insiderr-app | refs/heads/master | ios-patches/basemodules/twisted/web/topfiles/setup.py | 24 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
try:
from twisted.python import dist
except ImportError:
raise SystemExit("twisted.python.dist module not found. Make sure you "
"have installed the Twisted core package before "
"atte... |
amiramix/serna-free | refs/heads/master | serna/dist/plugins/idealliance/publishing/IDEAlliancePublisher.py | 4 | ##
## Copyright(c) 2009 Syntext, Inc. All Rights Reserved.
## Contact: info@syntext.com, http://www.syntext.com
##
## This file is part of Syntext Serna XML Editor.
##
## COMMERCIAL USAGE
## Licensees holding valid Syntext Serna commercial licenses may use this file
## in accordance with the Syntext Serna Commercial... |
Datera/cinder | refs/heads/datera_queens_backport | cinder/api/views/versions.py | 1 | # Copyright 2010-2011 OpenStack Foundation
# Copyright 2015 Clinton Knight
# 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/li... |
GdZ/scriptfile | refs/heads/master | software/googleAppEngine/lib/PyAMF/doc/tutorials/examples/jython/client.py | 9 | import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
)
from pyamf.remoting.client import RemotingService
from pyamf.remoting import RemotingError
url = 'http://localhost:8080/pyamf'
client = RemotingService(url, logger=logging)
service = cli... |
jtyr/ansible-modules-core | refs/heads/devel | network/nxos/nxos_snmp_contact.py | 20 | #!/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... |
golismero/golismero | refs/heads/master | thirdparty_libs/django/dispatch/saferef.py | 218 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import traceback
import weakref
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target... |
Akrog/sqlalchemy | refs/heads/master | lib/sqlalchemy/ext/declarative/api.py | 51 | # ext/declarative/api.py
# Copyright (C) 2005-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
"""Public API functions and helpers for declarative."""
from ...schema impor... |
kamujun/exercise_of_deep_larning_from_scratch | refs/heads/master | src/mnist.py | 6 | # coding: utf-8
try:
import urllib.request
except ImportError:
raise ImportError('You should use Python 3.x')
import os.path
import gzip
import pickle
import os
import numpy as np
url_base = 'http://yann.lecun.com/exdb/mnist/'
key_file = {
'train_img':'train-images-idx3-ubyte.gz',
'train_label':'train... |
strongswan/swidGenerator | refs/heads/master | swid_generator/environments/dpkg_environment.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import subprocess
import ntpath
from swid_generator.generators.utils import create_temp_folder
from swid_generator.command_manager import CommandManager as CM
from .common import CommonEnvironment
from ..package... |
dati91/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/lint/fnmatch.py | 135 | from __future__ import absolute_import
import fnmatch as _stdlib_fnmatch
import os
__all__ = ["fnmatch", "fnmatchcase", "filter", "translate"]
def fnmatch(name, pat):
name = os.path.normcase(name)
pat = os.path.normcase(pat)
return fnmatchcase(name, pat)
def fnmatchcase(name, pat):
if '?' not in ... |
trabacus-softapps/openerp-8.0-cc | refs/heads/master | openerp/addons/analytic/__init__.py | 424 | # -*- 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... |
GoogleCloudPlatform/training-data-analyst | refs/heads/master | courses/data_analysis/deepdive/pubsub-exercises/exercise0-prework/python/labs/entities_pb2.py | 4 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: entities.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... |
JoseALermaIII/python-tutorials | refs/heads/master | pythontutorials/Udacity/CS101/Lesson 24 - Problem Set 6 Starred/Q2-Khayyam Triangle.py | 1 | # Double Gold Star
# Khayyam Triangle
# The French mathematician, Blaise Pascal, who built a mechanical computer in
# the 17th century, studied a pattern of numbers now commonly known in parts of
# the world as Pascal's Triangle (it was also previously studied by many Indian,
# Chinese, and Persian mathematicians, an... |
aronysidoro/django-angular | refs/heads/master | djangular/styling/bootstrap3/widgets.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
from django.forms.util import flatatt
from django.forms import widgets
from djangular.forms.widgets import (
ChoiceFiel... |
HydrelioxGitHub/home-assistant | refs/heads/dev | homeassistant/components/remote/__init__.py | 1 | """Support to interface with universal remote control devices."""
from datetime import timedelta
import functools as ft
import logging
import voluptuous as vol
from homeassistant.loader import bind_hass
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity import ToggleE... |
StratoSource/StratoSource | refs/heads/master | stratosource/management/commands/labels.py | 1 | # Copyright 2010, 2011 Red Hat Inc.
#
# This file is part of StratoSource.
#
# StratoSource 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 opti... |
mrunge/openstack_horizon | refs/heads/master | openstack_horizon/dashboards/admin/networks/ports/tabs.py | 1 | # Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
nprapps/dailygraphics | refs/heads/master | graphic_templates/ai2html_graphic/graphic_config.py | 1 | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1G5p4UIsKwUK303k4gLXhAmFnret0lg3w7qLm5S62Tsg'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
|
SE2Dev/PyCoD | refs/heads/master | xbin.py | 1 | # <pep8 compliant>
import struct
import os
from io import BytesIO
from . import _lz4 as lz4
LOG_BLOCKS = False
LZ4_VERBOSE = False
__LZ4_DISPLAY_SUPPORT_INFO__ = True
def print_lz4_support_info(force=False):
'''
Print the lz4 support info
'force' can be used to force the info to print again after the ... |
willhardy/django | refs/heads/master | tests/migrations/test_migrations_no_changes/0002_second.py | 846 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author",... |
imsparsh/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/test/test_session.py | 56 | # Copyright (c) 2007-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the 'session' channel implementation in twisted.conch.ssh.session.
See also RFC 4254.
"""
import os, signal, sys, struct
from zope.interface import implements
from twisted.internet.error import ProcessTerminated, Proces... |
andviro/ropevim-bundled | refs/heads/master | ftplugin/python/rope/base/oi/runmod.py | 27 |
def __rope_start_everything():
import os
import sys
import socket
import cPickle as pickle
import marshal
import inspect
import types
import threading
class _MessageSender(object):
def send_data(self, data):
pass
class _SocketSender(_MessageSender):
... |
photoninger/ansible | refs/heads/devel | test/units/modules/net_tools/test_nmcli.py | 5 | # Copyright: (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import pytest
import json
from ansible.modules.net_tools import nmcli
pytestmark = pytest.mark.usefixtures('patch_ansible_module')
TESTCASE_CONNECTION = [
{
'type': 'etherne... |
charanpald/sandbox | refs/heads/master | sandbox/misc/RandomisedSVD.py | 1 | import numpy
import scipy.sparse
import gc
from sppy.linalg.GeneralLinearOperator import GeneralLinearOperator
from sandbox.util.Parameter import Parameter
import sppy.linalg
class RandomisedSVD(object):
"""
Compute the randomised SVD using the algorithm on page 9 of Halko et al.,
Finding Structure ... |
a25kk/apm | refs/heads/master | src/apm.sitecontent/apm/sitecontent/behaviors/__init__.py | 22 | # -*- coding: utf-8 -*-
"""Module providing dexterity behaviors"""
|
paplorinc/intellij-community | refs/heads/master | python/testData/inspections/PyPep8NamingInspection/argumentName.py | 83 | def do_stuff(a, <weak_warning descr="Argument name should be lowercase">BCD</weak_warning>): pass
|
lochiiconnectivity/libcloud | refs/heads/trunk | docs/examples/container/docker/deploy_container.py | 30 | from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
cls = get_driver(Provider.DOCKER)
driver = cls(host='https://198.61.239.128', port=4243,
key_file='key.pem', cert_file='cert.pem')
image = driver.install_image('tomcat:8.0')
container = driver.deploy_contai... |
vanesa/kid-o | refs/heads/master | kido/admin/__init__.py | 1 | # -*- coding: utf-8 -*-
__all__ = ["views"]
from . import views
|
lz1988/company-site | refs/heads/master | tests/regressiontests/views/tests/specials.py | 60 | # coding: utf-8
from __future__ import unicode_literals
from django.test import TestCase
class URLHandling(TestCase):
"""
Tests for URL handling in views and responses.
"""
urls = 'regressiontests.views.generic_urls'
redirect_target = "/%E4%B8%AD%E6%96%87/target/"
def test_combining_redirect... |
TheWardoctor/Wardoctors-repo | refs/heads/master | script.module.covenant/lib/resources/lib/sources/en/onlinedizi.py | 6 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This prog... |
tseaver/gcloud-python | refs/heads/master | vision/google/cloud/vision.py | 3 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
DazWorrall/ansible | refs/heads/devel | test/integration/targets/module_utils/other_mu_dir/a/b/c/d/e/f/g/h/__init__.py | 294 | data = 'should not be visible abcdefgh'
|
mrmaulana/ubsearch | refs/heads/master | src/indexing.py | 2 | # adding keyword into index
def add_to_index(index, keyword, url):
for entry in index:
if entry[0] == keyword:
if url not in entry[1]:
entry[1].append(url)
return
index.append([keyword, [url]])
# find keyword on the index
def lookup(index, keyword):
for entry... |
ypid-bot/check_mk | refs/heads/master | web/htdocs/multitar.py | 1 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... |
sbrauer/print_json_middleware | refs/heads/master | setup.py | 1 | import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
setup(
name='print_json_middleware',
version='0.1.1',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
author='Sam B... |
brightchen/h2o-3 | refs/heads/master | py2/testdir_rapids/test_rapids_funs_1000_stmnt.py | 21 | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_browse as h2b, h2o_exec as h2e, h2o_import as h2i
# '(def anon {x} ( (var %x "null" %FALSE "null");;(var %x "null" %FALSE "null") );;;)',
from h2o_xl import Def, Fcn, Assign, KeyIndexed
from copy import copy
prin... |
luniv/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py | 241 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... |
DLu/rosbridge_suite | refs/heads/develop | rosbridge_server/src/tornado/platform/windows.py | 387 | # NOTE: win32 support is currently experimental, and not recommended
# for production use.
from __future__ import absolute_import, division, print_function, with_statement
import ctypes
import ctypes.wintypes
# See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx
SetHandleInformation = ctypes.windll.ker... |
laosiaudi/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/tests/dataframe/__init__.py | 118 | # 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... |
40223235/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/external_import.py | 742 | import os
from browser import doc
import urllib.request
## this module is able to download modules that are external to
## localhost/src
## so we could download from any URL
class ModuleFinder:
def __init__(self, path_entry):
print("external_import here..")
#print(path_entry)
self._module=... |
githwxi/ATS-Postiats-frozen | refs/heads/master | projects/SMALL/openshift-flask-2016-07-20/libatscc2py3/ats2pypre_PYlist_cats.py | 1 | ######
#
# HX-2014-08:
# for Python code translated from ATS
#
######
######
# beg of [PYlist_cats.py]
######
######
from ats2pypre_basics_cats import *
######
############################################
def PYlist_nil(): return []
def PYlist_sing(x): return [x]
def PYlist_pair(x1, x2): return [x1, x2]
##########... |
theclanks/ajenti | refs/heads/master | plugins/hddtemp/meters.py | 17 | #coding: utf-8
from ajenti.api import *
from ajenti.utils import shell
import os
import re
class HDDTempMeter (DecimalMeter):
name = 'HDD temperature'
category = 'System'
transform = 'float'
def list_disks(self):
r = []
for s in os.listdir('/dev'):
if re.match('sd.$|hd.$|... |
ODM2/ODM2StreamingDataLoader | refs/heads/master | src/wizard/controller/frmAddNewSampFeatPanel.py | 1 | import wx
from odm2api.ODM2.services.createService import *
from odm2api.ODM2.models import Sites
from src.wizard.view.clsAddNewSampFeatPanel import AddNewSampFeatPanelView
from src.wizard.controller.frmAddSpatialReference import NewSpatialReferenceController
from src.wizard.view.clsCustomDialog import CustomDialog
c... |
sebadiaz/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/restat/src/touch.py | 344 | #!/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.
import os
import sys
"""Cross-platform touch."""
for fname in sys.argv[1:]:
if os.path.exists(fname):
os.utime(fname, None)
else:... |
alu042/edx-platform | refs/heads/master | lms/lib/xblock/test/test_mixin.py | 33 | """
Tests of the LMS XBlock Mixin
"""
import ddt
from xblock.validation import ValidationMessage
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import CourseFactory, ToyCourseFactory, ItemFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, TEST_DATA... |
ccnmtl/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/flatpages/tests/views.py | 152 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
class FlatpageViewTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.tests.urls'
def setUp(self):
... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/helmet/helmet_fighter_privateer_ace_craft.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/token/token.py | 85615 | import sys
def setup(core, object):
return |
pabloborrego93/edx-platform | refs/heads/master | openedx/core/djangoapps/cors_csrf/middleware.py | 10 | """
Middleware for handling CSRF checks with CORS requests
CSRF and referrer domain checks
-------------------------------
When processing HTTPS requests, the default CSRF middleware checks that the referer
domain and protocol is the same as the request's domain and protocol. This is meant
to avoid a type of attack ... |
cpennington/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/apps.py | 4 |
from django.apps import AppConfig
from openedx.core.djangoapps.plugins.constants import PluginURLs, ProjectType
plugin_urls_config = {PluginURLs.NAMESPACE: u'theming', PluginURLs.REGEX: r'^theming/'}
class ThemingConfig(AppConfig):
name = 'openedx.core.djangoapps.theming'
plugin_app = {
PluginURLs... |
anthraxx/pwndbg | refs/heads/dev | pwndbg/elftypes.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# mayhem/datatypes/elf.py
#
# 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 lis... |
Idematica/django-oscar | refs/heads/master | sites/sandbox/apps/user/models.py | 11 | """
Sample user/profile models for testing. These aren't enabled by default in the
sandbox
"""
from django.db import models
from django.utils import timezone
from oscar.core import compat
from oscar.apps.customer import abstract_models
class Profile(models.Model):
"""
Dummy profile model used for testing
... |
Avinash-Raj/appengine-django-skeleton | refs/heads/master | lib/django/utils/duration.py | 529 | """Version of str(timedelta) which is not English specific."""
def duration_string(duration):
days = duration.days
seconds = duration.seconds
microseconds = duration.microseconds
minutes = seconds // 60
seconds = seconds % 60
hours = minutes // 60
minutes = minutes % 60
string = '{:... |
jordanemedlock/psychtruths | refs/heads/master | temboo/core/Library/CloudMine/ObjectStorage/ObjectSearch.py | 5 | # -*- coding: utf-8 -*-
###############################################################################
#
# ObjectSearch
# Allows you to query key/value pair objects.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... |
bregman-arie/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_acl_interface.py | 103 | #!/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... |
marcinkaszynski/apnsclient | refs/heads/master | test/test.py | 17 | # Copyright 2014 Sardar Yumatov
#
# 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,... |
saleemjaveds/https-github.com-openstack-nova | refs/heads/master | nova/api/openstack/compute/schemas/v3/config_drive.py | 105 | # Copyright 2014 NEC 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
#
# Unless required ... |
mrinalabrol/magik | refs/heads/master | env/lib/python3.4/site-packages/setuptools/package_index.py | 301 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... |
sgiraud01/plonerules.slack | refs/heads/master | plonerules/slack/actions/slack.py | 1 | from Acquisition import aq_inner
from OFS.SimpleItem import SimpleItem
from zope.component import adapts
from zope.component.interfaces import ComponentLookupError
from zope.interface import Interface, implements
from zope.formlib import form
from zope.app.form import CustomWidgetFactory
from zope.app.form.bro... |
antoinecarme/pyaf | refs/heads/master | tests/sampling/test_ozone_with_sampling_3.py | 1 | from __future__ import absolute_import
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone()
df = b1.mPastData
#df.tail(10)
#df[:-10].tail()
#df[:-10:-1]
#df.describe()
lEngine = autof.cForecastEngine()
lEngine
H = b1.mHorizon;
#... |
bitkeeper/python-opcua | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
import sys
install_requires = ["python-dateutil", "pytz", "lxml"]
if sys.version_info[0] < 3:
install_requires.extend(["enum34", "trollius", "futures"])
setup(name="freeopcua",
version="0.90.3",
description="Pure Python OPC-UA client and server library",
... |
youprofit/scikit-image | refs/heads/master | skimage/util/tests/test_regular_grid.py | 40 | import numpy as np
from numpy.testing import assert_equal
from skimage.util import regular_grid
def test_regular_grid_full():
ar = np.zeros((2, 2))
g = regular_grid(ar, 25)
assert_equal(g, [slice(None, None, None), slice(None, None, None)])
ar[g] = 1
assert_equal(ar.size, ar.sum())
def test_regu... |
astrofrog/hyperion | refs/heads/master | hyperion/grid/tests/test_views.py | 2 | from copy import deepcopy
import numpy as np
from astropy.tests.helper import pytest
from hyperion.grid import CartesianGrid, CylindricalPolarGrid, SphericalPolarGrid, AMRGrid, OctreeGrid
ALL_GRID_TYPES = ['car', 'sph', 'cyl', 'amr', 'oct']
def exc_msg(exc):
if isinstance(exc.value, basestring):
return... |
e-mission/e-mission-server | refs/heads/master | emission/core/wrapper/motionactivity.py | 3 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import logging
import emission.core.wrapper.wrapperbase as ecwb
import enum a... |
helldorado/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_vsdatascriptset.py | 31 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
scottmcmaster/catapult | refs/heads/master | third_party/WebOb/webob/dec.py | 24 | """
Decorators to wrap functions to make them WSGI applications.
The main decorator :class:`wsgify` turns a function into a WSGI
application (while also allowing normal calling of the method with an
instantiated request).
"""
from webob.compat import (
bytes_,
text_type,
)
from webob.request import Reque... |
xcbat/vnpy | refs/heads/master | archive/demo/ctpdemo/demoApi.py | 88 | # encoding: UTF-8
"""
该文件中包含的是交易平台的底层接口相关的部分,
主要对API进行了一定程度的简化封装,方便开发。
"""
import os
from vnctpmd import MdApi
from vnctptd import TdApi
from eventEngine import *
from ctp_data_type import defineDict
#----------------------------------------------------------------------
def print_dict(d):
"""打印API收到的字典,该函数主要用于... |
BayanGroup/ansible | refs/heads/devel | lib/ansible/parsing/splitter.py | 16 | # (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... |
8u1a/plaso | refs/heads/master | tests/filters/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
2014c2g9/c2g9 | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/support.py | 770 | import unittest
class TestEquality(object):
"""Used as a mixin for TestCase"""
# Check for a valid __eq__ implementation
def test_eq(self):
for obj_1, obj_2 in self.eq_pairs:
self.assertEqual(obj_1, obj_2)
self.assertEqual(obj_2, obj_1)
# Check for a valid __ne__ impl... |
digitalfox/yokadi | refs/heads/master | yokadi/tests/keywordtestcase.py | 1 | # -*- coding: UTF-8 -*-
"""
Task test cases
@author: Aurélien Gâteau <aurelien.gateau@free.fr>
@license: GPL v3 or later
"""
import unittest
import testutils
from yokadi.core import dbutils
from yokadi.ycli import tui
from yokadi.ycli.keywordcmd import KeywordCmd
from yokadi.core.yokadiexception import YokadiExceptio... |
samanehsan/osf.io | refs/heads/develop | website/addons/osfstorage/tests/factories.py | 15 | #!/usr/bin/env python
# encoding: utf-8
from factory import SubFactory, post_generation
from tests.factories import ModularOdmFactory, AuthUserFactory
import datetime
from website.files import models
from website.addons.osfstorage import settings
generic_location = {
'service': 'cloud',
settings.WATERBUTL... |
jmztaylor/android_kernel_htc_a3ul | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
abligh/xen-4.2-live-migrate | refs/heads/master | tools/python/xen/xend/server/vfbif.py | 43 | from xen.xend.server.DevController import DevController
from xen.xend.XendLogging import log
from xen.xend.XendError import VmError
import xen.xend
import os
CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
'display', 'xauthority', 'keymap', 'vnc', 'sdl', 'uuid',
... |
mindm/2017Challenges | refs/heads/master | challenge_4/python/hkl0902/Challenge_4.py | 5 | class BinTree:
'''
Root: integer value
Left: BinTree
Right: BinTree
if left and right are both None, the tree is a leaf (an ending node)
'''
def __init__(self, root, left, right):
self.root = root
self.left = left
self.right = right
'''
Converts the Binary Tr... |
aclevy/pysensu-yelp | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='pysensu-yelp',
version='0.2.2',
provides=['pysensu_yelp'],
description='Emits Yelp-flavored Sensu events to a Sensu Client',
url='https://github.com/Yelp/pysensu-yelp',
author='Yelp Operations Team',
author_emai... |
olasitarska/django | refs/heads/master | django/utils/unittest.py | 180 | from __future__ import absolute_import
import warnings
from django.utils.deprecation import RemovedInDjango19Warning
warnings.warn("django.utils.unittest will be removed in Django 1.9.",
RemovedInDjango19Warning, stacklevel=2)
try:
from unittest2 import *
except ImportError:
from unittest import *
|
systemdaemon/systemd | refs/heads/master | src/linux/scripts/gdb/linux/cpus.py | 997 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... |
CamelBackNotation/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/plat-mac/Carbon/ControlAccessor.py | 81 | # Accessor functions for control properties
from Controls import *
import struct
# These needn't go through this module, but are here for completeness
def SetControlData_Handle(control, part, selector, data):
control.SetControlData_Handle(part, selector, data)
def GetControlData_Handle(control, part, selector):
... |
karimbahgat/Pipy | refs/heads/master | pipy/pip/_vendor/distlib/util.py | 327 | #
# Copyright (C) 2012-2016 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import shutil
import socket
try:
... |
adamkal/tornado-app-info | refs/heads/master | tests/test_collectors.py | 1 | # -*- coding: utf-8 -*-
"""Collectors tests."""
import unittest
try:
from unittest import mock
except ImportError:
import mock
from datetime import datetime
import six
from tornadoappinfo import collectors
if six.PY2:
import time
def to_timestamp(dt):
return time.mktime(dt.timetuple())
else... |
jackru/pybrain | refs/heads/master | examples/rl/valuebased/nfq.py | 25 | from __future__ import print_function
#!/usr/bin/env python
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.environments.cartpole import CartPoleEnvironment, DiscreteBalanceTask, CartPoleRenderer
from pybrain.rl.agents import LearningAgent
from pybrain.rl.experiments import EpisodicExperiment
fr... |
Semi-global/edx-platform | refs/heads/master | lms/djangoapps/discussion_api/render.py | 168 | """
Content rendering functionality
Note that this module is designed to imitate the front end behavior as
implemented in Markdown.Sanitizer.js.
"""
import re
import markdown
# These patterns could be more flexible about things like attributes and
# whitespace, but this is imitating Markdown.Sanitizer.js, so it uses... |
houshengbo/nova_vmware_compute_driver | refs/heads/attach-detach-VMware-iSCSI-driver | nova/api/openstack/compute/contrib/volumes.py | 2 | # Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
wilmoz/servo | refs/heads/master | python/mach/mach/logging.py | 125 | # 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/.
# This file contains logging functionality for mach. It essentially provides
# support for a structured logging framewor... |
Hassan93/openTima | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... |
aurex-linux/virt-manager | refs/heads/master | virtManager/mediadev.py | 3 | #
# Copyright (C) 2009, 2013 Red Hat, Inc.
# Copyright (C) 2009 Cole Robinson <crobinso@redhat.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
# (at yo... |
florianziemen/bin | refs/heads/master | flo_utils.py | 1 | from __future__ import print_function
import subprocess as sp
import shlex
import sys
import getopt
import os
import glob
import shutil
import re
import numpy as np
import netCDF4 as nc
import collections
from os.path import expanduser
home = expanduser("~")
debug = False
def cerr(*objs):
print( *objs, file=sys.st... |
pearsonlab/nipype | refs/heads/master | nipype/interfaces/afni/tests/test_auto_Merge.py | 11 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..preprocess import Merge
def test_Merge_inputs():
input_map = dict(args=dict(argstr='%s',
),
blurfwhm=dict(argstr='-1blur_fwhm %d',
units='mm',
),
doall=dict(argstr='-doall',
),
environ=dic... |
leilihh/nova | refs/heads/stable/icehouse | nova/virt/hyperv/migrationops.py | 3 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... |
wimberosa/samba | refs/heads/master | lib/pep8/pep8.py | 10 | #!/usr/bin/python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net>
#
# 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... |
Srisai85/scipy | refs/heads/master | scipy/weave/blitz_tools.py | 97 | from __future__ import absolute_import, print_function
import parser
import sys
import warnings
import copy
import numpy
from . import ast_tools
from . import slice_handler
from . import size_check
from . import converters
from . import inline_tools
from .inline_tools import attempt_function_call
function_catalog = ... |
ferrarimarco/rss-enclosure-downloader | refs/heads/master | enclosure_downloader/config.py | 1 | # Inoreader Client configuration
INO_BASE_URL = "https://www.inoreader.com/reader/api/0"
INO_AUTH_URL = "https://www.inoreader.com/accounts/ClientLogin"
|
gnu-sandhi/sandhi | refs/heads/master | modules/gr36/gr-filter/python/qa_pfb_decimator.py | 13 | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
csitarichie/boost_msm_bare_metal | refs/heads/master | boost/tools/build/v2/test/module_actions.py | 20 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2006 Rene Rivera
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import os
import re
spaces_re = re.compile... |
rexshihaoren/scikit-learn | refs/heads/master | sklearn/cluster/mean_shift_.py | 106 | """Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... |
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/contrib/testtools.py | 295 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.testtools
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements extended wrappers for simplified testing.
`TestResponse`
A response wrapper which adds various cached attributes for
simplified assertions on various content types.
:copyright:... |
K-Carrington/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/src/genmsg/deps.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.