repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
rossburton/yocto-autobuilder
refs/heads/ross
lib/python2.7/site-packages/SQLAlchemy-0.7.0-py2.7-linux-x86_64.egg/sqlalchemy/ext/compiler.py
8
# ext/compiler.py # Copyright (C) 2005-2011 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Provides an API for creation of custom ClauseElements and compilers. Synopsis ====...
acsone/stock-logistics-warehouse
refs/heads/8.0
stock_optional_valuation/__init__.py
23
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licen...
jonathanslenders/python-prompt-toolkit
refs/heads/master
prompt_toolkit/document.py
1
""" The `Document` that implements all the text operations/querying. """ import bisect import re import string import weakref from typing import Callable, Dict, Iterable, List, Optional, Pattern, Tuple, cast from .clipboard import ClipboardData from .filters import vi_mode from .selection import PasteMode, SelectionSt...
neavouli/yournextrepresentative
refs/heads/release-neavouli
candidates/tests/test_date_parsing.py
1
from __future__ import unicode_literals from django.test import TestCase from django.test.utils import override_settings from django.utils.translation import override from django_date_extensions.fields import ApproximateDate from candidates.models import parse_approximate_date # These tests supplement the doctests...
temasek/android_external_chromium_org
refs/heads/cm-11.0
third_party/protobuf/python/google/protobuf/internal/message_listener.py
590
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
jamespcole/home-assistant
refs/heads/master
homeassistant/components/onvif/__init__.py
15
"""The onvif component."""
davidgbe/scikit-learn
refs/heads/master
examples/decomposition/plot_pca_vs_fa_model_selection.py
142
""" =============================================================== Model selection with Probabilistic PCA and Factor Analysis (FA) =============================================================== Probabilistic PCA and Factor Analysis are probabilistic models. The consequence is that the likelihood of new data can be u...
PyWaw/pywaw.org
refs/heads/master
pywaw/meetups/forms.py
1
from django import forms from django.core.exceptions import ValidationError from meetups.constants import EITHER_EXISTING_OR_NEW_SPEAKER_ERROR from . import models class TalkProposalForm(forms.ModelForm): talk_title = forms.CharField() talk_description = forms.CharField(max_length=1000, widget=forms.Textarea)...
ricardogtx/estudoDjango
refs/heads/master
simplemooc/core/tests.py
1
from django.test import TestCase from django.core import mail from django.test.client import Client from django.urls import reverse class HomeViewTest(TestCase): def test_home_status_code(self): client = Client() response = client.get(reverse('core:home')) self.assertEqual(response.status_c...
micolous/intuition
refs/heads/master
src/intuition/protocol.py
1
""" intuition/protocol.py - Twisted protocol library for OWL Intuition's multicast UDP energy monitoring protocol. Copyright 2013-2014 Michael Farrell <micolous+git@gmail.com> Copyright 2013 Johan van den Dorpe <johan.vandendorpe@gmail.com> This library is free software: you can redistribute it and/or modify it under ...
camptocamp/c2c-rd-addons
refs/heads/8.0
c2c_account_closing_remarks/__openerp__.py
4
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2011 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2011 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>) # # Thi...
shibumi/yowsup
refs/heads/master
src/Yowsup/Contacts/contacts.py
18
''' Copyright (c) <2012> Tarek Galal <tare2.galal@gmail.com> 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, m...
mandeepdhami/nova
refs/heads/master
nova/tests/unit/virt/libvirt/test_lvm.py
17
# Copyright 2012 NTT Data. All Rights Reserved. # Copyright 2012 Yahoo! 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/li...
FFMG/myoddweb.piger
refs/heads/master
monitor/api/python/Python-3.7.2/Lib/test/final_b.py
103
""" Fodder for module finalization tests in test_module. """ import shutil import test.final_a x = 'b' class C: def __del__(self): # Inspect module globals and builtins print("x =", x) print("final_a.x =", test.final_a.x) print("shutil.rmtree =", getattr(shutil.rmtree, '__name__',...
StrellaGroup/erpnext
refs/heads/develop
erpnext/hr/report/bank_remittance/bank_remittance.py
6
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.utils import formatdate import itertools from frappe import _, get_all def execute(filters=None): columns = [ { "label": _("Pay...
Nowheresly/odoo
refs/heads/8.0
addons/website_forum/controllers/__init__.py
4497
# -*- coding: utf-8 -*- import main
royorbs3/Leviathan-V1-Kernel-G925T
refs/heads/master
tools/perf/python/twatch.py
7370
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
pygeek/django
refs/heads/master
tests/regressiontests/bash_completion/management/commands/test_command.py
183
from optparse import make_option from django.core.management.base import BaseCommand class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option("--list", action="store_true", dest="list", help="Print all options"), ) def handle(self, *args, **options): ...
ecotg/Misc
refs/heads/master
Visions/for_360pi/spiders/__init__.py
1
""" Scrape: Visions.ca To run this script, in this directory, run 'scrapy crawl visions' in the terminal. For each category listed on the lefthand banner on the http://www.visions.ca/Default.aspx page, this script will extract the product details for one product. First, the spider will extract and follow the hrefs f...
the-zebulan/CodeWars
refs/heads/master
tests/beta_tests/test_separate_filename_from_extension.py
1
import unittest from katas.beta.separate_filename_from_extension import \ separate_filename_from_extension class SeparateFilenameFromExtensionTestCase(unittest.TestCase): def test_equal_1(self): self.assertEqual(separate_filename_from_extension( '/some/path/to/file.txt' ), ('/some...
Hao-Liu/avocado-vt
refs/heads/master
virttest/libvirt_xml/capability_xml.py
18
""" Module simplifying manipulation of XML described at http://libvirt.org/formatcaps.html """ from virttest import xml_utils from virttest.libvirt_xml import base, accessors, xcepts class CapabilityXML(base.LibvirtXMLBase): """ Handler of libvirt capabilities and nonspecific item operations. Propertie...
nikhilprathapani/python-for-android
refs/heads/master
python3-alpha/python3-src/Doc/includes/sqlite3/simple_tableprinter.py
96
import sqlite3 FIELD_MAX_WIDTH = 20 TABLE_NAME = 'people' SELECT = 'select * from %s order by age, name_last' % TABLE_NAME con = sqlite3.connect("mydb") cur = con.cursor() cur.execute(SELECT) # Print a header. for fieldDesc in cur.description: print(fieldDesc[0].ljust(FIELD_MAX_WIDTH), end=' ') print() # Finish...
gautam1858/tensorflow
refs/heads/master
tensorflow/python/autograph/core/function_wrapping.py
21
# 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...
goloveychuk/compose
refs/heads/master
compose/project.py
1
from __future__ import absolute_import from __future__ import unicode_literals import logging from functools import reduce from docker.errors import APIError from .config import ConfigurationError from .config import get_service_name_from_net from .const import DEFAULT_TIMEOUT from .const import LABEL_ONE_OFF from ....
jffernandez/kivy
refs/heads/master
examples/widgets/textinput.py
81
''' Textinput tests =============== This test is used to demonstrate virtual keyboard according to current configuration. Run this test as:: # use dock virtual keyboard (one instance) python textinput.py -c kivy:keyboard_mode:dock # use multi users virtual keyboard (multiples instance) python textinpu...
TeamExodus/external_chromium_org
refs/heads/EXODUS-5.1
build/android/pylib/junit/test_runner.py
26
# 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 os from pylib import cmd_helper from pylib import constants class JavaTestRunner(object): """Runs java tests on the host.""" def __init__(self,...
dreamsxin/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/test/audiotests.py
72
from test.support import findfile, TESTFN, unlink import unittest import array import io import pickle import sys class UnseekableIO(io.FileIO): def tell(self): raise io.UnsupportedOperation def seek(self, *args, **kwargs): raise io.UnsupportedOperation class AudioTests: close_fd = False...
osungjin/livechat
refs/heads/master
livechat_app/hello_gae/handlers.py
1
# -*- coding: utf-8 -*- from flask import Blueprint from flask import render_template from flask import redirect, request import pdb hello_gae = Blueprint('hello_gae', __name__) livechat = Blueprint('livechat', __name__) @hello_gae.route('/') def login(): return render_template("login.html") @livechat.route('/'...
chirilo/kuma
refs/heads/master
kuma/demos/models.py
5
from hashlib import md5 import operator from os import makedirs from os.path import basename, dirname, isdir, join from shutil import rmtree, copyfileobj import re from time import time import zipfile import magic from django.conf import settings from django.core.exceptions import ValidationError from django.core.fil...
sadanandb/pmt
refs/heads/master
src/pyasm/search/sobject_default_config.py
6
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
britcey/ansible
refs/heads/devel
contrib/inventory/vmware_inventory.py
28
#!/usr/bin/env python # Requirements # - pyvmomi >= 6.0.0.2016.4 # TODO: # * more jq examples # * optional folder heriarchy """ $ jq '._meta.hostvars[].config' data.json | head { "alternateguestname": "", "instanceuuid": "5035a5cd-b8e8-d717-e133-2d383eb0d675", "memoryhotaddenabled": false, "guestfullna...
cernops/nova
refs/heads/master
nova/virt/virtapi.py
23
# Copyright 2012 IBM Corp. # # 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 agree...
haidarvm/hadits
refs/heads/master
assets/post.py
1
from urllib.request import Request, urlopen from urllib import parse,error url = 'http://192.168.12.30/post.php' value = {"test" : 'testing' , "data" : 'haidar123' } parse_data = parse.urlencode(value) try: ropen = urlopen(url, parse_data.encode('utf-8')) print(ropen.read()) except error.URLError as e: print("U...
HaebinShin/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/sparse_ops_test.py
1
# 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...
ville-k/tensorflow
refs/heads/master
tensorflow/contrib/keras/python/keras/models_test.py
7
# 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...
woggle/mesos-old
refs/heads/trunk
frameworks/hadoop-0.20.2/src/contrib/hod/hodlib/Common/descGenerator.py
182
#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 use thi...
culturagovbr/sistema-nacional-cultura
refs/heads/master
planotrabalho/migrations/0011_auto_20181206_1127.py
1
# Generated by Django 2.0.8 on 2018-12-06 16:34 from django.db import migrations, models from planotrabalho.models import Componente, Conselheiro from adesao.models import SistemaCultura, Municipio import django.db.models.deletion def migra_conselheiros(apps, schema_editor): conselheiros = apps.get_model('planotraba...
jcpowermac/ansible
refs/heads/devel
test/runner/lib/executor.py
5
"""Execute Ansible tests.""" from __future__ import absolute_import, print_function import json import os import collections import datetime import re import tempfile import time import textwrap import functools import pipes import hashlib import lib.pytar import lib.thread from lib.core_ci import ( AnsibleCore...
BTA-BATA/BATA-SOURCE
refs/heads/master
contrib/spendfrom/spendfrom.py
792
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
adgaudio/mutable_lru_cache
refs/heads/master
lru_cache_pandas.py
1
import pandas as pd def _pd_hash_on_indexes(arg): """ hash pandas objects to immutable (index, columns) without modifying the objects This hash function uniquely identifies pandas.Series and pandas.DataFrame by (index, columns). This means if values of a column have been overwritten (due to ...
acshi/osf.io
refs/heads/develop
scripts/analytics/run_keen_snapshots.py
6
from framework.celery_tasks import app as celery_app from scripts.analytics.base import BaseAnalyticsHarness from scripts.analytics.addon_snapshot import AddonSnapshot class SnapshotHarness(BaseAnalyticsHarness): @property def analytics_classes(self): return [AddonSnapshot] @celery_app.task(name='s...
joequery/django
refs/heads/master
django/contrib/sites/requests.py
695
from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RequestSite(object): """ A class that shares the primary interface of Site (i.e., it has ``domain`` and ``name`` attributes) but gets its data from a Django HttpReq...
tstirrat15/exercism-python-responses
refs/heads/master
series/series_test.py
20
"""Tests for the series exercise Implementation note: The slices function should raise a ValueError with a meaningful error message if its length argument doesn't fit the series. """ import unittest from series import slices class SeriesTest(unittest.TestCase): def test_slices_of_one(self): self.assertE...
dataxu/ansible
refs/heads/dx-stable-2.5
lib/ansible/modules/cloud/vultr/vr_user.py
23
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # 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': '1.1', ...
tumbl3w33d/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_user_setting.py
21
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
jandom/rdkit
refs/heads/master
rdkit/sping/Pyart/__init__.py
18
# sping:: pyart from pidPyart import *
uzh/vm-mad
refs/heads/master
vmmad/simul.py
1
#! /usr/bin/env python # """ Simulate an `Orchestrator` run given some parameters. """ # Copyright (C) 2011, 2012 ETH Zurich and University of Zurich. All rights reserved. # # Authors: # Christian Panse <cp@fgcz.ethz.ch> # Riccardo Murri <riccardo.murri@gmail.com> # Tyanko Aleksiev <tyanko.alexiev@gmail.com> # # ...
apark263/tensorflow
refs/heads/master
tensorflow/contrib/tensorrt/python/trt_convert_test.py
1
# Copyright 2018 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...
eloquence/unisubs
refs/heads/staging
apps/webdriver_testing/pages/site_pages/teams_dir_page.py
5
#!/usr/bin/env python import time from nose.tools import assert_true, assert_false from webdriver_testing.pages.site_pages import UnisubsPage class TeamsDirPage(UnisubsPage): """ Search page is the main search page stub. Watch Page and Search Results page """ _URL = "teams/" _SEARCH = "form.sear...
ogajduse/spacewalk
refs/heads/master
client/rhel/rhn-client-tools/src/up2date_client/debUtils.py
5
# Client code for Update Agent # Copyright (c) 2011--2016 Red Hat, Inc. Distributed under GPLv2. # # Author: Simon Lukasik # Lukas Durfina # import os import apt import gettext t = gettext.translation('rhn-client-tools', fallback=True) # Python 3 translations don't have a ugettext method if not hasattr(t, 'ug...
blaswan/dbn-cifar-10
refs/heads/master
code/logistic_regression.py
1
""" This tutorial introduces logistic regression using Theano. Logistic regression is a probabilistic, linear classifier. It is parametrized by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is done by projecting data points onto a set of hyperplanes, the distance to which is used to determine a...
learningequality/kolibri
refs/heads/develop
kolibri/core/device/test/test_api.py
2
import os import platform import sys from collections import namedtuple import mock from django.conf import settings from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from mock import patch from morango.models import DatabaseIDModel from morango.models import InstanceIDMod...
loli/sklearn-ensembletrees
refs/heads/master
sklearn/datasets/mlcomp.py
5
# Copyright (c) 2010 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause """Glue code to load http://mlcomp.org data as a scikit.learn dataset""" import os import numbers from sklearn.datasets.base import load_files def _load_document_classification(dataset_path, metadata, set_=None, **kwargs): if ...
Innovahn/cybex
refs/heads/master
addons/web/controllers/main.py
20
# -*- coding: utf-8 -*- import ast import base64 import csv import functools import glob import itertools import jinja2 import logging import operator import datetime import hashlib import os import re import simplejson import sys import time import urllib2 import zlib from xml.etree import ElementTree from cStringIO ...
israel-lugo/netcalc
refs/heads/master
netcalc/version.py
1
# NetCalc - advanced network calculator and address planning helper # Copyright (C) 2016, 2017 Israel G. Lugo # # This file is part of NetCalc. # # NetCalc 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, eith...
simonpatrick/bite-project
refs/heads/master
deps/mrtaskman/server/mapreduce/lib/files/testutil.py
44
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
EricMuller/mywebmarks-backend
refs/heads/master
requirements/twisted/Twisted-17.1.0/docs/core/howto/tutorial/listings/finger/finger/finger.py
2
# finger.py module from zope.interface import Interface, implementer from twisted.application import internet, service, strports from twisted.internet import protocol, reactor, defer, endpoints from twisted.words.protocols import irc from twisted.protocols import basic from twisted.python import components, log from ...
yorvic/.vim
refs/heads/master
bundle/python-mode/pylibs/pylama/checkers/pylint/logilab/astng/utils.py
1
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
bolmez/Class-HARK
refs/heads/master
HARKutilities.py
2
''' General purpose / miscellaneous functions. Includes functions to approximate continuous distributions with discrete ones, utility functions (and their derivatives), manipulation of discrete distributions, and basic plotting tools. ''' from __future__ import division # Import Python 3.x division function impo...
zofuthan/edx-platform
refs/heads/master
common/djangoapps/enrollment/data.py
39
""" Data Aggregation Layer of the Enrollment API. Collects all enrollment specific data into a single source to be used throughout the API. """ import logging from django.contrib.auth.models import User from opaque_keys.edx.keys import CourseKey from enrollment.errors import ( CourseNotFoundError, CourseEnrollmen...
levenlabs/ansible
refs/heads/stable-2.1
lib/ansible/utils/module_docs_fragments/azure_tags.py
16
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
kronicz/ecommerce-2
refs/heads/master
lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py
84
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} class GISLookup...
indictranstech/reciphergroup-erpnext
refs/heads/master
erpnext/accounts/doctype/journal_entry/journal_entry.py
4
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, fmt_money, formatdate, getdate, date_diff from frappe import msgprint, _, scrub from erpnext.setup.uti...
huongttlan/bokeh
refs/heads/master
bokeh/charts/builder/bar_builder.py
43
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Bar class which lets you build your Bar charts just passing the arguments to the Chart class and calling the proper functions. It also add a new chained stacked method. """ #-------------------------...
xombiemp/CouchPotatoServer
refs/heads/master
libs/pyutil/find_exe.py
106
import warnings import os, sys from twisted.python.procutils import which def find_exe(exename): """ Look for something named exename or exename + ".py". This is a kludge. @return: a list containing one element which is the path to the exename (if it is thought to be executable), or else the ...
mosaic-cloud/mosaic-distribution-dependencies
refs/heads/development
dependencies/mozilla-js/1.8.5/js/src/jit-test/progressbar.py
9
# Text progress bar library, like curl or scp. import sys, datetime class ProgressBar: def __init__(self, label, limit, label_width=12): self.label = label self.limit = limit self.label_width = label_width self.cur = 0 self.t0 = datetime.datetime.now() self.barlen ...
rdbhost/Rdbhdb
refs/heads/master
unittests-py2/test_rdbhdb_compressed.py
1
#!/usr/bin/env python ''' unit test suite for compressed features of rdbhdb''' import unittest import time import sys, os import accounts sys.path.insert(0, '..\lib') from rdbhdb import rdbhdb need_version = '0.11.0' class test_Rdbhdb_compressedRequest(unittest.TestCase): driver = rdbhdb # get choice of ...
maropu/spark
refs/heads/master
python/pyspark/pandas/tests/data_type_ops/test_datetime_ops.py
13
# # 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 us...
leoliujie/odoo
refs/heads/8.0
addons/gamification/tests/__init__.py
268
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
nicememory/pie
refs/heads/master
pyglet/tests/extlibs/future/py2_3/future/moves/urllib/response.py
70
from future import standard_library from future.utils import PY3 if PY3: from urllib.response import * else: __future_module__ = True with standard_library.suspend_hooks(): from urllib import (addbase, addclosehook, addinfo, ...
chaluemwut/fbserver
refs/heads/master
venv/lib/python2.7/site-packages/sklearn/ensemble/base.py
2
""" Base class for ensemble-based estimators. """ # Authors: Gilles Louppe # License: BSD 3 clause import numpy as np from ..base import clone from ..base import BaseEstimator from ..base import MetaEstimatorMixin from ..externals.joblib import cpu_count class BaseEnsemble(BaseEstimator, MetaEstimatorMixin): "...
ChinaQuants/zipline
refs/heads/master
zipline/protocol.py
3
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
vanyh/handkeinzungen-app
refs/heads/master
stats/apps.py
14
from django.apps import AppConfig class StatsConfig(AppConfig): name = 'stats'
HyunsukBaek/etherpad-lite
refs/heads/master
src/node_modules/npm/node_modules/node-gyp/gyp/test/mac/gyptest-rebuild.py
299
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that app bundles are rebuilt correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(...
foo123/sikuli-framework
refs/heads/master
src/log/logger.py
2
""" Copyright (c) 2013, SMART Technologies ULC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions an...
coinkeeper/2015-06-22_19-07_digitalcoin
refs/heads/master
contrib/testgen/gen_base58_test_vectors.py
1000
#!/usr/bin/env python ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json ''' # 2012 Wladimir J. van der Laan # R...
neilhan/tensorflow
refs/heads/master
tensorflow/python/lib/io/python_io.py
18
# 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...
wearpants/osf.io
refs/heads/develop
website/prereg/views.py
11
"""Back-end code to support the Prereg Challenge initiative Keeping the code together in this file should make it easier to remove the features added to the OSF specifically to support this initiative in the future. Other resources that are a part of the Prereg Challenge: * website/static/js/pages/prereg-landing-pag...
linea-it/qlf
refs/heads/master
backend/framework/qlf/dashboard/bokeh/globalfiber/main.py
2
from bokeh.plotting import figure from bokeh.layouts import row, column from bokeh.models import HoverTool, ColumnDataSource, Range1d from qlf_models import QLFModels from dashboard.bokeh.plots.descriptors.title import Title import numpy as np import logging from bokeh.resources import CDN from bokeh.embed import fi...
xwolf12/django
refs/heads/master
tests/utils_tests/test_os_utils.py
482
import os import unittest from django.core.exceptions import SuspiciousFileOperation from django.utils._os import safe_join class SafeJoinTests(unittest.TestCase): def test_base_path_ends_with_sep(self): drive, path = os.path.splitdrive(safe_join("/abc/", "abc")) self.assertEqual( pat...
jswanljung/iris
refs/heads/master
lib/iris/tests/unit/quickplot/test_pcolor.py
11
# (C) British Crown Copyright 2014 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
chriskmanx/qmole
refs/heads/master
QMOLEDEV/vte-0.24.1/python/vte-demo.py
7
#!/usr/bin/python import sys import string import getopt import gtk import vte def selected_cb(terminal, column, row, cb_data): if (row == 15): if (column < 40): return 1 return 0 def restore_cb(terminal): (text, attrs) = terminal.get_text(selected_cb, 1) print "A portion of the text at restore-time is:" pr...
renatopp/liac
refs/heads/master
samples/models/samples_kernelpca.py
1
# ============================================================================= # Federal University of Rio Grande do Sul (UFRGS) # Connectionist Artificial Intelligence Laboratory (LIAC) # Renato de Pontes Pereira - rppereira@inf.ufrgs.br # ============================================================================= ...
jlegendary/nupic
refs/heads/master
tests/swarming/nupic/swarming/experiments/dummyV2/description.py
8
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
aperigault/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_template.py
15
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUME...
2014c2g1/c2g1
refs/heads/master
w2/static/Brython2.0.0-20140209-164925/Lib/antigravity.py
917
import webbrowser import hashlib webbrowser.open("http://xkcd.com/353/") def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(d...
pyrocko/pyrocko
refs/heads/master
test/base/test_obspy_compat.py
1
from __future__ import division, print_function, absolute_import import unittest from .. import common import pyrocko.trace from pyrocko import util, io, model, pile if common.have_obspy(): import obspy from pyrocko import obspy_compat obspy_compat.plant() def close_win(win): win.close() @common.r...
sysadmin75/ansible
refs/heads/devel
test/units/module_utils/urls/test_RedirectHandlerFactory.py
70
# -*- coding: utf-8 -*- # (c) 2018 Matt Martz <matt@sivel.net> # 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.module_utils.urls import HAS_SSLCONTEXT, RedirectHandlerFactor...
souravbadami/oppia
refs/heads/develop
core/controllers/features_test.py
1
# Copyright 2019 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
MrSurly/micropython
refs/heads/master
tests/basics/builtin_round.py
103
# test round() with integral values tests = [ False, True, 0, 1, -1, 10 ] for t in tests: print(round(t))
Tejal011089/trufil-erpnext
refs/heads/master
erpnext/setup/doctype/sales_person/test_sales_person.py
104
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals test_dependencies = ["Employee"] import frappe test_records = frappe.get_test_records('Sales Person')
flh/odoo
refs/heads/master
addons/product_email_template/__openerp__.py
65
# -*- coding: utf-8 -*- { 'name': 'Product Email Template', 'depends': ['account'], 'author': 'OpenERP SA', 'category': 'Accounting & Finance', 'description': """ Add email templates to products to be send on invoice confirmation ================================================================== W...
MalloyPower/parsing-python
refs/heads/master
front-end/testsuite-python-lib/Python-2.1/Lib/py_compile.py
2
"""Routine to "compile" a .py file to a .pyc (or .pyo) file. This module has intimate knowledge of the format of .pyc files. """ import imp MAGIC = imp.get_magic() __all__ = ["compile"] def wr_long(f, x): """Internal; write a 32-bit int to a file in little-endian order.""" f.write(chr( x & 0xff)) ...
poljeff/odoo
refs/heads/8.0
addons/l10n_fr/report/compute_resultant_report.py
374
# -*- coding: utf-8 -*- # # # Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr # # WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users w...
gdub/django
refs/heads/master
django/utils/inspect.py
146
from __future__ import absolute_import import inspect from django.utils import six def getargspec(func): if six.PY2: return inspect.getargspec(func) sig = inspect.signature(func) args = [ p.name for p in sig.parameters.values() if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR...
gunicorn/gunicorn
refs/heads/master
examples/frameworks/django/testing/testing/apps/someapp/views.py
7
# Create your views here. import csv import io import os from django import forms from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext import tempfile class MsgForm(forms.Form): subject = forms.CharField(max_length=100) message = forms...
Lekanich/intellij-community
refs/heads/master
python/testData/keywordCompletion/continue.py
83
for x in []: conti<caret>
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/cloud/google/gcp_bigquery_table.py
6
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
jlombacher/pyqtgraph
refs/heads/develop
pyqtgraph/graphicsItems/VTickGroup.py
41
if __name__ == '__main__': import os, sys path = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(path, '..', '..')) from ..Qt import QtGui, QtCore from .. import functions as fn import weakref from .UIGraphicsItem import UIGraphicsItem __all__ = ['VTickGroup'] class VTickGroup(U...
MaKToff/SPbSU_Homeworks
refs/heads/master
Semester 7/Natural language processing/lang_detect.py
1
from keras import Sequential from keras.layers import Dense, Dropout, Conv1D, MaxPooling1D, Flatten from keras.models import load_model from sklearn.metrics import classification_report from preprocessing import * data_directory = "./data/" model_path = "./model.h5" def train_model(train_test_path): """ Crea...