repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
andela-ifageyinbo/django
refs/heads/master
tests/reverse_lookup/tests.py
326
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Poll, User class ReverseLookupTests(TestCase): def setUp(self): john = User.objects.create(name="John Doe") jim = User.objects.create(name="Jim Bo")...
cdrttn/samba-regedit
refs/heads/regedit-wip
buildtools/wafsamba/tests/__init__.py
47
# Copyright (C) 2012 Jelmer Vernooij <jelmer@samba.org> # This program 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 2.1 of the License, or # (at your option) any later version. # Thi...
zscproject/OWASP-ZSC
refs/heads/master
lib/encoder/ruby/base64.py
4
#!/usr/bin/env python ''' OWASP ZSC https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project https://github.com/zscproject/OWASP-ZSC http://api.z3r0d4y.com/ https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ] ''' import binascii import random import string from core.compatible import version...
ITCoders/Human-detection-and-Tracking
refs/heads/master
scripts/face_rec_demo.py
2
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Philipp Wagner <bytefish[at]gmx[dot]de>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistrib...
hroncok/devassistant
refs/heads/pathstests
features/environment.py
8
import os import signal datadir = os.path.join(os.path.dirname(__file__), 'data') cache = os.path.join(datadir, '.cache.yaml') config = os.path.join(datadir, '.config') lastrun = os.path.join(datadir, 'lastrun.log') homedir_files = [cache, config, lastrun] def before_all(context): context.dagui_scriptname = 'da-...
1stvamp/kombu
refs/heads/master
funtests/tests/test_redis.py
30
from nose import SkipTest from funtests import transport class test_redis(transport.TransportCase): transport = 'redis' prefix = 'redis' def before_connect(self): try: import redis # noqa except ImportError: raise SkipTest('redis not installed') def after_co...
qedi-r/home-assistant
refs/heads/dev
homeassistant/components/w800rf32/binary_sensor.py
2
"""Support for w800rf32 binary sensors.""" import logging import voluptuous as vol import W800rf32 as w800 from homeassistant.components.binary_sensor import ( DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA, BinarySensorDevice, ) from homeassistant.const import CONF_DEVICE_CLASS, CONF_DEVICES, CONF_NAME from home...
BruceDai/web-testing-service
refs/heads/master
wts/tests/xmlhttprequest/w3c/resources/accept-language.py
250
def main(request, response): return [("Content-Type", "text/plain"), request.headers.get("Accept-Language", "NO")]
TsarN/pysistem
refs/heads/master
pysistem/contests/decorators.py
1
# -*- coding: utf-8 -*- """Contest decorators""" from functools import wraps from flask import render_template from pysistem.contests.model import Contest def yield_contest(field='contest_id', yield_field='contest'): """Decorator Get contest identified by 'field' keyword argument and save it to 'yield_...
oxnz/NZChat
refs/heads/master
NZChat/NZChat.py
1
#-*- coding: utf-8 -*- from PyQt4.QtCore import * from PyQt4.QtGui import * from NZContentPane import NZContentPane from NZConfig import NZConfig from NZMessage import NZMessage from NZMessage import NZMsgType from NZStatus import NZStatus from NZSettings import NZSettings from NZSockets import NZSockets class NZAv...
stifoon/navitia
refs/heads/dev
source/jormungandr/jormungandr/protobuf_to_dict.py
12
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
stephane-martin/salt-debian-packaging
refs/heads/master
salt-2016.3.3/tests/integration/modules/mine.py
2
# -*- coding: utf-8 -*- ''' Test the salt mine system ''' # Import Python libs from __future__ import absolute_import import time # Import Salt Testing libs from salttesting.helpers import ensure_in_syspath ensure_in_syspath('../../') # Import salt libs import integration class MineTest(integration.ModuleCase): ...
xuanhan863/zulip
refs/heads/master
zilencer/management/commands/create_deployment.py
115
from __future__ import absolute_import from optparse import make_option import sys from django.core.management.base import BaseCommand from zerver.models import get_realm from zerver.lib.create_user import random_api_key from zerver.management.commands.create_realm import Command as CreateRealm from zilencer.models ...
Alignak-monitoring-contrib/alignak-checks-snmp
refs/heads/develop
version.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Checks pack for NRPE monitored Linux hosts/services """ # Package name __pkg_name__ = u"alignak_checks_snmp" # Checks types for PyPI keywords # Used for: # - PyPI keywords # -...
GameKinger123x/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/testing/gtest/test/gtest_help_test.py
2968
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
hnakamur/django
refs/heads/master
tests/migrations/test_migrations_squashed/0001_initial.py
2995
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): operations = [ migrations.CreateModel( "Author", [ ("id", models.AutoField(primary_key=True)), ("name",...
egaxegax/django-dbcartajs
refs/heads/master
django/contrib/gis/maps/google/gmap.py
174
from django.conf import settings from django.template.loader import render_to_string from django.utils.html import format_html from django.utils.safestring import mark_safe from django.utils.six.moves import xrange from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker class GoogleMapExcepti...
romankagan/DDBWorkbench
refs/heads/master
python/testData/intentions/afterConvertStaticMethodToFunction.py
83
class MyClass(object): """ My class to show intention. """ def __init__(self): self.a = 1 def my_static_method(): import code import time time.sleep(100) print code
jprine/monitoring-module
refs/heads/master
docs/source/conf.py
1
# -*- coding: utf-8 -*- import os from subprocess import check_output import sys git_args = ['git', 'describe', '--tags', '--always'] git_tag = check_output(git_args, universal_newlines=True) sys.path.insert(0, os.path.abspath('../../src')) needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', ] autodoc_m...
devcline/mtasa-blue
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/win/gyptest-link-uldi.py
344
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure that when ULDI is on, we link .objs that make up .libs rather than the .libs themselves. """ import TestGyp import sys if s...
AngelLMbot/The-Cocky-Website
refs/heads/master
functions/twitter.py
2
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains import time import math import bs4 as bs import urllib2 imp...
ewitz/PhotoHaus
refs/heads/master
venv/lib/python2.7/site-packages/werkzeug/test.py
146
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...
bigmlcom/python
refs/heads/master
bigml/tests/test_17_split_dataset.py
2
# -*- coding: utf-8 -*- # # Copyright 2015-2021 BigML # # 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 ...
TathagataChakraborti/resource-conflicts
refs/heads/master
PLANROB-2015/py2.5/lib/python2.5/macurl2path.py
332
"""Macintosh-specific module for conversion between pathnames and URLs. Do not import directly; use urllib instead.""" import urllib import os __all__ = ["url2pathname","pathname2url"] def url2pathname(pathname): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not r...
shahankhatch/scikit-learn
refs/heads/master
examples/feature_selection/plot_permutation_test_for_classification.py
250
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
impowski/servo
refs/heads/master
tests/wpt/web-platform-tests/XMLHttpRequest/resources/gzip.py
243
import gzip as gzip_module from cStringIO import StringIO def main(request, response): if "content" in request.GET: output = request.GET["content"] else: output = request.body out = StringIO() with gzip_module.GzipFile(fileobj=out, mode="w") as f: f.write(output) output = out...
c0defreak/python-for-android
refs/heads/master
python3-alpha/python3-src/Doc/includes/sqlite3/execsql_fetchonerow.py
96
import sqlite3 con = sqlite3.connect("mydb") cur = con.cursor() SELECT = "select name_last, age from people order by age, name_last" # 1. Iterate over the rows available from the cursor, unpacking the # resulting sequences to yield their elements (name_last, age): cur.execute(SELECT) for (name_last, age) in cur: ...
mapr/hue
refs/heads/hue-3.9.0-mapr
desktop/core/ext-py/Django-1.6.10/django/conf/locale/nl/formats.py
141
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' # '20 ja...
a-parhom/edx-platform
refs/heads/master
openedx/core/djangoapps/lang_pref/middleware.py
12
""" Middleware for Language Preferences """ from django.conf import settings from django.utils.translation import LANGUAGE_SESSION_KEY from django.utils.translation.trans_real import parse_accept_lang_header from openedx.core.djangoapps.lang_pref import COOKIE_DURATION, LANGUAGE_HEADER, LANGUAGE_KEY from openedx.core...
KhalidGit/flask
refs/heads/master
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/contrib/lint.py
295
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
gtcno/microservices-infrastructure
refs/heads/master
plugins/callbacks/profile_tasks.py
41
# The MIT License (MIT) # # Copyright (c) 2014 Jharrod LaFon # # 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, mod...
ff94315/hiwifi-openwrt-HC5661-HC5761
refs/heads/master
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/unittest/test/support.py
153
import unittest class TestHashing(object): """Used as a mixin for TestCase""" # Check for a valid __hash__ implementation def test_hash(self): for obj_1, obj_2 in self.eq_pairs: try: if not hash(obj_1) == hash(obj_2): self.fail("%r and %r do not has...
gyyu/cmu-debate
refs/heads/master
node_modules/node-gyp/gyp/gyptest.py
1752
#!/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. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse import subprocess import sys class CommandRunner(obje...
pitrou/numba
refs/heads/master
numba/cuda/tests/cudapy/test_vectorize_device.py
4
from __future__ import absolute_import, print_function, division from numba import vectorize from numba import cuda, float32 import numpy as np from numba import unittest_support as unittest from numba.cuda.testing import skip_on_cudasim @skip_on_cudasim('ufunc API unsupported in the simulator') class TestCudaVectori...
automatthias/aubio
refs/heads/master
python/tests/test_peakpicker.py
17
#! /usr/bin/env python from numpy.testing import TestCase, assert_equal, assert_almost_equal from aubio import peakpicker, fvec class aubio_peakpicker(TestCase): def test_members(self): o = peakpicker() def test_peakpicker_zeroes(self): o = peakpicker() assert_equal(o.get_thresholded...
mvpoland/django-smsgateway
refs/heads/master
smsgateway/smpplib/client.py
1
# # smpplib -- SMPP Library for Python # Copyright (c) 2005 Martynas Jocius <mjoc@akl.lt> # # This library 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 2.1 of the License, or (at you...
Frodox/buildbot
refs/heads/master
master/buildbot/util/service.py
1
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even...
napsternxg/gensim
refs/heads/develop
gensim/sklearn_api/phrases.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """Scikit learn interface for `gensim.models.phrases.Phrases`. Follows scikit-learn API conventions to facilitate using gensim along wi...
yichaoS/cbioportal
refs/heads/master
docs/conf.py
16
# -*- coding: utf-8 -*- # # cBioPortal documentation build configuration file, created by # sphinx-quickstart on Thu Jul 7 16:41:35 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
Saren-Arterius/BukkitPluginsUpdater
refs/heads/master
bukkit_plugin.py
1
#!/usr/bin/python3.3 from database import * from sys import argv from zipfile import ZipFile, is_zipfile from re import findall, sub, split from pyquery import PyQuery as pq from error import Error from hashlib import md5 from os.path import dirname, realpath import http.cookiejar import webbrowser import urllib.reques...
ytaben/cyphesis
refs/heads/master
rulesets/mason/world/tasks/Baking.py
3
#This file is distributed under the terms of the GNU General Public license. #Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details). from atlas import * from physics import * from physics import Quaternion from physics import Point3D from physics import Vector3D import server c...
shaulkf/bitcoin
refs/heads/master
qa/rpc-tests/bip65-cltv-p2p.py
11
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, N...
mihailignatenko/erp
refs/heads/master
addons/procurement_jit_stock/__init__.py
242
# -*- 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...
codingcave/Chimera-Solve
refs/heads/master
CreateMakefile.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import os # Variable definition makefile = 'Makefile' executable = 'chimera' extend_library = 'module' extend_library_name = 'lib' + extend_library + '.so' core_library = 'chimera' core_library_name = 'lib' + core_library + '.so' runtime_library = 'runtime' runtime_libra...
afaheem88/rally
refs/heads/master
tests/unit/cli/commands/test_verify.py
2
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
jmerkow/VTK
refs/heads/master
ThirdParty/Twisted/twisted/conch/test/test_recvline.py
42
# -*- test-case-name: twisted.conch.test.test_recvline -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.recvline} and fixtures for testing related functionality. """ import sys, os from twisted.conch.insults import insults from twisted.conch import recvline f...
prodromou87/gem5
refs/heads/master
src/arch/arm/ArmNativeTrace.py
27
# Copyright (c) 2009 The Regents of The University of Michigan # 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 ...
jakevdp/pelican-plugins
refs/heads/master
libravatar/test_libravatar.py
52
"""Unit testing suite for the Libravatar Plugin""" ## Copyright (C) 2015 Rafael Laboissiere <rafael@laboissiere.net> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Affero Public License as published by ## the Free Software Foundation, either version...
argv0/cloudstack
refs/heads/master
cloud-cli/cloudtool/__init__.py
2
# 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 u...
Endika/c2c-rd-addons
refs/heads/8.0
table_generate_csv/wizard/wizard_generate_csv.py
4
# -*- coding: utf-8 -*- ############################################## # # Swing Entwicklung betrieblicher Informationssysteme GmbH # (<http://www.swing-system.com>) # Copyright (C) ChriCar Beteiligungs- und Beratungs- GmbH # all rights reserved # 02-SEP-2011 (GK) created # # WARNING: This program as such is intende...
caterinaurban/Lyra
refs/heads/master
src/lyra/unittests/usage/tricky.py
1
x: bool = bool(input()) # STATE: x -> U; y -> W y: bool = bool(input()) if x: x: bool = x and y y: bool = False if x: x: bool = x and y y: bool = False print(y)
Mark24Code/python
refs/heads/master
Mr.Lin/0006/0006.py
40
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: 30987 # @Date: 2015-01-13 11:11:49 # @Last Modified by: 30987 # @Last Modified time: 2015-01-13 17:10:27 import re def hot_words(file_path): file = open(file_path,'r') file_content = file.read() p = re.compile(r'[\W\d]*') word_list = p.split(file_...
frouty/odoo_oph
refs/heads/dev_70
addons/l10n_uk/__openerp__.py
90
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2011 Smartmode LTD (<http://www.smartmode.co.uk>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as...
tumbl3w33d/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_devtestlabpolicy.py
27
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', ...
shitolepriya/Saloon_erp
refs/heads/master
erpnext/patches/v5_0/repost_requested_qty.py
90
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty count=0 for item_code, warehouse in frappe...
valdecdev/odoo
refs/heads/master
addons/payment/models/__init__.py
45
# -*- coding: utf-8 -*- import payment_acquirer import res_config import res_partner
maxhutch/pypif
refs/heads/master
pypif/stats/system/system_stats_wrapper.py
2
from pypif.stats.common.stats_wrapper import Stats from pypif.stats.common.stats_wrapper import StatsWrapper from pypif.stats.common.field_stats import FieldStats from pypif.stats.common.property_stats_wrapper import PropertyStatsWrapper class SystemStats(Stats): """ Class to store stats of a single system. ...
hasteur/g13bot_tools_new
refs/heads/master
tests/fixes_tests.py
6
# -*- coding: utf-8 -*- """Tests for fixes module.""" # # (C) Pywikibot team, 2015 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals from pywikibot import fixes from tests import unittest, join_data_path from tests.aspects import TestCase class TestFixes(...
eran-stratoscale/pyracktest
refs/heads/master
py/strato/racktest/infra/rackattackallocation.py
1
from rackattack import clientfactory from rackattack import api from strato.racktest.infra import config import logging from strato.racktest.infra import concurrently from strato.racktest.infra import suite from strato.racktest.infra import rootfslabel import tempfile import os import shutil import time from strato.rac...
nurmd2/nurmd
refs/heads/master
addons/sale/res_partner.py
46
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields,osv class res_partner(osv.osv): _inherit = 'res.partner' def _sale_order_count(self, cr, uid, ids, field_name, arg, context=None): res = dict(map(lambda x: (x,0), ids)) ...
Giftingnation/GN-Oscar-Custom
refs/heads/master
oscar/apps/dashboard/promotions/app.py
4
from django.conf.urls import patterns, url from oscar.core.application import Application from oscar.apps.dashboard.promotions import views from oscar.apps.promotions.conf import PROMOTION_CLASSES class PromotionsDashboardApplication(Application): name = None default_permissions = ['is_staff', ] list_vi...
mrpollo/ardupilot
refs/heads/master
Tools/LogAnalyzer/tests/TestDupeLogData.py
273
from LogAnalyzer import Test,TestResult import DataflashLog class TestDupeLogData(Test): '''test for duplicated data in log, which has been happening on PX4/Pixhawk''' def __init__(self): Test.__init__(self) self.name = "Dupe Log Data" def __matchSample(self, sample, sampleStartIndex, logdata): '''return...
mrakitin/sirepo
refs/heads/master
tests/uri_router_test.py
3
# -*- coding: utf-8 -*- u"""Test sirepo.uri_router :copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import pytest pytest.importorskip('srwl_bl') def test_not_found(): ...
moijes12/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/protocols/ident.py
20
# -*- test-case-name: twisted.test.test_ident -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Ident protocol implementation. @author: Jean-Paul Calderone """ from __future__ import generators import struct from twisted.internet import defer from twisted.protocols import basic from t...
chienlieu2017/it_management
refs/heads/master
odoo/addons/l10n_ar/__manifest__.py
25
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com) { 'name': 'Argentina - Accounting', 'version': '2.0', 'description': """ Argentinian accounting chart and tax localization. ==============...
leeseuljeong/leeseulstack_neutron
refs/heads/master
neutron/tests/unit/ml2/db/test_ml2_dvr_db.py
14
# Copyright (c) 2014 OpenStack Foundation, all rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
aetilley/scikit-learn
refs/heads/master
sklearn/utils/estimator_checks.py
41
from __future__ import print_function import types import warnings import sys import traceback import inspect import pickle from copy import deepcopy import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.externals.joblib import hash, Memory from sklearn.ut...
subutai/nupic.research
refs/heads/master
projects/transformers/experiments/__init__.py
2
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2021, 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...
kawamon/hue
refs/heads/master
desktop/core/ext-py/Django-1.11.29/tests/template_tests/filter_tests/test_floatformat.py
11
# -*- coding: utf-8 -*- from __future__ import unicode_literals from decimal import Decimal, localcontext from django.template.defaultfilters import floatformat from django.test import SimpleTestCase from django.utils import six from django.utils.safestring import mark_safe from ..utils import setup class Floatfor...
pquentin/libcloud
refs/heads/trunk
docs/examples/dns/create_a_record_for_all_rackspace_nodes.py
59
from pprint import pprint from libcloud.compute.providers import get_driver as get_compute_driver from libcloud.compute.types import Provider as ComputeProvider from libcloud.dns.providers import get_driver as get_dns_driver from libcloud.dns.types import Provider as DNSProvider from libcloud.dns.types import RecordTy...
jgasthaus/antaresia
refs/heads/master
nlp/utils.py
1
from collections import defaultdict import numpy as np def getNGramCounts(data, N): """Count the occurences of all N+1 grams in the data. Outputs a dictionary mapping histories of length N to a histogram dictionary.""" counts = defaultdict(dict) for i in xrange(N,len(data)): history = tuple(data[i-N:i])...
alistairlow/tensorflow
refs/heads/master
tensorflow/python/ops/random_ops.py
5
# 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...
erickt/pygments
refs/heads/master
scripts/check_sources.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Checker for file headers ~~~~~~~~~~~~~~~~~~~~~~~~ Make sure each Python file has a correct file header including copyright and license information. :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE fo...
RevelSystems/django
refs/heads/master
tests/messages_tests/test_cookie.py
37
import json from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.cookie import ( CookieStorage, MessageDecoder, MessageEncoder, ) from django.test import TestCase, override_settings from django.utils.safestring import SafeData, ...
nexusriot/cinder
refs/heads/master
cinder/volume/drivers/emc/emc_vmax_iscsi.py
11
# Copyright (c) 2012 - 2015 EMC Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
cloudbase/nova-virtualbox
refs/heads/virtualbox_driver
nova/tests/unit/keymgr/fake.py
110
# Copyright 2011 Justin Santa Barbara # Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/l...
soarpenguin/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/slackpkg.py
7
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kim Nørgaard # Written by Kim Nørgaard <jasen@jasen.dk> # Based on pkgng module written by bleader <bleader@ratonland.org> # that was based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com> # that was based on pacman module written by Afterburn <htt...
ECastleton/Popstop
refs/heads/master
popsicle/popsicle/wsgi.py
1
""" WSGI config for popsicle project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SET...
numpy/numpy-refactor
refs/heads/refactor
numpy/doc/performance.py
100
""" =========== Performance =========== Placeholder for Improving Performance documentation. """
GLMeece/faker
refs/heads/master
faker/cli.py
11
# coding=utf-8 from __future__ import unicode_literals from __future__ import print_function import os import sys import argparse from faker import Faker, Factory, documentor from faker import VERSION from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, META_PROVIDERS_MODULES if sys.version < '3': text_...
kressi/erpnext
refs/heads/develop
erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py
33
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class ChequePrintTemplate(Document): pass @frappe.white...
Whistler092/talk_flask
refs/heads/master
run.py
1
from flask import Flask app = Flask(__name__) @app.route("/") def init(): return "<h1>Hola Python Cali!</h1>" if __name__ == "__main__": app.run(debug=True)
reflectometry/osrefl
refs/heads/master
examples/sawtooth.py
1
from numpy import arange, linspace, float64, indices, zeros_like, ones_like, pi, sin, complex128, array, exp, newaxis, cumsum, sum, log10 from GISANS_problem import Shape, rectangle, GISANS_problem #def rectangle(x0, y0, dx, dy, sld=0.0, sldi=0.0): # #generate points for a rectangle # rect = Shape('rectangle') #...
F5Networks/f5-common-python
refs/heads/development
devtools/crawler.py
1
from __future__ import absolute_import # Copyright 2016 F5 Networks 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 ...
tmpgit/intellij-community
refs/heads/master
python/testData/resolve/LoopToLowerReassignment.py
83
def f(): while True: foo = 1 # <ref> foo = 2
unioslo/cerebrum
refs/heads/master
Cerebrum/modules/virthome/bofhd_auth.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 t...
kamyu104/LeetCode
refs/heads/master
Python/remove-nth-node-from-end-of-list.py
2
from __future__ import print_function # Time: O(n) # Space: O(1) # # Given a linked list, remove the nth node from the end of list and return its head. # # For example, # # Given linked list: 1->2->3->4->5, and n = 2. # # After removing the second node from the end, the linked list becomes 1->2->3->5. # Note: # ...
kjung/scikit-learn
refs/heads/master
examples/svm/plot_svm_regression.py
120
""" =================================================================== Support Vector Regression (SVR) using linear and non-linear kernels =================================================================== Toy example of 1D regression using linear, polynomial and RBF kernels. """ print(__doc__) import numpy as np ...
d4nnyk/reverse
refs/heads/master
reverse/lib/graph.py
1
#!/usr/bin/env python3 # # Reverse : Generate an indented asm code (pseudo-C) with colored syntax. # Copyright (C) 2015 Joel # # 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...
barryrobison/arsenalsuite
refs/heads/master
cpp/lib/stonegui/__init__.py
211
import build
dhiltgen/docker-registry
refs/heads/master
docker_registry/__init__.py
77
# -*- coding: utf-8 -*- try: import pkg_resources pkg_resources.declare_namespace(__name__) except ImportError: import pkgutil __path__ = pkgutil.extend_path(__path__, __name__)
groschovskiy/lerigos_music
refs/heads/master
Server/API/lib/system_tests/__init__.py
77
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
abantam/pmtud
refs/heads/master
nsc/scons-local-1.2.0.d20090223/SCons/Tool/MSCommon/vs.py
19
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
Bachaco-ve/odoo
refs/heads/8.0
addons/l10n_eu_service/wizard/wizard.py
242
# -*- coding: utf-8 -*- ############################################################################## # # Odoo, Open Source Business Applications # Copyright (C) 2015 Odoo S.A. <http://www.odoo.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Aff...
ludmilamarian/invenio
refs/heads/master
invenio/ext/admin/__init__.py
3
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014, 2015 CERN. # # Invenio 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 optio...
chuchiperriman/cloud-services-notifications
refs/heads/master
src/cloudsn/core/indicator.py
1
import os from cloudsn.core import config, utils, notification from cloudsn import logger class Indicator: def get_name(self): return None def set_active(self, active): pass def create_indicator(self, acc): pass def update_account(self, acc): pass def remove_indi...
cloudera/hue
refs/heads/master
desktop/core/ext-py/urllib3-1.25.8/src/urllib3/util/retry.py
28
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..pack...
schleichdi2/OPENNFR-6.0-CORE
refs/heads/master
opennfr-openembedded-core/scripts/lib/recipetool/append.py
2
# Recipe creation tool - append plugin # # Copyright (C) 2015 Intel Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it wi...
misgeatgit/opencog
refs/heads/master
opencog/python/monitor_changes.py
7
from opencog.atomspace import AtomSpace, types, Atom, Handle, TruthValue, types as t import opencog.cogserver import random from time import sleep def monitor_changes(atomspace): tv_delta = 0.1 interval = 5 + 5*random.random() # seconds t = types # Get latest and previous time nodes with large...
kjw0106/boto
refs/heads/master
tests/integration/codedeploy/__init__.py
586
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...