repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
lisael/pg-django | refs/heads/master | django/contrib/messages/storage/session.py | 456 | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... |
jhoenicke/python-trezor | refs/heads/master | trezorlib/transport/webusb.py | 1 | # This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... |
alorence/django-modern-rpc | refs/heads/master | modernrpc/tests/test_jsonrpc_errors.py | 1 | # coding: utf-8
import json
import random
import pytest
import requests
from django.core.serializers.json import DjangoJSONEncoder
from jsonrpcclient.exceptions import ReceivedErrorResponse
from modernrpc.exceptions import RPC_INVALID_REQUEST, RPC_METHOD_NOT_FOUND, RPC_PARSE_ERROR, RPC_INVALID_PARAMS, \
RPC_CUSTO... |
mcrowson/django | refs/heads/master | tests/test_discovery_sample/doctests.py | 471 | """
Doctest example from the official Python documentation.
https://docs.python.org/3/library/doctest.html
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30) # doctest: +ELLIPSIS
2652528598121910... |
hectord/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/admin_views/customadmin.py | 52 | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from django.conf.urls.defaults import patterns
from django.contrib import admin
from django.http import HttpResponse
import models, forms
class Admin2(admin.AdminSite):
login_form = forms.CustomAdminAuthenticationForm
login_template = 'cust... |
zooniverse/aggregation | refs/heads/master | experimental/algorithms/old_weather/alignment.py | 2 | import cv2
import numpy as np
import os
from scipy import spatial
import math
def deter(a,b,c,d):
return a*d - c*b
if os.path.exists("/home/ggdhines"):
base_directory = "/home/ggdhines"
else:
base_directory = "/home/greg"
minVal = 25
maxVal = 100
img = cv2.imread(base_directory + "/Dropbox/066e48f5-812... |
Avira/pootle | refs/heads/master | pootle/apps/reports/views.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import calendar
from ... |
tedder/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/package_facts.py | 21 | #!/usr/bin/python
# (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# most of it copied from AWX's scan_packages module
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': ... |
odubno/microblog | refs/heads/master | venv/lib/python2.7/site-packages/coverage/html.py | 159 | """HTML reporting for Coverage."""
import os, re, shutil, sys
import coverage
from coverage.backward import pickle
from coverage.misc import CoverageException, Hasher
from coverage.phystokens import source_token_lines, source_encoding
from coverage.report import Reporter
from coverage.results import Numbers
from cove... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/static/worldbuilding/battle_droid_static.py | 85615 | import sys
def setup(core, object):
return |
jamesblunt/scrapy | refs/heads/master | scrapy/utils/display.py | 187 | """
pprint and pformat wrappers with colorization support
"""
from __future__ import print_function
import sys
from pprint import pformat as pformat_
def _colorize(text, colorize=True):
if not colorize or not sys.stdout.isatty():
return text
try:
from pygments import highlight
from pyg... |
blissland/blissflixx | refs/heads/master | lib/chanutils/torrent/__init__.py | 1 | import re, base64, subprocess, chanutils, playitem, urlparse
from torrentparse import TorrentParser
hash_re = re.compile("xt=urn:btih:([A-Za-z0-9]+)")
base32_re = re.compile("[A-Z2-7]{32}")
valid_re = re.compile("[A-F0-9]{40}")
#torr_sites = ("torcache.net", "torrage.com", "zoink.it")
torr_sites = ("torcache.net", "z... |
rafalkolasinski/py-filters | refs/heads/master | src/Colours.py | 1 | class Palette:
PRIMARY = "#212121"
SECONDARY = "#EAEAEA"
GRAY = "#777777"
ACCENTPRIMARY = "#00C3A9"
ACCENTSECONDARY = "008798"
|
FRidh/scipy | refs/heads/master | scipy/io/tests/test_netcdf.py | 57 | ''' Tests for netcdf '''
from __future__ import division, print_function, absolute_import
import os
from os.path import join as pjoin, dirname
import shutil
import tempfile
import warnings
from io import BytesIO
from glob import glob
from contextlib import contextmanager
import numpy as np
from numpy.testing import a... |
alimony/django | refs/heads/master | django/conf/locale/zh_Hans/formats.py | 130 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5日
TIME_FORMAT = 'H:i' # 20:45
DATETIME_FORMAT =... |
RossBrunton/django | refs/heads/master | tests/modeladmin/models.py | 147 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... |
rogerwang/chromium | refs/heads/node | third_party/closure_linter/closure_linter/common/erroraccumulator.py | 264 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... |
n0fate/volafox | refs/heads/master | volafox/plugins/ps.py | 1 | # -*- coding: utf-8 -*-
import sys
import struct
import time
import os
from tableprint import columnprint
from volafox.vatopa.addrspace import FileAddressSpace
from volafox.vatopa.ia32_pml4 import IA32PML4MemoryPae
# Lion 32bit, SN 32bit, Lion64bit, SN 64bit, Mountain Lion 64bit, Mavericks, El Capitan
DATA_PROC_STRU... |
qmarlats/pyquizz | refs/heads/master | env-3/lib/python3.5/site-packages/sphinx/ext/coverage.py | 3 | # -*- coding: utf-8 -*-
"""
sphinx.ext.coverage
~~~~~~~~~~~~~~~~~~~
Check Python modules and C API for coverage. Mostly written by Josip
Dzolonga for the Google Highly Open Participation contest.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for d... |
Distrotech/bzr | refs/heads/distrotech-bzr | bzrlib/tests/test__chk_map.py | 2 | # Copyright (C) 2009, 2010, 2011 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is dis... |
richard-willowit/odoo | refs/heads/master | addons/website_event/controllers/__init__.py | 738 | # -*- coding: utf-8 -*-
from . import main
|
petewarden/tensorflow | refs/heads/master | tensorflow/python/keras/layers/preprocessing/benchmarks/bucketized_column_dense_benchmark.py | 6 | # Copyright 2020 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... |
legalsylvain/OpenUpgrade | refs/heads/master | addons/mail/tests/common.py | 40 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
tokyo-jesus/oosmos | refs/heads/master | Examples/Sync/Linux/bld.py | 1 | #!/usr/bin/env python
oosmos_dir = '../../..'
import sys
sys.path.append(oosmos_dir)
import oosmos
tests_dir = oosmos_dir+'/Classes/Tests'
classes_dir = oosmos_dir+'/Classes'
prt_c = classes_dir+'/prt.c'
oosmos_c = oosmos_dir+'/Source/oosmos.c'
synctest_c = oosmos_dir+'/Classes/Tests/synctest.c'
oosmos.c... |
memsharded/conan | refs/heads/develop | conans/test/unittests/util/local_db_test.py | 1 | import os
import unittest
from conans.client.store.localdb import LocalDB
from conans.test.utils.test_files import temp_folder
class LocalStoreTest(unittest.TestCase):
def localdb_test(self):
tmp_dir = temp_folder()
db_file = os.path.join(tmp_dir, "dbfile")
localdb = LocalDB.create(db_fi... |
wa1tnr/ainsuSPI | refs/heads/master | 0-Distribution.d/circuitpython-master/tests/io/bytesio_cow.py | 40 | # Make sure that write operations on io.BytesIO don't
# change original object it was constructed from.
try:
import uio as io
except ImportError:
import io
b = b"foobar"
a = io.BytesIO(b)
a.write(b"1")
print(b)
print(a.getvalue())
b = bytearray(b"foobar")
a = io.BytesIO(b)
a.write(b"1")
print(b)
print(a.get... |
rslayer/bhulan | refs/heads/master | constants.py | 1 | LAT_KEY = "lat"
LON_KEY = "lon"
PATENT_KEY = "patent"
TIMESTAMP_KEY = "timestamp"
TEMPERATURE_KEY = "temperature"
DRIVER_KEY = "driver"
COMMUNE_KEY = "commune"
CAPACITY_KEY = "capacity"
M_LAT_KEY = "mLat"
M_LON_KEY = "mLon"
VELOCITY_KEY = "velocity"
TRUCK_ID_KEY = "truckId"
TIME_KEY = "time"
TIME_START_KEY = "timeStart... |
hakiri/core | refs/heads/master | daemon/core/misc/xmlsession.py | 7 | #
# CORE
# Copyright (c)2011-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
Helpers for loading and saving XML files. savesessionxml(session, filename) is
the main public interface here.
'''
import os.path
from core.netn... |
GabMus/techpillswebsite | refs/heads/master | techpills/blog/admin.py | 1 | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Article)
|
ctippur/swaggeralliance | refs/heads/master | src/python/flask/swagger_server/lib/__init__.py | 1 | __all__ = ["aws"]
|
levilucio/SyVOLT | refs/heads/master | GM2AUTOSAR_MM/graph_MT_pre__MetaModelElement_S.py | 1 | """
__graph_MT_pre__MetaModelElement_S.py___________________________________________________________
Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION
________________________________________________________________________________________
"""
import tkFont
from graphEntity import *
f... |
t3dev/odoo | refs/heads/master | addons/crm/models/res_config_settings.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
crm_alias_prefix = fields.Char('Default Alias Name for Leads')
generate_lead_from_alias... |
trishnaguha/ansible | refs/heads/devel | lib/ansible/modules/net_tools/nios/nios_nsgroup.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... |
dimtruck/magnum | refs/heads/master | magnum/api/controllers/v1/certificate.py | 1 | # Copyright 2015 NEC 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
#
# Unless required ... |
valkyriesavage/invenio | refs/heads/263-date_added_math | modules/bibformat/lib/bibformat_dblayer.py | 3 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
## ... |
lsinfo/odoo | refs/heads/8.0 | addons/stock/tests/test_stock_flow.py | 219 | # -*- coding: utf-8 -*-
from openerp.addons.stock.tests.common import TestStockCommon
from openerp.tools import mute_logger, float_round
class TestStockFlow(TestStockCommon):
@mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models')
def test_00_picking_create_and_transfer_quantity(self):
"""... |
DirtyUnicorns/android_kernel_lge_msm8974 | refs/heads/n7x-caf | scripts/gcc-wrapper.py | 181 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... |
QGuLL/samba | refs/heads/master | third_party/waf/wafadmin/Configure.py | 32 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008 (ita)
"""
Configuration system
A configuration instance is created when "waf configure" is called, it is used to:
* create data dictionaries (Environment instances)
* store the list of modules to import
The old model (copied from Scons) was to store lo... |
junalmeida/Sick-Beard | refs/heads/master | lib/subliminal/converters/addic7ed.py | 32 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from babelfish import LanguageReverseConverter, language_converters
class Addic7edConverter(LanguageReverseConverter):
def __init__(self):
self.name_converter = language_converters['name']
self.from_addic7ed = {'Català': ('cat',), 'Ch... |
noironetworks/nova | refs/heads/master | nova/api/openstack/versioned_method.py | 97 | # Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
kobotoolbox/dkobo | refs/heads/master | fabfile.py | 1 | import os
import sys
import json
import re
import requests
from fabric.api import local, hosts, cd, env, prefix, run, sudo, settings, hide
def kobo_workon(venv_name):
return prefix('kobo_workon %s' % venv_name)
DEPLOYMENTS = {}
IMPORTED_DEPLOYMENTS = {}
deployments_file = os.environ.get('DEPLOYMENTS_JSON', 'depl... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/sigfox/test_sensor.py | 14 | """Tests for the sigfox sensor."""
import re
import requests_mock
from homeassistant.components.sigfox.sensor import (
API_URL,
CONF_API_LOGIN,
CONF_API_PASSWORD,
)
from homeassistant.setup import async_setup_component
TEST_API_LOGIN = "foo"
TEST_API_PASSWORD = "ebcd1234"
VALID_CONFIG = {
"sensor": ... |
devcline/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-framework-headers.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.
"""
Verifies that mac_framework_headers works properly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# TODO(thakis): Make... |
thomasdouenne/openfisca-france-indirect-taxation | refs/heads/master | openfisca_france_indirect_taxation/tests/test_depenses_caburants_ht.py | 4 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 10 18:40:27 2016
@author: thomas.douenne
"""
from __future__ import division
from openfisca_france_indirect_taxation.examples.utils_example import simulate
simulated_variables = [
'pondmen',
'decuc',
'depenses_diesel_ht',
'depenses_diesel_htva',
'di... |
Komzpa/GroundHog | refs/heads/master | groundhog/utils/utils.py | 16 | """
Utility functions
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("Razvan Pascanu "
"KyungHyun Cho "
"Caglar Gulcehre ")
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import numpy
import random
import string
import copy as pycopy
import thea... |
zidootech/zidoo-kodi-14.2 | refs/heads/master | lib/gtest/test/gtest_xml_outfiles_test.py | 2526 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
yiliaofan/faker | refs/heads/master | faker/providers/profile/__init__.py | 12 | # coding=utf-8
from .. import BaseProvider
import itertools
class Provider(BaseProvider):
"""
This provider is a collection of functions to generate personal profiles and identities.
"""
def simple_profile(self):
"""
Generates a basic profile with personal informations
"""
... |
TigorC/zulip | refs/heads/master | zerver/management/commands/process_queue.py | 32 | from __future__ import absolute_import
from types import FrameType
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from django.core.management import CommandError
from django.conf import settings
from django.utils import autoreload
from zerver.worker.queu... |
kernevil/samba | refs/heads/master | third_party/pep8/testsuite/E71.py | 40 | #: E711
if res == None:
pass
#: E711
if res != None:
pass
#: E711
if None == res:
pass
#: E711
if None != res:
pass
#
#: E712
if res == True:
pass
#: E712
if res != False:
pass
#: E712
if True != res:
pass
#: E712
if False == res:
pass
#
#: E713
if not X in Y:
pass
#: E713
if not X... |
40023256/2015cd_midterm- | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/logging/config.py | 739 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
tealover/nova | refs/heads/master | nova/volume/__init__.py | 64 | # 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 except in compliance with the License. You may obtain
# a ... |
w1r0x/ansible | refs/heads/devel | contrib/inventory/openvz.py | 86 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# openvz.py
#
# Copyright 2014 jordonr <jordon@beamsyn.net>
#
# 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 ... |
antonve/s4-project-mooc | refs/heads/master | common/djangoapps/util/tests/test_json_request.py | 191 | """
Test for JsonResponse and JsonResponseBadRequest util classes.
"""
from django.http import HttpResponse, HttpResponseBadRequest
from util.json_request import JsonResponse, JsonResponseBadRequest
import json
import unittest
import mock
class JsonResponseTestCase(unittest.TestCase):
"""
A set of tests to m... |
Neamar/django | refs/heads/master | django/core/management/templates.py | 274 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
from os import path
import django
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import handle_extensions
from django.template import C... |
gurneyalex/sale-workflow | refs/heads/8.0 | __unported__/sale_delivery_term/__init__.py | 74 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... |
pombredanne/abby | refs/heads/master | src/oscar/models.py | 1 | '''
Models definitions
'''
from __future__ import with_statement
import os
#import sys
import datetime
from google.appengine.ext import db
#import logging
class Post(db.Model):
"""
Abstract class over post provided in the `posts` directory
@todo: handle tzinfo http://tinyurl.com/dleqec
@todo: releted_... |
bluven/eonboard | refs/heads/master | eoncloud_web/biz/floating/admin.py | 4 | #coding=utf-8
from django.contrib import admin
from biz.floating.models import Floating
class FloatingAdmin(admin.ModelAdmin):
list_display = ("id", "ip", "status", "instance","user")
admin.site.register(Floating, FloatingAdmin)
|
googleapis/google-auth-library-python | refs/heads/master | google/auth/external_account.py | 1 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/esphome/switch.py | 7 | """Support for ESPHome switches."""
import logging
from typing import Optional
from aioesphomeapi import SwitchInfo, SwitchState
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from . import Espho... |
vbannai/disk-qos-horizon | refs/heads/master | horizon/tests/api_tests/quantum_tests.py | 3 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# 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
#... |
matthew-brett/draft-statsmodels | refs/heads/master | scikits/statsmodels/rlm.py | 1 | """
Robust linear models with support for the M-estimators listed under
:ref:`norms <norms>`.
References
----------
PJ Huber. 'Robust Statistics' John Wiley and Sons, Inc., New York. 1981.
PJ Huber. 1973, 'The 1972 Wald Memorial Lectures: Robust Regression:
Asymptotics, Conjectures, and Monte Carlo.' The An... |
belgrades/sabermetrics | refs/heads/master | docs/source/conf.py | 1 | # -*- coding: utf-8 -*-
#
# Sabermetrics documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 8 17:52:28 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.
... |
debguy0x/PyBitmessage | refs/heads/master | src/pyelliptic/cipher.py | 24 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>
# See LICENSE for details.
from pyelliptic.openssl import OpenSSL
class Cipher:
"""
Symmetric encryption
import pyelliptic
iv = pyelliptic.Cipher.gen_IV('aes-256-cfb')
ctx = pyell... |
Carles-Figuerola/marathon-python | refs/heads/master | itests/steps/marathon_steps.py | 3 | import sys
import time
import marathon
from behave import given, when, then
import mock
from itest_utils import get_marathon_connection_string
sys.path.append('../')
@given('a working marathon instance')
def working_marathon(context):
"""Adds a working marathon client as context.client for the purposes of
i... |
GunoH/intellij-community | refs/heads/master | python/testData/postfix/isNone/nonApplicable_after.py | 39 | a = 1.ifn <caret> |
autonoom/opencv-autonoom | refs/heads/master | opencv-autonoom/testROI.py | 1 | import cv2
import numpy as np
img = cv2.imread('watch.jpg', cv2.IMREAD_GRAYSCALE)
height, width = img.shape
########################################
#(0.0) (300.300)#
# #
# #
# ... |
reamdc1/gbeer_standalone | refs/heads/master | gbeer_standalone.py | 2 | #!/usr/bin/python
import time
import os
import sys
import argparse
import shutil
from ast import parse
from config import Config
import Configuration_Variables as conf_var
from turtle import config_dict
# Copyright(C) 2015 David Ream
# Released under GPL version 3 licence. http://www.gnu.org/licenses/lgpl.html
# Do n... |
csitarichie/boost_msm_bare_metal | refs/heads/master | boost/libs/python/example/test_std_pair.py | 53 | # Copyright Ralf W. Grosse-Kunstleve 2006. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import std_pair_ext
assert std_pair_ext.foo() == (3, 5)
print "OK"
|
chromium2014/src | refs/heads/master | native_client_sdk/src/build_tools/verify_ppapi.py | 62 | #!/usr/bin/env python
# Copyright (c) 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.
"""Helper script for PPAPI's PRESUBMIT.py to detect if additions or removals of
PPAPI interfaces have been propagated to the Native... |
DirtyUnicorns/android_external_chromium_org | refs/heads/lollipop | tools/telemetry/telemetry/results/base_test_results_unittest.py | 48 | # 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 sys
import unittest
from telemetry.core import exceptions
class TestOutputStream(object):
def __init__(self):
self.output_data = []
def wr... |
miracle2k/stgit | refs/heads/master | stgit/commands/prev.py | 6 | __copyright__ = """
Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
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 will be ... |
annakoop/jkphoto | refs/heads/master | inventory/settings.py | 2 | """
Django settings for inventory project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... |
QuantCrimAtLeeds/PredictCode | refs/heads/master | open_cp/gui/hierarchical.py | 1 | """
hierarchical
~~~~~~~~~~~~
An abstract way to view "hierarchical" data.
We imagine that we have a spreadsheet of data (or in Python, perhaps a list
of tuples). We have columns `0`,...,`n-1` with column `n` storing some data.
Each column is associated with finitely many "keys".
E.g.
A 1 a Bob
A ... |
infoxchange/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/tests/test_spatialrefsys.py | 64 | import unittest
from django.db import connection
from django.contrib.gis.tests.utils import mysql, no_mysql, oracle, postgis, spatialite
test_srs = ({'srid' : 4326,
'auth_name' : ('EPSG', True),
'auth_srid' : 4326,
'srtext' : 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6... |
gpitel/pyjs | refs/heads/master | pyjs/lib/htmlentitydefs.py | 8 | """HTML character entity references."""
# maps the HTML entity name to the Unicode codepoint
name2codepoint = {
'AElig': 0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
'Aacute': 0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
'Acirc': 0x00c2, # latin capit... |
sekikn/incubator-airflow | refs/heads/master | airflow/contrib/utils/log/__init__.py | 10 | # 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... |
moraes/tipfy | refs/heads/master | examples/auth/bootstrap.py | 16 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
Payshares/medida | refs/heads/master | test/gtest-1.6.0/test/gtest_shuffle_test.py | 3023 | #!/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 of... |
yujikato/DIRAC | refs/heads/integration | src/DIRAC/Core/DISET/private/ServiceConfiguration.py | 2 | """
It keeps the service configuration parameters like maximum running threads, number of processes, etc. ,
which can be configured in CS.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
from DIRAC.Core.Utilities import Network, List
... |
kdaniels/cobbler | refs/heads/master | cobbler/clogger.py | 16 | """
Python standard logging doesn't super-intelligent and won't expose filehandles,
which we want. So we're not using it.
Copyright 2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public ... |
bytedance/fedlearner | refs/heads/master | test/data_join/test_data_portal_job_manager.py | 1 | # Copyright 2021 The FedLearner 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... |
srajag/nova | refs/heads/master | nova/tests/virt/hyperv/db_fakes.py | 17 | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 ... |
mypetyak/StrokeWidthTransform | refs/heads/master | swt.py | 1 | # -*- encoding: utf-8 -*-
from __future__ import division
from collections import defaultdict
import hashlib
import math
import os
import time
from urllib2 import urlopen
import numpy as np
import cv2
import scipy.sparse, scipy.spatial
t0 = time.clock()
diagnostics = True
class SWTScrubber(object):
@classmetho... |
duyanning/epm | refs/heads/master | epmaux.py | 1 | # -*- coding: utf-8 -*-
import glob
import os
import os.path
from Project import *
from Solution import *
import settings
def findSlnFile():
slnFilesList = glob.glob("*.epmsln")
if slnFilesList:
return os.path.abspath(slnFilesList[0])
else:
return None
def findPrjFile():
topArrived = F... |
peterkuma/fileshackproject | refs/heads/master | fileshackproject/urls.py | 1 | from django.urls import path
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
import django.views.static
import fileshack.urls
admin.autodiscover()
handler404 = 'fileshack.views.page_not_found'
handler500 = 'fileshack.views.server_error'
urlpatterns = []
if... |
Pexego/odoo | refs/heads/master | addons/website_gengo/__init__.py | 76 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
angelapper/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/saml.py | 2 | """
Slightly customized python-social-auth backend for SAML 2.0 support
"""
import logging
from copy import deepcopy
import requests
from django.contrib.sites.models import Site
from django.http import Http404
from django.utils.functional import cached_property
from django_countries import countries
from social_core.b... |
youdonghai/intellij-community | refs/heads/master | python/testData/inspections/AddCallSuperKeywordOnlyParamInInit.py | 79 | class A:
def __init__(self, a):
pass
class B(A):
def <warning descr="Call to __init__ of super class is missed">__i<caret>nit__</warning>(self, b, c=1, *args, kw_only):
pass |
trtt/apitrace | refs/heads/guiwip2 | specs/scripts/xml2api.py | 7 | #!/usr/bin/env python
##########################################################################
#
# Copyright 2014 VMware, Inc
# 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... |
dajohnso/cfme_tests | refs/heads/master | cfme/tests/cloud/test_providers.py | 2 | # -*- coding: utf-8 -*-
# pylint: disable=E1101
# pylint: disable=W0621
import uuid
import fauxfactory
import pytest
from utils import error
from cfme.base.credential import Credential
from cfme.cloud.provider import discover, wait_for_a_provider, CloudProvider
from cfme.cloud.provider.azure import AzureProvider
from... |
Soya93/Extract-Refactoring | refs/heads/master | python/testData/intentions/convertLambdaToFunction.py | 83 | newlist = lambda x<caret>, y: (x+y)/y
x = 1 |
pducks32/intergrala | refs/heads/master | python/sympy/sympy/plotting/pygletplot/plot_mode_base.py | 15 | from __future__ import print_function, division
from pyglet.gl import *
from plot_mode import PlotMode
from threading import Thread, Event, RLock
from color_scheme import ColorScheme
from sympy.core import S
from sympy.core.compatibility import is_sequence
from time import sleep
import warnings
class PlotModeBase(Pl... |
mbedmicro/pyOCD | refs/heads/master | pyocd/core/session.py | 1 | # pyOCD debugger
# Copyright (c) 2018-2020 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
qPCR4vir/orange | refs/heads/master | docs/reference/rst/code/testing-example.py | 6 | import Orange
iris = Orange.data.Table("iris")
learners = [Orange.classification.bayes.NaiveLearner(),
Orange.classification.majority.MajorityLearner()]
cv = Orange.evaluation.testing.cross_validation(learners, iris, folds=5)
print ["%.4f" % score for score in Orange.evaluation.scoring.CA(cv)]
|
GovCERT-CZ/dionaea | refs/heads/master | modules/python/scripts/hpfeeds.py | 1 | #*************************************************************************
#* Dionaea
#* - catches bugs -
#*
#*
#*
#* Copyright (C) 2010 Mark Schloesser
#*
#* This program is free software; you can redistribute it and/or
#* modify it under the terms of the GNU Ge... |
dave-shawley/setupext-janitor | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import setuptools
import setupext_janitor.janitor
setuptools.setup(
name='setupext-janitor',
version=setupext_janitor.version,
author='Dave Shawley',
author_email='daveshawley@gmail.com',
url='http://github.com/dave-shawley/setupext-janitor',
description='Making setup.py ... |
NicoSantangelo/sublime-text-trello | refs/heads/master | lib/requests/packages/urllib3/request.py | 60 | # urllib3/request.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencod... |
Brainiq7/Ananse | refs/heads/master | ananse_dl/extractor/myvideo.py | 1 | from __future__ import unicode_literals
import binascii
import base64
import hashlib
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_ord,
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
)
class MyVideoIE(InfoExtractor):
_V... |
CAPTools/CAPCollector | refs/heads/master | core/migrations/0004_geocodepreviewpolygon.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0003_alert_updated'),
]
operations = [
migrations.CreateModel(
name='GeocodePreviewPolygon',
... |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/ar.py | 87 | from django.contrib.localflavor.ar.forms import (ARProvinceSelect,
ARPostalCodeField, ARDNIField, ARCUITField)
from utils import LocalFlavorTestCase
class ARLocalFlavorTests(LocalFlavorTestCase):
def test_ARProvinceSelect(self):
f = ARProvinceSelect()
out = u'''<select name="provincias">
<opt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.