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 |
|---|---|---|---|---|---|
ashokpant/rnnlib | utils/dump_weights.py | 7 | 3714 | #Copyright 2009,2010 Alex Graves
#
# This file is part of RNNLIB.
#
# RNNLIB 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.
#
# RNNL... | gpl-3.0 |
tombstone/models | research/keypointnet/main.py | 4 | 21991 | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
ehashman/oh-mainline | vendor/packages/django-model-utils/model_utils/managers.py | 17 | 10202 | from __future__ import unicode_literals
import django
from django.db import models
from django.db.models.fields.related import OneToOneField
from django.db.models.query import QuerySet
from django.core.exceptions import ObjectDoesNotExist
try:
from django.db.models.constants import LOOKUP_SEP
from django.utils... | agpl-3.0 |
magic0704/neutron | neutron/tests/unit/test_auth.py | 43 | 5071 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
gpg/gpgme | lang/python/tests/t-idiomatic.py | 1 | 2868 | #!/usr/bin/env python
# Copyright (C) 2016 g10 Code GmbH
#
# This file is part of GPGME.
#
# GPGME 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 la... | lgpl-2.1 |
tlevine/be | libbe/util/id.py | 5 | 25844 | # Copyright (C) 2008-2012 Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
# W. Trevor King <wking@tremily.us>
#
# This file is part of Bugs Everywhere.
#
# Bugs Everywhere is free software: you can redistribute it and/or modify it
# under the terms of the ... | gpl-2.0 |
rushtongarth/utilities | utils/src/docbuilder.py | 2 | 4181 | #!/usr/env python
import json,os,argparse,calendar as cal
CURR_FILE = os.path.abspath(__file__)
CURR_DIR = os.path.dirname(CURR_FILE)
HW_DIR = os.path.dirname(CURR_DIR)
JSON_FILE = os.path.join(CURR_DIR,'classes.json')
PROMPTS = {
0:"Path: {0}\nDoes not exist. Create? (Y/N) ",
1:"Path: {0}\nFile: {1}\nFile exists... | mit |
sparkslabs/kamaelia_ | Sketches/PT/BouncingCatGame/Sprites/SpriteScheduler.py | 9 | 1929 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ve... | apache-2.0 |
skg-net/ansible | test/units/modules/network/nxos/test_nxos_config.py | 11 | 8373 | # (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 |
wolfier/incubator-airflow | airflow/contrib/operators/bigquery_table_delete_operator.py | 11 | 2706 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
trentm/python-jira-cli | python-suds-0.3.9/tests/public.py | 2 | 7152 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-2.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.5/django/contrib/auth/management/__init__.py | 70 | 6746 | """
Creates permissions for all installed apps that need permissions.
"""
from __future__ import unicode_literals
import getpass
import locale
import unicodedata
from django.contrib.auth import models as auth_app, get_user_model
from django.core import exceptions
from django.core.management.base import CommandError
f... | mit |
untitaker/vdirsyncer | tests/system/cli/test_discover.py | 1 | 5197 | import pytest
import json
from textwrap import dedent
from vdirsyncer import exceptions
from vdirsyncer.storage.base import Storage
def test_discover_command(tmpdir, runner):
runner.write_with_general(dedent('''
[storage foo]
type = "filesystem"
path = "{0}/foo/"
fileext = ".txt"
[storage ba... | mit |
frague59/xhtml2pdf | xhtml2pdf/context.py | 28 | 35124 | # -*- coding: utf-8 -*-
from reportlab.lib.enums import TA_LEFT
from reportlab.lib.fonts import addMapping
from reportlab.lib.pagesizes import landscape, A4
from reportlab.lib.styles import ParagraphStyle
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus.frame... | apache-2.0 |
JorgeCoock/django | tests/utils_tests/test_feedgenerator.py | 163 | 4306 | from __future__ import unicode_literals
import datetime
import unittest
from django.utils import feedgenerator
from django.utils.timezone import get_fixed_timezone
class FeedgeneratorTest(unittest.TestCase):
"""
Tests for the low-level syndication feed framework.
"""
def test_get_tag_uri(self):
... | bsd-3-clause |
HCastano/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | lgpl-2.1 |
kobotoolbox/kpi | kpi/deployment_backends/base_backend.py | 1 | 10244 | # coding: utf-8
import copy
import json
from typing import Union
from bson import json_util
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.pagination import _positive_int as positive_int
from shortuuid import ShortUUI... | agpl-3.0 |
rackergs/ansible-modules-extras | network/dnsmadeeasy.py | 77 | 13305 | #!/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 distributed... | gpl-3.0 |
ptphp/PyLib | src/dev/case/timethread.py | 1 | 2356 | # -*- coding:utf-8-*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from time import *
import sys
class Windows(QDialog):
def __init__(self, parent=None):
super(Windows, self).__init__(parent)
self.startButton = QPushButton("Start")
self.stopButton = QPushButton("Stop")
... | apache-2.0 |
watspidererik/testenv | flask/lib/python2.7/site-packages/whoosh/index.py | 73 | 24060 | # Copyright 2007 Matt Chaput. 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 and the... | mit |
mrknow/filmkodi | plugin.video.fanfilm/resources/lib/libraries/phdialogs.py | 38 | 5196 | # -*- coding: utf-8 -*-
'''
Phoenix Add-on
Copyright (C) 2015 Blazetamer
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) ... | apache-2.0 |
JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32com/test/testStreams.py | 21 | 4390 | import pythoncom
import win32com.server.util
import win32com.test.util
import unittest
from pywin32_testutil import str2bytes
class Persists:
_public_methods_ = [ 'GetClassID', 'IsDirty', 'Load', 'Save',
'GetSizeMax', 'InitNew' ]
_com_interfaces_ = [ pythoncom.IID_IPersistStreamInit ]... | gpl-2.0 |
thodoris/djangoPharma | djangoPharma/env/Lib/encodings/tis_620.py | 272 | 12300 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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,input,errors='st... | apache-2.0 |
nttks/edx-platform | openedx/core/djangoapps/course_groups/management/commands/tests/test_post_cohort_membership_fix.py | 32 | 4191 | """
Test for the post-migration fix commands that are included with this djangoapp
"""
from django.core.management import call_command
from django.test.client import RequestFactory
from openedx.core.djangoapps.course_groups.views import cohort_handler
from openedx.core.djangoapps.course_groups.cohorts import get_cohor... | agpl-3.0 |
pbmanis/acq4 | acq4/devices/AxoPatch200/devGuiTemplate_pyqt5.py | 3 | 1971 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'acq4/devices/AxoPatch200/devGuiTemplate.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_devGui(object):
def setupUi(self, de... | mit |
EnviroCentre/jython-upgrade | jython/lib/site-packages/setuptools/tests/__init__.py | 147 | 11160 | """Tests for the 'setuptools' package"""
import sys
import os
import distutils.core
import distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
from distutils.core import Extension
from distutils.version import LooseVersion
from setupto... | mit |
Hubert51/AutoGrading | learning/web_Haotian/venv/Lib/encodings/iso8859_4.py | 272 | 13376 | """ Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.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,input,errors='... | mit |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.5/django/contrib/localflavor/pl/forms.py | 110 | 7602 | """
Polish-specific form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.pl.pl_administrativeunits import ADMINISTRATIVE_UNIT_CHOICES
from django.contrib.localflavor.pl.pl_voivodeships import VOIVODESHIP_CHOICES
from django.core.validators import EMPTY_V... | mit |
gundalow/ansible | lib/ansible/plugins/action/service.py | 11 | 4549 | # (c) 2015, Ansible 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 di... | gpl-3.0 |
mysweet/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 |
feureau/Small-Scripts | Blender/Blender config/2.91/scripts/addons/mecafig/ui_templates/mecafig.py | 1 | 1372 | import bpy
from ..operators.mecafig import get_mecafig
from ..icons.__init__ import get_icon
def ui_template_mecafig(context, layout):
scene = context.scene
ob = context.active_object
data = scene.mecafig
mf = get_mecafig(context)
objects = []
for obj in bpy.data.objects:
if obj.type ... | gpl-3.0 |
ollej/GoldQuest | src/gqtelnetserver.py | 1 | 3167 | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2011 Olle Johansson
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,... | mit |
bala4901/odoo | addons/hr_payroll/hr_payroll.py | 32 | 50506 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
zuotingbing/spark | examples/src/main/python/mllib/summary_statistics_example.py | 128 | 1550 | #
# 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 |
nimbusproject/cloudinit.d | cloudinitd/__init__.py | 1 | 4360 | import logging
from cloudinitd.exceptions import *
#from cloudinitd.user_api import *
from cloudinitd.statics import *
import urlparse
service_state_initial = 0
service_state_launched = 2
service_state_contextualized = 4
service_state_terminated = 6
g_open_loggers = []
Version = "1.3"
def find_true():
cmds = [
... | apache-2.0 |
andreea-lucau/python-patterns | src/iterator/travel.py | 1 | 2144 | """Sample usage of the Iterator pattern."""
#!/usr/bin/env python
# pylint: disable=missing-docstring,too-few-public-methods
class Europe(object):
def __init__(self):
self._est = ["Romania", "Poland", "Ukraine"]
self._south = ["Greece", "Italy", "Spain"]
self._west = ["France", "UK", "Irel... | gpl-3.0 |
bhupennewalkar1337/erpnext | erpnext/patches/v7_0/rename_prevdoc_fields.py | 43 | 3368 | import frappe
import json
from frappe.model.utils.rename_field import update_reports, rename_field, update_property_setters
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
def execute():
frappe.reload_doctype('Purchase Order Item')
frappe.reload_doctype('Purchase Receipt Item')... | gpl-3.0 |
Sodki/ansible | lib/ansible/modules/network/ldap_entry.py | 28 | 9767 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Peter Sagerson <psagers@ignorare.net>
# (c) 2016, Jiri Tyr <jiri.tyr@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free So... | gpl-3.0 |
MJuddBooth/pandas | pandas/tests/io/msgpack/test_seq.py | 3 | 1171 | # coding: utf-8
import io
import pandas.io.msgpack as msgpack
binarydata = bytes(bytearray(range(256)))
def gen_binary_data(idx):
return binarydata[:idx % 300]
def test_exceeding_unpacker_read_size():
dumpf = io.BytesIO()
packer = msgpack.Packer()
NUMBER_OF_STRINGS = 6
read_size = 16
#... | bsd-3-clause |
spencerliechty/semaphore | semaphore/semaphore/settings.py | 2 | 5623 | # Django settings for semaphore project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', ... | mit |
ZECTBynmo/notnode-gyp | gyp/test/variants/gyptest-variants.py | 240 | 1315 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify handling of build variants.
TODO: Right now, only the SCons generator supports this, so the
test case is SCons-specific. In pa... | mit |
prarthitm/edxplatform | lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py | 23 | 13182 | """
Tests for the CyberSource processor handler
"""
from collections import OrderedDict
from django.test import TestCase
from django.test.utils import override_settings
from django.conf import settings
from student.tests.factories import UserFactory
from shoppingcart.models import Order, OrderItem
from shoppingcart.pro... | agpl-3.0 |
hackatbrown/2015.hackatbrown.org | hack-at-brown-2015/cssutils/css/cssstyledeclaration.py | 2 | 27181 | """CSSStyleDeclaration implements DOM Level 2 CSS CSSStyleDeclaration and
extends CSS2Properties
see
http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#parsing-errors
Unknown properties
------------------
User agents must ignore a declaration with an unknown property.
For example, if the style sheet is::
... | mit |
robbiet480/home-assistant | tests/components/html5/test_notify.py | 13 | 19013 | """Test HTML5 notify platform."""
import json
from aiohttp.hdrs import AUTHORIZATION
import homeassistant.components.html5.notify as html5
from homeassistant.const import HTTP_INTERNAL_SERVER_ERROR
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup import async_setup_component
from test... | apache-2.0 |
arnaud-morvan/QGIS | tests/src/python/test_qgsrastercolorrampshader.py | 24 | 1135 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorRampShader.
.. 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 the License, or
(at your option) any later version.
""... | gpl-2.0 |
GreenTeaDev/Lede | scripts/json_add_image_info.py | 4 | 1678 | #!/usr/bin/env python3
from os import getenv
from pathlib import Path
from sys import argv
import hashlib
import json
if len(argv) != 2:
print("ERROR: JSON info script requires output arg")
exit(1)
json_path = Path(argv[1])
bin_dir = Path(getenv("BIN_DIR"))
image_file = bin_dir / getenv("IMAGE_NAME")
if not... | gpl-2.0 |
mscook/SeqFindR | SeqFindr/config.py | 4 | 3886 | # Copyright 2013-2014 Mitchell Stanton-Cook Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# Unless required by ... | apache-2.0 |
grepme/CMPUT410Lab01 | virt_env/virt1/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/upload_docs.py | 65 | 6174 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's packages.python.org).
"""
import os
import socket
import zipfile
import httplib
import base64
import urlparse
import tempfile
import sys
from distutils import log
from distutils.errors import Distut... | apache-2.0 |
neumerance/cloudloon2 | .venv/lib/python2.7/site-packages/jsonschema/exceptions.py | 2 | 2791 | import collections
import pprint
import textwrap
from jsonschema import _utils
from jsonschema.compat import PY3, iteritems
_unset = _utils.Unset()
class _Error(Exception):
def __init__(
self, message, validator=_unset, path=(), cause=None, context=(),
validator_value=_unset, instance=_unset, s... | apache-2.0 |
youprofit/cobbler | cobbler/validate.py | 15 | 6446 | """
Copyright 2014-2015. Jorgen Maas <jorgen.maas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is d... | gpl-2.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/curses/has_key.py | 195 | 5634 |
#
# Emulation of has_key() function for platforms that don't use ncurses
#
import _curses
# Table mapping curses keys to the terminfo capability name
_capability_names = {
_curses.KEY_A1: 'ka1',
_curses.KEY_A3: 'ka3',
_curses.KEY_B2: 'kb2',
_curses.KEY_BACKSPACE: 'kbs',
_curses.KEY_BEG: 'kbeg',
... | lgpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | tools/memory_inspector/memory_inspector/classification/results_unittest.py | 109 | 2191 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import unittest
from memory_inspector.classification import results
from memory_inspector.classification import rules
class ResultsTest(unittest... | bsd-3-clause |
Limags/MissionPlanner | Lib/site-packages/numpy/distutils/command/config.py | 89 | 17058 | # Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
import os, signal
import warnings
import sys
from distutils.command.config import config as old_config
from dist... | gpl-3.0 |
seanli9jan/tensorflow | tensorflow/python/kernel_tests/compare_and_bitpack_op_test.py | 3 | 2444 | # 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 |
franosincic/edx-platform | common/djangoapps/util/markup.py | 8 | 1476 | """
Utilities for use in Mako markup.
"""
from django.utils.translation import ugettext as django_ugettext
from django.utils.translation import ungettext as django_ungettext
import markupsafe
# So that we can use escape() imported from here.
escape = markupsafe.escape # pylint: disable=invalid-n... | agpl-3.0 |
benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwcustomsettings.py | 3 | 3465 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
voxlol/scikit-learn | examples/ensemble/plot_gradient_boosting_oob.py | 230 | 4762 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... | bsd-3-clause |
nttks/edx-ora2 | openassessment/management/commands/simulate_ai_grading_error.py | 8 | 5417 | # -*- coding: utf-8 -*-
"""
Simulate failure of the worker AI grading tasks.
When the workers fail to successfully complete AI grading,
the AI grading workflow in the database will never be marked complete.
To simulate the error condition, therefore, we create incomplete
AI grading workflows without scheduling a gradi... | agpl-3.0 |
realsaiko/odoo | addons/l10n_mx/__openerp__.py | 379 | 2559 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# All Rights Reserved
###############Credits######################################################
# Coded by: Alejandro Negrin anegrin@vauxoo.com,
#... | agpl-3.0 |
40123247/2015cd_midterm | wsgi.py | 3 | 25678 | #@+leo-ver=5-thin
#@+node:2014fall.20141212095015.1775: * @file wsgi.py
# coding=utf-8
# 上面的程式內容編碼必須在程式的第一或者第二行才會有作用
################# (1) 模組導入區
# 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2014fall.20141212095015.1776: ** <<declar... | gpl-3.0 |
simonjpartridge/byeBias | lib/werkzeug/_compat.py | 448 | 6184 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... | apache-2.0 |
atareao/my-weather-indicator | src/weatherservice.py | 1 | 73577 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of my-weather-indicator
#
# Copyright (c) 2012 Lorenzo Carbonell Cerezo <a.k.a. atareao>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | mit |
azureplus/chromium_depot_tools | third_party/logilab/common/umessage.py | 86 | 6551 | # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | bsd-3-clause |
numba/numba | numba/cuda/tests/cudapy/test_idiv.py | 5 | 1056 | import numpy as np
from numba import cuda, float32, float64, int32, void
from numba.cuda.testing import unittest, CUDATestCase
class TestCudaIDiv(CUDATestCase):
def test_inplace_div(self):
@cuda.jit(void(float32[:, :], int32, int32))
def div(grid, l_x, l_y):
for x in range(l_x):
... | bsd-2-clause |
tailhook/aio-routes | aioroutes/http.py | 1 | 6022 | import asyncio
import logging
from operator import attrgetter
from urllib.parse import urlparse, parse_qsl
from http.cookies import SimpleCookie
from .util import cached_property
from .core import Context
from .core import ValueResolver, HierarchicalResolver
from .core import Scope, endpoint, resource
from .exceptions... | mit |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/linalg/_procrustes.py | 112 | 2375 | """
Solve the orthogonal Procrustes problem.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .decomp_svd import svd
__all__ = ['orthogonal_procrustes']
def orthogonal_procrustes(A, B, check_finite=True):
"""
Compute the matrix solution of the orthogonal Procrus... | mit |
SebKuzminsky/linuxcnc-mirror | lib/python/propertywindow.py | 38 | 1575 | # This is a component of emc2
# Copyright 2007 Jeff Epler <jepler@unpythonic.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at yo... | lgpl-2.1 |
yupeng820921/batch_send_email | server.py | 1 | 5007 | #! /usr/bin/env python
import os
import time
import sqlite3
import yaml
import re
import codecs
import logging
from flask import Flask, request, redirect, url_for, render_template, abort
from werkzeug import secure_filename
with open(u'%s/conf.yaml' % os.path.dirname(__file__), u'r') as f:
conf = yaml.safe_load(f... | gpl-3.0 |
joeyt83/androguard | androguard/core/bytecodes/libdvm/test_dvm.py | 38 | 2427 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2011, Anthony Desnos <desnos at t0t0.fr>
# 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
#
#... | apache-2.0 |
SiderZhang/p2pns3 | src/uan/bindings/callbacks_list.py | 150 | 1150 | callback_classes = [
['void', 'int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::Ptr<ns3... | gpl-2.0 |
EwgOskol/python_training | fixture/session.py | 1 | 1457 | __author__ = 'tester'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys("%s" % us... | apache-2.0 |
fluentpython/example-code | attic/objects/cards_format.py | 7 | 3271 | """
Test Suite formatting:
>>> Suite.spades
<Suite.spades: 0>
>>> print(Suite.spades)
Suite.spades
>>> format(Suite.spades)
'spades'
>>> format(Suite.spades, 's')
'spades'
>>> format(Suite.spades, 'S')
'Spades'
>>> format(Suite.spades, 'p')
'♠'
>>> format(Suite.spade... | mit |
petemounce/ansible | test/units/parsing/test_splitter.py | 181 | 3734 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@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, either version 3 of the License, or
# (at your o... | gpl-3.0 |
ovnicraft/openerp-restaurant | l10n_gt/__openerp__.py | 170 | 2385 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Soluciones Tecnologócias Prisma S.A. All Rights Reserved.
# José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A.
# (http://www.solucionesprisma.com)
#
# This program is ... | agpl-3.0 |
Pythonify/awesome | venv/lib/python2.7/site-packages/appdirs.py | 335 | 22374 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2010 ActiveState Software Inc.
# Copyright (c) 2013 Eddy Petrișor
"""Utilities for determining application-specific dirs.
See <http://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# ... | gpl-3.0 |
Kast0rTr0y/ansible | lib/ansible/modules/clustering/kubernetes.py | 35 | 15315 | #!/usr/bin/python
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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 o... | gpl-3.0 |
kemalakyol48/python-for-android | python3-alpha/python3-src/Lib/distutils/archive_util.py | 55 | 6579 | """distutils.archive_util
Utility functions for creating archive files (tarballs, zip files,
that sort of thing)."""
import os
from warnings import warn
import sys
try:
import zipfile
except ImportError:
zipfile = None
from distutils.errors import DistutilsExecError
from distutils.spawn import spawn
from d... | apache-2.0 |
viaict/viaduct | app/service/page_service.py | 1 | 1658 | from app import Roles
from app.repository import page_repository
from app.service import group_service, role_service
def set_read_page_permissions(page, new_groups):
current_groups = set(get_read_permission_groups_by_page(page))
new_groups = set(new_groups)
added_groups = new_groups - current_groups
... | mit |
adricnet/pyew | vtrace/archs/amd64.py | 27 | 1068 | """
Amd64 Support Module
"""
# Copyright (C) 2007 Invisigoth - See LICENSE file for details
import struct
import envi.archs.amd64 as e_amd64
import vtrace.archs.i386 as vt_i386
class Amd64Mixin(
e_amd64.Amd64Module,
e_amd64.Amd64RegisterContext,
vt_i386.i386WatchMixin):
"""
Do what we ... | gpl-2.0 |
lulandco/SickRage | lib/tornado/locale.py | 40 | 23777 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2009 Facebook
#
# 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 ... | gpl-3.0 |
henkvos/xhtml2pdf | xhtml2pdf/w3c/cssParser.py | 37 | 39947 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~ Copyright (C) 2002-2004 TechGame Networks, LLC.
##~
##~ This library is free software; you can redistribute it and/or
##~ modify it under the terms of the BSD style License as found in the
##~ LICENSE file included with this distribution.... | apache-2.0 |
jamesblunt/edx-platform | lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py | 110 | 18922 | # -*- 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):
# Adding field 'RegistrationCodeRedemption.course_enrollment'
db.add_column('shoppingcart_registrationcodere... | agpl-3.0 |
Jervelund/VendingMachinePython | vending_tweet.py | 2 | 7817 | #!/usr/bin/python
import sys
import time
import serial
from optparse import OptionParser, make_option
print "Loading twitter library"
execfile("twt.py")
from random import choice
sales = ['Sales are up 64% since last year!',
'With this rate, we\'re going to run out of stock soon!',
'All I do is - vend, vend, vend -... | mit |
Gateworks/platform-external-chromium_org | tools/telemetry/telemetry/page/page_measurement_results_unittest.py | 23 | 5823 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import unittest
from telemetry.page import page_measurement_results
from telemetry.page import page_set
from telemetry.page import perf_tests_h... | bsd-3-clause |
pantonov/serna-free | serna/dist/plugins/dita-examples/open_topicref.py | 5 | 2806 | ##
## Copyright(c) 2009 Syntext, Inc. All Rights Reserved.
## Contact: info@syntext.com, http://www.syntext.com
##
## This file is part of Syntext Serna XML Editor.
##
## COMMERCIAL USAGE
## Licensees holding valid Syntext Serna commercial licenses may use this file
## in accordance with the Syntext Serna Commercial... | gpl-3.0 |
CubicERP/odoo | addons/mrp/company.py | 381 | 1383 | # -*- 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 |
losnikitos/googleads-python-lib | examples/adwords/adwords_appengine_demo/handlers/api_handler.py | 4 | 8926 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
zoidbergwill/lint-review | lintreview/tools/jshint.py | 4 | 1404 | import logging
import os
from lintreview.tools import Tool
from lintreview.tools import run_command
from lintreview.utils import in_path
from lintreview.utils import npm_exists
log = logging.getLogger(__name__)
class Jshint(Tool):
name = 'jshint'
def check_dependencies(self):
"""
See if jsh... | mit |
RudoCris/horizon | openstack_dashboard/dashboards/project/data_processing/utils/workflow_helpers.py | 30 | 10029 | # 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 |
mrcslws/nupic.research | projects/whydense/computation_table.py | 3 | 5766 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2019, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and condition... | agpl-3.0 |
soerendip42/rdkit | rdkit/Chem/FeatMaps/FeatMapPoint.py | 6 | 3134 | # $Id$
#
# Copyright (C) 2006 Greg Landrum
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import Geometry
from rdkit import Chem
from ... | bsd-3-clause |
TeamExodus/external_chromium_org | build/android/gyp/create_device_library_links.py | 28 | 3543 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Creates symlinks to native libraries for an APK.
The native libraries should have previously been pushed to the device (in
option... | bsd-3-clause |
Distrotech/scons | test/Progress/function.py | 5 | 2224 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit |
edulramirez/nova | nova/tests/unit/virt/libvirt/volume/test_remotefs.py | 25 | 10045 | # Copyright 2014 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
manpreet9112/LibreHatti | src/tinymce/compressor.py | 10 | 4403 | """
Based on "TinyMCE Compressor PHP" from MoxieCode.
http://tinymce.moxiecode.com/
Copyright (c) 2008 Jason Davies
Licensed under the terms of the MIT License (see LICENSE.txt)
"""
from datetime import datetime
import os
import re
from django.conf import settings
from django.core.cache import cache
... | gpl-2.0 |
aneeshusa/servo | tests/wpt/harness/wptrunner/update/tree.py | 142 | 11075 | # 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 os
import re
import subprocess
from .. import vcs
from ..vcs import bind_to_repo, git, hg
def get_unique_name(... | mpl-2.0 |
wnkz/codebuilder | codebuilder/helpers/aws.py | 1 | 2878 | import os
import click
import boto3
import botocore
import dpath.util
import botocore.vendored.requests.packages.urllib3 as urllib3
urllib3.disable_warnings(urllib3.exceptions.SecurityWarning)
from base64 import b64decode
from .base import BaseHelper
# TODO: Better permissions checking
class AWSHelper(BaseHelper):... | mit |
dwaynebailey/pootle | pootle/apps/pootle_app/management/commands/list_languages.py | 10 | 1687 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
os.environ['DJANGO_SETTINGS_MODULE... | gpl-3.0 |
msabramo/pip | pip/_vendor/distlib/metadata.py | 427 | 38314 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... | mit |
akretion/account-financial-tools | account_journal_always_check_date/__openerp__.py | 6 | 2048 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Journal Always Check Date module for OpenERP
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free so... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.