repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
JackNokia/robotframework
refs/heads/master
atest/testdata/keywords/resources/MyLibrary2.py
22
from robot.libraries.BuiltIn import BuiltIn, register_run_keyword class MyLibrary2: def keyword_only_in_library_2(self): print "Keyword from library 2" def keyword_in_both_libraries(self): print "Keyword from library 2" def keyword_in_all_resources_and_libraries(self): print "Ke...
soldag/home-assistant
refs/heads/dev
tests/util/test_thread.py
12
"""Test Home Assistant thread utils.""" import asyncio import pytest from homeassistant.util.async_ import run_callback_threadsafe from homeassistant.util.thread import ThreadWithException async def test_thread_with_exception_invalid(hass): """Test throwing an invalid thread exception.""" finish_event = a...
saurabh6790/test-erp
refs/heads/develop
erpnext/projects/doctype/activity_cost/test_activity_cost.py
22
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from erpnext.projects.doctype.activity_cost.activity_cost import DuplicationError class TestActivityCost(unittest.TestC...
Udayraj123/dashboard_IITG
refs/heads/master
Binder/discussions/migrations/0023_auto_20160711_2352.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10a1 on 2016-07-11 18:22 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('discussions', '0022_remove_post_score'), ] operations = [ migrations.AlterF...
Tchanders/socorro
refs/heads/master
socorro/lib/httpclient.py
11
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import httplib class HttpClient(object): """Class for doing HTTP requests to any server. Encapsulate python's http...
ixiom/phantomjs
refs/heads/master
src/qt/qtwebkit/Tools/TestResultServer/handlers/__init__.py
6014
# Required for Python to search this directory for module files
nicoTrombon/DjangoPolls
refs/heads/master
env/Lib/site-packages/django/contrib/gis/db/backends/postgis/creation.py
87
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_ops = 'GIST_GEOMETRY_OPS' geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND' def sql_indexes_for_field(self, model, f, style): "Return any spatial ...
bestdpf/2dbarcode
refs/heads/master
cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/mssdk.py
34
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 li...
gylian/Sick-Beard
refs/heads/master
lib/beets/util/artresizer.py
15
# This file is part of beets. # Copyright 2013, Fabrice Laporte # # 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, ...
page-io/Cactus
refs/heads/master
cactus/utils/network.py
9
#coding:utf-8 import logging import time import urllib2 from cactus.utils.parallel import multiMap logger = logging.getLogger(__name__) def retry(exceptions, tries=4, delay=3, backoff=2): """ Retry execution in case we fail on one of the exceptions """ def deco_retry(f): def f_retry(*args, ...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
parallel/test_cases/8NodeBrick/cantilever_different_Poisson/NumberOfDivision2/PoissonRatio0.20/compare_txt.py
637
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
cristiana214/cristianachavez214-cristianachavez
refs/heads/master
python/src/Lib/plat-mac/Carbon/OSAconst.py
81
# Generated from 'OSA.h' def FOUR_CHAR_CODE(x): return x from Carbon.AppleEvents import * kAEUseStandardDispatch = -1 kOSAComponentType = FOUR_CHAR_CODE('osa ') kOSAGenericScriptingComponentSubtype = FOUR_CHAR_CODE('scpt') kOSAFileType = FOUR_CHAR_CODE('osas') kOSASuite = FOUR_CHAR_CODE('ascr') kOSARecordedText = FOUR...
virgree/odoo
refs/heads/8.0
addons/l10n_at/__init__.py
438
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) conexus.at # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
OKThess/website
refs/heads/master
main/migrations/0039_auto_20170926_1634.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-26 16:34 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('main', '0038_auto_20170926_1624'), ] operations = [ migrations.RenameField( ...
orchidinfosys/odoo
refs/heads/master
addons/mail/models/update.py
28
# -*- coding: utf-8 -*- from ast import literal_eval import datetime from functools import partial import logging import werkzeug.urls import urllib2 from openerp import release, SUPERUSER_ID from openerp.models import AbstractModel from openerp.tools.translate import _ from openerp.tools.config import config from ope...
Lafunamor/ns3
refs/heads/master
src/applications/bindings/callbacks_list.py
331
callback_classes = [ ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['bool', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', ...
toolforger/sympy
refs/heads/master
sympy/categories/__init__.py
122
""" Category Theory module. Provides some of the fundamental category-theory-related classes, including categories, morphisms, diagrams. Functors are not implemented yet. The general reference work this module tries to follow is [JoyOfCats] J. Adamek, H. Herrlich. G. E. Strecker: Abstract and Concre...
sve-odoo/odoo
refs/heads/master
addons/website_sale_delivery/controllers/main.py
214
# -*- coding: utf-8 -*- import openerp from openerp import http from openerp.http import request import openerp.addons.website_sale.controllers.main class website_sale(openerp.addons.website_sale.controllers.main.website_sale): @http.route(['/shop/payment'], type='http', auth="public", website=True) def paym...
postrational/django
refs/heads/master
tests/middleware_exceptions/tests.py
63
import sys from django.conf import settings from django.core.signals import got_request_exception from django.http import HttpResponse from django.template.response import TemplateResponse from django.template import Template from django.test import TestCase class TestException(Exception): pass # A middleware ba...
wuzheng-sjtu/FastFPN
refs/heads/master
libs/layers/roi.py
2
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import libs.boxes.cython_bbox as cython_bbox import libs.configs.config_v1 as cfg from libs.boxes.bbox_transform import bbox_transform, bbox_transform_inv, clip_boxes from libs.logs.log impo...
yxxyun/shadowsocks
refs/heads/master
shadowsocks/asyncdns.py
655
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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 r...
txm/make-good
refs/heads/master
django/views/generic/__init__.py
493
from django.views.generic.base import View, TemplateView, RedirectView from django.views.generic.dates import (ArchiveIndexView, YearArchiveView, MonthArchiveView, WeekArchiveView, DayArchiveView, TodayArchiveView, DateDetailView) from django.vie...
Sun-Wukong/CokeNRum
refs/heads/master
crblog/migrations/0001_initial.py
12
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
aferr/LatticeMemCtl
refs/heads/master
src/arch/x86/isa/insts/simd64/floating_point/compare/compare_and_write_mask.py
91
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
hujiajie/chromium-crosswalk
refs/heads/master
tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py
8
# 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 collections import logging import os import plistlib import shutil import tempfile import xml.parsers.expat from telemetry.core import os_version fro...
louyihua/edx-platform
refs/heads/master
cms/djangoapps/contentstore/features/course_import.py
176
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # pylint: disable=unused-argument import os from lettuce import world, step from django.conf import settings def import_file(filename): world.browser.execute_script("$('input.file-input').css('display', 'block')") path = os.path.join(...
AllMyChanges/allmychanges.com
refs/heads/master
allmychanges/management/commands/load_migrated.py
1
# coding: utf-8 import os import shutil import json from django.core.management.base import BaseCommand from django.conf import settings from twiggy_goodies.threading import log from twiggy_goodies.django import LogMixin from allmychanges.downloaders import guess_downloaders from allmychanges.models import ( Cha...
damonkohler/sl4a
refs/heads/master
python/src/Lib/test/relimport.py
400
from .test_import import *
dsdinter/learning-spark-examples
refs/heads/master
src/python/BasicAvg.py
42
""" >>> from pyspark.context import SparkContext >>> sc = SparkContext('local', 'test') >>> b = sc.parallelize([1, 2, 3, 4]) >>> basicAvg(b) 2.5 """ import sys from pyspark import SparkContext def basicAvg(nums): """Compute the avg""" sumCount = nums.map(lambda x: (x, 1)).fold( (0, 0), (lambda x, y:...
curtacircuitos/pcb-tools
refs/heads/master
gerber/tests/test_cam.py
1
#! /usr/bin/env python # -*- coding: utf-8 -*- # Author: Hamilton Kibbe <ham@hamiltonkib.be> import pytest from ..cam import CamFile, FileSettings def test_filesettings_defaults(): """ Test FileSettings default values """ fs = FileSettings() assert fs.format == (2, 5) assert fs.notation == "abs...
3manuek/scikit-learn
refs/heads/master
sklearn/cluster/tests/test_dbscan.py
114
""" Tests for DBSCAN clustering algorithm """ import pickle import numpy as np from scipy.spatial import distance from scipy import sparse from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing im...
harshilasu/LinkurApp
refs/heads/master
y/google-cloud-sdk/platform/gcutil/lib/google_compute_engine/gcutil_lib/thread_pool_test.py
4
# Copyright 2012 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...
dvliman/jaikuengine
refs/heads/master
.google_appengine/google/appengine/api/prospective_search/error_pb.py
27
#!/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...
feliam/opaf
refs/heads/master
tests/filters_tst.py
1
import unittest from opaflib import filters class FiltersTest(unittest.TestCase): random_strings = [ "AAAAAAAAA", "$#@%!#TYU$&#%^!@%THJDTKE%I$U^", "X"*65537 ] def setUp(self): pass def tearDown(self): pass def _basicTest(self, flt, decode_tbl=[], encode_tbl=[], random_strings=[], decod...
SwagColoredKitteh/servo
refs/heads/master
python/tidy/servo_tidy/tidy.py
7
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
hkchenhongyi/django
refs/heads/master
django/contrib/messages/api.py
512
from django.contrib.messages import constants from django.contrib.messages.storage import default_storage from django.http import HttpRequest __all__ = ( 'add_message', 'get_messages', 'get_level', 'set_level', 'debug', 'info', 'success', 'warning', 'error', 'MessageFailure', ) class MessageFailure(E...
ykalchevskiy/cookiecutter-yad
refs/heads/master
{{ cookiecutter.repo_name }}/{{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/settings/base.py
1
""" Django settings for {{ cookiecutter.project_name }} project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ Security: https://docs.djangoproject.com/en/dev/howto/...
qianwenming/mapnik
refs/heads/master
scons/scons-local-2.3.1/SCons/Tool/f95.py
11
"""engine.SCons.Tool.f95 Tool-specific initialization for the generic Posix f95 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2...
h2oai/h2o
refs/heads/master
py/testdir_single_jvm/test_exec2_cmp_many_cols.py
9
import unittest, random, sys, time sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_exec as h2e print "Many cols, compare two data frames using exec ==" def write_syn_dataset(csvPathname, rowCount, colCount, SEED): # 8 random generatators, 1 per column r1...
Ayub-Khan/edx-platform
refs/heads/master
common/test/acceptance/tests/discussion/test_cohorts.py
137
""" Tests related to the cohorting feature. """ from uuid import uuid4 from .helpers import BaseDiscussionMixin, BaseDiscussionTestCase from .helpers import CohortTestMixin from ..helpers import UniqueCourseTest from ...pages.lms.auto_auth import AutoAuthPage from ...fixtures.course import (CourseFixture, XBlockFixtur...
ryfeus/lambda-packs
refs/heads/master
Tensorflow_Pandas_Numpy/source3.6/setuptools/command/bdist_wininst.py
991
import distutils.command.bdist_wininst as orig class bdist_wininst(orig.bdist_wininst): def reinitialize_command(self, command, reinit_subcommands=0): """ Supplement reinitialize_command to work around http://bugs.python.org/issue20819 """ cmd = self.distribution.reinitiali...
sniemi/SamPy
refs/heads/master
sandbox/src1/stats.py
1
# Copyright (c) 1999-2007 Gary Strangman; 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 # to use, copy, m...
Esri/ArcREST
refs/heads/master
src/arcrest/manageags/_logs.py
6
from __future__ import absolute_import from __future__ import print_function from .._abstract.abstract import BaseAGSServer from datetime import datetime import csv, json ######################################################################## class Log(BaseAGSServer): """ Log of a server """ _url = None _s...
Eforcers/inbox-cleaner
refs/heads/master
src/lib/requests/packages/charade/langhebrewmodel.py
2762
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved...
goodwinnk/intellij-community
refs/heads/master
python/testData/refactoring/extractsuperclass/moveExtends/source_module.after.py
320
from dest_module import NewParent class MyClass(NewParent): pass
silveregg/moto
refs/heads/master
tests/test_ec2/test_key_pairs.py
2
from __future__ import unicode_literals # Ensure 'assert_raises' context manager support for Python 2.6 import tests.backport_assert_raises from nose.tools import assert_raises import boto import six import sure # noqa from boto.exception import EC2ResponseError, JSONResponseError from moto import mock_ec2 @mock_e...
nelson-liu/scikit-learn
refs/heads/master
sklearn/svm/bounds.py
36
"""Determination of parameter bounds""" # Author: Paolo Losi # License: BSD 3 clause from warnings import warn import numpy as np from ..preprocessing import LabelBinarizer from ..utils.validation import check_consistent_length, check_array from ..utils.extmath import safe_sparse_dot def l1_min_c(X, y, loss='squar...
yoe/veyepar
refs/heads/master
dj/scripts/fix.py
3
#!/usr/bin/python # fix.py - mass fix some goof from process import process from main.models import Show, Location, Episode, Raw_File, Cut_List class fix(process): # this will bump everything from 5 back to 4 ready_state = 7 def process_ep(self, ep): if self.options.verbose: print(ep.id, ep.na...
tkelman/utf8rewind
refs/heads/master
tools/gyp/test/actions/src/subdir3/generate_main.py
125
#!/usr/bin/env python # Copyright (c) 2009 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. import sys contents = """ #include <stdio.h> int main(void) { printf("Hello from generate_main.py\\n"); return 0; } """ open(sys.argv...
pkuyym/Paddle
refs/heads/develop
python/paddle/fluid/tests/unittests/test_cast_op.py
5
# Copyright (c) 2018 PaddlePaddle 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 app...
bregman-arie/ansible
refs/heads/devel
lib/ansible/module_utils/openstack.py
20
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
release-monitoring/anitya
refs/heads/master
anitya/lib/backends/rubygems.py
1
# -*- coding: utf-8 -*- """ (c) 2014-2019 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon <pingou@pingoured.fr> Ralph Bean <rbean@redhat.com> Michal Konecny <mkonecny@redhat.com> """ from anitya.lib.backends import BaseBackend from anitya.lib.exceptions import AnityaPluginException class RubygemsBa...
danjac/pyramid-medley
refs/heads/master
setup.py
1
from setuptools import setup setup( name='pyramid-medley', version='0.0.1', author='Dan Jacob', author_email='danjac354@gmail.com', packages=['pyramid_medley'], scripts=[], license='LICENSE.txt', description='Pyramid/Jinja2/SQLAlchemy scaffold', long_description=open('README.md').re...
ea4gja/mrig
refs/heads/master
mrigd/tt_orion.py
1
#!/usr/bin/env python # # File: tt_orion.py # Version: 1.0 # # mrigd: TT_orion class definition # Copyright (c) 2006-2008 Martin Ewing # # 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 ve...
Razesdark/mps-youtube
refs/heads/develop
mps_youtube/player.py
1
import os import sys import random import logging import math import time import shlex import subprocess import socket from urllib.error import HTTPError, URLError from abc import ABCMeta, abstractmethod from . import g, screen, c, streams, history, content, config, util from .commands import lastfm mswin = os.name...
ATIX-AG/ansible
refs/heads/devel
test/units/modules/network/f5/test_bigip_partition.py
27
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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 import os import json import sys from nose.plugins.skip import SkipTest i...
bcrochet/eve
refs/heads/master
eve/methods/post.py
1
# -*- coding: utf-8 -*- """ eve.methods.post ~~~~~~~~~~~~~~~~ This module imlements the POST method, supported by the resources endopints. :copyright: (c) 2017 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ from datetime import datetime from flask import current_app as a...
setrofim/workload-automation
refs/heads/master
wa/workloads/templerun2/__init__.py
5
# Copyright 2013-2018 ARM Limited # # 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 w...
c1728p9/pyOCD
refs/heads/master
test/blank_test.py
12
#!/usr/bin/env python """ mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 r...
evandrix/Splat
refs/heads/master
code/mypkg/gui/GraphicsView.py
1
import sys from PyQt4 import QtGui, QtCore class GraphicsView(QtGui.QGraphicsView): def __init__(self, pixmap, scene, parent, *args): print >> sys.stderr, "GraphicsView::init()" QtGui.QGraphicsView.__init__(self, scene) self.scene = scene self.pixmap = pixmap self.win...
yfdyh000/kuma
refs/heads/master
kuma/wiki/migrations/0021_document_attachments_populated.py
4
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wiki', '0020_add_is_linked_is_original'), ] operations = [ migrations.AddField( model_name='document', ...
opennode/nodeconductor-assembly-waldur
refs/heads/develop
src/waldur_auth_saml2/tests/test_backend.py
1
from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from django.test import TestCase from waldur_auth_saml2.auth import WaldurSaml2Backend User = get_user_model() class WaldurSaml2BackendTest(TestCase): def test_email_should_be_unique_positive(self): User.ob...
Distrotech/pygobject
refs/heads/distrotech-pygobject
gi/repository/__init__.py
23
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2009 Johan Dahlin <johan@gnome.org> # # 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;...
lawnmowerlatte/hyper
refs/heads/development
tasks.py
7
import json import os from binascii import hexlify from invoke import task from hyper.http20.hpack import Encoder @task def hpack(): """ This task generates HPACK test data suitable for use with https://github.com/http2jp/hpack-test-case The current format defines a JSON object with three keys: 'draf...
voilet/cmdb
refs/heads/master
assets/views.py
1
# coding:utf-8 import ast import nmap from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from assets.models import Host, IDC, Service, Line, Project, HostRecord from django.views.decorators.csrf import csrf_protect from...
munhanha/mtg-random
refs/heads/master
django/contrib/localflavor/ch/ch_states.py
544
# -*- coding: utf-8 -* from django.utils.translation import ugettext_lazy as _ STATE_CHOICES = ( ('AG', _('Aargau')), ('AI', _('Appenzell Innerrhoden')), ('AR', _('Appenzell Ausserrhoden')), ('BS', _('Basel-Stadt')), ('BL', _('Basel-Land')), ('BE', _('Berne')), ('FR', _('Fribourg')), ('...
redhat-openstack/nova
refs/heads/f22-patches
nova/network/floating_ips.py
10
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
astropy/astropy
refs/heads/main
astropy/io/fits/tests/__init__.py
12
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os import shutil import stat import tempfile import time from astropy.io import fits class FitsTestCase: def setup(self): self.data_dir = os.path.join(os.path.dirname(__file__), 'data') self.temp_dir = tempfile.mkdtemp(prefix=...
rhattersley/cartopy
refs/heads/master
lib/cartopy/examples/un_flag.py
2
""" UN Flag ------- A demonstration of the power of Matplotlib combined with cartopy's Azimuthal Equidistant projection to reproduce the UN flag. """ import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from matplotlib.patches import PathPatch import matplotlib.path import mat...
rotofly/odoo
refs/heads/master
addons/mrp_byproduct/mrp_byproduct.py
108
# -*- 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...
iliamo/sensor-prototype
refs/heads/master
.waf-tools/default-compiler-flags.py
1
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- from waflib import Logs, Configure def options(opt): opt.add_option('--debug', '--with-debug', action='store_true', default=False, dest='debug', help='''Compile in debugging mode without optimizations (-O0 or -Og...
frankvdp/django
refs/heads/master
django/core/management/commands/startapp.py
108
from django.core.management.templates import TemplateCommand class Command(TemplateCommand): help = ( "Creates a Django app directory structure for the given app name in " "the current directory or optionally in the given directory." ) missing_args_message = "You must provide an applicatio...
caot/intellij-community
refs/heads/master
python/testData/completion/noUnderscoredBuiltin.after.py
83
___Cl
karibou/sosreport
refs/heads/master
sos/policies/ibmkvm.py
8
# Copyright (C) IBM Corporation, 2015 # # Authors: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> # # 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...
Azure/azure-sdk-for-python
refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/aio/operations/_bastion_hosts_operations.py
1
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
tempbottle/python-driver
refs/heads/master
cassandra/cqlengine/functions.py
8
# Copyright 2015 DataStax, 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 writing, s...
pli3/enigma2-git
refs/heads/master
lib/python/Plugins/Extensions/HbbTV/plugin.py
2
from Plugins.Plugin import PluginDescriptor from Screens.Screen import Screen from Screens.InfoBar import InfoBar from Screens.ChoiceBox import ChoiceBox from Screens.MessageBox import MessageBox from Screens.InfoBarGenerics import InfoBarNotifications from Screens.VirtualKeyBoard import VirtualKeyBoard from Screens.H...
ThatRfernand/or-tools
refs/heads/master
examples/python/blending.py
5
# Copyright 2011 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
jstoxrocky/statsmodels
refs/heads/master
statsmodels/examples/ex_kernel_singleindex_dgp.py
34
# -*- coding: utf-8 -*- """ Created on Sun Jan 06 09:50:54 2013 Author: Josef Perktold """ from __future__ import print_function if __name__ == '__main__': import numpy as np import matplotlib.pyplot as plt #from statsmodels.nonparametric.api import KernelReg import statsmodels.sandbox.nonparametr...
namboy94/messengerbot
refs/heads/master
kudubot/db/config/impl/MySqlConfig.py
2
"""LICENSE Copyright 2015 Hermann Krumrey <hermann@krumreyh.com> This file is part of kudubot. kudubot 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 lat...
JioCloud/oslo.db
refs/heads/master
oslo/db/concurrency.py
3
# 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 by ...
xq262144/hue
refs/heads/master
desktop/core/ext-py/Django-1.6.10/django/core/management/commands/compilemessages.py
98
from __future__ import unicode_literals import codecs import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import find_command, popen_wrapper from django.utils._os import npath def has_bom(fn): with open(fn, 'rb') as f: ...
tetsuo13/OpenDKIM-Rotate-Keys
refs/heads/master
odkim_rotate/dns/linode_provider.py
1
import os import requests from odkim_rotate.dns.provider import * class LinodeDnsProvider(DnsProvider): """DNS provider for Linode. Linode requires a domain ID when adding any DNS records. Rather than enumerating all domains on every request to create a TXT record in order to find the ID of the domai...
danalec/dotfiles
refs/heads/master
sublime/.config/sublime-text-3/Packages/anaconda_php/plugin/handlers_php/commands/phpcpd.py
3
# Copyright (C) 2014 - Oscar Campos <oscar.campos@member.fsf.org> # This program is Free Software see LICENSE file for details import os import sys import logging import traceback import subprocess from commands.base import Command from process import spawn PIPE = subprocess.PIPE class PHPCPD(Command): """Ru...
wakatime/sketch-wakatime
refs/heads/master
WakaTime.sketchplugin/Contents/Resources/wakatime/packages/pygments/lexers/other.py
31
# -*- coding: utf-8 -*- """ pygments.lexers.other ~~~~~~~~~~~~~~~~~~~~~ Just export lexer classes previously contained in this module. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexers.sql import SqlLexer, MySqlLexe...
dancerj/monthly-report
refs/heads/master
2012/image201212/memberanalysis/unique_names.py
3
#!/usr/bin/python # dump unique names count. # use: # ./unique_names.py < memberls.csv import csv import sys csv_reader = csv.reader(sys.stdin) usernames = {} for row in csv_reader: for column in row[2:]: # each column is a username. name = column.decode('utf-8') usernames[name] = userna...
kpespinosa/BuildingMachineLearningSystemsWithPython
refs/heads/master
ch03/noise_analysis.py
24
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import sklearn.datasets groups = [ 'comp.graphics', 'comp.os.ms-windows.misc', 'comp.sys.ibm.pc.ha...
aborrero/pkg-rpmlint
refs/heads/master
TagsCheck.py
1
# -*- coding: utf-8 -*- ############################################################################# # File : TagsCheck.py # Package : rpmlint # Author : Frederic Lepied # Created on : Tue Sep 28 00:03:24 1999 # Purpose : Check a package to see if some rpm tags are present ##############...
iLoveTux/data_store
refs/heads/master
build/lib/data/store/store.py
2
# -*- coding: utf-8 -*- import uuid from threading import RLock import pickle import base64 from itertools import cycle, izip def encrypt(string, key="_"): """Return the base64 encoded XORed version of string. This is XORed with key which defaults to a single underscore.""" return base64.encodestring( ...
se000ra/myflaskcooktest
refs/heads/master
tests/conftest.py
1
# -*- coding: utf-8 -*- """Defines fixtures available to all tests.""" import os import pytest from webtest import TestApp from myflaskcooktest.settings import TestConfig from myflaskcooktest.app import create_app from myflaskcooktest.database import db as _db from .factories import UserFactory @pytest.yield_fixtur...
ChipaKraken/iRnWs
refs/heads/master
search_backend/language.py
1
# encoding=utf8 from re import findall as fa from collections import defaultdict as dd class LangChecker(object): """docstring for LangChecker""" def __init__(self): self.langs = {} def training(self, lang, path): data = dd(int) with open(path) as book: book = book.read() for word in fa('\w+', book): ...
p0psicles/SickGear
refs/heads/master
lib/unidecode/x084.py
252
data = ( 'Hu ', # 0x00 'Qi ', # 0x01 'He ', # 0x02 'Cui ', # 0x03 'Tao ', # 0x04 'Chun ', # 0x05 'Bei ', # 0x06 'Chang ', # 0x07 'Huan ', # 0x08 'Fei ', # 0x09 'Lai ', # 0x0a 'Qi ', # 0x0b 'Meng ', # 0x0c 'Ping ', # 0x0d 'Wei ', # 0x0e 'Dan ', # 0x0f 'Sha ', # 0x10 'Hu...
zygmuntz/pybrain
refs/heads/master
pybrain/structure/modules/table.py
31
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from pybrain.structure.modules.module import Module from pybrain.structure.parametercontainer import ParameterContainer class Table(Module, ParameterContainer): """ implements a simple 2D table with dimensions rows x columns, which is basically a wrap...
CaliOpen/CaliOpen
refs/heads/master
src/backend/main/py.main/caliopen_main/common/store/tag.py
1
# -*- coding: utf-8 -*- """Caliopen tag objects.""" from __future__ import absolute_import, print_function, unicode_literals from cassandra.cqlengine import columns from elasticsearch_dsl import InnerObjectWrapper, Date, Integer from elasticsearch_dsl import Boolean, Keyword from caliopen_storage.store import BaseUse...
ch3ll0v3k/scikit-learn
refs/heads/master
sklearn/cluster/__init__.py
364
""" The :mod:`sklearn.cluster` module gathers popular unsupervised clustering algorithms. """ from .spectral import spectral_clustering, SpectralClustering from .mean_shift_ import (mean_shift, MeanShift, estimate_bandwidth, get_bin_seeds) from .affinity_propagation_ import affinity_propagati...
grucin/Potyczki-Algorytmiczne-2016
refs/heads/master
sze/test.py
1
import unittest from sze import sze class SzeTests(unittest.TestCase): def test_ok(self): self.assertEqual( sze(2, ((3, 8, 3), (2, 5, 2), (3, 7, 3))), 1) def test_ok_full(self): self.assertEqual( sze(3, ( (0, 9, 6), (0, 8, 6), ...
cuckoobox/cuckoo
refs/heads/master
cuckoo/machinery/xenserver.py
1
# Copyright (C) 2014-2017 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import logging import threading from cuckoo.common.abstracts import Machinery from cuckoo.common.exceptions import CuckooMachineError, CuckooDependenc...
ar7z1/ansible
refs/heads/devel
lib/ansible/executor/process/__init__.py
2520
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
mick-d/nipype
refs/heads/master
nipype/interfaces/diffusion_toolkit/tests/__init__.py
14224
# -*- coding: utf-8 -*-
katepanping/libyuv
refs/heads/master
gyp_libyuv.py
179
#!/usr/bin/env python # # Copyright 2014 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All cont...