repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
quheng/scikit-learn | refs/heads/master | examples/plot_digits_pipe.py | 250 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Pipelining: chaining a PCA and a logistic regression
=========================================================
The PCA does an unsupervised dimensionality reduction, while the logistic
regression does the predictio... |
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/bloom-filter-cpp/vendor/depot_tools/third_party/boto/s3/prefix.py | 237 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... |
openearth/aeolis-python | refs/heads/master | aeolis/wind.py | 1 | '''This file is part of AeoLiS.
AeoLiS 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.
AeoLiS is distributed in the hope that it will... |
vishalsahu5/carpool | refs/heads/master | notification/admin.py | 1 | from django.contrib import admin
from .models import Notification
# Register your models here.
admin.site.register(Notification) |
wikimedia/operations-debs-python-diamond | refs/heads/master | src/collectors/ipvs/ipvs.py | 3 | # coding=utf-8
"""
Shells out to get ipvs statistics, which may or may not require sudo access
#### Dependencies
* /usr/sbin/ipvsadmin
"""
import diamond.collector
import subprocess
import os
import string
from diamond.collector import str_to_bool
class IPVSCollector(diamond.collector.Collector):
def __ini... |
diogo149/treeano | refs/heads/master | canopy/transforms/fns.py | 3 | import treeano
from .. import network_utils
from .. import walk_utils
from .. import node_utils
def network_to_kwargs(network, priority="post_override"):
"""
converts a network into kwargs that could be used for constructing
the same network while sharing shared variables
priority:
one of:
-... |
toomoresuch/pysonengine | refs/heads/master | parts/google_appengine/lib/django/django/db/backends/mysql/creation.py | 62 | # This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict__ before being output.
# If a column type is set to None, it won't be included in the output.
DATA_TYPES = {
'AutoFi... |
datapackages/tabulator-py | refs/heads/master | tests/formats/test_tsv.py | 1 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import io
from mock import Mock
from tabulator.parsers.tsv import TSVParser
# Parser
def test_parser_tsv():
source = 'data/table.tsv'
... |
sftd/scons | refs/heads/master | scons-local/SCons/Platform/darwin.py | 11 | """engine.SCons.Platform.darwin
Platform-specific initialization for Mac OS X systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008... |
antiface/mne-python | refs/heads/master | mne/datasets/spm_face/spm_data.py | 16 | # Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD Style.
from ...utils import verbose
from ...fixes import partial
from ..utils import (has_dataset, _data_path, _data_path_doc,
_get_version, _version_doc)
has_spm_data = partial(has_dataset, name='spm')
@verbose
def data_pat... |
woobe/h2o | refs/heads/master | py/testdir_multi_jvm/test_GBM_with_cancels.py | 1 | import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd,h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_hosts, h2o_jobs, h2o_gbm
DELETE_KEYS = True
# FIX need to get exec workin
DO_CLASSIFICATION = False
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_san... |
smartfile/django-1.4 | refs/heads/master | tests/regressiontests/app_loading/not_installed/__init__.py | 12133432 | |
alexkolar/home-assistant | refs/heads/dev | homeassistant/components/switch/modbus.py | 10 | """
homeassistant.components.switch.modbus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Modbus switches.
Configuration:
To use the Modbus switches you will need to add something like the following to
your configuration.yaml file.
sensor:
platform: modbus
slave: 1
registers:
24:
... |
GetSomeBlocks/ServerStatus | refs/heads/master | resources/lib/twisted/twisted/cred/credentials.py | 59 | # -*- test-case-name: twisted.test.test_newcred-*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
from zope.interface import implements, Interface
import hmac, time, random
from twisted.python.hashlib import md5
from twisted.python.randbytes import secureRandom
from twisted.cred._... |
tashigaofei/BlogSpider | refs/heads/master | scrapy/tests/test_utils_jsonrpc.py | 15 | import unittest, json
from cStringIO import StringIO
from scrapy.utils.jsonrpc import jsonrpc_client_call, jsonrpc_server_call, \
JsonRpcError, jsonrpc_errors
from scrapy.utils.serialize import ScrapyJSONDecoder
from scrapy.tests.test_utils_serialize import CrawlerMock
class urllib_mock(object):
def __init__(... |
gabrielcaputo/pokeapi | refs/heads/master | pokemon/south_migrations/__init__.py | 12133432 | |
TheMOOCAgency/edx-platform | refs/heads/master | cms/djangoapps/contentstore/__init__.py | 12133432 | |
abstract-open-solutions/OCB | refs/heads/8.0 | addons/pos_discount/discount.py | 315 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/radarr/__init__.py | 36 | """The radarr component."""
|
darktears/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/internal/platform/power_monitor/android_temperature_monitor.py | 16 | # Copyright 2014 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 logging
from telemetry.internal.platform import power_monitor
try:
from devil.android import device_errors # pylint: disable=import-error
except ... |
cjwinty/p2pool-dimecoin | refs/heads/master | wstools/MIMEAttachment.py | 294 | #TODO add the license
#I had to rewrite this class because the python MIME email.mime (version 2.5)
#are buggy, they use \n instead \r\n for new line which is not compliant
#to standard!
# http://bugs.python.org/issue5525
#TODO do not load all the message in memory stream it from the disk
import re
import random
impo... |
vc3-project/vc3-client | refs/heads/master | testing/test_policies.py | 1 | """
Unit tests for testing user policies as implemented in the vc3 client code
"""
import unittest
import ConfigParser
import sys
import os
import vc3client.client
vc3_client = None
def setupModule():
"""
Create
:return:
"""
global vc3_client
c = ConfigParser.SafeConfigParser()
if 'VC... |
gmist/my-gae-init | refs/heads/master | main/auth/github.py | 7 | # coding: utf-8
from __future__ import absolute_import
import flask
import auth
import config
import model
import util
from main import app
github_config = dict(
access_token_method='POST',
access_token_url='https://github.com/login/oauth/access_token',
authorize_url='https://github.com/login/oauth/authorize... |
allotria/intellij-community | refs/heads/master | python/testData/requirement/generation/keepEditableFromVCS/main.py | 10 | import django
import numpy
import tox |
plotly/dash-table | refs/heads/dev | tests/selenium/test_dropdown.py | 1 | import dash
from dash_table import DataTable
def get_app():
app = dash.Dash(__name__)
columns = [
dict(id="a", name="a"),
dict(id="b", name="b"),
dict(id="c", name="c", presentation="dropdown"),
]
app.layout = DataTable(
id="table",
columns=columns,
d... |
DesertBus/txircd | refs/heads/master | txircd/modules/cmd_version.py | 1 | from twisted.words.protocols import irc
from txircd.modbase import Command
class VersionCommand(Command):
def onUse(self, user, data):
user.sendMessage(irc.RPL_VERSION, ":{} {}".format(self.ircd.version, self.ircd.name))
user.send_isupport()
class Spawner(object):
def __init__(self, ircd):
... |
townbull/keystone-dtrust | refs/heads/dev/domain-trusts | keystone/auth/plugins/oauth1.py | 6 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
#
# 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
#
# Unle... |
seecr/meresco-distributed | refs/heads/master | test/servicemanagementtest.py | 1 | ## begin license ##
#
# "Meresco Distributed" has components for group management based on "Meresco Components."
#
# Copyright (C) 2015 Drents Archief http://www.drentsarchief.nl
# Copyright (C) 2015, 2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2021 Data Archiving and Network Services https://dans.k... |
mahadeva604/ansible-modules-extras | refs/heads/devel | windows/win_chocolatey.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Trond Hindenes <trond@hindenes.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 L... |
simongibbons/numpy | refs/heads/main | numpy/f2py/tests/test_size.py | 17 | import os
import pytest
from numpy.testing import assert_equal
from . import util
def _path(*a):
return os.path.join(*((os.path.dirname(__file__),) + a))
class TestSizeSumExample(util.F2PyTest):
sources = [_path('src', 'size', 'foo.f90')]
@pytest.mark.slow
def test_all(self):
r = self.modu... |
olsaki/ansible-modules-extras | refs/heads/devel | packaging/os/pacman.py | 19 | #!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.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 publish... |
peterjc/bioconda-recipes | refs/heads/master | recipes/biopet/0.8.0/biopet.py | 52 | #!/usr/bin/env python
#
# Wrapper script for starting the Biopet JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker/peptide-shak... |
magicalhobo/Hatchling | refs/heads/master | appengine/hatchling/apis/twitter/__init__.py | 1 | import calendar, json
from base64 import b64encode
from cgi import parse_qs
from datetime import datetime
from hashlib import sha1
from hmac import new as hmac
from logging import debug, info, warning, error, exception
from random import getrandbits
from urllib import quote, urlencode
from google.appengine.api import... |
aselle/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/optimizers/__init__.py | 39 | # 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... |
sffjunkie/home-assistant | refs/heads/master | homeassistant/components/media_player/cast.py | 1 | """
Provide functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
# pylint: disable=import-error
import logging
from homeassistant.components.media_player import (
MEDIA_TYP... |
lyft/incubator-airflow | refs/heads/master | airflow/providers/openfass/hooks/openfaas.py | 4 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
ukBaz/ble_beacon | refs/heads/main | examples/workshop2.py | 1 | from scanner import protocols, hci_socket
for pkt in hci_socket.run():
ad = protocols.AdvertEventHandler(pkt)
if ad.eddystone_uid:
print(f'instance id: {ad.eddystone_uid.instance_id}')
if ad.eddystone_uid.instance_id == 11:
print(f'namespace id: {ad.eddystone_uid.namespace_id}')
... |
insiderr/insiderr-app | refs/heads/master | ios-patches/basemodules/Crypto/Util/number.py | 127 | #
# number.py : Number-theoretic functions
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling, Barry A. Warsaw, and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... |
Lektorium-LLC/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/migrate_to_split.py | 6 | """
Django management command to migrate a course from the old Mongo modulestore
to the new split-Mongo modulestore.
"""
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from ... |
ryfeus/lambda-packs | refs/heads/master | Rasterio_osgeo_shapely_PIL_pyproj_numpy/source/numpy/dual.py | 174 | """
Aliases for functions which may be accelerated by Scipy.
Scipy_ can be built to use accelerated or otherwise improved libraries
for FFTs, linear algebra, and special functions. This module allows
developers to transparently support these accelerated functions when
scipy is available but still support users who hav... |
faulkner/prospector | refs/heads/master | prospector/tools/pylint/collector.py | 3 | from __future__ import absolute_import
from pylint.reporters import BaseReporter
from pylint.utils import UnknownMessage
from prospector.message import Location, Message
class Collector(BaseReporter):
name = 'collector'
def __init__(self, message_store):
BaseReporter.__init__(self, output=None)
... |
mscuthbert/abjad | refs/heads/master | abjad/tools/indicatortools/test/test_indicatortools_Clef_middle_c_position.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_indicatortools_Clef_middle_c_position_01():
assert Clef('treble').middle_c_position == pitchtools.StaffPosition(-6)
assert Clef('alto').middle_c_position == pitchtools.StaffPosition(0)
assert Clef('tenor').middle_c_position == pitchtools.StaffPositio... |
bregmanstudio/BregmanToolkit | refs/heads/master | bregman/examples/2_testsignal.py | 1 | # examples_testsignal.py
# Bregman audio testsignal synthesis examples
#
# Copyright (C) 2011 Mike Casey
# Dartmouth College, Hanover, NH
# All Rights Reserved
#
from bregman.suite import *
import os
import os.path
from pylab import *
def ex_1a():
"""
sinusoid
"""
print "Example 1: sinusoid"
sys.... |
tudorbarascu/QGIS | refs/heads/master | tests/src/python/test_provider_oapif.py | 6 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the OAPIF provider.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
""... |
JudoWill/glue | refs/heads/master | doc/customizing_guide/scripts/bball_viewer_1.py | 8 | from glue import custom_viewer
from matplotlib.colors import LogNorm
bball = custom_viewer('Shot Plot',
x='att(x)',
y='att(y)')
@bball.plot_data
def show_hexbin(axes, x, y):
axes.hexbin(x, y,
cmap='Purples',
gridsize=40,
... |
dga4654dan/UTM-Demo | refs/heads/master | V_1_0_2_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/mimify.py | 9 | #! /usr/bin/env python
"""Mimification and unmimification of mail messages.
Decode quoted-printable parts of a mail message or encode using
quoted-printable.
Usage:
mimify(input, output)
unmimify(input, output, decode_base64 = 0)
to encode and decode respectively. Input and output may be the name
of... |
abhishekkrthakur/scikit-learn | refs/heads/master | examples/cluster/plot_digits_agglomeration.py | 377 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Feature agglomeration
=========================================================
These images how similar features are merged together using
feature agglomeration.
"""
print(__doc__)
# Code source: Gaël Varoquaux
#... |
chrisfilda/edx_platform | refs/heads/master | common/lib/django_startup.py | 50 | """
Automatic execution of startup modules in Django apps.
"""
from importlib import import_module
from django.conf import settings
def autostartup():
"""
Execute app.startup:run() for all installed django apps
"""
for app in settings.INSTALLED_APPS:
# See if there's a startup module in each a... |
bblanchon/Stino | refs/heads/new-stino | stino/pyarduino/arduino_item.py | 14 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# 1. Copyright
# 2. Lisence
# 3. Author
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from . import arduino_params_file
class ItemsFile(arduino_para... |
ashhher3/pylearn2 | refs/heads/master | pylearn2/datasets/tests/test_tfd.py | 45 | import unittest
import numpy as np
from pylearn2.datasets.tfd import TFD
from pylearn2.space import Conv2DSpace
from pylearn2.testing.skip import skip_if_no_data
class TestTFD(unittest.TestCase):
def setUp(self):
skip_if_no_data()
def test_load(self):
TFD(which_set='valid')
TFD(which... |
ssalka/django-node | refs/heads/master | django/core/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-02 00:26
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... |
alshedivat/tensorflow | refs/heads/master | tensorflow/python/ops/distributions/student_t.py | 6 | # 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... |
nicolargo/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/management/commands/startapp.py | 321 | import os
from django.core.management.base import copy_helper, CommandError, LabelCommand
from django.utils.importlib import import_module
class Command(LabelCommand):
help = "Creates a Django app directory structure for the given app name in the current directory."
args = "[appname]"
label = 'application... |
commtrack/commtrack-core | refs/heads/master | apps/django_extensions/management/commands/dumpscript.py | 28 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Title: Dumpscript management command
Project: Hardytools (queryset-refactor version)
Author: Will Hardy (http://willhardy.com.au)
Date: June 2008
Usage: python manage.py dumpscript appname > scripts/scriptname.py
$Revision: 217 $
Descripti... |
rmboggs/django | refs/heads/master | tests/model_forms/__init__.py | 12133432 | |
erikr/django | refs/heads/master | tests/migrations/test_add_many_to_many_field_initial/__init__.py | 12133432 | |
ClovisIRex/Snake-django | refs/heads/master | env/lib/python3.6/site-packages/django/conf/locale/fy/__init__.py | 12133432 | |
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/aqualogic/__init__.py | 19 | """Support for AquaLogic devices."""
from datetime import timedelta
import logging
import threading
import time
from aqualogic.core import AquaLogic
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_PORT,
EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistan... |
thaim/ansible | refs/heads/fix-broken-link | test/units/modules/storage/netapp/test_netapp_e_hostgroup.py | 23 | # (c) 2018, NetApp Inc.
# 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
from ansible.modules.storage.netapp.netapp_e_hostgroup import NetAppESeriesHostGroup
from units.modules.utils impo... |
mozilla/olympia | refs/heads/master | src/olympia/amo/tests/test_settings.py | 4 | # -*- coding: utf-8 -*-
import os
import json
import pytest
from django.conf import settings
from olympia.lib.settings_base import get_sentry_release
@pytest.mark.parametrize(
'key', ('SHARED_STORAGE', 'GUARDED_ADDONS_PATH', 'TMP_PATH', 'MEDIA_ROOT')
)
def test_base_paths_bytestring(key):
"""Make sure all ... |
3dfxmadscientist/odoo_vi | refs/heads/master | addons/crm_claim/report/__init__.py | 446 | # -*- 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... |
with-git/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | 153 | # 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... |
DefyVentures/edx-platform | refs/heads/master | common/djangoapps/student/migrations/0030_auto__chg_field_anonymoususerid_anonymous_user_id.py | 167 | # -*- 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 'AnonymousUserId.anonymous_user_id'
db.alter_column('student_anonymoususerid', 'anonymous_... |
garcia/cassium | refs/heads/master | config.example.py | 1 | log_verbosity = 'INFO'
log_format = '%(name)s: [%(levelname)s] %(message)s'
server = 'irc.example.com'
port = 6667
nick = 'Cassium'
realname = 'A Cassium IRC Bot'
channels = [
'#cassium',
]
admins = []
|
callmealien/wazimap_zambia | refs/heads/master | census/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/sanitizer.py | 1734 | from __future__ import absolute_import, division, unicode_literals
from . import _base
from ..sanitizer import HTMLSanitizerMixin
class Filter(_base.Filter, HTMLSanitizerMixin):
def __iter__(self):
for token in _base.Filter.__iter__(self):
token = self.sanitize_token(token)
if tok... |
pepetreshere/odoo | refs/heads/patch-2 | addons/l10n_in_purchase/models/purchase_order.py | 4 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.addons.purchase.models.purchase import PurchaseOrder as Purchase
class PurchaseOrder(models.Model):
_inherit = "purchase.order"
l10n_in_journal_id = fields.Many2o... |
MwanzanFelipe/rockletonfortune | refs/heads/master | lib/django/contrib/sessions/migrations/__init__.py | 12133432 | |
alex-pirozhenko/sklearn-pmml | refs/heads/master | sklearn_pmml/convert/test/__init__.py | 12133432 | |
wolverineav/neutron | refs/heads/master | neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/__init__.py | 12133432 | |
drewejohnson/sssFile | refs/heads/master | SerpentFile.py | 1 | """
SerpentFile
Class for handling simple operations on SERPENT input files
Andrew Johnson
TODO - better str methods
TODO - scrape from matlabDep file -> return numpy matrix of isotopics over depletion
TODO - plot detector values given some mapping function
TODO - plot material burnup values given some mapping funct... |
rkorkosz/rinfo | refs/heads/master | base/apps.py | 45 | from django.apps import AppConfig
class BaseConfig(AppConfig):
name = 'base'
|
googleads/google-ads-python | refs/heads/master | google/ads/googleads/v6/services/services/conversion_adjustment_upload_service/transports/grpc.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
ingokegel/intellij-community | refs/heads/master | python/testData/completion/moduleWithNoImportablePath/a.py | 54 | m7<caret> |
mustafat/odoo-1 | refs/heads/8.0 | openerp/osv/orm.py | 199 | import simplejson
from lxml import etree
from ..exceptions import except_orm
from ..models import (
MetaModel,
BaseModel,
Model, TransientModel, AbstractModel,
MAGIC_COLUMNS,
LOG_ACCESS_COLUMNS,
)
from openerp.tools.safe_eval import safe_eval as eval
# extra definitions for backward compatibilit... |
ichko/PyLearn | refs/heads/master | tests/__init__.py | 12133432 | |
zulip/zulip | refs/heads/master | zerver/webhooks/semaphore/__init__.py | 12133432 | |
tersmitten/ansible | refs/heads/devel | lib/ansible/executor/discovery/__init__.py | 12133432 | |
gregdek/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_errorpagebody.py | 31 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
ANSIB... |
christianurich/VIBe2UrbanSim | refs/heads/master | 3rdparty/opus/src/biocomplexity/tests/test_run_simulation_all_chunks.py | 2 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
import os
import shutil
from opus_core.tests import opus_unittest
from biocomplexity.examples.run_simulation_all_chunks import Simulation
from biocomplexity.datasets.land_cover_dataset impo... |
marcua/qurk_experiments | refs/heads/master | qurkexp/estimation/gtav/gtav_properties.py | 1 | # Note: files ID12_[028-036] do not exist, so I shifted 037-051 to fill their place
columns = ["personid", "numimages", "gender"]
properties = [
('ID01', 46, 'male'),
('ID02', 40, 'male'),
('ID03', 65, 'female'),
('ID04', 41, 'female'),
('ID05', 41, 'female'),
('ID06', 42, 'male'),
('ID07', 48, 'male'),
('ID08', 39, ... |
DCSaunders/tensorflow | refs/heads/master | tensorflow/contrib/framework/python/framework/__init__.py | 75 | # 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... |
MarsZone/DreamLand | refs/heads/master | evennia/evennia/contrib/tutorial_examples/bodyfunctions.py | 9 | """
Example script for testing. This adds a simple timer that has your
character make observations and notices at irregular intervals.
To test, use
@script me = examples.bodyfunctions.BodyFunctions
The script will only send messages to the object it is stored on, so
make sure to put it on yourself or you won't see ... |
DataDog/integrations-core | refs/heads/master | datadog_checks_dev/datadog_checks/dev/tooling/specs/configuration/constants.py | 1 | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# https://swagger.io/docs/specification/data-models/data-types/
OPENAPI_DATA_TYPES = {
'array',
'boolean',
'integer',
'number',
'object',
'string',
}
# https://spec.openapis.org/o... |
drr3d/JAABF | refs/heads/master | engine/classifier/sentenceclassifier.py | 1 | import json, re
import numpy as np
import random
from collections import defaultdict
from actions.action import ACTION
from intent.classify import IntentClassifier
from utils.loader import Loader
def whatisthis(s):
if isinstance(s, str):
print "ordinary string"
return True
elif isinstance(s, u... |
chiamingyen/pygroup | refs/heads/master | wsgi/static/Brython2.2.0rc0-20140913-093500/Lib/importlib/util.py | 741 | """Utility code for constructing importers, etc."""
from ._bootstrap import module_for_loader
from ._bootstrap import set_loader
from ._bootstrap import set_package
from ._bootstrap import _resolve_name
def resolve_name(name, package):
"""Resolve a relative module name to an absolute one."""
if not name.star... |
bbglab/adventofcode | refs/heads/master | 2016/iker/day6/tests.py | 1 | import pytest
from signals_and_noise import get_message, get_message2
def test0():
message = 'eedadn drvtee eandsr raavrd atevrs tsrnev sdttsa rasrtv ' \
'nssdts ntnada svetve tesnvt vntsnd vrdear dvrsen ' \
'enarar'.split(' ')
assert get_message(message) == 'easter'
def test1():
... |
hanpama/wagtail | refs/heads/master | wagtail/wagtailimages/migrations/0002_initial_data.py | 27 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import VERSION as DJANGO_VERSION
from django.db import migrations
def add_image_permissions_to_admin_groups(apps, schema_editor):
ContentType = apps.get_model('contenttypes.ContentType')
Permission = apps.get_model('auth.Permission')... |
HaebinShin/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/softplus_op_test.py | 8 | # 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... |
comic/comic-django | refs/heads/master | app/grandchallenge/cases/models.py | 1 | import logging
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List
import SimpleITK as sitk
from django.conf import settings
from django.contrib.auth.models import Group
from django.db import models
from guardian.shortcuts import assign_perm
from grandchallenge.challenges.models i... |
dougwig/a10-neutron-lbaas | refs/heads/master | a10_neutron_lbaas/tests/unit/test_base.py | 2 | # Copyright 2014, Doug Wiegley (dougwig), A10 Networks
#
# 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 b... |
an7oine/WinVHS | refs/heads/master | Cygwin/lib/python2.7/numbers.py | 141 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from __future__ import division
from abc import ABCMeta, abstractmethod, abstractprop... |
natanielruiz/android-yolo | refs/heads/master | jni-build/jni/include/tensorflow/contrib/copy_graph/python/util/__init__.py | 350 | # 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... |
vismartltd/edx-platform | refs/heads/master | common/test/acceptance/tests/helpers.py | 3 | """
Test helper functions and base classes.
"""
import inspect
import json
import unittest
import functools
import operator
import pprint
import requests
import os
import urlparse
from contextlib import contextmanager
from datetime import datetime
from path import path
from bok_choy.javascript import js_defined
from bo... |
jacobph/impact | refs/heads/master | wp-content/themes/impact/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 193 | # 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... |
mganeva/mantid | refs/heads/master | scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py | 1 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
""" The run tab presenter.
This presenter is... |
Sing-Li/go-buildpack | refs/heads/master | builds/runtimes/python-2.7.6/lib/python2.7/email/base64mime.py | 135 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Base64 content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
ch... |
klonage/nlt-gcs | refs/heads/master | packages/IronPython.StdLib.2.7.4/content/Lib/json/tool.py | 53 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m json.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name: line 1 column 2 (char 2)
"""
import sys
import json
def main():
if len(sy... |
mitar/django | refs/heads/master | tests/regressiontests/managers_regress/models.py | 43 | """
Various edge-cases for model managers.
"""
from django.db import models
class OnlyFred(models.Manager):
def get_query_set(self):
return super(OnlyFred, self).get_query_set().filter(name='fred')
class OnlyBarney(models.Manager):
def get_query_set(self):
return super(OnlyBarney, self).get_... |
akhilari7/pa-dude | refs/heads/master | lib/python2.7/site-packages/nltk/test/unit/test_twitter_auth.py | 3 | # -*- coding: utf-8 -*-
"""
Tests for static parts of Twitter package
"""
import os
import unittest
from nltk.twitter import Authenticate
class TestCredentials(unittest.TestCase):
"""
Tests that Twitter credentials information from file is handled correctly.
"""
def setUp(self):
self.subdir... |
tafaRU/odoo | refs/heads/8.0 | addons/report_webkit/ir_report.py | 382 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.