repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pombredanne/pulp | refs/heads/master | server/test/unit/server/webservices/views/serializers/test_content.py | 7 | from datetime import datetime
from unittest import TestCase
from mock import patch
from pulp.common import dateutils
from pulp.server.webservices.views.serializers import content, db
LAST_UPDATED = '_last_updated'
class TestSerialization(TestCase):
@patch('pulp.server.webservices.views.serializers.db.scrub_mo... |
chrislit/abydos | refs/heads/master | abydos/phonetic/_daitch_mokotoff.py | 1 | # Copyright 2014-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... |
krismcfarlin/todo_angular_endpoints | refs/heads/master | bp_includes/external/requests/packages/chardet/big5prober.py | 2930 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
sjuxax/raggregate | refs/heads/master | raggregate/models/user_preference.py | 1 | from raggregate.models import *
from sqlalchemy import Column
from sqlalchemy import UnicodeText
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship
from raggregate.models.user import User
from raggregate.guid_recipe import GUID
class UserPreference(Base):
__tablename__ = 'user_preferences... |
elkingtonmcb/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/units.py | 70 | """
The classes here provide support for using custom classes with
matplotlib, eg those that do not expose the array interface but know
how to converter themselves to arrays. It also supoprts classes with
units and units conversion. Use cases include converters for custom
objects, eg a list of datetime objects, as we... |
hsiaoyi0504/scikit-learn | refs/heads/master | setup.py | 143 | #! /usr/bin/env python
#
# Copyright (C) 2007-2009 Cournapeau David <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# License: 3-clause BSD
descr = """A set of python modules for machine learning and data mining"""
import sys
import os
import shutil
from distutils.command.clean ... |
jgillis/casadi | refs/heads/develop | experimental/greg/ode.py | 1 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010 by Joel Andersson, Moritz Diehl, K.U.Leuven. All rights reserved.
#
# CasADi is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pub... |
chunywang/crosswalk-test-suite | refs/heads/master | misc/webdriver-w3c-tests/client/webelement.py | 12 | """Element-level WebDriver operations."""
import searchcontext
class WebElement(searchcontext.SearchContext):
"""Corresponds to a DOM element in the current page."""
def __init__(self, driver, id):
self._driver = driver
self._id = id
# Set value of mode used by SearchContext
... |
javaos74/neutron | refs/heads/master | neutron/plugins/ml2/drivers/opendaylight/__init__.py | 12133432 | |
stacksync/web | refs/heads/master | webclient/__init__.py | 12133432 | |
paulrouget/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/resources/import-mime-type-worker.py | 71 | def main(request, response):
if 'mime' in request.GET:
return (
[('Content-Type', 'application/javascript')],
"importScripts('./mime-type-worker.py?mime={0}');".format(request.GET['mime'])
)
return (
[('Content-Type', 'application/javascript')],
"importScr... |
xxsergzzxx/python-for-android | refs/heads/master | python-modules/twisted/twisted/mail/_version.py | 49 | # This is an auto-generated file. Do not edit it.
from twisted.python import versions
version = versions.Version('twisted.mail', 10, 2, 0)
|
yesbox/ansible | refs/heads/devel | test/units/__init__.py | 267 |
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
|
harmy/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_pty.py | 3 | from test.support import verbose, run_unittest, import_module, reap_children
#Skip these tests if either fcntl or termios is not available
fcntl = import_module('fcntl')
import_module('termios')
import errno
import pty
import os
import sys
import signal
import unittest
TEST_STRING_1 = b"I wish to buy a ... |
jmwright/cadquery-freecad-module | refs/heads/master | Libs/requests/hooks.py | 136 | # -*- coding: utf-8 -*-
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ['response']
def default_hooks():
return {event: [] for event in HOOKS}
# TODO: response is the ... |
joariasl/odoo | refs/heads/8.0 | addons/l10n_pe/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
HandyCodeJob/mikeandzoey-site | refs/heads/master | src/rsvp/migrations/0015_auto_20150918_1303.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('rsvp', '0014_logistics'),
]
operations = [
migrations.AlterField(
model_name='logistics',
name='name... |
jarvys/django-1.7-jdb | refs/heads/master | django/contrib/formtools/tests/tests.py | 53 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import unittest
import warnings
from django import http
from django.contrib.formtools import preview, utils
from django.test import TestCase, override_settings
from django.utils._os import upath
from django.contrib.formtools.te... |
webdev1001/ansible | refs/heads/devel | v2/test/parsing/test_mod_args.py | 109 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
jazkarta/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py | 80 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CourseOverview'
db.create_table('course_overviews_courseo... |
wilkeraziz/grasp | refs/heads/master | grasp/cfg/info.py | 1 | """
Reports information about grammars.
:Authors: - Wilker Aziz
"""
import argparse
import logging
from grasp.cfg.reader import load_grammar
from tabulate import tabulate
from grasp.formal.hg import cfg_to_hg
from grasp.formal.topsort import LazyTopSortTable
def report(args):
general_header = ['path', 'type', '... |
perryjrandall/arsenalsuite | refs/heads/master | python/blur/examples/timesheet_reports.py | 11 | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from blur.Stone import *
from blur.Classes import *
import sys
import blur.reports
# First Create a Qt Application
app = QApplication(sys.argv)
# Load database config
if sys.platform=='win32':
initConfig("c:\\blur\\resin\\resin.ini")
else:
init... |
Matt-Deacalion/django | refs/heads/master | django/db/migrations/operations/base.py | 356 | from __future__ import unicode_literals
from django.db import router
class Operation(object):
"""
Base class for migration operations.
It's responsible for both mutating the in-memory model state
(see db/migrations/state.py) to represent what it performs, as well
as actually performing it agains... |
bis12/spdyathome | refs/heads/master | spdyathome/servers.py | 2 | """
Start the basic thor servers for each case of connection.
Use the standard request responders in BaseServer.
"""
import urilib
import os
import sys
import argparse
from . import conf
from . import util
from thor.loop import run
from thor import HttpServer
from thor import SpdyServer
from serverbase import BaseServe... |
OpenSlides/OpenSlides | refs/heads/master | server/openslides/assignments/migrations/0021_assignmentvote_user_token_3.py | 5 | # Generated by jsangmeister on 2021-03-25 10:41
from django.db import migrations, models
import openslides.poll.models
class Migration(migrations.Migration):
dependencies = [
("assignments", "0020_assignmentvote_user_token_2"),
]
operations = [
migrations.AlterField(
model_... |
classrank/ClassRank | refs/heads/master | classrank/handlers/suggestion.py | 1 | from tornado.web import authenticated
from classrank.database.wrapper import Query
from . import BaseHandler
from classrank.filters.collabfilter import CollaborativeFilter
class SuggestionHandler(BaseHandler):
@authenticated
def get(self):
page_data = {"error": False, "data":{}}
user = self.... |
dakcarto/suite-qgis-plugin | refs/heads/name_fixes | src/opengeo/gui/dialogs/styledialog.py | 1 | from PyQt4 import QtGui, QtCore
from opengeo.qgis import layers
class StyleFromLayerDialog(QtGui.QDialog):
def __init__(self, parent = None):
super(StyleFromLayerDialog, self).__init__(parent)
self.layer = None
self.name = None
self.initGui()
... |
pipermerriam/django | refs/heads/master | tests/schema/fields.py | 203 | from django.db import models
from django.db.models.fields.related import (
RECURSIVE_RELATIONSHIP_CONSTANT, ManyRelatedObjectsDescriptor,
ManyToManyField, ManyToManyRel, RelatedField,
create_many_to_many_intermediary_model,
)
from django.utils.functional import curry
class CustomManyToManyField(RelatedFie... |
willwray/dash | refs/heads/v0.12.2.x | contrib/seeds/makeseeds.py | 34 | #!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 400000
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... |
nagyistoce/edx-platform | refs/heads/master | common/djangoapps/auth_exchange/tests/test_forms.py | 113 | # pylint: disable=no-member
"""
Tests for OAuth token exchange forms
"""
import unittest
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase
from django.test.client import RequestFactory
import httpretty
from provider import scope
import so... |
vladryk/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/volumes/volume_types/extras/urls.py | 66 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
hughperkins/pycltorch | refs/heads/master | test_cltorch.py | 1 | from __future__ import print_function
import PyClTorch
from PyTorchAug import nn
# PyClTorch.newfunction(123)
import PyTorch
from PyTorchAug import *
def myeval(expr):
print(expr, ':', eval(expr))
if __name__ == '__main__':
# a = PyTorch.foo(3,2)
# print('a', a)
# print(PyTorch.FloatTensor(3,2))
... |
jleclanche/django-push-notifications | refs/heads/master | push_notifications/gcm.py | 3 | """
Firebase Cloud Messaging
Previously known as GCM / C2DM
Documentation is available on the Firebase Developer website:
https://firebase.google.com/docs/cloud-messaging/
"""
import json
from django.core.exceptions import ImproperlyConfigured
from .compat import Request, urlopen
from .conf import get_manager
from .... |
jia-kai/pynojo | refs/heads/master | experiments/serialize-set.py | 3 | # -*- coding: utf-8 -*-
# $File: serialize-set.py
# $Date: Sun Mar 04 18:48:58 2012 +0800
# $Author: jiakai <jia.kai66@gmail.com>
from clock import clock
import pickle, cPickle, json, cjson, marshal
data = set(range(10))
def test(lib, enc, dec, niter = 100000):
with clock(lib + ' encode:'):
for i in ran... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.2/tests/unit/modules/glusterfs_test.py | 2 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
:codeauthor: :email:`Joe Julian <me@joejulian.name>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
Ma... |
skoslowski/gnuradio | refs/heads/master | grc/core/cache.py | 1 | # Copyright 2017 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
from __future__ import absolute_import, print_function, unicode_literals
from io import open
import json
import logging
import os
import six
from .io import yaml
logger = logging.getLogg... |
hanleilei/note | refs/heads/master | python/vir_manager/backstage/view/home_views.py | 1 | import datetime
from django.db.models import Q
from django.shortcuts import render
from django.forms.models import model_to_dict
from backstage.base import logger
from backstage.models import IdcRoom
from backstage.models import Colony
from backstage.models import Host
from backstage.models import Virtual
from backsta... |
dkubiak789/odoo | refs/heads/8.0 | addons/portal_sale/res_config.py | 445 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
dims/glance | refs/heads/master | glance/db/sqlalchemy/api.py | 1 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# Copyright 2013 IBM Corp.
# Copyright 2015 Mirantis, Inc.
# All Rights Reserved.
#
# Licensed under t... |
Jorge-Rodriguez/ansible | refs/heads/devel | lib/ansible/plugins/doc_fragments/default_callback.py | 9 | # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = """
options:
display_skipped_hosts:
name: Show skipped hosts
description: "Toggle to control displaying skipped task/h... |
Petr-Kovalev/nupic-win32 | refs/heads/master | py/nupic/frameworks/opf/exp_generator/opfExperimentControlTemplate.py | 3 |
control = {
# The environment that the current model is being run in
"environment": $ENVIRONMENT,
# [optional] A sequence of one or more tasks that describe what to do with the
# model. Each task consists of a task label, an input spec., iteration count,
# and a task-control spec per opfTaskSchema.json
... |
jtakayama/ics691-setupbooster | refs/heads/master | makahiki/apps/managers/player_mgr/migrations/0002_auto__add_dailystatus.py | 7 | # encoding: 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 'DailyStatus'
db.create_table('player_mgr_dailystatus', (
('id', self.gf('djang... |
zer0yu/ZEROScan | refs/heads/master | thirdparty/colorama/win32.py | 6 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = Non... |
zubair-arbi/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/migrations/0003_add_cert_html_view_enabled.py | 66 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseOverview.cert_html_view_enabled'
# The default val... |
mrquim/mrquimrepo | refs/heads/master | repo/script.skin.helper.service/resources/lib/plugin_content.py | 4 | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
script.skin.helper.service
Helper service and scripts for Kodi skins
plugin_content.py
Hidden plugin entry point providing some helper features
'''
import xbmc
import xbmcplugin
import xbmcgui
import xbmcaddon
from simplecache import SimpleCache
from utils... |
Distrotech/scons | refs/heads/distrotech-scons | test/spaces.py | 4 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... |
gangadhar-kadam/verve_live_erp | refs/heads/v5.0 | erpnext/contacts/doctype/party_type/__init__.py | 12133432 | |
willingc/oh-mainline | refs/heads/master | vendor/packages/gdata/tests/__init__.py | 12133432 | |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/localflavor/pe/__init__.py | 12133432 | |
shakamunyi/sahara | refs/heads/master | sahara/tests/unit/plugins/storm/__init__.py | 12133432 | |
stevenewey/django | refs/heads/master | django/conf/locale/ka/__init__.py | 12133432 | |
dsm054/pandas | refs/heads/master | pandas/tests/groupby/aggregate/test_aggregate.py | 1 | # -*- coding: utf-8 -*-
"""
test .agg behavior / note that .apply is tested generally in test_groupby.py
"""
import pytest
import numpy as np
import pandas as pd
from pandas import concat, DataFrame, Index, MultiIndex, Series
from pandas.core.groupby.grouper import Grouping
from pandas.core.base import Specificatio... |
sameerparekh/pants | refs/heads/master | src/python/pants/backend/android/tasks/dx_compile.py | 9 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
benwaa/iPhotoCloudSync | refs/heads/master | lib/python2.7/tilutil/imageutils.py | 1 | '''Helpers to use with images files
@author: tsporkert@gmail.com
'''
# Copyright 2010 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/licen... |
pdellaert/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_igmp.py | 68 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... |
airtame/linux | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... |
bruecksen/isimip | refs/heads/master | isi_mip/pages/migrations/0029_auto_20181114_1549.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-14 14:49
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import isi_mip.contrib.blocks
import modelcluster.fields
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
impor... |
sjlehtin/django | refs/heads/master | tests/utils_tests/test_autoreload.py | 44 | import gettext
import os
import shutil
import tempfile
from importlib import import_module
from unittest import mock
import _thread
from django import conf
from django.contrib import admin
from django.test import SimpleTestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils import ... |
joshisa/zulip | refs/heads/master | analytics/management/commands/active_user_stats.py | 116 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.models import UserPresence, UserActivity
from zerver.lib.utils import statsd, statsd_key
from datetime import datetime, timedelta
from collections import defaultdict
class Command(BaseCommand):
help = """Sends... |
Jimdo/ansible-modules-core | refs/heads/devel | files/lineinfile.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2014, Ahti Kitsik <ak@ahtik.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 S... |
IndonesiaX/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/index.py | 5 | # -*- coding: utf-8 -*-
"""
LMS index (home) page.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
BANNER_SELECTOR = 'section.home header div.outer-wrapper div.title hgroup h1'
INTRO_VIDEO_SELECTOR = 'div.play-intro'
VIDEO_MODAL_SELECTOR = 'section#video-modal.modal.home-page-video-modal.video-m... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/django/contrib/messages/middleware.py | 1220 | from django.conf import settings
from django.contrib.messages.storage import default_storage
class MessageMiddleware(object):
"""
Middleware that handles temporary messages.
"""
def process_request(self, request):
request._messages = default_storage(request)
def process_response(self, re... |
bolster/sorl-url | refs/heads/master | sorl_url/tests.py | 6666 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 a... |
jomauricio/abgthe | refs/heads/master | abgthe/profiles/views.py | 2 | from .models import Profile
from .forms import ProfilesForm
from braces.views import LoginRequiredMixin
from django.views.generic import UpdateView, DetailView, RedirectView
from django.core.urlresolvers import reverse
class ProfileDetailView(LoginRequiredMixin, DetailView):
model = Profile
form_class = P... |
ftomassetti/intellij-community | refs/heads/master | python/testData/mover/theSameLevelMultiple_afterUp.py | 83 | try:
a = 1
except ImportError as A:
import <caret>tmp2; import tmp1
print xrange
|
mlassnig/pilot | refs/heads/master | movers/__init__.py | 3 | """
Site Movers package
:author: Alexey Anisenkov
"""
from .base import BaseSiteMover
# import evertying here to allow import movers explicitly by its name from the package
from .sitemovers import *
import sitemovers
def getSiteMover(name):
""" Resolve Site Mover class by its ID name """
# get all mov... |
syaiful6/django | refs/heads/master | tests/save_delete_hooks/__init__.py | 12133432 | |
msherry/PyXB-1.1.4 | refs/heads/master | pyxb_114/bundles/wssplat/__init__.py | 12133432 | |
vladmm/intellij-community | refs/heads/master | python/testData/resolve/multiFile/localImport/mypackage/__init__.py | 12133432 | |
cpenv/cpenv | refs/heads/master | cpenv/vendor/yaml/yaml2/resolver.py | 76 |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... |
strogo/flask-babel | refs/heads/master | tests/tests.py | 12 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import unittest
from decimal import Decimal
import flask
from datetime import datetime
from flaskext import babel
from flaskext.babel import gettext, ngettext, lazy_gett... |
caotianwei/django | refs/heads/master | tests/model_options/__init__.py | 12133432 | |
oceanobservatories/mi-instrument | refs/heads/master | mi/instrument/seabird/__init__.py | 12133432 | |
zorojean/scikit-learn | refs/heads/master | sklearn/utils/tests/test_optimize.py | 135 | import numpy as np
from sklearn.utils.optimize import newton_cg
from scipy.optimize import fmin_ncg
from sklearn.utils.testing import assert_array_almost_equal
def test_newton_cg():
# Test that newton_cg gives same result as scipy's fmin_ncg
rng = np.random.RandomState(0)
A = rng.normal(size=(10, 10))
... |
ryano144/intellij-community | refs/heads/master | python/lib/Lib/UserString.py | 91 | #!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
"""
import sys
__all__ = ["UserString","MutableString"]
class UserString:
def __init__(self, seq):
if isinstance(seq,... |
Benedicte/vibrational_motion | refs/heads/master | abavib.py | 1 | """
Copyright (c) 2013-2014 Benedicte Ofstad
Distributed under the GNU Lesser General Public License v3.0.
For full terms see the file LICENSE.md.
"""
import read_input as ri
import Molecule as mol
import Propertyclasses as pr
import pydoc
"""
The module working as the interface of the command line based program.
I... |
MJafarMashhadi/django-rest-framework | refs/heads/master | rest_framework/utils/__init__.py | 12133432 | |
thumbimigwe/echorizr | refs/heads/master | lib/python2.7/site-packages/django/conf/locale/fr/__init__.py | 12133432 | |
harej/requestoid | refs/heads/master | migrations/__init__.py | 12133432 | |
poldracklab/open_fmri | refs/heads/master | open_fmri/apps/dataset/migrations/0007_task_dataset.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dataset', '0006_auto_20151008_2052'),
]
operations = [
migrations.AddField(
model_name='task',
name=... |
SAug3n/burpPlatform | refs/heads/master | compoment/mysql_burp.py | 1 | # -*- coding: UTF-8 -*-
import MySQLdb
import burp
import logging
class mysql_burp(burp.burp):
def burp_thread(self,password):
if self.stop_signal:
return None
try:
db = MySQLdb.connect(host=self.target,port=self.port,user=self.now_user,passwd=password)
... |
knorrium/firefox-ios | refs/heads/master | scripts/clean-xliff.py | 41 | #! /usr/bin/env python
#
# clean-xliff.py <l10n_folder>
#
# Remove targets from a locale, remove target-language attribute
#
from glob import glob
from lxml import etree
import argparse
import os
NS = {'x':'urn:oasis:names:tc:xliff:document:1.2'}
def indent(elem, level=0):
# Prettify XML output
# http://eff... |
tfeagle/mitmproxy | refs/heads/master | test/tools/bench.py | 41 | from __future__ import print_function
import requests
import time
n = 100
url = "http://192.168.1.1/"
proxy = "http://192.168.1.115:8080/"
start = time.time()
for _ in range(n):
requests.get(url, allow_redirects=False, proxies=dict(http=proxy))
print(".", end="")
t_mitmproxy = time.time() - start
print("\r\n... |
0k/odoo | refs/heads/master | addons/point_of_sale/report/pos_invoice.py | 317 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
eecsu/BET | refs/heads/master | examples/validationExample/myModel.py | 2 | # Copyright (C) 2016 The BET Development Team
# -*- coding: utf-8 -*-
import numpy as np
# Define a model that is a linear QoI map
def my_model(parameter_samples):
Q_map = np.array([[0.506, 0.463], [0.253, 0.918]])
QoI_samples = np.dot(parameter_samples,Q_map)
return QoI_samples
|
moto-timo/ironpython3 | refs/heads/master | Src/StdLib/Lib/distutils/dir_util.py | 79 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminates redundant "creating ... |
jjp9624022/angularFlaskBlog | refs/heads/master | server/app/__init__.py | 12133432 | |
DNFcode/edx-platform | refs/heads/master | common/djangoapps/student/management/commands/transfer_students.py | 108 | """
Transfer Student Management Command
"""
from django.db import transaction
from opaque_keys.edx.keys import CourseKey
from optparse import make_option
from django.contrib.auth.models import User
from student.models import CourseEnrollment
from shoppingcart.models import CertificateItem
from track.management.tracked_... |
DaniilLeksin/gc | refs/heads/master | wx/richtext.py | 1 | # This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
import _richtext
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name ... |
pongem/python-bot-project | refs/heads/master | appengine/standard/botapp/lib/django/utils/autoreload.py | 295 | # Autoreloading launcher.
# Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
# Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
#
# Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with ... |
peak3d/kodi-agile | refs/heads/master | tools/EventClients/lib/python/xbmcclient.py | 26 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) ... |
parkr/Python-CGI | refs/heads/master | protein.py | 1 | #! /usr/bin/python
import cgi
def main():
print "Content-type: text/plain\n"
form = cgi.FieldStorage()
weight = int(form.getvalue("weight"))
print "A person of a normal activity level requires ",
print weight*.4,
print "g of protein per day."
print "If you are more active, try to eat ",
print weight*.6,
prin... |
klonage/nlt-gcs | refs/heads/master | Lib/site-packages/numpy/distutils/command/egg_info.py | 100 | from setuptools.command.egg_info import egg_info as _egg_info
class egg_info(_egg_info):
def run(self):
# We need to ensure that build_src has been executed in order to give
# setuptools' egg_info command real filenames instead of functions which
# generate files.
self.run_command("... |
kwikteam/global_superclustering | refs/heads/master | global_code/global_script.py | 1 | from phy.io import KwikModel
from phy.cluster.session import Session
import phy
phy.__version__
from klustakwik2 import *
#import hashutils
import numpy as np
import pickle
import sys
import os
import copy
import time
from IPython.parallel import Client
from IPython import embed
def write_mask(mask, filename, fm... |
albertomurillo/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_broadcast_domain.py | 38 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... |
noogel/xyzStudyPython | refs/heads/master | downloadPythontutorial-2.7.11/download.py | 1 | # -*- coding:utf-8 -*-
import os
import codecs
import requests
import chardet
root_url = "http://www.pythondoc.com/pythontutorial27/_sources/"
path_list = """index.html
appetite.html
interpreter.html
introduction.html
controlflow.html
datastructures.html
modules.html
inputoutput.html
errors.html
classes.html
stdlib.ht... |
bop/hybrid | refs/heads/master | lib/python2.6/site-packages/django/core/management/commands/sqlsequencereset.py | 242 | from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import AppCommand
from django.db import connections, models, DEFAULT_DB_ALIAS
class Command(AppCommand):
help = 'Prints the SQL statements for resetting sequences for the given app name(s).'
option_list... |
ringo-framework/ringo | refs/heads/master | ringo/resources.py | 3 | import logging
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import DataError
from pyramid.httpexceptions import HTTPNotFound
from ringo.lib.helpers import get_item_modul
log = logging.getLogger(__name__)
def get_resource_factory(clazz, modul=None):
"""Dynamically create a Resource factory. Th... |
jonycgn/scipy | refs/heads/master | scipy/signal/wavelets.py | 23 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.dual import eig
from scipy.special import comb
from scipy import linspace, pi, exp
from scipy.signal import convolve
__all__ = ['daub', 'qmf', 'cascade', 'morlet', 'ricker', 'cwt']
def daub(p):
"""
The coefficient... |
austinhyde/ansible-modules-core | refs/heads/devel | cloud/amazon/_ec2_ami_search.py | 75 | #!/usr/bin/python
#
# (c) 2013, Nimbis Services
#
# 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 ver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.