repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
NitishT/minio-py | refs/heads/master | tests/unit/helpers.py | 3 | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... |
kevinlondon/sentry | refs/heads/master | src/sentry/web/frontend/projects/tags.py | 11 | """
sentry.web.frontend.projects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.constants import MEMBER_ADMIN
from sentry.models import TagKey, TagKeyStatus
from sen... |
kater169/libcloud | refs/heads/trunk | docs/examples/compute/gce/gce_service_account_scopes.py | 59 | # See previous examples for connecting and creating the driver
# ...
driver = None
# Define common example attributes
s = 'n1-standard-1'
i = 'debian-7'
z = 'us-central1-a'
# Service Account Scopes require a list of dictionaries. Each dictionary
# can have an optional 'email' address specifying the Service Account
# ... |
jwmatthews/r3 | refs/heads/master | cds/cds/src/pulp_cds/repo_auth/auth_enabled_validation.py | 1 | #
# Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the im... |
andykimpe/chromium-test-npapi | refs/heads/master | chrome/test/chromedriver/test/test_environment.py | 11 | # Copyright 2013 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.
"""TestEnvironment classes.
These classes abstract away the various setups needed to run the WebDriver java
tests in various environments.
"""
import os
im... |
freedomtan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/init_ops_test.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... |
thaim/ansible | refs/heads/fix-broken-link | lib/ansible/module_utils/network/iosxr/facts/legacy/base.py | 23 | # -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The iosxr legacy fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the co... |
FederatedAI/FATE | refs/heads/master | python/federatedml/protobuf/generated/column_expand_meta_pb2.py | 1 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: column-expand-meta.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... |
tejasapatil/spark | refs/heads/master | python/pyspark/shell.py | 9 | #
# 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... |
FedoraScientific/salome-paravis | refs/heads/master | test/VisuPrs/Util/paravistesthelper.py | 1 | # Copyright (C) 2013-2014 CEA/DEN, EDF R&D
#
# 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 your option) any later version.
#
# This library ... |
gold3bear/swift | refs/heads/master | test/probe/test_account_get_fake_responses_match.py | 11 | #!/usr/bin/python -u
# Copyright (c) 2010-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... |
AtwooTM/ccm | refs/heads/master | ccmlib/common.py | 1 | #
# Cassandra Cluster Management lib
#
import fnmatch
import os
import platform
import re
import shutil
import socket
import stat
import subprocess
import sys
import time
import yaml
from six import print_
BIN_DIR = "bin"
CASSANDRA_CONF_DIR = "conf"
DSE_CASSANDRA_CONF_DIR = "resources/cassandra/conf"
OPSCENTER_CONF_... |
pfhayes/boto | refs/heads/develop | boto/sdb/db/key.py | 153 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... |
yl565/statsmodels | refs/heads/master | statsmodels/tsa/statespace/dynamic_factor.py | 1 | """
Dynamic factor model
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
from warnings import warn
from statsmodels.compat.collections import OrderedDict
import numpy as np
import pandas as pd
from .kalman_filter import KalmanFilter, FilterResults
from... |
GammaC0de/pyload | refs/heads/master | src/pyload/plugins/downloaders/CyberlockerCh.py | 1 | # -*- coding: utf-8 -*-
from ..base.dead_downloader import DeadDownloader
class CyberlockerCh(DeadDownloader):
__name__ = "CyberlockerCh"
__type__ = "downloader"
__version__ = "0.07"
__status__ = "stable"
__pyload_version__ = "0.5"
__pattern__ = r"http://(?:www\.)?cyberlocker\.ch/\w+"
_... |
singlebrook/AWS-ElasticBeanstalk-CLI | refs/heads/master | eb/linux/python3/scli/operation/terminal_operations.py | 8 | #!/usr/bin/env python
#==============================================================================
# Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the... |
damienmg/bazel | refs/heads/master | third_party/protobuf/3.4.0/python/google/protobuf/internal/generator_test.py | 71 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... |
aioue/ansible | refs/heads/devel | lib/ansible/modules/system/alternatives.py | 66 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
(c) 2015, David Wittman <dwittman@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 Gene... |
kschultz1986/robots_for_all | refs/heads/master | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | 1 | # generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/karl/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg"
services_str = ""
pkg_name = "costmap_2d"
dependencies_str = "std_msgs;geometry_msgs;map_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "costmap_2d;/home/... |
sudheesh001/oh-mainline | refs/heads/master | vendor/packages/scrapy/scrapy/tests/test_downloadermiddleware_stats.py | 19 | from unittest import TestCase
from scrapy.contrib.downloadermiddleware.stats import DownloaderStats
from scrapy.http import Request, Response
from scrapy.spider import BaseSpider
from scrapy.stats import stats
class TestDownloaderStats(TestCase):
def setUp(self):
self.spider = BaseSpider('scrapytest.org... |
NewVadim/django-sphinx | refs/heads/master | djangosphinx/query/queryset.py | 1 | #coding: utf-8
from __future__ import unicode_literals
__author__ = 'ego'
import MySQLdb
import re
import time
import warnings
import six
try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict # Python < 2.7
from datetime import dateti... |
0todd0000/spm1d | refs/heads/master | spm1d/examples/stats1d/ex_ci_onesample.py | 1 |
'''
One-sample confidence intervals for 1D data:
NOTES:
1. If mu=None then explicit hypothesis testing is suppressed (i.e. exploratory analysis)
Note that the hypothesis test is still conducted implicitly (to compute the CI).
However, the explicit null hypothesis rejection decision will not appear when using either ... |
kifcaliph/odoo | refs/heads/8.0 | addons/hr_applicant_document/__init__.py | 389 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
nwjs/chromium.src | refs/heads/nw45-log | third_party/blink/web_tests/external/wpt/webdriver/tests/get_window_handle/get.py | 22 | from tests.support.asserts import assert_error, assert_success
def get_window_handle(session):
return session.transport.send(
"GET", "session/{session_id}/window".format(**vars(session)))
def test_no_browsing_context(session, closed_window):
response = get_window_handle(session)
assert_error(res... |
robalar/A2_Project | refs/heads/master | solver/core/simplify.py | 1 | from .numbers import Integer, Rational, Number
from .symbol import Symbol
from .operations import Pow, Mul, Add, base, exponent, term, const
from .subs import _map
from .evaluate import *
from .order import _isordered
from .matix import Matrix
from .symbol import Undefined
from fractions import gcd
#~~~~LE... |
evitareul/android_kernel_htc_evitareul.DONTUSE | refs/heads/cm-10.2 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
szimszon/filecatalog | refs/heads/master | gluon/tests/test_utils.py | 11 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Unit tests for utils.py """
import unittest
from fix_path import fix_sys_path
fix_sys_path(__file__)
from utils import md5_hash
from utils import compare
import hashlib
from hashlib import md5, sha1, sha224, sha256, sha384, sha512
from utils import simple_hash, get... |
13steinj/pep257 | refs/heads/master | test_decorators.py | 5 | """Unit test for pep257 module decorator handling.
Use tox or py.test to run the test suite.
"""
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import textwrap
import pep257
class TestParser:
"""Check parsing of Python source code."""
def test_parse_class_single_de... |
satyarth934/root | refs/heads/master | interpreter/llvm/src/utils/lit/lit/Test.py | 23 | import os
from xml.sax.saxutils import escape
from json import JSONEncoder
# Test result codes.
class ResultCode(object):
"""Test result codes."""
# We override __new__ and __getnewargs__ to ensure that pickling still
# provides unique ResultCode objects in any particular instance.
_instances = {}
... |
Bonanashelby/MoodBot | refs/heads/master | mood_bot/mood_bot/models/meta.py | 30 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.schema import MetaData
# Recommended naming convention used by Alembic, as various different database
# providers will autogenerate vastly different names making migrations more
# difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.ht... |
nkmk/python-snippets | refs/heads/master | notebook/heapq_nlargest_nsmallest.py | 1 | import heapq
l = [3, 6, 7, -1, 23, -10, 18]
print(heapq.nlargest(3, l))
# [23, 18, 7]
print(heapq.nsmallest(3, l))
# [-10, -1, 3]
print(l)
# [3, 6, 7, -1, 23, -10, 18]
|
terbolous/SickRage | refs/heads/master | lib/cfscrape/__init__.py | 8 | from time import sleep
import logging
import random
import re
from requests.sessions import Session
import js2py
from copy import deepcopy
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
DEFAULT_USER_AGENTS = [
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTM... |
ibinti/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/BuiltinNumeric.py | 17 | def test():
abs(False)
int(10)
long(False)
float(False)
complex(False)
divmod(False, False)
divmod<warning descr="Unexpected type(s):(str, unicode)Possible types:(float, float)(int, int)">('foo', u'bar')</warning>
pow(False, True)
round<warning descr="Unexpected type(s):(bool, str)Po... |
mkmelin/bedrock | refs/heads/master | bedrock/redirects/redirects.py | 3 | from .util import gone, redirect
redirectpatterns = (
# from org-urls-410.txt
gone('^catalog/end-user/release$'),
gone('^help-wanted\.html$'),
gone('^projects/ui/accessibility/access-radar\.html$'),
gone('^projects/ui/accessibility/header\.html$'),
gone('^projects/ui/accessibility/unix/to-do\.h... |
aforalee/RRally | refs/heads/master | rally/plugins/openstack/scenarios/ironic/utils.py | 7 | # Copyright 2015: 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... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/histogram2dcontour/legendgrouptitle/font/_color.py | 1 | import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="color",
parent_name="histogram2dcontour.legendgrouptitle.font",
**kwargs
):
super(ColorValidator, self).__init__(
plotly_n... |
zhaochao/fuel-web | refs/heads/master | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/engines/targetimages.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... |
tengqm/senlin | refs/heads/master | senlin/tests/test_wsgi.py | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... |
adam-rabinowitz/general_python | refs/heads/master | unittests/iohandle_test.py | 2 | import unittest
import iohandle
import os
import tempfile
import gzip
import multiprocessing
import filecmp
class InputOutputTestCase(unittest.TestCase):
def setUp(self):
''' Create required data for unittest '''
# Create directories and file names
self.dirName = tempfile.mkdtemp()
... |
jobiols/server-tools | refs/heads/8.0 | auditlog/models/http_session.py | 10 | # -*- coding: utf-8 -*-
# © 2015 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from openerp.http import request
class AuditlogtHTTPSession(models.Model):
_name = 'auditlog.http.session'
_description = u"Auditlog - HTTP U... |
jj0hns0n/geonode | refs/heads/master | geonode/base/migrations/24_to_26.py | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('base', '24_initial'),
]
operations = [
migrations.CreateModel(
name='Backup',
... |
openstack/compute-hyperv | refs/heads/master | compute_hyperv/nova/cluster/livemigrationops.py | 1 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... |
asimshankar/tensorflow | refs/heads/master | tensorflow/tools/common/test_module1.py | 60 | # 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... |
ddico/odoomrp-wip | refs/heads/8.0 | stock_picking_wave_management/models/stock_picking_wave.py | 24 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
class StockPickin... |
palli/python-virtinst | refs/heads/master | virtconv/parsers/vmx.py | 1 | #
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# 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 yo... |
tobiasgehring/qudi | refs/heads/master | hardware/motor/zaber_motor_rotation_stage.py | 1 | # -*- coding: utf-8 -*-
"""
This file contains the hardware control of the motorized stage for PI.
Qudi 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 la... |
Elettronik/SickRage | refs/heads/master | lib/pgi/codegen/ctypes_backend/__init__.py | 20 | # Copyright 2012-2014 Christoph Reiter
#
# 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 your option) any later version.
from .main import CTy... |
israelbenatar/boto | refs/heads/develop | tests/integration/logs/test_layer1.py | 114 | # Copyright (c) 2014 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 right... |
Timmenem/micropython | refs/heads/master | examples/SDdatalogger/boot.py | 38 | # boot.py -- runs on boot-up
# Let's you choose which script to run.
# > To run 'datalogger.py':
# * press reset and do nothing else
# > To run 'cardreader.py':
# * press reset
# * press user switch and hold until orange LED goes out
import pyb
pyb.LED(3).on() # indicate we are waiti... |
YathishReddy/Robust_ECN_Signalling_With_Nonces | refs/heads/master | src/traffic-control/test/examples-to-run.py | 6 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
piffey/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py | 9 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... |
jgravois/developer-support | refs/heads/gh-pages | arcsde-sql/python/create-st-geometry-sierpinski/sierpinski.py | 9 | """
Author: Ashley S (MarieAshley)
Versions: Oracle 12c, ArcGIS for Desktop 10.3.1
"""
import cx_Oracle
class IterationError(Exception):
pass
class TableError(Exception):
pass
class InvalidSpan(Exception):
pass
class sierpinski(object):
"""
Contains methods to create two spatial tables. The f... |
Gateworks/platform-external-chromium_org | refs/heads/imx_kk4.4.3_2.0.0-beta | tools/code_coverage/croc_scan_test.py | 178 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Unit tests for croc_scan.py."""
import re
import unittest
import croc_scan
class TestScanner(unittest.TestCase):
"""Tests f... |
azjps/bokeh | refs/heads/master | bokeh/server/protocol/receiver.py | 17 | ''' Assemble websocket wire message fragments into complete Bokeh Server
message objects that can be processed.
'''
from __future__ import absolute_import
import six
from tornado.concurrent import return_future
from ..exceptions import ValidationError
import logging
log = logging.getLogger(__name__)
class Receiver... |
tadachi/miniview | refs/heads/master | main.py | 1 | # Author: Takumi 'takada' Adachi
# Copyright 2014-2015
# miniview
# A python-for-android kivy image-viewing app ideal for reading scanlated manga images.
#
# Features
# - Cycle to the next directory images upon hitting the last image. Key feature for cycling through chapters separated in directories.
# - One handed vie... |
MissionCriticalCloud/cosmic | refs/heads/master | cosmic-core/systemvm/patches/centos7/opt/cosmic/router/bin/cs/CsDatabag.py | 1 | from databag.merge import DataBag
class CsDatabag(object):
def __init__(self, key, config=None):
self.data = {}
self.db = DataBag()
self.db.setKey(key)
self.db.load()
self.dbag = self.db.getDataBag()
if config:
self.fw = config.get_fw()
self.... |
geekboxzone/lollipop_external_chromium_org_tools_gyp | refs/heads/geekbox | test/defines/gyptest-defines.py | 239 | #!/usr/bin/env python
# Copyright (c) 2011 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 build of an executable with C++ defines.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('defines.gyp')
expect = "... |
georgemarshall/django | refs/heads/master | django/urls/resolvers.py | 1 | """
This module converts requested URLs to callback view functions.
URLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
import functools
import inspect
import re
import string
from i... |
mjeanson/jenkins-job-builder | refs/heads/master | jenkins_jobs/modules/parameters.py | 3 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... |
jzt5132/scikit-learn | refs/heads/master | examples/cluster/plot_kmeans_stability_low_dim_dense.py | 338 | """
============================================================
Empirical evaluation of the impact of k-means initialization
============================================================
Evaluate the ability of k-means initializations strategies to make
the algorithm convergence robust as measured by the relative stan... |
jcderr/loot | refs/heads/master | elections/models.py | 1 | from django.db import models
# Create your models here.
LOOT_TYPES = [
['W', 'Weapon'],
['A', 'Armor'],
['O', 'Other'],
]
class Player(models.Model):
name = models.CharField(max_length=45)
character = models.CharField(max_length=45)
email = models.EmailField()
def __unicode__(self):
... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/command_lib/deployment_manager/flags.py | 2 | # Copyright 2016 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 ag... |
yonglehou/robotframework | refs/heads/master | atest/testdata/standard_libraries/operating_system/files/prog.py | 38 | import sys
def output(rc=0, stdout='', stderr='', count=1):
if stdout:
sys.stdout.write((stdout+'\n') * int(count))
if stderr:
sys.stderr.write((stderr+'\n') * int(count))
return int(rc)
if __name__ == '__main__':
rc = output(*sys.argv[1:])
sys.exit(rc)
|
double12gzh/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_flavors.py | 26 | # 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/licenses/LICENSE-2.0
#
# Unless requ... |
cwolferh/heat-scratch | refs/heads/master | heat/tests/test_urlfetch.py | 2 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
DerRomtester/android_kernel_oneplus_msm8974 | refs/heads/cm-14.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
openstack/tempest | refs/heads/master | tempest/lib/services/identity/v3/credentials_client.py | 1 | # Copyright 2013 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 requ... |
olasitarska/django | refs/heads/master | tests/migrations2/models.py | 560 | # Required for migration detection (#22645)
|
pskamburov/world-cup | refs/heads/master | worldcup/website/migrations/0006_auto_20140620_0126.py | 1 | # encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('website', '0005_points'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... |
lvtk/lvtk | refs/heads/master | waflib/extras/build_logs.py | 57 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2013 (ita)
"""
A system for recording all outputs to a log file. Just add the following to your wscript file::
def init(ctx):
ctx.load('build_logs')
"""
import atexit, sys, time, os, shutil, threading
from waflib import ansiterm, Logs, Context
# adding th... |
floodlight/loxigen-artifacts | refs/heads/master | pyloxi/loxi/of14/action.py | 2 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... |
quantmind/lux | refs/heads/master | tests/auth/test_sqlite.py | 1 | import tests.auth.test_postgresql as test
class TestSqlite(test.TestPostgreSql):
config_params = {'DATASTORE': 'sqlite://'}
|
synaptek/MathFluency | refs/heads/master | src/generators/gen_s2w4.py | 2 | import core
import random
import level_output
#Shortcut abbreviations
RI = random.randint
RC = random.choice
#generator specific configuration settings
class configN2(core.config):
def __init__(self, eng, header, dir, name):
core.config.__init__(self, eng, header, dir, name)
... |
kbrebanov/ansible | refs/heads/devel | lib/ansible/modules/windows/win_wakeonlan.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Dag Wieers <dag@wieers.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, ... |
zhouyao1994/incubator-superset | refs/heads/master | superset/exceptions.py | 1 | # 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... |
foursquare/pants-changed | refs/heads/master | foursquare/pants/__init__.py | 321 | __import__("pkg_resources").declare_namespace(__name__)
|
mrquim/repository.mrquim | refs/heads/master | script.module.exodus/lib/resources/lib/modules/cache.py | 5 | # -*- coding: utf-8 -*-
"""
Exodus Add-on
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... |
T-R0D/JustForFun | refs/heads/master | adventofcode/Day18/like_a_gif_for_your_yard.py | 1 | import numpy
DIM = 100
def main():
light_grid = numpy.zeros((DIM, DIM))
with open('input.txt') as input_file:
i = 0
for line in input_file:
j = 0
for c in line.strip():
light_grid[i][j] = 1 if c == '#' else 0
j += 1
i += 1
... |
swarna-k/MyDiary | refs/heads/master | flask/lib/python2.7/site-packages/flask/debughelpers.py | 777 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionEr... |
ssaeger/scikit-learn | refs/heads/master | benchmarks/bench_isotonic.py | 38 | """
Benchmarks of isotonic regression performance.
We generate a synthetic dataset of size 10^n, for n in [min, max], and
examine the time taken to run isotonic regression over the dataset.
The timings are then output to stdout, or visualized on a log-log scale
with matplotlib.
This allows the scaling of the algorit... |
feroda/django | refs/heads/master | tests/gis_tests/geos_tests/test_io.py | 282 | from __future__ import unicode_literals
import binascii
import unittest
from unittest import skipUnless
from django.contrib.gis.geos import (
HAS_GEOS, GEOSGeometry, WKBReader, WKBWriter, WKTReader, WKTWriter,
)
from django.utils.six import memoryview
@skipUnless(HAS_GEOS, "Geos is required.")
class GEOSIOTest(... |
s-rusev/github-matchmaker | refs/heads/master | query-services/language/api/language.py | 2 |
class Language:
query = ""
def generateIssueQuery(self, seed=""):
if seed != "":
query = "language:%s" % seed
else:
query = ""
return dict(query=query), 200
class_instance = Language()
|
Vassy/odoo | refs/heads/master | addons/purchase/stock.py | 33 | # -*- 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... |
google/llvm-propeller | refs/heads/bb-clusters | debuginfo-tests/dexter/dex/command/commands/DexExpectWatchBase.py | 5 | # DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""DexExpectWatch base class, holds logic... |
pasqualguerrero/django | refs/heads/master | django/conf/project_template/project_name/wsgi.py | 680 | """
WSGI config for {{ project_name }} 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/{{ docs_version }}/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.enviro... |
samthor/intellij-community | refs/heads/master | python/testData/joinLines/StatementColon-after.py | 79 | if True: return "No special handling"
|
chyeh727/django | refs/heads/master | django/core/checks/compatibility/django_1_8_0.py | 286 | from __future__ import unicode_literals
from django.conf import global_settings, settings
from .. import Tags, Warning, register
@register(Tags.compatibility)
def check_duplicate_template_settings(app_configs, **kwargs):
if settings.TEMPLATES:
values = [
'TEMPLATE_DIRS',
'ALLOWED... |
hbarghi/VirtualBattery1 | refs/heads/master | src/wifi/bindings/modulegen__gcc_LP64.py | 14 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
shreyasp/erpnext | refs/heads/develop | erpnext/manufacturing/doctype/production_order/test_production_order.py | 8 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt, time_diff_in_hours, now, add_days, cint
from erpnext.stock.doctype.purchase_receipt.test_pu... |
davidbarkhuizen/py_gps_tools | refs/heads/master | django_web_server/server/ctrl/gpxinfo.py | 1 | import sys
from fx.httpfx import success, failure, mandatory_parameters, init_routing
from server.models import Gpx
def get(request, params):
if (request.user is None):
infos = [gpx.to_gpx_info() for gpx in Gpx.objects.filter(user=None).order_by('time')]
else:
infos = [gpx.to_gpx_info() for gpx in Gpx.objects.f... |
skumar07/Air-Share-Real | refs/heads/master | boilerplate/external/wtforms/ext/i18n/utils.py | 119 | import os
def messages_path():
"""
Determine the path to the 'messages' directory as best possible.
"""
module_path = os.path.abspath(__file__)
return os.path.join(os.path.dirname(module_path), 'messages')
def get_builtin_gnu_translations(languages=None):
"""
Get a gettext.GNUTranslations... |
arnavd96/Cinemiezer | refs/heads/master | myvenv/lib/python3.4/site-packages/django/views/decorators/debug.py | 712 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... |
okwow123/djangol2 | refs/heads/master | example/env/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/features.py | 28 | from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures
from django.db.backends.sqlite3.features import \
DatabaseFeatures as SQLiteDatabaseFeatures
from django.utils.functional import cached_property
class DatabaseFeatures(BaseSpatialFeatures, SQLiteDatabaseFeatures):
supports_3d_storage... |
Minizinger/discordKuubioBot | refs/heads/master | bot/horsebase.py | 1 | #horsebase = database for storing horses
import sqlite3
import operator
import os
import datetime
import logging
HORSES_TABLE = """CREATE TABLE IF NOT EXISTS horses (
id integer PRIMARY KEY,
server text NOT NULL,
user text NOT NULL,
timest... |
Aeternam/emailpie | refs/heads/master | tests.py | 4 | from gevent import monkey
monkey.patch_all()
import unittest
from emailpie import utils
from emailpie.spelling import correct
from emailpie.throttle import should_be_throttled, reset_throttle
class TestParse(unittest.TestCase):
def test_good_email(self):
validator = utils.EmailChecker('bryan@bryanhelmig.... |
kidaa/entropy | refs/heads/master | rigo/rigo/ui/gtk3/controllers/noticeboard.py | 5 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Fabio Erculiani
Authors:
Fabio Erculiani
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; version 3.
This program is distributed in the hope that it ... |
cbowman0/graphite-web | refs/heads/master | webapp/graphite/functions/params.py | 4 | import six
from graphite.errors import InputParameterError
from graphite.render.attime import parseTimeOffset
from graphite.logger import log
from graphite.functions.aggfuncs import aggFuncs, aggFuncAliases
from graphite.render.datalib import TimeSeries
class ParamTypes(object):
pass
class ParamType(object):
... |
ekristen/compose | refs/heads/master | compose/project.py | 6 | from __future__ import unicode_literals
from __future__ import absolute_import
import logging
from functools import reduce
from docker.errors import APIError
from .config import get_service_name_from_net, ConfigurationError
from .const import LABEL_PROJECT, LABEL_SERVICE, LABEL_ONE_OFF, DEFAULT_TIMEOUT
from .service ... |
iamkingmaker/zipline | refs/heads/master | zipline/api.py | 33 | #
# Copyright 2014 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... |
EDUlib/edx-platform | refs/heads/master | import_shims/lms/instructor/tests/test_certificates.py | 2 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('instructor.tests.test_certificates', 'lms.djangoap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.