repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ejoful/scrapy_example
zhihu_spider/zhihu_spider/settings.py
1
3176
# -*- coding: utf-8 -*- # Scrapy settings for zhihu_spider project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/l...
gpl-3.0
tboyce021/home-assistant
tests/helpers/test_area_registry.py
1
5502
"""Tests for the Area Registry.""" import asyncio import pytest from homeassistant.core import callback from homeassistant.helpers import area_registry import tests.async_mock from tests.common import flush_store, mock_area_registry @pytest.fixture def registry(hass): """Return an empty, loaded, registry.""" ...
apache-2.0
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/protorpc/protorpc/util_test.py
19
14232
#!/usr/bin/env python # # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
devendermishrajio/nova_test_latest
nova/tests/functional/v3/test_networks.py
29
3919
# Copyright 2012 Nebula, Inc. # Copyright 2013 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...
apache-2.0
msiedlarek/qtwebkit
Tools/Scripts/webkitpy/port/gtk_unittest.py
117
5598
# Copyright (C) 2011 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...
lgpl-3.0
keedio/hue
desktop/core/ext-py/Django-1.6.10/django/db/backends/postgresql_psycopg2/base.py
47
6866
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db.backends import * from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from django.db.backends.postgresql_psycopg2.client import DatabaseClient from django.db.b...
apache-2.0
tobegit3hub/glance_docker
glance/db/sqlalchemy/migrate_repo/versions/026_add_location_storage_information.py
19
1514
# 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...
apache-2.0
luoyetx/Apriori
apriori/apriori.py
1
9932
# -*- coding: utf-8 -*- from collections import defaultdict from itertools import combinations from sys import stdout class cached_property(object): """A cached property only computed once """ def __init__(self, func): self.func = func def __get__(self, obj, cls): if obj is None: retu...
mit
gptech/ansible
lib/ansible/modules/network/iosxr/iosxr_system.py
50
8452
#!/usr/bin/python # # 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 distribut...
gpl-3.0
alanhamlett/flask
examples/flaskr/flaskr.py
157
2893
# -*- coding: utf-8 -*- """ Flaskr ~~~~~~ A microblog example application written as Flask tutorial with Flask and sqlite3. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request...
bsd-3-clause
wilvk/ansible
test/units/modules/network/nxos/test_nxos_vxlan_vtep.py
57
2521
# (c) 2016 Red Hat Inc. # # 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 dis...
gpl-3.0
lazytech-org/RIOT
tests/libfixmath/do-test.py
19
2250
#!/usr/bin/env python3 import math import operator import sys def rem(a, b): ret = a % b if ret < 0 and a > 0 and b < 0 or \ ret > 0 and a < 0 and b > 0: ret -= b return ret FUNS = { 'add': operator.add, 'sub': operator.sub, 'mul': operator.mul, 'div': operator.truediv, ...
lgpl-2.1
frouty/odoo_oph
openerp/workflow/wkf_service.py
61
6596
# -*- coding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
kartben/iotivity
tools/scons/BoostBuild.py
1
5868
# -*- coding: utf-8 -*- # ********************************************************************* # # Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved. # # ********************************************************************* # # Licensed under the Apache License, Version 2.0 (the "License"); ...
apache-2.0
davetcoleman/sdk-examples
baxter/baxter_interface/src/baxter_interface/robustcontroller.py
3
5500
# Copyright (c) 2013, Rethink Robotics # 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. Redistributions of source code must retain the above copyright notice, # this list of conditions an...
bsd-3-clause
megaumi/django
tests/m2m_recursive/tests.py
424
5410
from __future__ import unicode_literals from operator import attrgetter from django.test import TestCase from .models import Person class RecursiveM2MTests(TestCase): def setUp(self): self.a, self.b, self.c, self.d = [ Person.objects.create(name=name) for name in ["Anne", "Bill"...
bsd-3-clause
jpanikulam/experiments
gpgpu/generators/sdf_shape_defs.py
1
1463
# %codegen(cl_gen) import generate_opencl_structs def main(): plane_defd = [ { 'type': 'vector', 'length': 3, 'name': 'normal', }, { 'type': 'float', 'length': 1, 'name': 'd', } ] sphere_defd = [ ...
mit
napkindrawing/ansible
lib/ansible/modules/cloud/vmware/vmware_vm_facts.py
33
3282
#!/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
rkokkelk/CouchPotatoServer
libs/guessit/__main__.py
94
6835
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
coreos/chromite
scripts/cros_generate_sysroot.py
2
3711
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Generates a sysroot tarball for building a specific package. Meant for use after setup_board and build_packages have been run. "...
bsd-3-clause
psi4/psi4
psi4/share/psi4/scripts/apply_license.py
7
3497
# Checks all psi4 relevant files for proper boilerplate GNU license. # This is sold as is with no warrenty-- probably should double check everything # after running. I am not responsible if you break Psi4. # # Do not forget to do share/plugins by hand! import os # File type we know how to handle ftypes = ['cc', 'h', ...
lgpl-3.0
Tivix/wagtail
wagtail/utils/setup.py
5
1510
from __future__ import absolute_import, print_function, unicode_literals import os import subprocess from setuptools import Command from setuptools.command.bdist_egg import bdist_egg from setuptools.command.sdist import sdist as base_sdist class assets_mixin(object): def compile_assets(self): try: ...
bsd-3-clause
xxshutong/openerp-7.0
openerp/addons/mrp/company.py
56
1393
# -*- 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...
agpl-3.0
CareerVillage/slack-moderation
tools/smt/smt/conf/settings.py
1
1207
# -*- coding: utf-8 -*- import os AWS_ACCESS_KEY_ID = None AWS_SECRET_ACCESS_KEY = None PROJECT_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') def rel(*x): return os.path.abspath(os.path.join(PROJECT_ROOT, *x)) SETUP_DIR = rel('../../../setup') KEY_DIR = rel('../../../keys') # Stagin...
mit
RecursiveGreen/pymod
formats/XM.py
1
16803
import struct from pymod.constants import * from pymod.module import * from pymod.util import * class XMNote(Note): """The definition of an note and it's effects in Fast Tracker II""" def __init__(self, note=0, instrument=0, voleffect=0, volparam=0, effect=0, param=0): super(XMNote, self).__init__(note...
gpl-3.0
chatcannon/scipy
scipy/linalg/_cython_signature_generator.py
52
8369
""" A script that uses f2py to generate the signature files used to make the Cython BLAS and LAPACK wrappers from the fortran source code for LAPACK and the reference BLAS. To generate the BLAS wrapper signatures call: python _cython_signature_generator.py blas <blas_directory> <out_file> To generate the LAPACK wrapp...
bsd-3-clause
samdoran/ansible
lib/ansible/modules/network/nxos/nxos_evpn_vni.py
25
10474
#!/usr/bin/python # # 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 distribut...
gpl-3.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_shelve.py
138
4596
import os import unittest import shelve import glob from test import test_support test_support.import_module('anydbm', deprecated=True) class TestCase(unittest.TestCase): fn = "shelftemp" + os.extsep + "db" def test_close(self): d1 = {} s = shelve.Shelf(d1, protocol=2, writeback=False) ...
gpl-2.0
mick-d/nipype
nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py
1
2404
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..convert import AnalyzeHeader def test_AnalyzeHeader_inputs(): input_map = dict(args=dict(argstr='%s', ), centre=dict(argstr='-centre %s', units='mm', ), data_dims=dict(argstr='-datadims %s', ...
bsd-3-clause
hjanime/VisTrails
vistrails/db/versions/v0_9_0/domain/abstraction.py
3
2728
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
SanPen/GridCal
src/research/opf/dc_opf_3.py
1
8418
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program implements the DC power flow as a linear program This version uses the sparse structures and it the problem compilation is blazing fast compared to the full matrix version """ from pulp import * import numpy as np import pandas as pd from matplotlib import ...
gpl-3.0
NL66278/OCB
addons/l10n_ch/account_wizard.py
424
2192
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
agpl-3.0
tungvx/deploy
appengine_django/management/commands/testserver.py
45
2504
#!/usr/bin/python2.4 # # Copyright 2008 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...
apache-2.0
jaspreetw/tempest
tempest/tests/base.py
42
1610
# Copyright 2013 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...
apache-2.0
RAtechntukan/CouchPotatoServer
libs/pyutil/platformutil.py
106
3607
# Thanks to Daenyth for help porting this to Arch Linux. import os, platform, re, subprocess _distributor_id_cmdline_re = re.compile("(?:Distributor ID:)\s*(.*)", re.I) _release_cmdline_re = re.compile("(?:Release:)\s*(.*)", re.I) _distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) _release_file_r...
gpl-3.0
vmarkovtsev/django
tests/template_tests/tests.py
183
4760
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from django.contrib.auth.models import Group from django.core import urlresolvers from django.template import Context, Engine, TemplateSyntaxError from django.template.base import UNKNOWN_SOURCE from django.test import SimpleTestCase, override...
bsd-3-clause
inetCatapult/flask-sqlalchemy
test_sqlalchemy.py
7
23928
from __future__ import with_statement import atexit import unittest from datetime import datetime import flask import flask_sqlalchemy as sqlalchemy from sqlalchemy import MetaData from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import sessionmaker def make_todo_model(db): class Todo(db....
bsd-3-clause
un33k/CouchPotatoServer
libs/axl/axel.py
65
13262
# axel.py # # Copyright (C) 2010 Adrian Cristea adrian dot cristea at gmail dotcom # Edits by Ruud Burger # # Based on an idea by Peter Thatcher, found on # http://www.valuedlessons.com/2008/04/events-in-python.html # # This module is part of Axel and is released under # the MIT License: http://www.opensource.org/licen...
gpl-3.0
ford-prefect/cerbero
test/test_packages_common.py
31
3804
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
mozts2005/OuterSpace
oslauncher/oslauncher/version.py
3
1031
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of Outer Space. # # Outer Space 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, ...
gpl-2.0
JesseLivezey/pylearn2
pylearn2/datasets/tests/test_ocr.py
43
3754
"""module for testing datasets.ocr""" import unittest import numpy as np from pylearn2.datasets.ocr import OCR from pylearn2.space import Conv2DSpace from pylearn2.testing.skip import skip_if_no_data class TestOCR(unittest.TestCase): """ Unit test of OCR dataset Parameters ---------- None """...
bsd-3-clause
sagemath/git-trac-command
git_trac/cmdline.py
1
12216
## -*- encoding: utf-8 -*- """ Handle Command Line Options """ ############################################################################## # The "git trac ..." command extension for git # Copyright (C) 2013 Volker Braun <vbraun.name@gmail.com> # # This program is free software: you can redistribute it and/or mo...
gpl-3.0
gaboflowers/mallador_v3
unidecode/x059.py
252
4644
data = ( 'Shou ', # 0x00 'Yi ', # 0x01 'Zhi ', # 0x02 'Gu ', # 0x03 'Chu ', # 0x04 'Jiang ', # 0x05 'Feng ', # 0x06 'Bei ', # 0x07 'Cay ', # 0x08 'Bian ', # 0x09 'Sui ', # 0x0a 'Qun ', # 0x0b 'Ling ', # 0x0c 'Fu ', # 0x0d 'Zuo ', # 0x0e 'Xia ', # 0x0f 'Xiong ', # 0x10 ...
gpl-3.0
neuront/redis-ctl
models/cluster_plan.py
2
1308
import json from werkzeug.utils import cached_property from base import db, Base, DB_TEXT_TYPE from cluster import Cluster class ClusterBalancePlan(Base): __tablename__ = 'cluster_balance_plan' cluster_id = db.Column(db.ForeignKey(Cluster.id), unique=True, nullable=False) bala...
mit
gboone/wedding.harmsboone.org
rsvp/migrations/0019_auto__chg_field_guest_notes.py
1
5628
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Guest.notes' db.alter_column(u'rsvp_guest', 'notes', self.gf('django.db.models.fields.Tex...
mit
YuriGural/erpnext
erpnext/hr/doctype/salary_slip/salary_slip.py
8
16266
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.utils import add_days, cint, cstr, flt, getdate, rounded, date_diff, money_in_words from frappe.model.naming import ...
gpl-3.0
jnez71/demos
signals/gaussian_markov_kernel.py
1
1646
#!/usr/bin/env python3 """ Kernel of Gaussian-transition scalar Markov process? """ import numpy as np from matplotlib import pyplot npr = np.random np.set_printoptions(suppress=True) pyplot.rcParams["font.size"] = 16 pyplot.rcParams["axes.grid"] = True ################################################## SYSTEM def...
mit
rananda/cfme_tests
cfme/infrastructure/config_management.py
1
19414
from functools import partial from cached_property import cached_property from navmazing import NavigateToSibling, NavigateToAttribute import cfme import cfme.fixtures.pytest_selenium as sel import cfme.web_ui.flash as flash import cfme.web_ui.tabstrip as tabs import cfme.web_ui.toolbar as tb from cfme.web_ui import ...
gpl-2.0
rawls238/planout
planout-editor/planout-editor-kernel.py
9
2393
from flask import Flask, jsonify, render_template, request, url_for app = Flask(__name__) from planout.interpreter import Interpreter import traceback import json import sys def testPlanOutScript(script, inputs={}, overrides=None, assertions=None): payload = {} # make sure experiment runs with the given inputs ...
bsd-3-clause
hbrunn/hr
hr_contract_hourly_rate/tests/test_hr_contract_hourly_rates.py
23
7450
# -*- coding:utf-8 -*- ############################################################################## # # Copyright (C) 2014 Savoir-faire Linux. All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
agpl-3.0
mfherbst/spack
var/spack/repos/builtin/packages/r-affxparser/package.py
2
2101
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
twz915/django
tests/migrations/test_optimizer.py
2
26004
from django.db import migrations, models from django.db.migrations import operations from django.db.migrations.optimizer import MigrationOptimizer from django.test import SimpleTestCase from .models import EmptyManager, UnicodeModel class OptimizerTests(SimpleTestCase): """ Tests the migration autodetector. ...
bsd-3-clause
bikong2/django
tests/null_fk_ordering/tests.py
381
2012
from __future__ import unicode_literals from django.test import TestCase from .models import Article, Author, Comment, Forum, Post, SystemInfo class NullFkOrderingTests(TestCase): def test_ordering_across_null_fk(self): """ Regression test for #7512 ordering across nullable Foreign Key...
bsd-3-clause
a-doumoulakis/tensorflow
tensorflow/contrib/tensor_forest/python/tensor_forest.py
5
26323
# Copyright 2016 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
sh1nu11bi/sulley
utils/crash_binning.py
12
10341
# # Crash Binning # Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com> # # $Id: crash_binning.py 193 2007-04-05 13:30:01Z cameron $ # # 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; e...
gpl-2.0
grangier/xhtml2pdf
xhtml2pdf/version.py
61
1551
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
toert/django-shop-template
myshop/urls.py
1
1142
"""myshop URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
mit
Johnetordoff/osf.io
addons/github/api.py
9
5246
from future.moves.urllib.parse import urlencode import github3 import cachecontrol from requests.adapters import HTTPAdapter from requests.exceptions import ConnectionError from addons.github import settings as github_settings from addons.github.exceptions import NotFoundError # Initialize caches https_cache = cach...
apache-2.0
asmodehn/catkin
test/unit_tests/test_setup_util.py
2
6374
import os import shutil import sys import tempfile import unittest from catkin_pkg.cmake import configure_file data = configure_file(os.path.join(os.path.dirname(__file__), '..', '..', 'cmake', 'templates', '_setup_util.py.in'), { 'CATKIN_LIB_ENVIRONMENT_PATHS': "'lib'"...
bsd-3-clause
cherylyli/stress-aid
env/lib/python3.5/site-packages/markupsafe/tests.py
674
6107
# -*- coding: utf-8 -*- import gc import sys import unittest from markupsafe import Markup, escape, escape_silent from markupsafe._compat import text_type class MarkupTestCase(unittest.TestCase): def test_adding(self): # adding two strings should escape the unsafe one unsafe = '<script type="appl...
mit
wuga214/Django-Wuga
env/lib/python2.7/site-packages/whoosh/lang/snowball/bases.py
96
4874
# Base classes class _ScandinavianStemmer(object): """ This subclass encapsulates a method for defining the string region R1. It is used by the Danish, Norwegian, and Swedish stemmer. """ def _r1_scandinavian(self, word, vowels): """ Return the region R1 that is used by the Scan...
apache-2.0
Ziemin/telepathy-gabble
tests/twisted/muc/chat-states.py
2
5219
""" Regression test for <https://bugs.freedesktop.org/show_bug.cgi?id=32952>, wherein chat states in MUCs were misparsed, and MUC chat states in general. """ from servicetest import assertEquals, assertLength, EventPattern from gabbletest import exec_test, elem, make_muc_presence, sync_stream from mucutil import join_...
lgpl-2.1
hushaoqing/my_notes
Python/Scrapy/mytest/testScrapyGraphite/settings.py
1
3248
# -*- coding: utf-8 -*- # Scrapy settings for mytest project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest/...
mit
rodrigods/keystone
keystone/token/controllers.py
2
19819
# Copyright 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 applicable law ...
apache-2.0
rahul-c1/scrapy
scrapy/contrib/downloadermiddleware/robotstxt.py
15
1856
""" This is a middleware to respect robots.txt policies. To activate it you must enable this middleware and enable the ROBOTSTXT_OBEY setting. """ import robotparser from scrapy import signals, log from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.http import Request from scrapy.utils.httpobj im...
bsd-3-clause
crazy-cat/incubator-mxnet
python/mxnet/module/bucketing_module.py
20
20458
# 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
HyperBaton/ansible
lib/ansible/modules/cloud/univention/udm_group.py
37
4839
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright: (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # 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...
gpl-3.0
google-research/language
language/tek_representations/utils/mrqa_official_eval.py
1
3638
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
apache-2.0
MostlyOpen/odoo_addons_jcafb
myo_lab_test_cst/models/lab_test_result_urina.py
1
4485
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by #...
agpl-3.0
systemd/casync
doc/conf.py
1
3578
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # SPDX-License-Identifier: LGPL-2.1+ # # casync documentation build configuration file, created by # sphinx-quickstart on Tue Jun 20 16:46:39 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configura...
lgpl-2.1
oikoumene/wcc.api
wcc/api/api.py
1
2196
# -*- coding: utf-8 -*- from plone.jsonapi.routes import add_plone_route # CRUD from plone.jsonapi.routes.api import get_items from plone.jsonapi.routes.api import create_items from plone.jsonapi.routes.api import update_items from plone.jsonapi.routes.api import delete_items from plone.jsonapi.routes.api import url...
lgpl-3.0
TalShafir/ansible
lib/ansible/modules/cloud/docker/docker_image_facts.py
7
7425
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
gpl-3.0
Menpiko/SnaPKernel-N
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed 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 failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
mahak/neutron
neutron/tests/unit/services/logapi/drivers/test_manager.py
2
7789
# Copyright (c) 2017 Fujitsu Limited # 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 requi...
apache-2.0
wwj718/edx-platform
common/test/acceptance/tests/discussion/helpers.py
46
4061
""" Helper functions and classes for discussion tests. """ from uuid import uuid4 import json from ...fixtures import LMS_BASE_URL from ...fixtures.course import CourseFixture from ...fixtures.discussion import ( SingleThreadViewFixture, Thread, Response, ) from ...pages.lms.discussion import DiscussionTa...
agpl-3.0
groschovskiy/keyczar
cpp/src/tools/swtoolkit/site_scons/site_tools/environment_tools.py
11
10726
#!/usr/bin/python2.4 # 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...
apache-2.0
smips/Temporary_Insanity
TI/src/TI.py
1
4468
import libtcodpy as libtcod import sys from time import sleep import os, math, random sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","World")) sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","Engine")) sys.path.insert(0, os.path.realpath(__file__).replace("TI.py","Scripts")) imp...
mit
HubLot/PBxplore
pbxplore/tests/test_regression.py
2
21493
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Regression tests for PBxplore. This test suite run the various PBxplore programs with various argument, and makes sure the output is the expected one. The aim is to check that the programs are not broken during development. Be careful this test suite does not test th...
mit
alexpap/exareme
exareme-tools/madis/src/lib/chardet/mbcharsetprober.py
215
3182
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
to266/hyperspy
hyperspy/misc/elements.py
1
302319
# Database # # The X-ray lines energies are taken from Chantler2005, # Chantler, C.T., Olsen, K., Dragoset, R.A., Kishore, A.R., # Kotochigova, S.A., and Zucker, D.S. # # The line weight, more precisely the approximate line weight for K,L M # shells are taken from epq library from hyperspy.misc import utils elements ...
gpl-3.0
rjschof/gem5
src/dev/BadDevice.py
69
1789
# Copyright (c) 2005-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this ...
bsd-3-clause
haya14busa/alc-etm-searcher
nltk-3.0a3/build/lib/nltk/classify/tadm.py
2
3527
# Natural Language Toolkit: Interface to TADM Classifier # # Copyright (C) 2001-2013 NLTK Project # Author: Joseph Frazee <jfrazee@mail.utexas.edu> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function, unicode_literals import sys import subprocess from nltk import...
mit
gavin-feng/odoo
addons/document/odt2txt.py
435
2110
#!/usr/bin/python # -*- 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 unde...
agpl-3.0
Venturi/oldcms
env/lib/python2.7/site-packages/django/db/models/fields/related.py
10
114783
from __future__ import unicode_literals import warnings from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, router, transaction from django.d...
apache-2.0
rallylee/gem5
configs/ruby/GPU_VIPER.py
12
25726
# # Copyright (c) 2011-2015 Advanced Micro Devices, Inc. # All rights reserved. # # For use for simulation and test purposes only # # 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 co...
bsd-3-clause
Suwings/Yeinw
src/Crypto/Random/OSRNG/posix.py
125
2835
# # Random/OSRNG/posix.py : OS entropy source for POSIX systems # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain i...
gpl-3.0
WoLpH/EventGhost
lib27/site-packages/curl/__init__.py
8
7023
'''A high-level interface to the pycurl extension''' # ** mfx NOTE: the CGI class uses "black magic" using COOKIEFILE in # combination with a non-existant file name. See the libcurl docs # for more info. import sys, pycurl py3 = sys.version_info[0] == 3 # python 2/3 compatibility if py3: import urllib.par...
gpl-2.0
h3biomed/ansible
lib/ansible/modules/network/cnos/cnos_reload.py
52
3430
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) __metaclass__ = type # # Copyright (C) 2017 Lenovo, Inc. # # 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 Licens...
gpl-3.0
AbsentMoniker/ECE463Honors
web2py/gluon/contrib/fpdf/template.py
40
11941
# -*- coding: iso-8859-1 -*- "PDF Template Helper for FPDF.py" __author__ = "Mariano Reingart <reingart@gmail.com>" __copyright__ = "Copyright (C) 2010 Mariano Reingart" __license__ = "LGPL 3.0" import sys,os,csv from fpdf import FPDF def rgb(col): return (col // 65536), (col // 256 % 256), (col% 256) class Te...
gpl-2.0
sadanandb/pmt
src/pyasm/application/common/dependency.py
6
2711
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
switchboardOp/ansible
lib/ansible/modules/packaging/os/pkg5.py
29
5253
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014 Peter Oliver <ansible@mavit.org.uk> # # 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 o...
gpl-3.0
40123148/w17b
static/Brython3.1.1-20150328-091302/Lib/opcode.py
714
5442
""" opcode module - potentially shared between dis and other modules which operate on bytecodes (e.g. peephole optimizers). """ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", "haslocal", "hascompare", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"] ...
agpl-3.0
mars-knowsnothing/amos-bot
src/Lib/site-packages/pip/download.py
334
32171
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys import tempfile try: import ssl # noqa HAS_TLS = True except ImportError: HAS_TLS = False from pip._vendor.six.move...
gpl-3.0
mrunge/horizon
openstack_dashboard/dashboards/admin/routers/panel.py
43
1067
# Copyright 2012, Nachi Ueno, NTT MCL, 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 applic...
apache-2.0
proggy/uic
doc/conf.py
1
7924
# -*- coding: utf-8 -*- # # uic documentation build configuration file, created by # sphinx-quickstart on Mon Jun 9 23:00:14 2014. # # 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. # # All con...
gpl-2.0
LordSputnik/mbws3
ws/schema/artist.py
1
1672
import datetime from sqlalchemy.dialects.postgresql import UUID from ws import db class Artist(db.Model): id = db.Column(db.Integer, primary_key=True) gid = db.Column(UUID, unique=True, nullable=False) name = db.Column(db.UnicodeText, nullable=False) sort_name = db.Column(db.UnicodeText, nullable=Fa...
gpl-3.0
Xilinx/hopper
hopper/commands/CommandHopperBase.py
1
3733
# Copyright (c) 2015 Xilinx Inc. # # 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, publish, distrib...
mit
swenson/sagewiki
unidecode/unidecode/x058.py
252
4678
data = ( 'Ku ', # 0x00 'Ke ', # 0x01 'Tang ', # 0x02 'Kun ', # 0x03 'Ni ', # 0x04 'Jian ', # 0x05 'Dui ', # 0x06 'Jin ', # 0x07 'Gang ', # 0x08 'Yu ', # 0x09 'E ', # 0x0a 'Peng ', # 0x0b 'Gu ', # 0x0c 'Tu ', # 0x0d 'Leng ', # 0x0e '[?] ', # 0x0f 'Ya ', # 0x10 'Qian ', ...
gpl-2.0
twitchyliquid64/misc-scripts
s3tool/boto-develop/boto/services/sonofmmm.py
170
3498
# Copyright (c) 2006,2007 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
v-iam/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/fabric_error.py
2
1515
# 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