repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pbrady/sympy | refs/heads/master | sympy/functions/combinatorial/tests/__init__.py | 12133432 | |
pshen/ansible | refs/heads/devel | lib/ansible/modules/remote_management/foreman/__init__.py | 12133432 | |
etzhou/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_videoannotation.py | 92 | # -*- coding: utf-8 -*-
"Test for Annotation Xmodule functional logic."
import unittest
from mock import Mock
from lxml import etree
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.videoannotation_module import VideoAnnotationModule
from . import get_test_system
class V... |
alistairlow/tensorflow | refs/heads/master | tensorflow/python/ops/distributions/bijector.py | 53 | # 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... |
hosseinmh/jango_learning | refs/heads/master | .venv/lib/python2.7/site-packages/django/shortcuts.py | 117 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.http import (
Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect,
)
from django.template imp... |
ulope/django | refs/heads/master | django/core/serializers/__init__.py | 121 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... |
lakshayg/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/division_future_test.py | 79 | # 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... |
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/test/test_zlib.py | 29 | import unittest
from test.test_support import TESTFN, run_unittest, import_module, unlink, requires
import binascii
import random
from test.test_support import precisionbigmemtest, _1G, _4G
import sys
try:
import mmap
except ImportError:
mmap = None
zlib = import_module('zlib')
class ChecksumTestCase(unitte... |
mediafactory/tryton_core_daemon | refs/heads/stable-2.4 | trytond/backend/sqlite/table.py | 1 | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.backend.table import TableHandlerInterface
import logging
import re
class TableHandler(TableHandlerInterface):
def __init__(self, cursor, model, module_name=N... |
yancz1989/cancer | refs/heads/master | tf_upgrade.py | 1 | # -*- coding: utf-8 -*-
# @Author: yancz1989
# @Date: 2017-02-19 08:22:23
# @Last Modified by: yancz1989
# @Last Modified time: 2017-02-19 08:22:51
# 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 ... |
bcpki/nonce2testblocks | refs/heads/master | qa/rpc-tests/receivedby.py | 16 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listreceivedbyaddress API
from test_framework import BitcoinTestFramework
from bitcoinrpc.a... |
tgarc/python-sounddevice | refs/heads/master | sounddevice_build.py | 1 | from cffi import FFI
ffibuilder = FFI()
ffibuilder.set_source("_sounddevice", None)
ffibuilder.cdef("""
int Pa_GetVersion( void );
const char* Pa_GetVersionText( void );
typedef int PaError;
typedef enum PaErrorCode
{
paNoError = 0,
paNotInitialized = -10000,
paUnanticipatedHostError,
paInvalidChannelC... |
blaze/distributed | refs/heads/master | distributed/http/worker/__init__.py | 12133432 | |
idegtiarov/ceilometer | refs/heads/master | ceilometer/compute/virt/__init__.py | 12133432 | |
peritus/robotframework-selenium2library | refs/heads/master | test/unit/keywords/__init__.py | 12133432 | |
tomduijf/netdisco | refs/heads/master | netdisco/discoverables/netgear_router.py | 2 | """ Discovers Netgear routers. """
from . import SSDPDiscoverable
try:
from urlparse import urlparse # Py2
except ImportError:
from urllib.parse import urlparse # Py3
class Discoverable(SSDPDiscoverable):
""" Adds support for discovering Philips Hue bridges. """
def info_from_entry(self, entry):
... |
emilliman5/Bpipes | refs/heads/master | unique_read_filter.py | 1 | #!/usr/bin/env python
import csv
import sys
import re
f = csv.reader(sys.stdin, dialect="excel-tab")
of = csv.writer(sys.stdout, dialect="excel-tab")
last_read = None
XS=0
for line in f:
#take care of the header
if(line[0][0] == "@"):
of.writerow(line)
continue
if(last_read == None):
... |
aldebaran/openni2 | refs/heads/master | Packaging/ReleaseVersion.py | 32 | #!/usr/bin/python
#/****************************************************************************
#* *
#* OpenNI 2.x Alpha *
#* Copyright (C) 2012 PrimeSense Ltd. ... |
KhalidGit/flask | refs/heads/master | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/distlib/util.py | 190 | #
# Copyright (C) 2012-2013 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
import... |
costypetrisor/scikit-learn | refs/heads/master | examples/exercises/digits_classification_exercise.py | 350 | """
================================
Digits Classification Exercise
================================
A tutorial exercise regarding the use of classification techniques on
the Digits dataset.
This exercise is used in the :ref:`clf_tut` part of the
:ref:`supervised_learning_tut` section of the
:ref:`stat_learn_tut_inde... |
progwriter/tmgen | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# TMgen documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 25 23:18:51 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
vabs22/zulip | refs/heads/master | zerver/migrations/0054_realm_icon.py | 19 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-15 06:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0053_emailchangestatus'),
]
operations = [
migrations.AddField(
... |
JeffHoogland/mtg-totals | refs/heads/master | elm/mtg-totals.py | 1 | theirName = "Mat Bimonte"
myLifeFile = "/media/jeff/Storage/CrashTest/DataTextFiles/MyLife.txt"
theirLifeFile = "/media/jeff/Storage/CrashTest/DataTextFiles/TheirLife.txt"
import efl.elementary as elm
from efl.elementary.window import StandardWindow, Window, ELM_WIN_DIALOG_BASIC
from efl.elementary.background import ... |
CompPhysics/ComputationalPhysicsMSU | refs/heads/master | doc/Programs/PythonCodesLectureNotes/ising2dim.py | 4 | from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import math, sys
def periodic (i, limit, add):
"""
Choose correct matrix index with periodic
boundary conditions
Input:
- i: Base index
- limit: Highest \"legal\" index
- add: Number to add or subtract... |
chimkentec/KodiMODo_rep | refs/heads/master | plugin.video.youtube/resources/lib/youtube/helper/yt_setup_wizard.py | 10 | __author__ = 'bromix'
def _process_language(provider, context):
if not context.get_ui().on_yes_no_input(context.localize(provider.LOCAL_MAP['youtube.setup_wizard.adjust']),
context.localize(provider.LOCAL_MAP[
'youtube.set... |
dagmartin/capirca | refs/heads/master | lib/policyreader.py | 7 | #!/usr/bin/python2.4
#
# Copyright 2011 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... |
defance/edx-platform | refs/heads/master | common/test/acceptance/pages/studio/settings_group_configurations.py | 10 | """
Course Group Configurations page.
"""
from bok_choy.promise import EmptyPromise
from ..common.utils import confirm_prompt
from .course_page import CoursePage
class GroupConfigurationsPage(CoursePage):
"""
Course Group Configurations page.
"""
url_path = "group_configurations"
experiment_group... |
mrbox/django | refs/heads/master | tests/template_tests/filter_tests/test_slice.py | 428 | from django.template.defaultfilters import slice_filter
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SliceTests(SimpleTestCase):
@setup({'slice01': '{{ a|slice:"1:3" }} {{ b|slice:"1:3" }}'})
def test_slice01(self):
output = sel... |
xwolf12/scikit-learn | refs/heads/master | sklearn/metrics/tests/__init__.py | 12133432 | |
andela-ooladayo/django | refs/heads/master | tests/migrations/related_models_app/__init__.py | 12133432 | |
pczerkas/aodh | refs/heads/master | aodh/api/controllers/__init__.py | 12133432 | |
pdellaert/ansible | refs/heads/devel | test/units/module_utils/network/avi/__init__.py | 12133432 | |
kmike/gensim | refs/heads/develop | gensim/test/test_models.py | 21 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import o... |
BladeSmithJohn/nixysa | refs/heads/master | third_party/ply-3.1/test/lex_module_import.py | 174 | # -----------------------------------------------------------------------------
# lex_module_import.py
#
# A lexer defined in a module, but built in lex_module.py
# -----------------------------------------------------------------------------
tokens = (
'NAME','NUMBER',
'PLUS','MINUS','TIMES','DIVIDE','EQUALS'... |
clumsy/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/gdal/prototypes/geom.py | 315 | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... |
hunterfu/it-manager | refs/heads/master | stock_tech/trade_system/trade_system.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
import sys
import getopt
import commands
#import pysqlite2.dbapi2 as sqlite
import sqlite3 as sqlite
import datetime
from pprint import pprint
def load_config():
"""
读取配置文件
"""
configFile = "%s/conf/%s" % (base_dir,"glo... |
3dfxsoftware/cbss-addons | refs/heads/master | imsar_ui_customizations/imsar_ui.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# IMSAR LLC
# Author: Ben Olsen
# Copyright (C) 2014
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publ... |
66eli77/fle-home | refs/heads/master | fle_site/apps/about/migrations/0002_auto__add_organizationtype__add_supportingorganization.py | 5 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'OrganizationType'
db.create_table('about_organizationtype', (
('id', self.gf('dj... |
mchristopher/PokemonGo-DesktopMap | refs/heads/master | app/pylibs/shared/pgoapi/protos/POGOProtos/Networking/Requests/Messages/LevelUpRewardsMessage_pb2.py | 16 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Requests/Messages/LevelUpRewardsMessage.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 _me... |
pnkfelix/tamarin-redux | refs/heads/master | test/util/which.py | 8 | #!/usr/bin/env python
# Copyright (c) 2002-2005 ActiveState Corp.
# See LICENSE.txt for license details.
# Author:
# Trent Mick (TrentM@ActiveState.com)
# Home:
# http://trentm.com/projects/which/
r"""Find the full path to commands.
which(command, path=None, verbose=0, exts=None)
Return the full path to the f... |
NullSoldier/django | refs/heads/master | tests/migrations/test_migrations_no_default/__init__.py | 12133432 | |
berkeley-cocosci/Wallace | refs/heads/master | tests/__init__.py | 12133432 | |
fujita/ryu | refs/heads/master | ryu/services/protocols/bgp/info_base/vrf4.py | 52 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... |
campagnola/acq4 | refs/heads/develop | acq4/modules/TaskRunner/analysisModules/Uncaging/__init__.py | 3 | from __future__ import print_function
from .interface import * |
mattseymour/django | refs/heads/master | tests/indexes/models.py | 15 | from django.db import connection, models
class CurrentTranslation(models.ForeignObject):
"""
Creates virtual relation to the translation with model cache enabled.
"""
# Avoid validation
requires_unique_target = False
def __init__(self, to, on_delete, from_fields, to_fields, **kwargs):
... |
XiaosongWei/chromium-crosswalk | refs/heads/master | native_client_sdk/src/tools/tests/oshelpers_test.py | 159 | #!/usr/bin/env python
# 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.
import os
import shutil
import subprocess
import sys
import tempfile
import unittest
import zipfile
SCRIPT_DIR = os.path.dirname(o... |
Trust-Code/odoo8.0-addons | refs/heads/master | project_scrum/report/__init__.py | 6 | # -*- 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... |
NL66278/OCB | refs/heads/8.0 | addons/email_template/email_template.py | 22 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... |
tequa/ammisoft | refs/heads/master | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/matplotlib/backends/backend_mixed.py | 10 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import six
from matplotlib.backends.backend_agg import RendererAgg
from matplotlib.tight_bbox import process_figure_for_rasterizing
class MixedModeRenderer(object):
"""
A helper c... |
kenshay/ImageScripter | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/urllib3/contrib/_securetransport/bindings.py | 162 | """
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.
This code is a bastardised version of the code found in ... |
priyankajain18/stock_package | refs/heads/develop | stock.py | 1 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelSQL, ModelView, Workflow, fields
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval
from trytond.report import Report
__all... |
Containers-Testing-Framework/ctf-cli | refs/heads/master | features/steps/command_util.py | 3 | # -*- coding -*-
"""
Provides some command utility functions.
TODO:
matcher that ignores empty lines and whitespace and has contains comparison
"""
from __future__ import absolute_import
import pathutil
from __setup import TOP, TOPA
import os.path
import shutil
from fnmatch import fnmatch
# -----------------------... |
ormnv/os_final_project | refs/heads/master | django/contrib/messages/constants.py | 630 | DEBUG = 10
INFO = 20
SUCCESS = 25
WARNING = 30
ERROR = 40
DEFAULT_TAGS = {
DEBUG: 'debug',
INFO: 'info',
SUCCESS: 'success',
WARNING: 'warning',
ERROR: 'error',
}
|
NewpTone/stacklab-nova | refs/heads/master | debian/tmp/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/consoles.py | 19 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 OpenStack LLC.
# 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/... |
habeanf/Open-Knesset | refs/heads/upmaster | mks/migrations/0016_bill_stats.py | 15 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for mk in orm.Member.objects.all():
mk.bills_stats_proposed = mk.bills.count()
mk.bills_stats_pre ... |
AlphaCluster/NewsBlur | refs/heads/master | utils/munin/newsblur_app_times.py | 3 | #!/srv/newsblur/venv/newsblur/bin/python
from utils.munin.base import MuninGraph
class NBMuninGraph(MuninGraph):
@property
def graph_config(self):
graph = {
'graph_category' : 'NewsBlur',
'graph_title' : 'NewsBlur App Server Times',
'graph_vlabel' : 'Page load time ... |
crdoconnor/pexpect | refs/heads/master | tests/depricated_test_filedescriptor.py | 20 | #!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WIT... |
jaggu303619/asylum | refs/heads/master | openerp/tests/common.py | 58 | # -*- coding: utf-8 -*-
"""
The module :mod:`openerp.tests.common` provides a few helpers and classes to write
tests.
"""
import threading
import time
import unittest2
import xmlrpclib
import openerp
# The openerp library is supposed already configured.
ADDONS_PATH = openerp.tools.config['addons_path']
PORT = openerp... |
naturalatlas/mapnik | refs/heads/master | scons/scons-local-3.0.1/SCons/PathList.py | 6 | #
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge... |
djkonro/client-python | refs/heads/master | kubernetes/client/models/v1_git_repo_volume_source.py | 2 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
Leila20/django | refs/heads/master | django/template/loader_tags.py | 15 | import logging
import posixpath
import warnings
from collections import defaultdict
from django.utils import six
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
... |
amir-qayyum-khan/edx-platform | refs/heads/master | common/djangoapps/terrain/stubs/tests/test_http.py | 172 | """
Unit tests for stub HTTP server base class.
"""
import unittest
import requests
import json
from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params
class StubHttpServiceTest(unittest.TestCase):
def setUp(self):
super(StubHttpServiceTest, self).setUp()
self.serv... |
zhuyue1314/Empire | refs/heads/master | lib/modules/situational_awareness/network/stealth_userhunter.py | 10 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-StealthUserHunter',
'Author': ['@harmj0y'],
'Description': ('Finds which machines users of a specified group are logged into by '
... |
GbalsaC/bitnamiP | refs/heads/master | pyfs/fs/expose/http.py | 14 | __all__ = ["serve_fs"]
import SimpleHTTPServer
import SocketServer
from fs.path import pathjoin, dirname
from fs.errors import FSError
from time import mktime
from cStringIO import StringIO
import cgi
import urllib
import posixpath
import time
import threading
import socket
def _datetime_to_epoch(d):
return mktim... |
dana-i2cat/felix | refs/heads/master | optin_manager/src/python/openflow/optin_manager/opts/tests.py | 4 |
from django.conf import settings
from expedient.common.tests.manager import SettingsTestCase
from django.core.urlresolvers import reverse
import logging
from django.contrib.auth.models import User
from openflow.optin_manager.opts.models import UserFlowSpace,\
Experiment,ExperimentFLowSpace, UserOpts, OptsFlowS... |
atanasAV/forex-trading-api | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup
setup(name='tradingModule',
version='1.0',
description='Trading API',
author='atanasAV',
author_email='atanas.vasilev.av@gmail.com',
packages=['tradingModule'],
) |
leafclick/intellij-community | refs/heads/master | python/testData/editing/enterInIncompleteDictLiteral.after.py | 18 | d = {'foo': 'bar',
'baz' |
xzYue/odoo | refs/heads/8.0 | addons/l10n_ch/account_wizard.py | 424 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... |
Boris-Barboris/PySubs | refs/heads/master | engine/IOBroker.py | 1 | # Copyright Alexander Baranin 2016
import sfml
from engine.Reloadable import reloadable
_import_modules = (
('EngineCore', 'engine.EngineCore'),
('Logging', 'engine.Logging'),
('WindowModule', 'engine.WindowModule'))
SCHED_ORDER = 20
def onLoad(core):
EngineCore.schedule_FIFO(run, SCHED_ORDER)
... |
onezens/python | refs/heads/master | basic/15_regex_getimage.py | 1 | #encoding=utf8
import re
import urllib
def getUrl(url):
page = urllib.urlopen(url)
return page.read()
def getImages(html):
images = re.findall(r'src="(.*?\.(jpg|png))"', html)
x = 1
for imageurl in images :
print('downloading %s'%imageurl[0])
urllib.urlretrieve(imageurl[0], './images/%d.jpg'%x)
x += 1
ht... |
peterstace/project-euler | refs/heads/master | OLD_PY_CODE/project_euler_old_old/155/155.py | 1 | from fractions import Fraction
from itertools import product
N = 18
capacities = [None] + [set() for _ in range(N)] #none for index 0
capacities[1].add(Fraction(1))
for n in range(2, N+1):
print(n)
for i in range(1, n // 2 + 1):
for c1, c2 in product(capacities[i], capacities[n-i]):
capa... |
stripe/stripe-python | refs/heads/master | stripe/api_resources/abstract/nested_resource_class_methods.py | 1 | from __future__ import absolute_import, division, print_function
from stripe import api_requestor, util
from stripe.six.moves.urllib.parse import quote_plus
def nested_resource_class_methods(
resource, path=None, operations=None, resource_plural=None
):
if resource_plural is None:
resource_plural = "... |
ddboline/pylearn2 | refs/heads/master | pylearn2/devtools/__init__.py | 147 | __authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
|
nilbody/h2o-3 | refs/heads/master | h2o-py/tests/testdir_jira/pyunit_pubdev_1839_citi_bike_small_repro.py | 3 | import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def pubdev_1839():
train = h2o.import_file(pyunit_utils.locate("smalldata/jira/pubdev_1839_repro_train.csv"))
test = h2o.import_file(pyunit_utils.locate("smalldata/jira/pubdev_1839_repro_test.csv"))
glm0 = h2o.glm(x ... |
fergalmoran/dss | refs/heads/master | spa/migrations/0006_auto__chg_field_mix_title.py | 1 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Mix.title'
db.alter_column(u'spa_mix', 'title', self.gf('django.db.models.fields.CharFiel... |
cgaspoz/l10n-switzerland | refs/heads/8.0 | l10n_ch_payment_slip/bank.py | 9 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright 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 t... |
systers/vms | refs/heads/develop | vms/organization/__init__.py | 12133432 | |
P0cL4bs/3vilTwinAttacker | refs/heads/master | plugins/external/BDFProxy-ng/bdf/aPLib/contrib/python/__init__.py | 12133432 | |
TQRG/physalia | refs/heads/master | physalia/fixtures/__init__.py | 12133432 | |
MazeFX/cookiecutter_website_project | refs/heads/master | config/__init__.py | 12133432 | |
lucidmotifs/auto-aoc | refs/heads/master | .venv/lib/python3.5/site-packages/flake8/plugins/manager.py | 6 | """Plugin loading and management logic and classes."""
import collections
import logging
import pkg_resources
from flake8 import exceptions
from flake8 import utils
from flake8.plugins import notifier
LOG = logging.getLogger(__name__)
__all__ = (
'Checkers',
'Listeners',
'Plugin',
'PluginManager',
... |
limbocode/anime-list | refs/heads/master | exceptions.py | 1 | class ImproperlyConfigured(Exception): # Django feelings
pass
class SettingsFileMissing(ImproperlyConfigured):
pass
class LanguageNotAvailable(ImproperlyConfigured):
pass
class WrongTimezone(ImproperlyConfigured):
pass
class AnimeListNotFound(ImproperlyConfigured):
pass
|
olt/mapproxy | refs/heads/master | mapproxy/util/ext/odict.py | 8 | # -*- coding: utf-8 -*-
"""
odict
~~~~~
This module is an example implementation of an ordered dict for the
collections module. It's not written for performance (it actually
performs pretty bad) but to show how the API works.
Questions and Answers
=====================
Why would any... |
geopython/pywps | refs/heads/main | tests/test_capabilities.py | 1 | ##################################################################
# Copyright 2018 Open Source Geospatial Foundation and others #
# licensed under MIT, Please consult LICENSE.txt for details #
##################################################################
import unittest
import lxml
import lxml.etree
from ... |
untitaker/icalendar | refs/heads/master | bootstrap.py | 95 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
jobiols/odoo-addons | refs/heads/11.0 | product_price_update/wizard/__init__.py | 1 | # For copyright and license notices, see __manifest__.py file in module root
from . import price_update |
mancoast/CPythonPyc_test | refs/heads/master | fail/341_test_crashers.py | 116 | # Tests that the crashers in the Lib/test/crashers directory actually
# do crash the interpreter as expected
#
# If a crasher is fixed, it should be moved elsewhere in the test suite to
# ensure it continues to work correctly.
import unittest
import glob
import os.path
import test.support
from test.script_helper impor... |
elysium001/zamboni | refs/heads/master | lib/video/utils.py | 44 | import subprocess
def check_output(*popenargs, **kwargs):
# Tell thee, check_output was from Python 2.7 untimely ripp'd.
# check_output shall never vanquish'd be until
# Marketplace moves to Python 2.7.
if 'stdout' in kwargs:
raise ValueError('stdout argument not allowed, it will be overridden... |
heldtogether/peeping-tom | refs/heads/master | peeping-tom.py | 1 | #!/usr/bin/python
import logging
import sys
import threading
import time
from peepingtom import Arguments, tasks, io
def main(argv):
args = Arguments()
args.parse_arguments(argv)
logging.basicConfig(level=args.log_level)
reset_button = io.PushButton(4)
lcd = io.LCD()
lcd_lock = threading.L... |
charbeljc/OCB | refs/heads/8.0 | openerp/tools/pdf_utils.py | 456 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
geodynamics/pylith | refs/heads/hackathon/static-greens-fns | pylith/utils/NullComponent.py | 1 | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... |
oliviersm199/mstsversion2 | refs/heads/master | mstsv2/mstsv2app/resources/routes.py | 1 | from flask import Blueprint
from views import list_resources
# Blueprint aids in creating a modular application. This blueprint can be
# imported and added to our main app so all of the resources and url rules
# listed in here can be used in the entire application.
# This allows for a modular design.
resources_bluepri... |
Curious72/sympy | refs/heads/master | sympy/vector/tests/test_coordsysrect.py | 26 | from sympy.vector.coordsysrect import CoordSysCartesian
from sympy.vector.scalar import BaseScalar
from sympy import sin, cos, pi, ImmutableMatrix as Matrix, \
symbols, simplify, zeros, expand
from sympy.vector.functions import express
from sympy.vector.point import Point
from sympy.vector.vector import Vector
fro... |
narrowcast/pyipay | refs/heads/master | setup.py | 1 | from distutils.core import setup
setup (
name='pyipay',
version='0.1.1',
author='Chee-Hyung Yoon',
author_email='yoon@tikkon.com',
packages=['pyipay',],
url='http://pypi.python.org/pypi/pyipay/',
license='LICENSE.txt',
description='A Python library for accessing the Auction iPay API',
... |
brandond/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_stack.py | 15 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# (c) 2016, Steve Baker <sbaker@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
ANSIBLE... |
sajeeshcs/nested_quota_latest | refs/heads/master | nova/api/openstack/compute/plugins/v3/limits.py | 2 | # Copyright 2011 OpenStack Foundation
# 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... |
La0/mozilla-relengapi | refs/heads/master | src/pulselistener/pulselistener/hook.py | 1 | # -*- coding: utf-8 -*-
import json
import structlog
from pulselistener import taskcluster
from pulselistener.lib.bus import MessageBus
from pulselistener.lib.pulse import create_consumer
from pulselistener.monitoring import task_monitoring
logger = structlog.get_logger(__name__)
class Hook(object):
'''
A ... |
mavenlin/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/neon_depthwise_conv_op_test.py | 57 | # Copyright 2017 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... |
DarkArtek/FFXIVITAFC | refs/heads/master | allauth/socialaccount/providers/eveonline/views.py | 10 | import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import EveOnlineProvider
class EveOnlineOAuth2Adapter(OAuth2Adapter):
provider_id = EveOnlineProvider.id
access_token_url = 'https://login.eveonline.com... |
garbled1/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/apache2_module.py | 23 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013-2014, Christian Berendt <berendt@b1-systems.de>
# 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': ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.