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 |
|---|---|---|---|---|---|
aam-at/tensorflow | tensorflow/python/kernel_tests/xent_op_test.py | 5 | 15784 | # 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 |
alvaroaleman/ansible | lib/ansible/plugins/action/net_config.py | 6 | 4154 | #
# Copyright 2015 Peter Sprygada <psprygada@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 option) any... | gpl-3.0 |
bensternthal/bedrock | bedrock/mozorg/cron.py | 25 | 1085 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf import settings
from django.core.cache import cache
import cronjobs
import feedparser
from bedrock.mo... | mpl-2.0 |
marook/tagfs | src/test/tagfs_test_small/test_freebase_support_query.py | 2 | 1239 | #
# Copyright 2012 Markus Pielmeier
#
# This file is part of tagfs.
#
# tagfs 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.
#
# tagfs... | gpl-3.0 |
co63oc/p2pool | nattraverso/pynupnp/upnpxml.py | 288 | 3026 | """
This module parse an UPnP device's XML definition in an Object.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
from xml.dom import minidom
import logging
# Allowed UPnP services to use when ... | gpl-3.0 |
fredericlepied/ansible | lib/ansible/modules/cloud/amazon/ec2_scaling_policy.py | 72 | 7106 | #!/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 |
ChanChiChoi/scikit-learn | examples/ensemble/plot_adaboost_regression.py | 311 | 1529 | """
======================================
Decision Tree Regression with AdaBoost
======================================
A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D
sinusoidal dataset with a small amount of Gaussian noise.
299 boosts (300 decision trees) is compared with a single decision tr... | bsd-3-clause |
tangyiyong/odoo | openerp/addons/base/res/__init__.py | 384 | 1261 | # -*- 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 GNU... | agpl-3.0 |
bemehow/yum-s3-tools | scripts/find-package.py | 1 | 1355 | #!/usr/bin/env python
"""
Usage:
find-package.py --repourl=<repo-url> --package=<package-name> [--env|--iam] [--debug] [--filter=<filter>]
Attributes:
--repourl=<repourl> -r Repository URL eg. https://BUCKET_NAME.s3.amazonaws.com/cent6/
--package=<package-name> -p Package name to search for... | apache-2.0 |
tecan/xchat-rt | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/build/lib/supybot/plugins/Lart/plugin.py | 15 | 3812 | ###
# Copyright (c) 2005, Daniel DiPaolo
# 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 condition... | gpl-2.0 |
krishnab-datakind/mining-data-acquisition | data_gather/HandlerSetRadius.py | 1 | 1730 |
#!/usr/bin/python
"""
Handler for setting radius on the request.
"""
## MIT License
##
## Copyright (c) 2017, krishna bhogaonker
## 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 r... | mit |
detiber/ansible | lib/ansible/module_utils/database.py | 401 | 5839 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
dongjoon-hyun/tensorflow | tensorflow/python/layers/utils.py | 31 | 8695 | # 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 |
Adnn/django | django/core/management/commands/dbshell.py | 467 | 1192 | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
def add... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/estimator/python/estimator/baseline_test.py | 9 | 15538 | # 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 |
Konubinix/lazygal | lazygal/generators.py | 1 | 35055 | # Lazygal, a lazy static web gallery generator.
# Copyright (C) 2007-2012 Alexandre Rossi <alexandre.rossi@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 Li... | gpl-2.0 |
linked67/p2pool-cryptcoin | p2pool/util/graph.py | 226 | 7325 | from __future__ import absolute_import
from __future__ import division
import math
from p2pool.util import math as math2
class DataViewDescription(object):
def __init__(self, bin_count, total_width):
self.bin_count = bin_count
self.bin_width = total_width/bin_count
def _shift(x, shift, pad_item... | gpl-3.0 |
shawnadelic/shuup | shuup/admin/modules/products/views/list.py | 1 | 2246 | # -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.db.models import Q
from... | agpl-3.0 |
alobbs/ansible | samples/multi_queues.py | 38 | 4867 | #!/usr/bin/env python
import sys
import time
import Queue
import traceback
import multiprocessing
from ansible.inventory import Inventory
from ansible.inventory.host import Host
from ansible.playbook.play import Play
from ansible.playbook.task import Task
from ansible.executor.connection_info import ConnectionInforma... | gpl-3.0 |
manahl/pytest-plugins | pytest-pyramid-server/setup.py | 1 | 1728 | import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from setuptools import setup
from common_setup import common_setup
classifiers = [
'License :: OSI Approved :: MIT License',
'Development Status :: 5 - Production/Stable',
'Topic :: Software Development :: Libraries',
'To... | mit |
jorik041/scrapy | scrapy/contrib/linkextractors/lxmlhtml.py | 14 | 4121 | """
Link extractor based on lxml.html
"""
import re
from six.moves.urllib.parse import urlparse, urljoin
import lxml.etree as etree
from scrapy.selector import Selector
from scrapy.link import Link
from scrapy.utils.misc import arg_to_iter
from scrapy.utils.python import unique as unique_list, str_to_unicode
from sc... | bsd-3-clause |
aperigault/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 38 | 12535 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
raghavs1108/DataPlotter | pyqtgraph/util/cprint.py | 38 | 3028 | """
Cross-platform color text printing
Based on colorama (see pyqtgraph/util/colorama/README.txt)
"""
import sys, re
from .colorama.winterm import WinTerm, WinColor, WinStyle
from .colorama.win32 import windll
from ..python2_3 import basestring
_WIN = sys.platform.startswith('win')
if windll is not None:
winterm... | mit |
robovm/robovm-studio | python/testData/inspections/PyTypeCheckerInspection/Generator.py | 25 | 3013 | def test():
def gen(n):
for x in xrange(n):
yield str(x)
def f_1(xs):
"""
:type xs: list of int
"""
return xs
def f_2(xs):
"""
:type xs: collections.Sequence of int
"""
return xs
def f_3(xs):
"""
:type xs... | apache-2.0 |
gslate-cm9/android_kernel_lge_v909 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
mleinart/graphite-web | webapp/graphite/remote_storage.py | 8 | 8672 | import socket
import time
import httplib
from urllib import urlencode
from threading import Lock, Event
from django.conf import settings
from django.core.cache import cache
from graphite.node import LeafNode, BranchNode
from graphite.intervals import Interval, IntervalSet
from graphite.readers import FetchInProgress
fr... | apache-2.0 |
dwf/numpy | doc/sphinxext/docscrape.py | 68 | 15425 | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from StringIO import StringIO
from warnings import warn
class Reader(object):
"""A line-based string reader.
"""
def __init__(self, data):
"""
Parameters
-----... | bsd-3-clause |
sargas/scipy | scipy/signal/cont2discrete.py | 1 | 5015 | """
Continuous to discrete transformations for state-space and transfer function.
"""
from __future__ import division, print_function, absolute_import
# Author: Jeffrey Armstrong <jeff@approximatrix.com>
# March 29, 2011
import numpy as np
from scipy import linalg
from .ltisys import tf2ss, ss2tf, zpk2ss, ss2zpk
__... | bsd-3-clause |
RobertWWong/WebDev | djangoApp/ENV/lib/python3.5/site-packages/django/contrib/auth/tokens.py | 45 | 2862 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | mit |
maleficarium/youtube-dl | test/test_write_annotations.py | 18 | 2547 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import get_params, try_rm
import io
import xml.etree.ElementTree
import youtu... | unlicense |
TaliesinSkye/evennia | contrib/procpools/ampoule/pool.py | 6 | 15205 | import time
import random
import heapq
import itertools
import signal
choice = random.choice
now = time.time
count = itertools.count().next
pop = heapq.heappop
from twisted.internet import defer, task, error
from twisted.python import log, failure
from contrib.procpools.ampoule import commands, main
try:
DIE = s... | bsd-3-clause |
x13n/contrib | keepalived-vip/vendor/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
FusionWorks/adam | bin/append_to_option.py | 18 | 1630 | #!/usr/bin/env python
#
# Licensed to Big Data Genomics (BDG) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The BDG licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); yo... | apache-2.0 |
apache-spark-on-k8s/spark | examples/src/main/python/pi.py | 14 | 1468 | from __future__ import print_function
#
# 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... | apache-2.0 |
fake-name/ReadableWebProxy | sqlalchemy_continuum_vendored/relationship_builder.py | 2 | 12507 | import sqlalchemy as sa
from .exc import ClassNotVersioned
from .expression_reflector import VersionExpressionReflector
from .operation import Operation
from .table_builder import TableBuilder
from .utils import adapt_columns, version_class, option
class RelationshipBuilder(object):
def __init__(self, versioning... | bsd-3-clause |
pyramania/scipy | scipy/integrate/tests/test_quadrature.py | 40 | 8072 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import cos, sin, pi
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_almost_equal, assert_allclose, assert_
from scipy.integrate import (quadrature, romberg, romb, newton_cote... | bsd-3-clause |
amwelch/a10sdk-python | a10sdk/core/A10_file/file_debug_monitor.py | 2 | 1972 | from a10sdk.common.A10BaseClass import A10BaseClass
class DebugMonitor(A10BaseClass):
""" :param action: {"optional": true, "enum": ["create", "import", "export", "copy", "rename", "check", "replace", "delete"], "type": "string", "description": "'create': create; 'import': import; 'export': export; 'copy'... | apache-2.0 |
nemith/Marlin-BigBoxPro | Marlin/scripts/g29_auto.py | 184 | 4842 | #!/usr/bin/python3
# This file is for preprocessing gcode and the new G29 Autobedleveling from Marlin
# It will analyse the first 2 Layer and return the maximum size for this part
# After this it will replace with g29_keyword = ';MarlinG29Script' with the new G29 LRFB
# the new file will be created in the same folder.... | gpl-3.0 |
partofthething/home-assistant | homeassistant/components/bmw_connected_drive/lock.py | 4 | 3564 | """Support for BMW car locks with BMW ConnectedDrive."""
import logging
from bimmer_connected.state import LockState
from homeassistant.components.lock import LockEntity
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
from . import DOMAIN as BMW_DOMAIN, BMWConnectedDriveBaseEntity
from .const import CON... | mit |
tjsavage/tmrwmedia | django/db/utils.py | 16 | 5970 | import inspect
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
DEFAULT_DB_ALIAS = 'default'
# Define some exceptions that mirror the PEP249 interface.
# We will rethrow any backend-specific errors using these
# common... | bsd-3-clause |
rgacogne/pdns | build-scripts/docker/repo-test/generate-repo-files.py | 6 | 8620 | #!/usr/bin/env python3
#
# Given Python's versioning history I'm going with `python3`.
#
# Usage:
# - `python3 -m venv venv`
# - `bash`
# - `source venv/bin/activate`
# - `pip install --upgrade pip`
# - `pip install -r requirements.txt`
# - `./generate-repo-files.py auth-41`
# Modules
import argparse
import subproces... | gpl-2.0 |
jmacmahon/invenio | modules/bibformat/lib/elements/bfe_url.py | 16 | 1467 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License,... | gpl-2.0 |
QGuLL/samba | python/samba/tests/__init__.py | 18 | 12737 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-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 opti... | gpl-3.0 |
cprov/snapcraft | tests/unit/plugins/test_catkin_tools.py | 2 | 8676 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
aaltay/beam | sdks/python/apache_beam/runners/worker/bundle_processor.py | 1 | 71716 | #
# 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 |
cervinko/calibre-web | vendor/requests/packages/chardet/mbcssm.py | 982 | 19608 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
new-xiaji/peewee | playhouse/tests/test_read_slave.py | 19 | 4913 | from peewee import *
from peewee import Using
from playhouse.read_slave import ReadSlaveModel
from playhouse.tests.base import database_initializer
from playhouse.tests.base import ModelTestCase
queries = []
def reset():
global queries
queries = []
class QueryLogDatabase(SqliteDatabase):
name = ''
... | mit |
philsch/ansible | lib/ansible/modules/windows/win_unzip.py | 5 | 4047 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Phil Schwartz <schwartzmx@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 Software Foundation, either version 3 of the ... | gpl-3.0 |
tkaitchuck/nupic | external/common/lib/python2.6/site-packages/logilab/common/registry.py | 2 | 41325 | # 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... | gpl-3.0 |
abhinavmoudgil95/root | documentation/primer/macros/runall.py | 67 | 1051 | #! /usr/bin/env python
macros = [\
"slits.C",
"write_ntuple_to_file_advanced.C",
"write_ntuple_to_file.C",
"write_to_file.C",
"ExampleMacro.C",
"ExampleMacro_GUI.C",
"makeMySelector.C",
"RunMySelector.C",
"macro1.C",
"macro2.C",
"macro3.C",
"macro4.C",
"macro5.C",
"macro6.C",
"macro7.C",
"macro8.C",
"macro9.C",
"read_... | lgpl-2.1 |
richbs/colourlens | colourlens/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
joariasl/odoo | addons/sale_order_dates/sale_order_dates.py | 223 | 5308 | # -*- 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 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/pyasn1/pyasn1/type/namedval.py | 200 | 1605 | # ASN.1 named integers
from pyasn1 import error
__all__ = [ 'NamedValues' ]
class NamedValues:
def __init__(self, *namedValues):
self.nameToValIdx = {}; self.valToNameIdx = {}
self.namedValues = ()
automaticVal = 1
for namedValue in namedValues:
if isinstance(na... | lgpl-3.0 |
FreakJoe/cryptolockpy | cryptolock/SecureDatabase.py | 1 | 2510 | """Provides an interface for interaction with the encrypted sqlite database"""
from cryptolock.Database import Database
from cryptolock.security import encrypt, decrypt, ensure_key_validity
from cryptolock.exceptions import DocumentNotFoundException
from config import DB_NAME
class SecureDatabase(object):
"""Inte... | mit |
neilLasrado/frappe | frappe/utils/doctor.py | 9 | 3574 | from __future__ import unicode_literals, print_function
import frappe.utils
from collections import defaultdict
from rq import Worker, Connection
from frappe.utils.background_jobs import get_redis_conn, get_queue, get_queue_list
from frappe.utils.scheduler import is_scheduler_disabled
from six import iteritems
def ge... | mit |
epfl-lts2/pygsp | examples/random_walk.py | 1 | 1806 | r"""
Random walks
============
Probability of a random walker to be on any given vertex after a given number
of steps starting from a given distribution.
"""
# sphinx_gallery_thumbnail_number = 2
import numpy as np
from scipy import sparse
from matplotlib import pyplot as plt
import pygsp as pg
N = 7
steps = [0, 1,... | bsd-3-clause |
a-parhom/edx-platform | openedx/core/djangoapps/content/course_overviews/tasks.py | 17 | 1815 | import logging
from celery import task
from celery_utils.persist_on_failure import LoggedPersistOnFailureTask
from django.conf import settings
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from openedx.core.djangoapps.content.course_overviews.models import CourseOvervi... | agpl-3.0 |
dyyi/moneybook | venv/Lib/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | apache-2.0 |
jnayak1/osf.io | website/conferences/model.py | 5 | 2592 | # -*- coding: utf-8 -*-
import bson
from modularodm import fields, Q
from modularodm.exceptions import ModularOdmException
from framework.mongo import StoredObject
from website.conferences.exceptions import ConferenceError
DEFAULT_FIELD_NAMES = {
'submission1': 'poster',
'submission2': 'talk',
'submissio... | apache-2.0 |
tjanez/ansible | lib/ansible/plugins/callback/timer.py | 168 | 1125 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from datetime import datetime
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
This callback module tells you how long your plays ran for.
"""
... | gpl-3.0 |
ayoubg/gem5-graphics | gem5-gpu/tests/configs/gem5-gpu-ruby.py | 1 | 7700 | # Copyright (c) 2006-2008 The Regents of The University of Michigan
# Copyright (c) 2012-2015 Mark D. Hill and David A. Wood
# 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 so... | bsd-3-clause |
40223239/cdb0622 | static/Brython3.1.1-20150328-091302/Lib/linecache.py | 785 | 3864 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... | gpl-3.0 |
albertomurillo/ansible | lib/ansible/modules/cloud/amazon/lambda.py | 30 | 22661 | #!/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 |
RedHatQE/cfme_tests | cfme/tests/control/test_control_simulation.py | 1 | 1824 | import pytest
from cfme import test_requirements
from cfme.infrastructure.provider import InfraProvider
from cfme.markers.env_markers.provider import ONE_PER_CATEGORY
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
pytest.mark.long_running,
pytest.mark.provider(classes=[InfraPro... | gpl-2.0 |
kmmartins/xbmc | addons/service.xbmc.versioncheck/lib/aptdeamonhandler.py | 177 | 3661 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 later versio... | gpl-2.0 |
jeffreyzli/pokerbot-2017 | MiniTourn_Triple/GameData.py | 1 | 15989 | import HandRankings as Hand
from deuces.deuces import Card, Evaluator
class GameData:
def __init__(self, name, opponent_name, stack_size, bb):
# match stats
self.name = name
self.opponent_name = opponent_name
self.starting_stack_size = int(stack_size)
self.num_hands = 0
... | mit |
JCA-Developpement/Odoo | addons/project_issue/project_issue.py | 5 | 31214 | #-*- 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 |
jonathan-beard/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/factories.py | 34 | 21631 | """
Factories for use in tests of XBlocks.
"""
import functools
import pymongo.message
import threading
import traceback
from collections import defaultdict
from decorator import contextmanager
from uuid import uuid4
from factory import Factory, Sequence, lazy_attribute_sequence, lazy_attribute
from factory.container... | agpl-3.0 |
wbthomason/minigrade | minigrade.py | 1 | 17857 | from flask import Flask, render_template, request, jsonify, Response, abort, session, stream_with_context, redirect, g
from ast import literal_eval
import subprocess
import re
import requests
import json
import shutil
import time
import os
import sqlite3
import logging
import sys
import commands
import threading
minig... | mit |
GehenHe/Recognize-Face-on-Android | tensorflow/python/training/sync_replicas_optimizer_test.py | 13 | 11344 | # 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 |
hefen1/chromium | tools/perf/benchmarks/benchmark_smoke_unittest.py | 15 | 4441 | # 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.
"""Run the first page of one benchmark for every module.
Only benchmarks that have a composable measurement are included.
Ideally this test would be compreh... | bsd-3-clause |
chromium/web-page-replay | third_party/dns/rdtypes/keybase.py | 248 | 5017 | # Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
nwjs/chromium.src | chrome/browser/vr/PRESUBMIT.py | 3 | 1328 | # Copyright 2017 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.
"""Presubmit script for changes affecting chrome/browser/vr
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details abo... | bsd-3-clause |
zalando/patroni | patroni/api.py | 1 | 40300 | import base64
import hmac
import json
import logging
import psycopg2
import time
import traceback
import dateutil.parser
import datetime
import os
import six
import socket
import sys
from ipaddress import ip_address, ip_network as _ip_network
from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from... | mit |
mmazanec22/too-windy | env/lib/python3.5/site-packages/pip/_vendor/lockfile/linklockfile.py | 536 | 2652 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class LinkLockFile(LockBase):
"""Lock access to a file using atomic property of link(2).
>>> lock = LinkLockFile('somefile')
>>> lock = Link... | gpl-3.0 |
heke123/chromium-crosswalk | third_party/pylint/pylint/checkers/design_analysis.py | 59 | 14962 | # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | bsd-3-clause |
sve-odoo/odoo | addons/mrp/mrp.py | 9 | 64294 | # -*- 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 |
leeseuljeong/leeseulstack_neutron | neutron/neutron_plugin_base_v2.py | 17 | 14715 | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
wooga/airflow | airflow/api/auth/backend/kerberos_auth.py | 5 | 5597 | # 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 |
patsissons/Flexget | flexget/plugins/plugin_spy_headers.py | 23 | 4220 | from __future__ import unicode_literals, division, absolute_import
import logging
import urllib2
import httplib
import socket
from flexget import plugin
from flexget.event import event
log = logging.getLogger('spy_headers')
class CustomHTTPConnection(httplib.HTTPConnection):
def __init__(self, *args, **kwargs)... | mit |
avanzosc/avanzosc6.1 | avanzosc_stock_invoice_pesamod/__init__.py | 1 | 1095 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Avanzosc - Avanced Open Source Consulting
# Copyright (C) 2011 - 2012 Avanzosc <http://www.avanzosc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
jdemaeyer/scrapy | tests/test_crawl.py | 14 | 10928 | import json
import socket
import logging
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.http import Request
from scrapy.crawler import CrawlerRunner
from scrapy.utils.python import to_unicode
from tests import mock
from tests.spiders impo... | bsd-3-clause |
nilsgrabbert/spark | examples/src/main/python/mllib/naive_bayes_example.py | 106 | 2285 | #
# 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 |
tdfischer/protobuf | python/google/protobuf/internal/decoder.py | 223 | 26136 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
jfhumann/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | mpl-2.0 |
UBERMALLOW/external_skia | tools/jsondiff.py | 67 | 7458 | #!/usr/bin/python
'''
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
'''
Gathers diffs between 2 JSON expectations files, or between actual and
expected results within a single JSON actual-results file,
and generates an old-vs-new diff... | bsd-3-clause |
flyballlabs/threatdetectionservice | api/venv/lib/python2.7/site-packages/pip/_vendor/colorama/ansitowin32.py | 450 | 9668 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
winterm = WinTerm()
def ... | apache-2.0 |
RNAcentral/rnacentral-webcode | rnacentral/portal/models/ensembl_karyotype.py | 1 | 1093 | """
Copyright [2009-2017] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | apache-2.0 |
staslev/incubator-beam | sdks/python/apache_beam/runners/dataflow/internal/clients/dataflow/message_matchers.py | 9 | 4292 | #
# 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 |
fevxie/odoo | addons/crm_helpdesk/__init__.py | 442 | 1081 | # -*- 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 |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.5-beta1/content/Lib/fractions.py | 252 | 22390 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... | gpl-3.0 |
vanessajurtz/lasagne4bio | peptide_MHCII/scripts/seq2bl.py | 1 | 7560 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import subprocess
import sys
import os
import numpy as np
from scipy.io import netcdf
##########################################################################
# FUNCTIONS
###################################################################... | gpl-3.0 |
wonder-sk/QGIS | python/plugins/processing/algs/lidar/lastools/lasnoise.py | 5 | 4112 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lasnoise.py
---------------------
Date : September 2013 and May 2016
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
***... | gpl-2.0 |
nickofbh/kort2 | app/startup/init_app.py | 1 | 1559 | from flask.ext.security import Security, SQLAlchemyUserDatastore
from flask.ext.social import Social, SQLAlchemyConnectionDatastore
from logging.handlers import SMTPHandler
import logging
def init_error_logger_with_email_handler(app):
"""
Initialize a logger to send emails on error-level messages.
Unhandl... | mit |
t-tran/libcloud | libcloud/common/buddyns.py | 24 | 2400 | # 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 |
tobykurien/MakerDroid | assetsrc/pycam.mp3/src/pycam/Exporters/GCodeExporter.py | 1 | 13911 | # -*- coding: utf-8 -*-
"""
$Id: GCodeExporter.py 1092 2011-06-13 14:40:56Z sumpfralle $
Copyright 2010-2011 Lars Kruse <devel@sumpfralle.de>
Copyright 2008-2009 Lode Leroy
This file is part of PyCAM.
PyCAM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License a... | gpl-3.0 |
detrout/pykolab | pykolab/setup/setup_imap.py | 1 | 7351 | # -*- coding: utf-8 -*-
# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com)
#
# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.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 ... | gpl-3.0 |
hoosteeno/mozillians | vendor-local/lib/python/rest_framework/tests/test_serializer_bulk_update.py | 21 | 8866 | """
Tests to cover bulk create and update using serializers.
"""
from __future__ import unicode_literals
from django.test import TestCase
from rest_framework import serializers
class BulkCreateSerializerTests(TestCase):
"""
Creating multiple instances using serializers.
"""
def setUp(self):
c... | bsd-3-clause |
listingmirror/boto | boto/kms/exceptions.py | 135 | 1523 | # The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
# ITY, FITNESS FOR A PARTICULAR PURPOS... | mit |
jtaghiyar/kronos | kronos/kronos.py | 1 | 9365 | """
Created on Mar 10, 2014
@author: jtaghiyar
"""
import os
import subprocess as sub
from kronos_version import kronos_version
from utils import Pipeline
from helpers import make_dir, Configurer
from workflow_manager import WorkFlow, WorkFlowManager
from plumber import Plumber
from string import Template
from tempfi... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.