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 |
|---|---|---|---|---|---|
centrofermi/e3pipe | tracking/E3FittingTool2dUnweighted.py | 1 | 2330 | #!/usr/bin/env python
# *********************************************************************
# * Copyright (C) 2015 Luca Baldini (luca.baldini@pi.infn.it) *
# * *
# * For the license terms see the file LICENSE, distributed *
# * along ... | gpl-3.0 |
v-iam/azure-sdk-for-python | azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py | 4 | 2416 | # 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 |
shelbycruver/real-python-test | env/lib/python2.7/site-packages/pip/_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-2.0 |
khalibartan/Antidote-DM | Antidotes DM/youtube_dl/extractor/ro220.py | 176 | 1451 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
class Ro220IE(InfoExtractor):
IE_NAME = '220.ro'
_VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
_TEST = {
'url': ... | gpl-2.0 |
olasitarska/django | django/db/models/sql/subqueries.py | 15 | 10496 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.conf import settings
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.query_utils import Q
from django.db.models.constants import LOOKUP_SEP
from django.db.models.fi... | bsd-3-clause |
Edraak/edraak-platform | cms/djangoapps/contentstore/tests/test_course_create_rerun.py | 14 | 7173 | """
Test view handler for rerun (and eventually create)
"""
import datetime
import ddt
from django.urls import reverse
from django.test.client import RequestFactory
from mock import patch
from opaque_keys.edx.keys import CourseKey
from contentstore.tests.utils import AjaxEnabledTestClient, parse_json
from student.rol... | agpl-3.0 |
jaggu303619/asylum-v2.0 | openerp/addons/hr/__openerp__.py | 54 | 2515 | # -*- 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 |
wangyum/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/onehot_categorical_test.py | 89 | 10643 | # 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 |
decvalts/iris | docs/iris/src/sphinxext/generate_package_rst.py | 3 | 9320 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/sphinx/util/i18n.py | 1 | 10576 | """
sphinx.util.i18n
~~~~~~~~~~~~~~~~
Builder superclass for all builders.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import gettext
import os
import re
import warnings
from collections import namedtuple
from datetime import datetim... | mit |
ojengwa/sympy | sympy/logic/boolalg.py | 2 | 41626 | """
Boolean algebra module for SymPy
"""
from __future__ import print_function, division
from collections import defaultdict
from itertools import product, islice
from sympy.core.basic import Basic
from sympy.core.cache import cacheit
from sympy.core.numbers import Number
from sympy.core.decorators import deprecated
... | bsd-3-clause |
KaranToor/MA450 | google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/gs/test_storage_uri.py | 135 | 6558 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Google, Inc.
# All rights reserved.
#
# 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 rig... | apache-2.0 |
dvhbru/dvhb-hybrid | dvhb_hybrid/mailer/django.py | 1 | 2561 | import base64
from concurrent.futures import ThreadPoolExecutor
from django.core import mail
from . import base
class DjangoConnection(base.BaseConnection):
def __init__(self, loop, conf, **kwargs):
super().__init__(**kwargs)
self.loop = loop
self.executor = ThreadPoolExecutor(max_worker... | mit |
felipenaselva/felipe.repository | script.module.resolveurl/lib/resolveurl/plugins/grifthost.py | 3 | 1209 | """
grifthost resolveurl plugin
Copyright (C) 2015 tknorris
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 version.
This program is di... | gpl-2.0 |
aidan-/ansible-modules-extras | cloud/vmware/vmware_dvs_portgroup.py | 31 | 6867 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | gpl-3.0 |
crossbario/autobahn-python | examples/twisted/wamp/pubsub/basic/backend.py | 3 | 2100 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
jayceyxc/hue | desktop/core/ext-py/Django-1.6.10/django/db/models/aggregates.py | 114 | 2601 | """
Classes to represent the definitions of aggregate functions.
"""
from django.db.models.constants import LOOKUP_SEP
def refs_aggregate(lookup_parts, aggregates):
"""
A little helper method to check if the lookup_parts contains references
to the given aggregates set. Because the LOOKUP_SEP is contained i... | apache-2.0 |
CDrummond/cantata | icons/yaru/render-bitmaps.py | 2 | 6913 | #!/usr/bin/python3
#
# This file has been take from Suru, and modified to just generate cantata icons
#
# ------------8<----------
# Legal Stuff:
#
# This file is part of the Suru Icon Theme and 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 |
klmitch/nova | nova/policies/extensions.py | 3 | 1318 | # Copyright 2016 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 |
andrejb/cloudant_bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Options/__init__.py | 61 | 2667 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
rtruxal/metagoofil | pdfminer/pdffont.py | 32 | 26471 | #!/usr/bin/env python2
import sys
import struct
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from cmapdb import CMapDB, CMapParser, FileUnicodeMap, CMap
from encodingdb import EncodingDB, name2unicode
from psparser import PSStackParser
from psparser import PSSyntaxError,... | gpl-2.0 |
xkfz007/binutils-gdb | gdb/copyright.py | 19 | 11540 | #! /usr/bin/env python
# Copyright (C) 2011-2015 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
# 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, ... | gpl-2.0 |
lmiccini/sos | sos/plugins/lvm2.py | 5 | 3024 | # 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 distributed in the hope that it will be useful,
# but... | gpl-2.0 |
vthorsteinsson/tensor2tensor | tensor2tensor/models/research/transformer_aux.py | 1 | 5657 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
mitchelljkotler/django | django/contrib/staticfiles/views.py | 581 | 1329 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.contrib.staticfiles import finders
from django.http import Http404
from django.utils.six.moves.url... | bsd-3-clause |
bluemini/kuma | vendor/packages/pygments/lexers/__init__.py | 73 | 8735 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping ... | mpl-2.0 |
hrjn/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 33 | 20167 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
jarn0ld/gnuradio | gr-vocoder/python/vocoder/qa_g721_vocoder.py | 57 | 1573 | #!/usr/bin/env python
#
# Copyright 2011,2013 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 optio... | gpl-3.0 |
GGFHF/NGScloud | Package/gdialogs.py | 1 | 44030 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
'''
This software has been developed by:
GI Genética, Fisiología e Historia Forestal
Dpto. Sistemas y Recursos Naturales
ETSI Montes, Forestal y del Medio Natural
Universida... | gpl-3.0 |
xen0l/ansible | lib/ansible/modules/remote_management/ucs/ucs_ntp_server.py | 11 | 4688 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
basepi/hubble | hubblestack/files/hubblestack_nova/misc.py | 2 | 45373 | # -*- encoding: utf-8 -*-
'''
Hubble Nova plugin for running miscellaneous one-off python functions to
run more complex nova audits without allowing arbitrary command execution
from within the yaml profiles.
Sample YAML data, with inline comments:
# Top level key lets the module know it should look at this data
misc:... | apache-2.0 |
sschiau/swift | utils/swift-bench.py | 28 | 15119 | #!/usr/bin/env python
# ===--- swift-bench.py ------------------------------*- coding: utf-8 -*-===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https... | apache-2.0 |
jumpstarter-io/nova | nova/cmd/api_ec2.py | 26 | 1537 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/test/test_scope.py | 114 | 15536 | import unittest
from test.test_support import check_syntax_error, check_py3k_warnings, \
check_warnings, run_unittest
class ScopeTests(unittest.TestCase):
def testSimpleNesting(self):
def make_adder(x):
def adder(y):
return x + y
retu... | gpl-3.0 |
fevangelou/namebench | nb_third_party/dns/query.py | 215 | 15983 | # Copyright (C) 2003-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 |
mne-tools/mne-python | mne/viz/circle.py | 14 | 15879 | """Functions to plot on circle as for connectivity."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: Simplified BSD
from itertools import cycle
from functools import partial
import ... | bsd-3-clause |
seaotterman/tensorflow | tensorflow/contrib/factorization/python/ops/clustering_ops.py | 22 | 25599 | # 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 |
xzturn/tensorflow | tensorflow/python/data/kernel_tests/optional_test.py | 4 | 19765 | # Copyright 2018 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 |
40123248/w16b_test | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/constants.py | 603 | 15297 | #!/usr/bin/env python
'''Constants defined by SDL, and needed in pygame.
Note that many of the flags for SDL are not needed in pygame, and are not
included here. These constants are generally accessed from the
`pygame.locals` module. This module is automatically placed in the pygame
namespace, but you will usually ... | gpl-3.0 |
alfonsokim/nupic | examples/opf/experiments/params/EnsembleOnline.py | 10 | 15348 | import random
import multiprocessing
import numpy as np
from nupic.frameworks.opf import helpers
from nupic.frameworks.opf.client import Client
from random import shuffle
from random import randrange, uniform
import copy
windowSize=36
r=30
predictedField='pounds'
inertia=0.25
socRate=1.0
class Worker(multiprocessing.P... | agpl-3.0 |
Iconik/eve-suite | src/model/static/map/constellation.py | 1 | 1590 | from model.flyweight import Flyweight
from model.static.database import database
class Constellation(Flyweight):
def __init__(self, constellation_id):
#prevents reinitializing
if "_inited" in self.__dict__:
return
self._inited = None
#prevents reinitializing
sel... | gpl-3.0 |
blois/AndroidSDKCloneMin | ndk/prebuilt/linux-x86_64/lib/python2.7/mailbox.py | 64 | 80751 | #! /usr/bin/env python
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method. See functions _sync_flush() and
# _sync_close().
import sys
im... | apache-2.0 |
ElectroweakGroup/Database_Extraction_Tool | Main.py | 1 | 1572 | import IsotopeDataExporting as ided
import os
import glob
import time
import sys
import renormalize as renorm
def function(option):
#Exports data requested by the user into text files (necessary to generate plots)
userInput = ided.datExp(option,True,True)
#Prints the user input allowing user to make su... | mit |
javierder/dogestart.me | django/db/models/fields/files.py | 105 | 15978 | import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils.encoding import force_str, for... | mit |
GenericStudent/home-assistant | homeassistant/components/cast/home_assistant_cast.py | 9 | 2387 | """Home Assistant Cast integration for Cast."""
from typing import Optional
from pychromecast.controllers.homeassistant import HomeAssistantController
import voluptuous as vol
from homeassistant import auth, config_entries, core
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.helpers import config_v... | apache-2.0 |
Jgarcia-IAS/localizacion | openerp/addons/base/tests/test_osv.py | 446 | 4722 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
apache/airflow | airflow/sentry.py | 2 | 6613 | #
# 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... | apache-2.0 |
teltek/edx-platform | openedx/core/djangoapps/user_api/management/tests/test_bulk_rehash_retired_usernames.py | 6 | 6666 | """
Test the bulk_rehash_retired_usernames management command
"""
from mock import call, patch
import pytest
from django.conf import settings
from django.core.management import call_command
from user_util.user_util import get_retired_username
from lms.lib import comment_client
from openedx.core.djangoapps.user_api.ac... | agpl-3.0 |
teddym6/qualitybots | src/appengine/handlers/config_handler.py | 26 | 2465 | #!/usr/bin/python2.4
#
# Copyright 2011 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... | apache-2.0 |
posterior/loom | loom/test/test_posterior_enum.py | 2 | 26903 | # Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
# Copyright (c) 2015, Google, Inc.
#
# 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
... | bsd-3-clause |
TeamHG-Memex/frontera | examples/scripts/09_frontier_backends.py | 8 | 1052 | """
Test different frontier backends
"""
from frontera import FrontierManager, Settings, FrontierTester, graphs
def test_logic(backend):
# Graph
graph = graphs.Manager('sqlite:///data/graph.db')
# Frontier
settings = Settings()
settings.BACKEND = backend
settings.LOGGING_MANAGER_ENABLED = Tru... | bsd-3-clause |
bheesham/servo | tests/wpt/web-platform-tests/tools/html5lib/utils/entities.py | 438 | 2734 | import json
import html5lib
def parse(path="html5ents.xml"):
return html5lib.parse(open(path), treebuilder="lxml")
def entity_table(tree):
return dict((entity_name("".join(tr[0].xpath(".//text()"))),
entity_characters(tr[1].text))
for tr in tree.xpath("//h:tbody/h:tr",
... | mpl-2.0 |
yipenggao/moose | python/MooseDocs/extensions/admonition.py | 4 | 3946 | ##pylint: disable=missing-docstring
####################################################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment ... | lgpl-2.1 |
chentao/thrift | lib/py/src/transport/THttpClient.py | 51 | 4464 | #
# 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 |
anurag03/integration_tests | cfme/storage/object_store_object.py | 1 | 6474 | # -*- coding: utf-8 -*-
import attr
from navmazing import NavigateToSibling, NavigateToAttribute
from widgetastic.widget import View, Text, NoSuchElementException
from widgetastic_patternfly import BreadCrumb, Button, Dropdown
from cfme.base.ui import BaseLoggedInPage
from cfme.common import TagPageView, Taggable
from... | gpl-2.0 |
eroicaleo/LearningPython | interview/leet/394_Decode_String.py | 1 | 2187 | #!/usr/bin/env python3
import re
# s = "3[a]2[bc]", return "aaabcbc".
# s = "3[a2[c]]", return "accaccacc".
# s = "2[abc]3[cd]ef", return "abcabccdcdcdef".
class Solution:
def decodeString(self, s):
stack, n, t = [], 0, ''
for c in s:
if c.isdigit():
n = 10*n + int(c)
... | mit |
mastizada/kuma | vendor/packages/nose/nose/plugins/testid.py | 29 | 9641 | """
This plugin adds a test id (like #1) to each test name output. After
you've run once to generate test ids, you can re-run individual
tests by activating the plugin and passing the ids (with or
without the # prefix) instead of test names.
For example, if your normal test run looks like::
% nosetests -v
tests.t... | mpl-2.0 |
rabipanda/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/cauchy_test.py | 33 | 16857 | # 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 |
pwhelan/djshouts | django/db/backends/postgresql_psycopg2/base.py | 239 | 8346 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql.operations import DatabaseOperations as Postgresq... | bsd-3-clause |
legrosbuffle/or-tools | examples/python/coins3.py | 7 | 2902 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
xujb/odoo | addons/account_payment/account_move_line.py | 241 | 4455 | # -*- 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 |
rahushen/ansible | lib/ansible/utils/module_docs_fragments/k8s_state_options.py | 80 | 1411 | #
# Copyright 2018 Red Hat | Ansible
#
# 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.
#
# ... | gpl-3.0 |
soxofaan/luigi | test/simulate_test.py | 13 | 2971 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
aviaryan/pythons | TheHyliaSoundtrack/hylia_s.py | 1 | 1588 | from bs4 import BeautifulSoup
from urllib.request import urlopen
from platform import subprocess
# if genlist = 0, then this script downloads the files, the cmd_downloader variable comes into play
# if genlist = 1, then this script generates a list.txt file containing direct links to music files in the working direct... | apache-2.0 |
chipx86/reviewboard | reviewboard/diffviewer/tests/test_forms.py | 2 | 35354 | from __future__ import unicode_literals
import base64
import json
import nose
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test.client import RequestFactory
from django.utils import six
from djblets.siteconfig.models import SiteConfiguration
from djblets.util.filesystem import is_exe_in_p... | mit |
BlueLens/bl-magi | tensorflow/slim/datasets/cifar10.py | 7 | 3237 | # 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 applicable ... | apache-2.0 |
RasaHQ/rasa_nlu | rasa/core/policies/form_policy.py | 1 | 5093 | import logging
from typing import List, Optional, Dict, Text
from rasa.core.actions.action import ACTION_LISTEN_NAME
from rasa.core.domain import PREV_PREFIX, ACTIVE_FORM_PREFIX, Domain
from rasa.core.events import FormValidation
from rasa.core.featurizers import TrackerFeaturizer
from rasa.core.policies.memoization i... | apache-2.0 |
zturchan/CMPUT410-Lab6 | v1/lib/python2.7/site-packages/django/forms/fields.py | 34 | 46782 | """
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
from django.forms.utils ... | apache-2.0 |
Kiiv/CouchPotatoServer | libs/rsa/key.py | 110 | 17087 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | gpl-3.0 |
jazcollins/models | syntaxnet/dragnn/python/composite_optimizer_test.py | 12 | 4661 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
koonsolo/MysticMine | monorail/pickupsview.py | 1 | 11068 |
import random
import pygame
from koon.geo import Vec2D
import koon.geo as geo
from koon.gfx import SpriteFilm, Font, LoopAnimationTimer, PingPongTimer, Timer
from koon.res import resman
import pickups
import event
import tiles
class PickupView:
def __init__( self ):
self.pos = None
self.jump_pos... | mit |
dgzurita/odoo | addons/hr_recruitment/__openerp__.py | 260 | 2780 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
GbalsaC/bitnamiP | lms/djangoapps/instructor/tests/utils.py | 121 | 2732 | """
Utilities for instructor unit tests
"""
import datetime
import json
import random
from django.utils.timezone import utc
from util.date_utils import get_default_time_display
class FakeInfo(object):
"""Parent class for faking objects used in tests"""
FEATURES = []
def __init__(self):
for featur... | agpl-3.0 |
raviflipsyde/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_handshake.py | 452 | 7134 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
eayunstack/fuel-ostf | fuel_health/common/facts.py | 2 | 2308 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
Geeglee/scrapy | tests/test_selector_csstranslator.py | 59 | 6026 | """
Selector tests for cssselect backend
"""
from twisted.trial import unittest
from scrapy.http import HtmlResponse
from scrapy.selector.csstranslator import ScrapyHTMLTranslator
from scrapy.selector import Selector
from cssselect.parser import SelectorSyntaxError
from cssselect.xpath import ExpressionError
HTMLBODY... | bsd-3-clause |
mitsuhiko/click | src/click/types.py | 1 | 30864 | import os
import stat
from datetime import datetime
from ._compat import _get_argv_encoding
from ._compat import filename_to_ui
from ._compat import get_filesystem_encoding
from ._compat import get_strerror
from ._compat import open_stream
from .exceptions import BadParameter
from .utils import LazyFile
from .utils im... | bsd-3-clause |
nox/servo | tests/wpt/web-platform-tests/XMLHttpRequest/resources/authentication.py | 247 | 1292 | def main(request, response):
if "logout" in request.GET:
return ((401, "Unauthorized"),
[("WWW-Authenticate", 'Basic realm="test"')],
"Logged out, hopefully")
session_user = request.auth.username
session_pass = request.auth.password
expected_user_name = request.h... | mpl-2.0 |
blindFS/powerline | powerline/lint/__init__.py | 9 | 21309 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
import logging
from collections import defaultdict
from itertools import chain
from functools import partial
from powerline import generate_config_finder, get_config_paths, load_config
from po... | mit |
chenjun0210/tensorflow | tensorflow/python/ops/state_ops.py | 10 | 9619 | # 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 |
llvm/llvm-test-suite | MicroBenchmarks/libs/benchmark/bindings/python/google_benchmark/__init__.py | 4 | 4370 | # Copyright 2020 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
mwilliammyers/sportsstats | tests/test_nba.py | 1 | 1960 | #!/usr/bin/env python
"""test_nba
Tests for `nba` module.
"""
from sportsstats import nba
import unittest
class TestNba(unittest.TestCase):
def setUp(self):
from datetime import datetime
april_9 = datetime(2016, 4, 9)
self.nba_stats = nba.Stats(april_9, april_9)
self.expected_qu... | gpl-3.0 |
onitake/ansible | lib/ansible/module_utils/oneview.py | 23 | 18876 | # 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 |
Emsu/prophet | examples/tutorial/__main__.py | 3 | 1782 | import datetime as dt
from prophet import Prophet
from prophet.data import YahooCloseData
from prophet.analyze import default_analyzers
from bollinger import BollingerData
from eventstudy import BollingerEventStudy
from eventstudy import OrderGenerator
# Based on Homework #7 for Computational Investing
# http://wik... | bsd-3-clause |
markeTIC/OCB | addons/website_mail/tests/__init__.py | 261 | 1081 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
yrizk/django-blog | blogvenv/lib/python3.4/site-packages/django/core/management/commands/createcachetable.py | 96 | 3927 | from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... | apache-2.0 |
simongoffin/website_version | openerp/addons/base/ir/ir_model.py | 8 | 59779 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
diorcety/intellij-community | python/helpers/pydev/pydev_imports.py | 53 | 2519 | from pydevd_constants import USE_LIB_COPY, izip
try:
try:
if USE_LIB_COPY:
from _pydev_imps import _pydev_xmlrpclib as xmlrpclib
else:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
except ImportError:
from _pydev_imps import _pydev_x... | apache-2.0 |
python-ivi/python-ivi | ivi/agilent/agilentU2004A.py | 2 | 1628 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2015-2017 Alex Forencich
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... | mit |
arrabito/DIRAC | Core/DISET/private/MessageBroker.py | 8 | 15445 | """ Here, we need some documentation...
"""
import threading
import select
import time
import socket
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.DISET.private.TransportPool import getGlobalTransportPool
from DIRAC.Core.Utilities.ThreadPool import getGlobalThreadPool
from DIRAC.Core.Utilities.ReturnValues... | gpl-3.0 |
muffin/tutorial-rss-reader | server/vendor/pyquery/cssselectpatch.py | 3 | 7695 | #-*- coding:utf-8 -*-
#
# Copyright (C) 2008 - Olivier Lauzanne <olauzanne@gmail.com>
#
# Distributed under the BSD license, see LICENSE.txt
from cssselect import xpath as cssselect_xpath
from cssselect.xpath import ExpressionError
class JQueryTranslator(cssselect_xpath.HTMLTranslator):
"""This class is used to i... | mit |
ionomy/ion | test/functional/token_test-pt1.py | 1 | 8466 | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Ion Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the functionality of all CLI commands.
"""
from test_framework.test_framework import BitcoinTestFrame... | mit |
axmachado/simplepos | simplepos/objfile/module.py | 1 | 5296 | # -*- coding: utf-8 -*-
"""
Copyright © 2017 - Alexandre Machado <axmachado@gmail.com>
This file is part of Simple POS Compiler.
Simnple POS Compiler 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 Found... | gpl-3.0 |
praekelt/molo | molo/core/migrations/0020_add-social-media-fields-to-article-page.py | 1 | 1042 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0010_change_on_delete_behaviour'),
('core', '0019_add_tags_to_article'),
]
... | bsd-2-clause |
chunyisong/shadowsocks | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
flar2/m7wl-Bulletproof | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
befelix/GPy | GPy/util/normalizer.py | 1 | 2996 | '''
Created on Aug 27, 2014
@author: Max Zwiessele
'''
import numpy as np
class _Norm(object):
def __init__(self):
pass
def scale_by(self, Y):
"""
Use data matrix Y as normalization space to work in.
"""
raise NotImplementedError
def normalize(self, Y):
"... | bsd-3-clause |
greenape/gem-module | gaussianemulation/uncertainty.py | 1 | 2386 | from sympy import *
from mpmath import *
from util import *
def E(r_h, b_hat, r_t, e):
return r_h.T*b_hat + r_t.T*e
def V(sigma, u, r_t, A_inv, r_h, g, w):
res = Matrix([u])
res -= r_t.T*A_inv*r_t
res += (r_h - g.T*r_t).T*w*(r_h-g.T*r_t)
res *= sigma
return sigma*(u - r_t.T*A_inv*r_t + (r_h - ... | mpl-2.0 |
zorroblue/scikit-learn | examples/model_selection/plot_roc.py | 102 | 5056 | """
=======================================
Receiver Operating Characteristic (ROC)
=======================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality.
ROC curves typically feature true positive rate on the Y axis, and false
positive rate on the X a... | bsd-3-clause |
jralls/gramps | gramps/gen/filters/rules/note/_hasreferencecountof.py | 6 | 1716 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007 Stephane Charette
#
# 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 optio... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.