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 |
|---|---|---|---|---|---|
mykytamorachov/outpost | flask/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/pyodbc.py | 18 | 2739 | # mysql/pyodbc.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the MySQL database via the pyodbc adapter.
pyodbc is available at:
... | gpl-2.0 |
carsongee/edx-platform | lms/djangoapps/shoppingcart/migrations/0003_auto__del_field_orderitem_line_cost.py | 182 | 8538 | # -*- 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):
# Deleting field 'OrderItem.line_cost'
db.delete_column('shoppingcart_orderitem', 'line_cost')
def back... | agpl-3.0 |
trondhindenes/ansible | lib/ansible/modules/storage/ibm/ibm_sa_host.py | 16 | 3260 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 IBM CORPORATION
# Author(s): Tzur Eliyahu <tzure@il.ibm.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_META... | gpl-3.0 |
sgerhart/ansible | test/units/modules/network/netscaler/test_netscaler_nitro_request.py | 45 | 12933 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | mit |
theonlydude/RandomMetroidSolver | rando/ItemLocContainer.py | 1 | 10007 |
import copy, utils.log
from logic.smbool import SMBool, smboolFalse
from logic.smboolmanager import SMBoolManager
from collections import Counter
class ItemLocation(object):
__slots__ = ( 'Item', 'Location', 'Accessible' )
def __init__(self, Item=None, Location=None, accessible=True):
self.Item = It... | gpl-3.0 |
hlin117/scikit-learn | examples/ensemble/plot_forest_iris.py | 18 | 6190 | """
====================================================================
Plot the decision surfaces of ensembles of trees on the iris dataset
====================================================================
Plot the decision surfaces of forests of randomized trees trained on pairs of
features of the iris dataset.
... | bsd-3-clause |
quinot/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_facts.py | 46 | 4270 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
# 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_versio... | gpl-3.0 |
harisibrahimkv/django | tests/expressions/models.py | 26 | 2210 | """
Tests for F() query expression syntax.
"""
from django.db import models
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField(max_length=50)
salary = models.IntegerField(blank=True, null=True)
def __str__(self):
return '%s %s' % (self.first... | bsd-3-clause |
brainwane/zulip | zerver/views/submessage.py | 2 | 1118 | import orjson
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.decorator import REQ, has_request_variables
from zerver.lib.actions import do_add_submessage
from zerver.lib.message import access_message
from zerver.lib.response import json_error, json_succ... | apache-2.0 |
HoracioAlvarado/fwd | venv/Lib/site-packages/flask/app.py | 427 | 76782 | # -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... | mit |
ox-it/moxie | moxie/places/importers/osm.py | 1 | 8808 | # -*- coding: utf-8 -*-
import logging
from xml.sax import handler
from moxie.places.importers.helpers import prepare_document, format_uk_telephone
logger = logging.getLogger(__name__)
DEFAULT_SHOP = '/amenities/shop'
SHOPS = {'supermarket': '/amenities/supermarket',
'department_store': '/amenities/superm... | apache-2.0 |
wzhfy/spark | examples/src/main/python/ml/anova_test_example.py | 7 | 1887 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
alx-eu/django | django/conf/locale/ko/formats.py | 107 | 2105 | # -*- 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 = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i:s'... | bsd-3-clause |
NTesla/wordpress-sploit-framework | web_server_builder.py | 2 | 2235 | from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import random
global_url = global_parameters = global_method = global_payload = ''
class HTTPHandler (SimpleHTTPRequestHandler):
server_version = "LibHttpWSF/1.0"
def do_GET(self):
print "[+] New connection: %s... | gpl-3.0 |
glove747/liberty-neutron | neutron/tests/unit/db/test_allowedaddresspairs_db.py | 5 | 15627 | # Copyright (c) 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 or agreed to... | apache-2.0 |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/collective_concat_op.py | 1 | 2231 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
dimagol/trex-core | scripts/external_libs/nose-1.3.4/python3/nose/plugins/attrib.py | 11 | 9709 | """Attribute selector plugin.
Oftentimes when testing you will want to select tests based on
criteria rather then simply by filename. For example, you might want
to run all tests except for the slow ones. You can do this with the
Attribute selector plugin by setting attributes on your test methods.
Here is an example:... | apache-2.0 |
402231466/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_collections.py | 603 | 19111 | # "High performance data structures
# "
# copied from pypy repo
#
# Copied and completed from the sandbox of CPython
# (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger)
#
# edited for Brython line 558 : catch ImportError instead of AttributeError
import operator
#try:
# from thread import get_i... | gpl-3.0 |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/encodings/cp1026.py | 593 | 13369 | """ Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... | gpl-2.0 |
NaohiroTamura/ironic | ironic/objects/volume_target.py | 1 | 11250 | # Copyright (c) 2016 Hitachi, Ltd.
#
# 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 |
thaumos/ansible | test/units/modules/network/f5/test_bigip_gtm_monitor_external.py | 16 | 4081 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
hhucn/netsec-uebungssystem | netsecus/student.py | 1 | 5593 | from __future__ import unicode_literals
from . import helper
from . import grading
import collections
Student = collections.namedtuple('Student', ['id'])
NamedStudent = collections.namedtuple('Student', ['student', 'aliases'])
FullStudent = collections.namedtuple('FullStudent', ['student', 'aliases', 'submissions', ... | mit |
tuanavu/deep-learning-a-z | DeepLearningA-Z/02-supervised-deep-learning/02-Convolutional-Neural-Networks-CNN/Convolutional_Neural_Networks/cnn_homework_solution.py | 2 | 2718 | # Convolutional Neural Network
# Installing Theano
# pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
# Installing Tensorflow
# pip install tensorflow
# Installing Keras
# pip install --upgrade keras
# Part 1 - Building the CNN
# Importing the Keras libraries and packages
from keras.models im... | mit |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | mit |
tkhirianov/fox_python_2016 | lesson_2/task4-11.py | 1 | 1501 | #-*- coding: utf-8 -*
import robot
r = robot.rmap()
r.loadmap('task4-11')
def task():
pass
#------- пишите код здесь -----
r.right()
r.down()
for line in range(13):
for step in range(line+1):
r.paint('red')
r.right()
for step in range(line+1):
r.le... | gpl-3.0 |
GauriGNaik/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/support/generate-text-emphasis-line-height-tests.py | 829 | 3431 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... | mpl-2.0 |
bitmovin/bitmovin-python | bitmovin/resources/models/encodings/encoding.py | 1 | 4786 | from bitmovin.errors import InvalidTypeError
from bitmovin.resources.enums import CloudRegion, EncoderVersion
from bitmovin.utils import Serializable
from bitmovin.resources.models import AbstractModel
from bitmovin.resources import AbstractNameDescriptionResource
from .infrastructure import Infrastructure
class Enc... | unlicense |
jessefeinman/FintechHackathon | venv/Lib/encodings/cp1257.py | 272 | 13374 | """ Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | bsd-2-clause |
acsone/Arelle | arelle/XbrlUtil.py | 2 | 8014 | '''
Created on Nov 26, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import xml.dom.minidom, math
from arelle import XbrlConst, XmlUtil
from arelle.ModelValue import qname, QName, DateTime
from arelle.ModelObject import ModelObject, ModelAttribute
from arelle.... | apache-2.0 |
scalable-networks/ext | gnuradio-3.7.0.1/gnuradio-runtime/python/gnuradio/eng_notation.py | 61 | 2247 | #
# Copyright 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-2.0 |
Backflipz/plugin.video.excubed | resources/lib/js2py/legecy_translators/utils.py | 96 | 2705 | import sys
import unicodedata
from collections import defaultdict
def is_lval(t):
"""Does not chceck whether t is not resticted or internal"""
if not t:
return False
i = iter(t)
if i.next() not in IDENTIFIER_START:
return False
return all(e in IDENTIFIER_PART for e in i)
def is_val... | gpl-2.0 |
kanagasabapathi/python-for-android | python3-alpha/python3-src/Lib/test/test_ioctl.py | 87 | 3327 | import array
import unittest
from test.support import run_unittest, import_module, get_attribute
import os, struct
fcntl = import_module('fcntl')
termios = import_module('termios')
get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature
try:
tty = open("/dev/tty", "rb")
except IOError:
raise ... | apache-2.0 |
takeflight/wagtail | wagtail/admin/views/generic.py | 2 | 8292 | from django.shortcuts import redirect
from django.urls import reverse
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy
from django.views.generic.base import TemplateResponseMixin
from django.views.generic.edit import BaseCreateView, BaseDeleteView, BaseUpdateView
from ... | bsd-3-clause |
thobbs/cassandra-dtest | upgrade_tests/cql_tests.py | 1 | 233827 | # coding: utf-8
import itertools
import math
import random
import struct
import time
from collections import OrderedDict
from distutils.version import LooseVersion
from unittest import skipUnless
from uuid import UUID, uuid4
from cassandra import ConsistencyLevel, InvalidRequest
from cassandra.concurrent import execu... | apache-2.0 |
gurneyalex/sale-workflow | __unported__/sale_line_description/res_config.py | 5 | 1346 | # -*- coding: utf-8 -*-
#
#
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.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 published
# by the Free Software Foundation, either version 3 o... | agpl-3.0 |
jbedorf/tensorflow | tensorflow/python/saved_model/loader.py | 36 | 2542 | # 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 |
kubeflow/kfserving | python/kfserving/test/test_v1alpha2_inference_service_status.py | 1 | 1542 | # Copyright 2020 kubeflow.org.
#
# 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 |
eXistenZNL/SickRage | tornado/gen.py | 64 | 35105 | """``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment. Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.
For example, the following asynchronous handler::
class Asy... | gpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/astroid/tests/unittest_manager.py | 8 | 8780 | # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
#... | gpl-3.0 |
kurikaesu/arsenalsuite | cpp/lib/PyQt4/examples/tools/qtdemo/launcher.py | 11 | 43752 | #!/usr/bin/env python
############################################################################
##
## Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## License version 2... | gpl-2.0 |
fullphat/redsquare | rs_pcd8544.py | 1 | 1295 | # RedSqaure
# pcd8544.device handler
# LCD matrix used in the original Nokia 3310 phones
# Copyright (c) 2017 full phat products
#
import threading
import sos
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# init:
#
def init():
global lcd
try:
import pcd8544lib as lcd
... | mit |
zahari/samba | python/samba/tests/dcerpc/testrpc.py | 51 | 5283 | # test generated python code from pidl
# Copyright (C) Andrew Tridgell August 2010
#
# 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 |
nwjs/blink | Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py | 48 | 4096 | # 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... | bsd-3-clause |
leppa/home-assistant | homeassistant/components/ring/light.py | 1 | 2991 | """This component provides HA switch support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
from homeassistant.components.light import Light
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
import homeassistant.util.dt as dt_util... | apache-2.0 |
dagwieers/ansible | lib/ansible/modules/network/panos/_panos_admpwd.py | 4 | 6148 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
shaz13/oppia | core/domain/email_manager.py | 1 | 36969 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
M4sse/nw.js | tests/automation/buff_from_string/internal/test.py | 169 | 1430 | #!/usr/bin/env python
from selenium import webdriver
import os
import traceback
import time
from selenium import webdriver
from platform import platform
import socket
from sys import argv
port = 13013
if len(argv) >= 2:
port = int(argv[1])
path = os.path
dirname = path.abspath(path.dirname(__file__))
chromedriv... | mit |
otadmor/Open-Knesset | committees/tests.py | 8 | 21838 | from datetime import datetime, timedelta
from django.test import TestCase
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User,Group,Permission
from django.contrib.contenttypes.models import ContentType
import unittest
from annotatetext.models import ... | bsd-3-clause |
caorong/mysql-connector-python | lib/mysql/connector/authentication.py | 16 | 6477 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptions to ... | gpl-2.0 |
EDUlib/edx-platform | lms/djangoapps/mobile_api/users/serializers.py | 5 | 5731 | """
Serializer for user API
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
from common.djangoapps.student.models import CourseEnrollment, User
from common.djangoapps.util.course import get_encoded_course_sharing_utm_params, get_link_for_about_page
from lms.djangoapps.certificat... | agpl-3.0 |
MaheshIBM/keystone | doc/source/conf.py | 13 | 9055 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | apache-2.0 |
bospetersen/h2o-3 | h2o-py/tests/testdir_algos/rf/pyunit_NOPASS_error_checkpointRF.py | 1 | 2494 | import sys, shutil
sys.path.insert(1, "../../../")
import h2o, tests
def cars_checkpoint(ip,port):
cars = h2o.upload_file(h2o.locate("smalldata/junit/cars_20mpg.csv"))
predictors = ["displacement","power","weight","acceleration","year"]
response_col = "economy"
# build first model
model1 = h2o.ra... | apache-2.0 |
Shade5/coala | coalib/results/LineDiff.py | 35 | 2418 | import collections
from coala_utils.decorators import generate_repr
class ConflictError(Exception):
pass
@generate_repr('change', 'delete', 'add_after')
class LineDiff:
"""
A LineDiff holds the difference between two strings.
"""
def __init__(self, change=False, delete=False, add_after=False):... | agpl-3.0 |
WillisXChen/django-oscar | src/oscar/apps/basket/migrations/0002_auto_20140827_1705.py | 54 | 1749 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('partner', '0001_initial'),
('catalogue', '0001_initial'),
('basket', '0001_initial'),
... | bsd-3-clause |
merfii/PythonExercises | protream/0023/run.py | 40 | 2241 | """
Message Board
~~~~~~~~~~~~~
A simple message board application written with Flask and sqlite3.
Since it's a small application, I have not use SQLAlchemy and wtf.
:copyright: (c) 2015 by proteam@gmail.com.
:license: BSD.
"""
import os
import sqlite3
from datetime import datetime
from flask ... | mit |
ksachs/invenio | modules/bibauthorid/lib/bibauthorid_prob_matrix_unit_tests.py | 5 | 1254 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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... | gpl-2.0 |
chatcannon/scipy | scipy/sparse/setup.py | 108 | 2206 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import os
import sys
import subprocess
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('sparse',parent_package,top_path)
config.add_data_... | bsd-3-clause |
schinke/solid-fortnight-ba | flask/venv/lib/python2.7/site-packages/click/core.py | 63 | 70085 | import os
import sys
from contextlib import contextmanager
from itertools import repeat
from functools import update_wrapper
from .types import convert_type, IntRange, BOOL
from .utils import make_str, make_default_short_help, echo, get_os_args
from .exceptions import ClickException, UsageError, BadParameter, Abort, \... | mit |
jeffrey4l/nova | nova/ipv6/account_identifier.py | 97 | 1952 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
cmallwitz/Sunflower | application/plugins/find_file_extensions/size.py | 1 | 2603 | from gi.repository import Gtk
from plugin_base.find_extension import FindExtension
class SizeFindFiles(FindExtension):
"""Size extension for find files tool"""
def __init__(self, parent):
FindExtension.__init__(self, parent)
# create container
table = Gtk.Table(2, 4, False)
table.set_border_width(5)
ta... | gpl-3.0 |
puzan/ansible | lib/ansible/galaxy/role.py | 15 | 15020 | ########################################################################
#
# (C) 2015, Brian Coca <bcoca@ansible.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... | gpl-3.0 |
nox/servo | components/script/dom/bindings/codegen/parser/tests/test_bytestring.py | 118 | 3772 | # -*- coding: UTF-8 -*-
import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestByteString {
attribute ByteString bs;
attribute DOMString ds;
};
""")
results = parser.finish();
harness.ok(True, "TestByteString interface parsed without error... | mpl-2.0 |
vismartltd/edx-platform | common/djangoapps/student/migrations/0001_initial.py | 188 | 8556 | # encoding: 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):
# Adding model 'UserProfile'
db.create_table('auth_userprofile', (
('id', self.gf('django.db.models.f... | agpl-3.0 |
andrei-milea/unbiased | web/backend/urls.py | 1 | 1264 | """backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-ba... | gpl-3.0 |
odejesush/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/layers/fully_connected.py | 20 | 2981 | # 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 |
katrid/django | tests/custom_columns/models.py | 282 | 1716 | """
Custom column/table names
If your database column name is different than your model attribute, use the
``db_column`` parameter. Note that you'll use the field's name, not its column
name, in API usage.
If your database table name is different than your model name, use the
``db_table`` Meta attribute. This has no ... | bsd-3-clause |
adaur/SickRage | lib/tornado/simple_httpclient.py | 39 | 23547 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado.concurrent import is_future
from tornado.escape import utf8, _unicode
from tornado.httpclient import HTTPResponse, HTTPError, AsyncHTTPClient, main, _RequestProxy
from tornado import httputil
from tornad... | gpl-3.0 |
Appono/hey-orpheus | vendor/pip-1.3.1/pip/commands/list.py | 63 | 5403 | from pip.basecommand import Command
from pip.exceptions import DistributionNotFound, BestVersionAlreadyInstalled
from pip.index import PackageFinder
from pip.log import logger
from pip.req import InstallRequirement
from pip.util import get_installed_distributions, dist_is_editable
from pip.cmdoptions import make_option... | mit |
tmcone/ycmd | cpp/ycm/tests/gmock/test/gmock_leak_test.py | 779 | 4384 | #!/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... | gpl-3.0 |
jesramirez/odoo | addons/account_anglo_saxon/stock.py | 208 | 2930 | # -*- encoding: 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 t... | agpl-3.0 |
emory-libraries/eulcore-history | src/eulcore/django/existdb/tests.py | 1 | 7136 | # file django/existdb/tests.py
#
# Copyright 2010 Emory University General Library
#
# 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/LI... | apache-2.0 |
pierreg/tensorflow | tensorflow/python/kernel_tests/cast_op_test.py | 11 | 7835 | # 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 |
40223220/w16b_test | static/Brython3.1.1-20150328-091302/Lib/site-packages/spur.py | 291 | 5461 | #coding: utf-8
import math
# 導入數學函式後, 圓周率為 pi
# deg 為角度轉為徑度的轉換因子
deg = math.pi/180.
class Spur(object):
def __init__(self, ctx):
self.ctx = ctx
def create_line(self, x1, y1, x2, y2, width=3, fill="red"):
self.ctx.beginPath()
self.ctx.lineWidth = width
self.ctx.moveTo(x1, y1)
... | agpl-3.0 |
barachka/odoo | addons/web_analytics/__openerp__.py | 62 | 1409 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
837468220/python-for-android | python3-alpha/python3-src/Lib/lib2to3/pgen2/parse.py | 569 | 8053 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | apache-2.0 |
hernandito/SickRage | lib/github/Download.py | 74 | 10417 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
hxddh/youtube-dl | youtube_dl/extractor/periscope.py | 66 | 3574 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import parse_iso8601
class PeriscopeIE(InfoExtractor):
IE_DESC = 'Periscope'
_VALID_URL = r'https?://(?:www\.)?periscope\.tv/w/(?... | unlicense |
ian-garrett/meetMe | env/lib/python3.4/site-packages/pyasn1_modules/rfc2511.py | 77 | 9505 | #
# X.509 certificate Request Message Format (CRMF) syntax
#
# ASN.1 source from:
# http://tools.ietf.org/html/rfc2511
#
# Sample captures could be obtained with OpenSSL
#
from pyasn1.type import tag, namedtype, namedval, univ, constraint, char,useful
from pyasn1_modules.rfc2459 import *
from pyasn1_modules import rfc2... | artistic-2.0 |
gwu-libraries/launchpad | lp/ui/management/commands/make_sitemap.py | 1 | 2292 | import gzip
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connections
def _newfile(counter):
"""Generate a new sitemap filename based on count."""
name = '%s/sitemap-%s.xml.gz' % (settings.SITEMAPS_DIR,
counter)
fp = gzip.open... | mit |
sedthh/lara-hungarian-nlp | examples/example_stemmer_1.py | 1 | 1290 | # -*- coding: UTF-8 -*-
import os.path, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
from lara import stemmer, nlp
''' Stemmer and n-gram example '''
if __name__ == "__main__":
text = '''
A szövegbányászat a strukturálatlan vagy kis mértékben strukturált
szöveges á... | mit |
lmazuel/azure-sdk-for-python | azure-cognitiveservices-vision-computervision/azure/cognitiveservices/vision/computervision/models/list_models_result.py | 2 | 1162 | # 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 |
nurnbeck/project-2-CMPUT-291 | ret_KEY.py | 1 | 1724 | import os
import time
import bsddb3 as bsddb
'''
Retrieve records with a given key
- Modified and simplified based on the old version
- Has the same format and assumption as ret_DATA()
Tested under DB_SIZE = 10
'''
DB_FILE = "/tmp/yishuo_db/sample_db"
SDB_FILE = "/tmp/yishuo_db/IndexFile"
def ret_KEY(filetype):
... | mit |
aostapenko/manila | manila/tests/scheduler/test_host_manager.py | 2 | 8018 | # Copyright (c) 2011 OpenStack, LLC
# 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 requir... | apache-2.0 |
M4rtinK/anaconda | tests/nosetests/pyanaconda_tests/module_part_blivet_test.py | 2 | 4848 | #
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
mediaProduct2017/learn_NeuralNet | neural_network_design.py | 1 | 1568 | """
In order to decide how many hidden nodes the hidden layer should have,
split up the data set into training and testing data and create networks
with various hidden node counts (5, 10, 15, ... 45), testing the performance
for each.
The best-performing node count is used in the actual system. If multiple counts
perf... | mit |
CapOM/ChromiumGStreamerBackend | third_party/mojo/src/mojo/public/python/mojo_bindings/promise.py | 28 | 6835 | # 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.
"""
Promise used by the python bindings.
The API is following the ECMAScript 6 API for promises.
"""
import sys
class Promise(object):
"""The promise o... | bsd-3-clause |
freeflightsim/fg-flying-club | google_appengine/google/appengine/api/datastore_entities.py | 12 | 11632 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | gpl-2.0 |
cfg2015/EPT-2015-2 | addons/website_mail_group/controllers/main.py | 306 | 7883 | # -*- coding: utf-8 -*-
import datetime
from dateutil import relativedelta
from openerp import tools, SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import slug
from openerp.addons.web.http import request
class MailGroup(http.Controller):
_thread_per_page = 20
_r... | agpl-3.0 |
FlintHill/SUAS-Competition | env/lib/python3.7/site-packages/pip/_vendor/packaging/specifiers.py | 7 | 28026 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | mit |
nirvn/QGIS | tests/src/python/test_qgsserver_response.py | 23 | 2422 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServerResponse.
From build dir, run: ctest -R PyQgsServerResponse -V
.. note:: 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 t... | gpl-2.0 |
kursitet/edx-ora2 | openassessment/assessment/api/peer.py | 6 | 37000 | """Public interface managing the workflow for peer assessments.
The Peer Assessment Workflow API exposes all public actions required to complete
the workflow for a given submission.
"""
import logging
from django.utils import timezone
from django.db import DatabaseError, IntegrityError, transaction
from dogapi import... | agpl-3.0 |
lepistone/odoo | addons/sale_crm/sale_crm.py | 28 | 1484 | # -*- 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 |
Contextualist/Quip4AHA | lib/werkzeug/contrib/limiter.py | 3 | 1373 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproje... | apache-2.0 |
OpenUpgrade-dev/OpenUpgrade | openerp/tools/__init__.py | 337 | 1447 | # -*- 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 |
fedora-infra/bodhi | bodhi/tests/server/services/test_comments.py | 2 | 27011 | # Copyright © 2014-2019 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 lat... | gpl-2.0 |
lundjordan/build-relengapi | relengapi/lib/auth/auth_types/constant.py | 1 | 1235 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import logging
from flask import redirect
from flask import request
from flask import url_for
from flask.ext.login impo... | mpl-2.0 |
iPlantCollaborativeOpenSource/libcloud | libcloud/compute/drivers/__init__.py | 38 | 1208 | # 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 use ... | apache-2.0 |
Joni-Aaltonen/pebble-owner-info | .waf-1.7.0-9334f7e963bee5410f4fa28728feffdd/waflib/Tools/xlcxx.py | 330 | 1222 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... | gpl-2.0 |
foodszhang/kbengine | kbe/src/lib/python/Tools/freeze/makefreeze.py | 37 | 2706 | import marshal
import bkfile
# Write a file containing frozen code for the modules in the dictionary.
header = """
#include "Python.h"
static struct _frozen _PyImport_FrozenModules[] = {
"""
trailer = """\
{0, 0, 0} /* sentinel */
};
"""
# if __debug__ == 0 (i.e. -O option given), set Py_OptimizeFlag in frozen... | lgpl-3.0 |
rjkunde/TempHumiditySensorProject | THSP/THSP_Functions.py | 1 | 5164 | import sys
import Adafruit_DHT
import datetime
import sqlite3
import os
import glob
import ConfigParser
import logging
# import time
# Global variable
global errorState
errorState = None
# Specify AM203 sensor on Raspberry Pi GPIO pin #4 (physical pin 7)
# Detecting Pi version / beaglebone is handled by Adafruit DH... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.