repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
hubert667/AIR | build/celery/build/lib.linux-i686-2.7/celery/worker/consumer.py | 2 | 26417 | # -*- coding: utf-8 -*-
"""
celery.worker.consumer
~~~~~~~~~~~~~~~~~~~~~~
This module contains the components responsible for consuming messages
from the broker, processing the messages and keeping the broker connections
up and running.
"""
from __future__ import absolute_import
import errno
import kombu
import logg... | gpl-3.0 |
omar-AM/python-pgp | pgp/test_keys.py | 2 | 23039 | # python-pgp A Python OpenPGP implementation
# Copyright (C) 2014 Richard Mitchell
#
# 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 la... | gpl-3.0 |
Jannes123/django-oscar | src/oscar/apps/checkout/utils.py | 37 | 7910 | class CheckoutSessionData(object):
"""
Responsible for marshalling all the checkout session data
Multi-stage checkouts often require several forms to be submitted and their
data persisted until the final order is placed. This class helps store and
organise checkout form data until it is required to... | bsd-3-clause |
iut-ibk/DynaMind-UrbanSim | 3rdparty/opus/src/urbansim/datasets/plan_type_group_dataset.py | 2 | 1696 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.datasets.dataset import Dataset
from urbansim.datasets.resource_creator_plantypegroups import ResourceCreatorPlanTypeGroups
from opus_core.misc import DebugPrinter
class PlanTyp... | gpl-2.0 |
gsnedders/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/lib/python/autobahn/case/case9_5_3.py | 14 | 1112 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | bsd-3-clause |
tungvx/deploy | .google_appengine/lib/webapp2/tests/extras_protorpc_test.py | 3 | 6332 | # -*- coding: utf-8 -*-
import webapp2
import test_base
from protorpc import messages
from protorpc import remote
from protorpc.webapp import service_handlers
from webapp2_extras import protorpc
# Hello service ---------------------------------------------------------------
class HelloRequest(messages.Message):
... | apache-2.0 |
miptliot/edx-platform | lms/djangoapps/instructor_task/tests/test_base.py | 3 | 16734 | """
Base test classes for LMS instructor-initiated background tasks
"""
import json
# pylint: disable=attribute-defined-outside-init
import os
import shutil
from tempfile import mkdtemp
from uuid import uuid4
import unicodecsv
from celery.states import FAILURE, SUCCESS
from django.contrib.auth.models import User
from... | agpl-3.0 |
kmoocdev2/edx-platform | cms/djangoapps/contentstore/management/commands/tests/test_fix_not_found.py | 87 | 2147 | """
Tests for the fix_not_found management command
"""
from django.core.management import CommandError, call_command
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
class ... | agpl-3.0 |
mvaled/OpenUpgrade | addons/gamification/models/badge.py | 287 | 13760 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
hstefan/grpc | test/http2_test/http2_base_server.py | 13 | 9323 | # Copyright 2016, 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 conditions and the f... | bsd-3-clause |
chemiron/aiopool | aiopool/fork.py | 1 | 6082 | import asyncio
import logging
import os
import signal
from struct import Struct
import time
from .base import (WorkerProcess, ChildProcess,
IDLE_CHECK, IDLE_TIME)
MSG_HEAD = 0x0
MSG_PING = 0x1
MSG_PONG = 0x2
MSG_CLOSE = 0x3
PACK_MSG = Struct('!BB').pack
UNPACK_MSG = Struct('!BB').unpack
logger =... | mit |
Shaps/ansible | lib/ansible/module_utils/facts/virtual/hpux.py | 199 | 2486 | # 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) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
jsilter/scipy | scipy/weave/catalog.py | 97 | 34645 | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | bsd-3-clause |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/django/conf/locale/az/formats.py | 1059 | 1267 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i'
DAT... | bsd-3-clause |
keimlink/django-cms | cms/tests/test_cache.py | 24 | 14080 | # -*- coding: utf-8 -*-
from django.template import Template, RequestContext
from django.conf import settings
from sekizai.context import SekizaiContext
from cms.api import add_plugin, create_page
from cms.cache import _get_cache_version, invalidate_cms_page_cache
from cms.models import Page
from cms.plugin_pool impor... | bsd-3-clause |
ioannistsanaktsidis/inspire-next | inspire/base/format_elements/bfe_inspire_url.py | 2 | 1497 | # -*- coding: utf-8 -*-
##
## This file is part of INSPIRE.
## Copyright (C) 2015 CERN.
##
## INSPIRE 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) a... | gpl-2.0 |
hypebeast/etapi | etapi/utils.py | 1 | 1765 | # -*- coding: utf-8 -*-
'''Helper utilities and decorators.'''
import time
from flask import flash
def flash_errors(form, category="warning"):
'''Flash all errors for a form.'''
for field, errors in form.errors.items():
for error in errors:
flash("{0} - {1}"
.format(get... | bsd-3-clause |
DBeath/flask-feedrsub | tests/period_test.py | 1 | 1488 | from datetime import datetime
from dateutil.relativedelta import relativedelta
from feedrsub.database import db
from feedrsub.models.period import PERIOD, Period
from feedrsub.models.populate_db import populate_periods
def test_populate_periods(session):
populate_periods()
daily = Period.query.filter_by(na... | mit |
nigelb/Static-UPnP | examples/Chromecast/StaticUPnP_StaticServices.py | 1 | 3345 | # static_upnp responds to upnp search requests with statically configures responses.
# Copyright (C) 2016 NigelB
#
# 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 Licens... | gpl-2.0 |
Tranzystorek/servo | tests/wpt/css-tests/tools/webdriver/webdriver/__init__.py | 149 | 1055 | # 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/.
from client import Cookies, Element, Find, Session, Timeouts, Window
from error import (
ElementNotSelectableExcepti... | mpl-2.0 |
UWPCE-PythonCert/IntroPython2016 | students/liverpoolforever/session04/dict_lab.py | 3 | 1402 | ''' Dictionary Lab '''
inputDict = {'name':'Chris','city':'Seattle','cake':'Chocolate'}
def print_dict(dict):
for key,value in dict.items():
print(key,value)
def delete_item(key):
# specificy the key to delete
del inputDict[key]
print(inputDict)
def add_an_item(key,value):
inputDict[key]... | unlicense |
avanov/django | django/db/models/sql/where.py | 439 | 8054 | """
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from django.db.models.sql.datastructures import EmptyResultSet
from django.utils import tree
from django.utils.functional import cached_property
# Connection types
AND = 'AND'
OR = 'OR'
class WhereNode(tree.Node):
"""
Used to repr... | bsd-3-clause |
ininex/geofire-python | resource/lib/python2.7/site-packages/Crypto/SelfTest/Cipher/test_CTR.py | 5 | 16449 | # ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | mit |
abhattad4/Digi-Menu | digimenu2/django/db/models/sql/subqueries.py | 81 | 7861 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.query_utils import Q
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE, NO_RESULTS
from django.db.models.sql.qu... | bsd-3-clause |
andrewmchen/incubator-airflow | tests/www/api/experimental/test_endpoints.py | 4 | 6128 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
MrLoick/python-for-android | python-build/python-libs/gdata/tests/atom_tests/data_test.py | 87 | 37163 | #!/usr/bin/python
# -*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2006 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
#
# Unle... | apache-2.0 |
civisanalytics/ansible | lib/ansible/modules/cloud/vmware/vmware_host.py | 16 | 7732 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/integration/cloud/providers/msazure.py | 2 | 5620 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
import os
import random
import string
from distutils.version import LooseVersion
# Import Salt Testing Libs
from salttesting import skipIf
from salttesting.helpers... | apache-2.0 |
iamroot12CD/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
MaryanMorel/faker | faker/utils/datetime_safe.py | 20 | 2881 | # coding=utf-8
# From django.utils.datetime_safe
# Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> da... | mit |
ygenc/onlineLDA | onlineldavb_new/build/scipy/scipy/sparse/linalg/eigen/lobpcg/info.py | 10 | 3809 | """
Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG)
LOBPCG is a preconditioned eigensolver for large symmetric positive definite
(SPD) generalized eigenproblems.
Call the function lobpcg - see help for lobpcg.lobpcg. See also lobpcg.as2d,
which can be used in the preconditioner (example below)... | gpl-3.0 |
ponty/MyElectronicProjects | pavement.py | 1 | 1718 | from easyprocess import Proc
from paver.easy import *
import paver.doctools
import paver.virtual
import paver.misctasks
from paved import *
from paved.dist import *
from paved.util import *
from paved.docs import *
from paved.pycheck import *
from paved.pkg import *
options(
sphinx=Bunch(
docroot='docs',
... | bsd-2-clause |
jart/tensorflow | tensorflow/contrib/data/python/kernel_tests/sql_dataset_op_test_base.py | 13 | 4314 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
GoogleCloudPlatform/python-docs-samples | appengine/standard/endpoints-frameworks-v2/quickstart/main_test.py | 1 | 1894 | # 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 a... | apache-2.0 |
OSU-CS-325/Project_Two_Coin_Change | run-files/analysisQ7.py | 1 | 2957 | import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import random
import datetime
# Import the three change making algorithms
sys.path.insert(0, "../divide-conquer/")
sys.path.insert(0, "../dynamic-programming")
sys.path.insert(0, "../greedy")
from changeslow import changeslow
from chan... | mit |
looker/sentry | tests/sentry/integrations/github/test_issues.py | 1 | 6535 | from __future__ import absolute_import
import responses
from mock import patch
from exam import fixture
from django.test import RequestFactory
from sentry.integrations.github.integration import GitHubIntegration
from sentry.models import Integration, ExternalIssue
from sentry.testutils import TestCase
from sentry.ut... | bsd-3-clause |
lochiiconnectivity/boto | boto/vpc/dhcpoptions.py | 17 | 2479 | # Copyright (c) 2009-2010 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, modi... | mit |
mikedh/trimesh | trimesh/creation.py | 1 | 40606 | """
creation.py
--------------
Create meshes from primitives, or with operations.
"""
from .base import Trimesh
from .constants import log, tol
from .geometry import faces_to_edges, align_vectors, plane_transform
from . import util
from . import grouping
from . import triangles
from . import transformations as tf
i... | mit |
zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/ha/test_2nfs_vm_ha_net_discon_host_vm_killed.py | 2 | 5911 | '''
New Integration Test for KVM VM ha network disconnect and check vm has been killed on original host
In addition, this test is sepcific for 2nfs.
@author: turnyouon
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import... | apache-2.0 |
marcwebbie/youtube-dl | youtube_dl/extractor/francetv.py | 7 | 16004 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
parse_duration,
determine_ext,
)
from .dailymotion import (
DailymotionIE,
Da... | unlicense |
stormvirux/vturra-cli | vturra/asys.py | 1 | 1936 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# from scipy import stats
# import statsmodels.api as sm
# from numpy.random import randn
import matplotlib as mpl
# import seaborn as sns
# sns.set_color_palette("deep", desat=.6)
mpl.rc("figure", fig... | mit |
Axam/nsx-web | fuelmenu/fuelmenu/fuelmenu.py | 2 | 15653 | #!/usr/bin/env python
# Copyright 2013 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 required by applicable law or a... | apache-2.0 |
hall1467/wikidata_usage_tracking | wbc_usage/utilities/determine_wikis.py | 1 | 2123 | """
Prints all wikis to stdout.
Usage:
determine_wikis (-h|--help)
determine_wikis [--debug]
[--verbose]
Options:
-h, --help This help message is printed
--debug Print debug logging to stderr
--verbose Print dots ... | mit |
simod/geonode | geonode/layers/views.py | 1 | 58343 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
Helais/herostats | lib/heroprotocol/protocol36693.py | 18 | 29680 | # Copyright (c) 2015 Blizzard Entertainment
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | mit |
nboley/grit | grit/simulator/reads_simulator.py | 1 | 21238 | """
Copyright (c) 2011-2015 Nathan Boley
This file is part of GRIT.
GRIT 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.
GRIT is distribut... | gpl-3.0 |
allenlavoie/tensorflow | tensorflow/contrib/estimator/python/estimator/head.py | 2 | 31202 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
michaelhkw/incubator-impala | tests/query_test/test_query_opts.py | 3 | 2932 | # 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... | apache-2.0 |
Netflix-Skunkworks/iep-apps | atlas-slotting/src/scripts/lift-data.py | 1 | 4221 | #!/usr/bin/env python3
# Copyright 2014-2019 Netflix, 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 applicabl... | apache-2.0 |
xively/node-red-nodes | hardware/Pibrella/nrgpio.py | 9 | 7471 | #!/usr/bin/python
#
# Copyright 2014,2016 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 ... | apache-2.0 |
VirtueSecurity/aws-extender | BappModules/boto/roboto/awsqueryservice.py | 153 | 4453 | from __future__ import print_function
import os
import urlparse
import boto
import boto.connection
import boto.jsonresponse
import boto.exception
from boto.roboto import awsqueryrequest
class NoCredentialsError(boto.exception.BotoClientError):
def __init__(self):
s = 'Unable to find credentials'
s... | mit |
MartinHjelmare/home-assistant | tests/components/hassio/test_init.py | 5 | 12794 | """The tests for the hassio component."""
import asyncio
import os
from unittest.mock import patch, Mock
import pytest
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.setup import async_setup_component
from homeassistant.components.hassio import STORAGE_KEY
from homeassistant.components import ... | apache-2.0 |
pranjan77/kb_go_express | lib/kb_go_express/baseclient.py | 150 | 11073 | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
from __future__ import print_function
import json as _json
import requests as _requests
import random a... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/models/identity.py | 2 | 1517 | # 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 ... | mit |
drmrd/ansible | lib/ansible/modules/network/junos/junos_static_route.py | 12 | 7438 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
mengxn/tensorflow | tensorflow/python/kernel_tests/decode_csv_op_test.py | 57 | 5036 | # 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... | apache-2.0 |
EricMountain-1A/openshift-ansible | roles/openshift_health_checker/openshift_checks/package_availability.py | 8 | 2460 | """Check that required RPM packages are available."""
from openshift_checks import OpenShiftCheck
from openshift_checks.mixins import NotContainerizedMixin
class PackageAvailability(NotContainerizedMixin, OpenShiftCheck):
"""Check that required RPM packages are available."""
name = "package_availability"
... | apache-2.0 |
nemonik/CoCreateLite | ccl-cookbook/files/default/cocreatelite/cocreate/views/playgrounds.py | 1 | 5229 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.core.urlresolvers import reverse
from ..models import VMPlayground
from ..forms import VMPlaygroundForm, VMPlaygroundDescriptionForm, VMPlaygroundUserAccessForm, VMPlaygroundGroupAccessForm
fr... | bsd-3-clause |
roscopecoltran/scraper | .staging/meta-engines/xlinkBook/update/spider.py | 1 | 7851 | #!/usr/bin/env python
#author: wowdd1
#mail: developergf@gmail.com
#data: 2014.12.09
import requests
import json
from bs4 import BeautifulSoup;
import os,sys
import time
import re
from all_subject import subject_dict, need_update_subject_list
reload(sys)
sys.setdefaultencoding("utf-8")
sys.path.append(".... | mit |
Soya93/Extract-Refactoring | python/lib/Lib/site-packages/django/contrib/gis/gdal/tests/test_geom.py | 93 | 21063 | from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, \
OGRException, OGRIndexError, SpatialReference, CoordTransform, \
gdal_version
from django.utils import unittest
from django.contrib.gis.geometry.test_data import TestDataMixin
class OGRGeomTest(unittest.TestCase, TestDataMixin):
"This tests th... | apache-2.0 |
idovear/odoo | addons/account_voucher/report/account_voucher_sales_receipt.py | 326 | 5808 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
DPaaS-Raksha/horizon | openstack_dashboard/dashboards/settings/user/forms.py | 14 | 2544 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
wangdahoo/jinja2 | examples/profile.py | 75 | 1107 | try:
from cProfile import Profile
except ImportError:
from profile import Profile
from pstats import Stats
from jinja2 import Environment as JinjaEnvironment
context = {
'page_title': 'mitsuhiko\'s benchmark',
'table': [dict(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10) for x in range(1000)]
}
source = ""... | bsd-3-clause |
bliz937/kivy | kivy/tools/extensions/make-kivyext.py | 49 | 6573 | #!/usr/bin/env python
"""
make-kivyext
~~~~~~~~~~~~~
Little helper script that helps creating new Kivy extensions.
To use it, just run it::
python make-kivyext.py
:copyright: (c) 2011: Adjusted by the Kivy Authors,
2010: Courtesy of Armin Ronacher
... | mit |
PabloPiaggi/lammps | tools/i-pi/ipi/utils/nmtransform.py | 41 | 9470 | """Contains functions for doing the inverse and forward normal mode transforms.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 ... | gpl-2.0 |
ptoraskar/django | django/contrib/gis/geos/linestring.py | 259 | 5843 | from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import (
GEOSGeometry, ProjectInterpolateMixin,
)
from django.contrib.gis.geos.point import Point
from django... | bsd-3-clause |
MuckRock/muckrock | muckrock/organization/tests/test_models.py | 1 | 8505 | """
Tests the models of the organization application
"""
# Django
from django.test import TestCase
# Standard Library
from datetime import date
# Third Party
from nose.tools import assert_false, assert_raises, assert_true, eq_
# MuckRock
from muckrock.core.factories import UserFactory
from muckrock.foia.exceptions ... | agpl-3.0 |
Grokzen/redisco | redisco/containers.py | 1 | 34087 | # -*- coding: utf-8 -*-
# doctest: +ELLIPSIS
import collections
from . import default_expire_time
def _parse_values(values):
(_values,) = values if len(values) == 1 else (None,)
if _values and type(_values) == type([]):
return _values
return values
class Container(object):
"""
Base clas... | mit |
johancz/olympia | apps/addons/management/commands/personas_fix_mojibake.py | 13 | 5793 | from getpass import getpass
from optparse import make_option
from time import time
from django.core.management.base import BaseCommand
from django.db import connection as django_connection, transaction
import MySQLdb as mysql
def debake(s):
for c in s:
try:
yield c.encode('windows-1252')
... | bsd-3-clause |
abhishekkrthakur/scikit-learn | examples/svm/plot_oneclass.py | 249 | 2302 | """
==========================================
One-class SVM with non-linear kernel (RBF)
==========================================
An example using a one-class SVM for novelty detection.
:ref:`One-class SVM <svm_outlier_detection>` is an unsupervised
algorithm that learns a decision function for novelty detection:
... | bsd-3-clause |
robinro/ansible | lib/ansible/module_utils/facts/utils.py | 9 | 1847 | # 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) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
JimCircadian/ansible | lib/ansible/modules/clustering/consul_acl.py | 32 | 22127 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@gmail.com>
# 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',
'... | gpl-3.0 |
flackr/quickopen | src/prelaunch_test.py | 2 | 1798 | # Copyright 2011 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 or agreed to in writing,... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/tensorflow/contrib/slim/python/slim/summaries.py | 63 | 7497 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
joshuajan/odoo | addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py | 39 | 13980 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
IONISx/edx-platform | lms/envs/bok_choy.py | 11 | 6630 | """
Settings for Bok Choy tests that are used when running LMS.
Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running the tests
Note: it isn't possible to have a single settings file, because Django doesn't
support both generating sta... | agpl-3.0 |
robinro/ansible | contrib/inventory/apstra_aos.py | 17 | 20303 | #!/usr/bin/env python
#
# (c) 2017 Apstra Inc, <community@apstra.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... | gpl-3.0 |
FirmlyReality/docklet | web/webViews/cluster.py | 2 | 15450 | from flask import session, redirect, request
from webViews.view import normalView
from webViews.dockletrequest import dockletRequest
from webViews.dashboard import *
from webViews.checkname import checkname
import time, re
class addClusterView(normalView):
template_path = "addCluster.html"
@classmethod
de... | bsd-3-clause |
ty707/airflow | airflow/migrations/versions/1968acfc09e3_add_is_encrypted_column_to_variable_.py | 62 | 1058 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
mAzurkovic/flask | tests/test_config.py | 139 | 5543 | # -*- coding: utf-8 -*-
"""
tests.test_config
~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Flask Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import flask
# config keys used for the TestConfig
TEST_KEY = 'foo'
SECRET_KEY = 'devkey'
... | bsd-3-clause |
codeforamerica/westsac-urban-land-locator | farmsList/public/views.py | 1 | 5434 | # -*- coding: utf-8 -*-
'''Public section, including homepage and signup.'''
from flask import (Blueprint, request, render_template, flash, url_for,
redirect, session)
from flask_mail import Message
from flask.ext.login import login_user, login_required, logout_user
from farmsList.extensions import... | bsd-3-clause |
seocam/django | tests/queries/models.py | 36 | 16195 | """
Various complex queries that have been problematic in the past.
"""
from __future__ import unicode_literals
import threading
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class DumbCategory(models.Model):
pass
class ProxyCategory(Du... | bsd-3-clause |
basicthinker/Sexain-MemController | gem5-stable/src/mem/SimpleMemory.py | 1 | 3222 | # Copyright (c) 2012-2013 ARM Limited
# 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 implementation of the functiona... | apache-2.0 |
toanalien/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/prettydiff.py | 186 | 1857 | # Copyright (c) 2010 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 conditions and the ... | bsd-3-clause |
heke123/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/style/filereader_unittest.py | 3 | 6694 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
ubc/compair | alembic/versions/316f3b73962c_modified_criteria_tables.py | 1 | 2136 | """modified criteria tables
Revision ID: 316f3b73962c
Revises: 2fe3d8183c34
Create Date: 2014-09-10 15:42:55.963855
"""
# revision identifiers, used by Alembic.
revision = '316f3b73962c'
down_revision = '2fe3d8183c34'
import logging
from alembic import op
import sqlalchemy as sa
from sqlalchemy import UniqueConstra... | gpl-3.0 |
abligh/xen-4.2-live-migrate | tools/xm-test/tests/block-integrity/02_block_device_write_verify.py | 42 | 1838 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2006
# Author: Harry Butterworth <butterwo@uk.ibm.com>
# This test imports a ram disk device as a physical device into a domU.
# The domU initialises the ram disk with data from /dev/urandom and calculates
# the md5 checksum of the data (using t... | gpl-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/carrier_constant_service/transports/__init__.py | 3 | 1067 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
craffel/mir_eval | tests/test_pattern.py | 4 | 3010 | """
Some unit tests for the pattern discovery task.
"""
import numpy as np
import json
import mir_eval
import glob
import warnings
import nose.tools
A_TOL = 1e-12
# Path to the fixture files
REF_GLOB = 'data/pattern/ref*.txt'
EST_GLOB = 'data/pattern/est*.txt'
SCORES_GLOB = 'data/pattern/output*.json'
def __unit_t... | mit |
matsprea/omim | 3party/protobuf/python/google/protobuf/internal/message_python_test.py | 74 | 2359 | #! /usr/bin/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 are
... | apache-2.0 |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/encodings/euc_jp.py | 816 | 1027 | #
# euc_jp.py: Python Unicode Codec for EUC_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('euc_jp')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | lgpl-3.0 |
tchellomello/home-assistant | homeassistant/components/demo/tts.py | 26 | 1444 | """Support for the demo for text to speech service."""
import os
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
SUPPORT_LANGUAGES = ["en", "de"]
DEFAULT_LANG = "en"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{vol.Optional(CONF_LANG, default=DEFAULT_LANG): ... | apache-2.0 |
beiko-lab/gengis | bin/Lib/site-packages/pythonwin/pywin/scintilla/scintillacon.py | 4 | 47114 | # Generated by h2py from Include\scintilla.h
# Included from BaseTsd.h
def HandleToUlong(h): return HandleToULong(h)
def UlongToHandle(ul): return ULongToHandle(ul)
def UlongToPtr(ul): return ULongToPtr(ul)
def UintToPtr(ui): return UIntToPtr(ui)
INVALID_POSITION = -1
SCI_START = 2000
SCI_OPTIONAL_STA... | gpl-3.0 |
StackStorm/st2 | contrib/chatops/actions/match_and_execute.py | 3 | 2668 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
earshel/PokeyPyManager | POGOProtos/Networking/Responses/SetAvatarResponse_pb2.py | 16 | 4194 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/SetAvatarResponse.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 g... | mit |
BT-jmichaud/l10n-switzerland | l10n_ch_payment_slip/tests/test_payment_slip.py | 1 | 9506 | # -*- coding: utf-8 -*-
# © 2014-2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import time
import re
import odoo.tests.common as test_common
from odoo.report import render_report
class TestPaymentSlip(test_common.TransactionCase):
_compile_get_ref = re.compile(r'[^0-9]')
... | agpl-3.0 |
ddietze/pyFSRS | available_modules/Devices/dummySensor.py | 2 | 5873 | """
.. module: dummySensor
:platform: Windows
.. moduleauthor:: Scott R. Ellis <skellis@berkeley.edu>
dummyDAQ provides a dummy input device for testing purposes.
You can use this file as a starting point when writing your own input device module for pyFSRS.
..
This file is part of the pyFSRS app.
This prog... | gpl-3.0 |
chuan9/chromium-crosswalk | tools/telemetry/third_party/typ/typ/tests/main_test.py | 35 | 26317 | # Copyright 2014 Dirk Pranke. 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... | bsd-3-clause |
asnir/airflow | airflow/utils/operator_helpers.py | 31 | 1556 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
YangSongzhou/django | tests/admin_docs/models.py | 244 | 1941 | """
Models for testing various aspects of the djang.contrib.admindocs app
"""
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=200)
class Group(models.Model):
name = models.CharField(max_length=200)
class Family(models.Model):
last_name = models.CharField(m... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.