code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from argparse import ArgumentParser
from utils import load_data
from lm import NeuralLM
from deepy.trainers import SGDTrainer, LearningRateAnnealer, AdamTrainer
from deepy.layers import LSTM, Dense, RNN, Softmax3D
from layers import FullOutputLaye... | rldotai/deepy | experiments/lm/baseline_rnnlm.py | Python | mit | 1,355 |
from direct.directnotify import DirectNotifyGlobal
from toontown.racing.DistributedKartPadAI import DistributedKartPadAI
from direct.distributed.ClockDelta import *
class DistributedViewPadAI(DistributedKartPadAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedViewPadAI")
def __init__(s... | Spiderlover/Toontown | toontown/racing/DistributedViewPadAI.py | Python | mit | 938 |
###########################################################
#
# Copyright (c) 2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without writte... | CeltonMcGrath/TACTIC | src/tactic/ui/widget/gear_menu_wdg.py | Python | epl-1.0 | 44,404 |
from mutagen._util import DictMixin, cdata, utf8, insert_bytes, delete_bytes
from tests import TestCase, add
import mmap
import random
class FDict(DictMixin):
uses_mmap = False
def __init__(self):
self.__d = {}
self.keys = self.__d.keys
def __getitem__(self, *args): return self.__d.__geti... | enginoid/mutagen | tests/test__util.py | Python | gpl-2.0 | 12,554 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsExpressionLineEdit
.. 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.
... | drnextgis/QGIS | tests/src/python/test_qgsexpressionlineedit.py | Python | gpl-2.0 | 2,368 |
# -*- test-case-name: twisted.words.test -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An implementation of the OSCAR protocol, which AIM and ICQ use to communcate.
Maintainer: Paul Swartz
"""
import struct
import string
import socket
import random
import types
import re
... | icucinema/madcow | madcow/include/twisted/words/protocols/oscar.py | Python | gpl-3.0 | 45,563 |
"""
tools to run the double ended connect in a separte process and
make sure the the minima and transition states found are
incorporated back into the master database
"""
import multiprocessing as mp
import sys
import signal
import logging
import numpy as np
from PyQt4 import QtCore, QtGui
from pele.utils.events i... | kjs73/pele | pele/gui/double_ended_connect_runner.py | Python | gpl-3.0 | 10,769 |
import os, sys, re, errno
import polib
def get_module_path():
"""Return the folder containing this script (or its .exe)."""
module_name = sys.executable if hasattr(sys, 'frozen') else __file__
abs_path = os.path.abspath(module_name)
return os.path.dirname(abs_path)
def print_usage():
"""Print us... | theRealTacoTime/poclbm | po_to_mo.py | Python | gpl-3.0 | 1,119 |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | danielbair/aeneas | aeneas/plotter.py | Python | agpl-3.0 | 20,789 |
"""
Acceptance tests for Studio related to the split_test module.
"""
import math
from bok_choy.promise import Promise
from nose.plugins.attrib import attr
from selenium.webdriver.support.ui import Select
from base_studio_test import StudioCourseTest
from common.test.acceptance.fixtures.course import XBlockFixtureDe... | lduarte1991/edx-platform | common/test/acceptance/tests/studio/test_studio_split_test.py | Python | agpl-3.0 | 47,097 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRandomfields(RPackage):
"""Simulation and Analysis of Random Fields
Methods for the ... | LLNL/spack | var/spack/repos/builtin/packages/r-randomfields/package.py | Python | lgpl-2.1 | 1,712 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## Enhanced by Maxence Tury <maxence.tury@ssi.gouv.fr>
## This program is published under a GPLv2 license
"""
Classes that implement ASN.1 data structures.
"""
from asn1.a... | mytliulei/Scapy | scapy/asn1fields.py | Python | apache-2.0 | 20,495 |
"""Tests for tensorflow.ops.nn_ops.Pad."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.kernel_tests import gradient_checker as gc
class PadOpTest(tf.... | arunhotra/tensorflow | tensorflow/python/kernel_tests/pad_op_test.py | Python | apache-2.0 | 4,704 |
# -*- coding: utf-8 -*-
###############################################################################
#
# PhotosFromUser
# Returns photos from a user.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exce... | jordanemedlock/psychtruths | temboo/core/Library/Foursquare/Users/PhotosFromUser.py | Python | apache-2.0 | 4,080 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textw... | jtrobec/pants | tests/python/pants_test/backend/python/tasks/python_task_test_base.py | Python | apache-2.0 | 3,479 |
#
# Copyright 2012 NVIDIA Corporation
#
# 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 ... | frgomes/copperhead | tests/test_sort.py | Python | apache-2.0 | 1,521 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | brenton/openshift-ansible | roles/lib_openshift/library/oc_service.py | Python | apache-2.0 | 57,767 |
from django.core.files import File
from django.core.validators import ValidationError
from django.contrib.auth.models import User
from django.http import Http404
from django.utils.translation import ugettext as _
from django.utils import six
from rest_framework import exceptions
from rest_framework import mixins
from ... | hnjamba/onaclone | onadata/apps/api/viewsets/briefcase_viewset.py | Python | bsd-2-clause | 9,326 |
from django.conf import settings
from django.http import Http404
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from rest_framework import viewsets
from rest_framework.permissions import AllowAny
from onadata.apps.logger.models import Attachment
from onadata.libs.utils.ima... | spatialdev/onadata | onadata/apps/api/viewsets/media_viewset.py | Python | bsd-2-clause | 1,744 |
from __future__ import print_function, division
from sympy.core import S, sympify
from sympy.core.add import Add
from sympy.core.containers import Tuple
from sympy.core.operations import LatticeOp, ShortCircuit
from sympy.core.function import Application, Lambda, ArgumentIndexError
from sympy.core.expr import Expr
fro... | vipulroxx/sympy | sympy/functions/elementary/miscellaneous.py | Python | bsd-3-clause | 16,681 |
import zlib
from scrapy.utils.gz import gunzip, is_gzipped
from scrapy.http import Response, TextResponse
from scrapy.responsetypes import responsetypes
from scrapy.exceptions import NotConfigured
class HttpCompressionMiddleware(object):
"""This middleware allows compressed (gzip, deflate) traffic to be
sent... | Zephor5/scrapy | scrapy/downloadermiddlewares/httpcompression.py | Python | bsd-3-clause | 2,273 |
from cyder.api.v1.endpoints.dns.sshfp import api
| akeym/cyder | cyder/api/v1/endpoints/dns/sshfp/__init__.py | Python | bsd-3-clause | 49 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..model import EstimateContrast
def test_EstimateContrast_inputs():
input_map = dict(axis=dict(mandatory=True,
),
beta=dict(mandatory=True,
),
constants=dict(mandatory=True,
),
contrasts=dict... | mick-d/nipype | nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py | Python | bsd-3-clause | 1,143 |
"""The mDS application API.
:Authors: Sana dev team
:Version: 1.1
""" | SanaMobile/sana.mds | src/mds/mrs/__init__.py | Python | bsd-3-clause | 70 |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from astropy.timeseries.periodograms.lombscargle.utils import convert_normalization, compute_chi2_ref
from astropy.timeseries.periodograms.lombscargle.core import LombScargle
NORMALIZATIONS = ['standard', 'model', 'log', 'psd']
@pytest.fixt... | bsipocz/astropy | astropy/timeseries/periodograms/lombscargle/tests/test_utils.py | Python | bsd-3-clause | 1,515 |
from pysal.cg import Point, LineSegment, Line, Ray, Chain, Rectangle, Polygon
import doctest
import unittest
class test_Point(unittest.TestCase):
def test___init__1(self):
"""
Tests whether points are created without issue.
Test tag: <tc>#tests#Point.__init__</tc>
"""
for... | AlanZatarain/pysal | pysal/cg/tests/test_shapes.py | Python | bsd-3-clause | 26,685 |
from auxiliary import Auxiliary
from log import LOG
import socket
import utility
class Auxiliary:
def __init__(self):
self.name = 'JBoss Path Traversal (CVE-2005-2006)'
self.versions = ['3.0', '3.2', '4.0']
self.flag = 'jb-fetch'
def check(self, fingerprint):
"""
"""
... | GHubgenius/clusterd | src/platform/jboss/auxiliary/fetch_creds.py | Python | mit | 2,236 |
#!/usr/bin/env python
# Author: Abhishek Malik <abhishek.malik@intel.com>
# Copyright (c) 2017 Intel Corporation.
#
# 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, includ... | pylbert/upm | examples/python/veml6070.py | Python | mit | 2,044 |
from chimera.core.chimeraobject import ChimeraObject
class ManagerHelperWithStopException (ChimeraObject):
def __init__ (self):
ChimeraObject.__init__(self)
def __start__ (self):
return True
def __stop__ (self):
raise Exception("oops in __stop__")
def __main__ (se... | ankanaan/chimera | src/chimera/core/tests/managerhelperwithstopexception.py | Python | gpl-2.0 | 393 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2005 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
#
# 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; ... | sam-m888/gramps | gramps/gui/pluginmanager.py | Python | gpl-2.0 | 8,526 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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) ... | tomprince/gemrb | gemrb/GUIScripts/pst/GUIWORLD.py | Python | gpl-2.0 | 5,094 |
#
# Copyright 2013 eNovance <licensing@enovance.com>
# Copyright 2013 Red Hat, Inc.
#
# Author: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
# Angus Salkeld <asalkeld@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/storage/sqlalchemy/migrate_repo/versions/007_add_alarm_table.py | Python | gpl-2.0 | 2,063 |
"""
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... | GREO/GNU-Radio | grc/base/FlowGraph.py | Python | gpl-3.0 | 7,249 |
class TokenModel(object):
def __init__(self, email, password):
self.email = email
self.password = password
| one-love/api | onelove/models/parsing.py | Python | gpl-3.0 | 127 |
"""
==============================================
Label Propagation learning a complex structure
==============================================
Example of LabelPropagation learning a complex internal structure
to demonstrate "manifold learning". The outer circle should be
labeled "red" and the inner circle "blue". Be... | chenyyx/scikit-learn-doc-zh | examples/zh/semi_supervised/plot_label_propagation_structure.py | Python | gpl-3.0 | 2,433 |
import sys
if sys.version_info[0] == 2:
import htmlentitydefs
import urlparse
import HTMLParser
import urllib
else:
import urllib.parse as urlparse
import html.entities as htmlentitydefs
import html.parser as HTMLParser
import urllib.request as urllib
| LS80/script.module.html2text | lib/html2text/compat.py | Python | gpl-3.0 | 286 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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... | le9i0nx/ansible | lib/ansible/modules/network/ios/ios_logging.py | Python | gpl-3.0 | 10,456 |
# 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 https://mozilla.org/MPL/2.0/.
import pytest
from jinja2 import Markup
from bedrock.contentful.templatetags.helpers import (
ALLOWED_ATTRS,
A... | mozilla/bedrock | bedrock/contentful/tests/test_templatetags_helpers.py | Python | mpl-2.0 | 2,297 |
# -*- coding: utf-8 -*-
{
'name': 'test-import-export',
'version': '0.1',
'category': 'Hidden/Tests',
'description': """A module to test import/export.""",
'depends': ['base'],
'data': ['ir.model.access.csv'],
'installable': True,
'auto_install': False,
}
| ygol/odoo | odoo/addons/test_impex/__manifest__.py | Python | agpl-3.0 | 288 |
# -*- coding: utf-8 -*-
# © 2016 Elico Corp (www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import ir_actions
| OpenERPJeff/gooderp_addons | report_docx/models/__init__.py | Python | agpl-3.0 | 162 |
#!/usr/bin/env python3
#
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import time
import io
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import test.support
import test.script_helper
# Skip tests if _multi... | LaoZhongGu/kbengine | kbe/src/lib/python/Lib/test/test_multiprocessing.py | Python | lgpl-3.0 | 76,667 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | punalpatel/st2 | st2tests/integration/mistral/test_errors.py | Python | apache-2.0 | 3,686 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | eltonkevani/tempest_el_env | tempest/services/compute/xml/extensions_client.py | Python | apache-2.0 | 1,692 |
# 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... | odejesush/tensorflow | tensorflow/contrib/distributions/python/ops/gamma.py | Python | apache-2.0 | 10,840 |
import pkgutil
from importlib import import_module
from pathlib import Path
from asgiref.local import Local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
from django.utils.module_loading import import_string
DEFAULT_DB_ALI... | georgemarshall/django | django/db/utils.py | Python | bsd-3-clause | 10,214 |
# Copyright (c) 2005-2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this ... | aferr/LatticeMemCtl | src/dev/Pci.py | Python | bsd-3-clause | 4,910 |
import json
import logging
from datetime import date, timedelta
from django.conf import settings
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import get_object_or_404, render
from django.utils.translation import ugettext as _
from django.views.decorators.http import require... | MikkCZ/kitsune | kitsune/dashboards/views.py | Python | bsd-3-clause | 7,532 |
# This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | ttsda/beets | beets/util/__init__.py | Python | mit | 22,558 |
# -*- coding: utf-8 -*-
"""
set_fake_passwords.py
Reset all user passwords to a common value. Useful for testing in a
development environment. As such, this command is only available when
setting.DEBUG is True.
"""
from django.conf import settings
from django.contrib.auth import get_user_model
from django... | neilpelow/wmap-django | venv/lib/python3.5/site-packages/django_extensions/management/commands/set_fake_passwords.py | Python | gpl-3.0 | 1,767 |
# Copyright (C) 2012-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | khushboo9293/mailman | src/mailman/app/tests/test_templates.py | Python | gpl-3.0 | 4,989 |
import re
import traceback
from couchpotato import fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.userscript.base import UserscriptBase
log = CPLog(__name__)
autoload = 'RottenTomatoes'
class RottenTomatoes(UserscriptBase):
includes = ['*://www.rottentomatoes.... | vktr/CouchPotatoServer | couchpotato/core/media/movie/providers/userscript/rottentomatoes.py | Python | gpl-3.0 | 985 |
# Copyright 2010-2014 RethinkDB, all rights reserved.
__all__ = [
'js', 'http', 'json', 'args', 'error', 'random', 'do', 'row', 'branch',
'union', 'map', 'object', 'binary', 'uuid', 'type_of', 'info', 'range',
'literal', 'asc', 'desc',
'db', 'db_create', 'db_drop', 'db_list',
'table', 'table_create... | mbroadst/rethinkdb | drivers/python/rethinkdb/query.py | Python | agpl-3.0 | 6,811 |
"""Tests for Vizio init."""
from datetime import timedelta
import pytest
from homeassistant.components.media_player.const import DOMAIN as MP_DOMAIN
from homeassistant.components.vizio.const import DOMAIN
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.core import HomeAssistant
from homeassistant... | jawilson/home-assistant | tests/components/vizio/test_init.py | Python | apache-2.0 | 3,734 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | eharney/nova | nova/network/manager.py | Python | apache-2.0 | 86,412 |
import unittest
import sys
import nose
import numpy as np
from sklearn.mixture import DPGMM, VBGMM
from sklearn.mixture.dpgmm import log_normalize
from sklearn.datasets import make_blobs
from sklearn.utils.testing import assert_array_less, assert_equal
from sklearn.mixture.tests.test_gmm import GMMTester
from sklear... | schets/scikit-learn | sklearn/mixture/tests/test_dpgmm.py | Python | bsd-3-clause | 4,553 |
# Copyright 2016 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 agree... | catapult-project/catapult | third_party/google-endpoints/test/test_metric_value.py | Python | bsd-3-clause | 7,043 |
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be us... | ignatenkobrain/dnf-plugins-core | tests/test_needs_restarting.py | Python | gpl-2.0 | 2,366 |
# Copyright 2012 Bouvet ASA
#
# Author: Endre Karlson <endre.karlson@bouvet.no>
#
# 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 ... | grahamhayes/designate | designate/plugin.py | Python | apache-2.0 | 4,112 |
#!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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,
# t... | jrogers512/pynet | class6/library/eos_vxlan_vtep.py | Python | apache-2.0 | 16,877 |
#
# 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... | practice-vishnoi/dev-spark-1 | examples/src/main/python/avro_inputformat.py | Python | apache-2.0 | 3,074 |
from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework.exceptions import NotFound
from api.base import permissions as base_permissions
from api.base.views import JSONAPIBaseView
from api.base.filters import ListFilterMixin
from api.base.pagination import MaxSi... | mfraezz/osf.io | api/regions/views.py | Python | apache-2.0 | 2,812 |
import sys
sys.path.insert(0, "../../build/examples/import_from_module")
from b import Derived
obj = Derived()
obj.do_something()
| neweagle/ns-3_multisim | pybindgen/examples/import_from_module/b_test.py | Python | gpl-2.0 | 133 |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | snakeleon/YouCompleteMe-x64 | .ycm_extra_conf.py | Python | gpl-3.0 | 3,104 |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
from ..parameters import parse_token_response, prepare_token_request
from .ba... | eleonrk/SickRage | lib/oauthlib/oauth2/rfc6749/clients/backend_application.py | Python | gpl-3.0 | 2,474 |
from __future__ import unicode_literals
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
from erpnext.regional.india.setup import update_address_template
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
update_e... | ovresko/erpnext | erpnext/patches/v8_1/gst_fixes.py | Python | gpl-3.0 | 2,070 |
# Copyright (C) 2012, Daniel Narvaez
#
# 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 i... | tchx84/sugar-toolkit-gtk3 | tests/test_uitree.py | Python | lgpl-2.1 | 1,535 |
"""
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... | zaxtax/scikit-learn | examples/text/document_clustering.py | Python | bsd-3-clause | 8,357 |
# Copyright (C) 2010 Research in Motion Ltd. 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 conditio... | nwjs/chromium.src | third_party/blink/tools/blinkpy/common/system/user_unittest.py | Python | bsd-3-clause | 6,374 |
# test basic capability to start a new thread
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
try:
import utime as time
except ImportError:
import time
import _thread
def foo():
pass
def thread_entry(n):
for i in range(n):
foo()
for i in range(2):
while Tru... | bvernoux/micropython | tests/thread/thread_start1.py | Python | mit | 521 |
# This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | jobsafran/mediadrop | mediadrop/lib/storage/ftp.py | Python | gpl-3.0 | 6,900 |
#!/usr/bin/env python
# Copyright 2010 Google Inc. All Rights Reserved.
"""GRR Rapid Response Framework."""
| MiniSEC/GRR_clone | __init__.py | Python | apache-2.0 | 109 |
# Copyright 2013 NEC Corporation. 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 ... | Metaswitch/calico-nova | nova/tests/unit/test_api_validation.py | Python | apache-2.0 | 37,136 |
#
# 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... | jeremiaswerner/openwhisk | tests/dat/actions/python-zip/__main__.py | Python | apache-2.0 | 851 |
"""
.. module: lemur.common.health
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from flask import Blueprint
mod = Blueprint('healthCheck', __name__)
@mod.route('/healt... | nevins-b/lemur | lemur/common/health.py | Python | apache-2.0 | 359 |
"""
XML serializer.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import bas... | hackerbot/DjangoDev | django/core/serializers/xml_serializer.py | Python | bsd-3-clause | 15,357 |
"""Utilities for meta-estimators"""
# Author: Joel Nothman
# Andreas Mueller
# License: BSD
from abc import ABCMeta, abstractmethod
from operator import attrgetter
from functools import update_wrapper
import numpy as np
from ..utils import safe_indexing
from ..base import BaseEstimator
__all__ = ['if_delegat... | chrsrds/scikit-learn | sklearn/utils/metaestimators.py | Python | bsd-3-clause | 7,622 |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
import sys
try:
import MacOS
except ImportError:
MacOS = None
from .py23 import *
def _reverseString(s):
s = list(s)
s.reverse()
return strjoin(s)
def getMacCreatorAndType(path):
if MacOS is not None:
fileCreat... | googlei18n/fontuley | src/third_party/fontTools/Lib/fontTools/misc/macCreatorType.py | Python | apache-2.0 | 986 |
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from ..graph import graph_laplacian
def test_graph_laplacian():
for mat in (np.arange(10) * np.arange(10)[:, np.newaxis],
np.ones((7, 7)),
np.eye(19),
... | JT5D/scikit-learn | sklearn/utils/tests/test_graph.py | Python | bsd-3-clause | 934 |
"""Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | BiaDarkia/scikit-learn | benchmarks/bench_plot_lasso_path.py | Python | bsd-3-clause | 4,006 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import warnings
from django.contrib.auth import get_user, get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.http import HttpR... | frishberg/django | tests/auth_tests/test_basic.py | Python | bsd-3-clause | 7,419 |
import datetime
import re
import fixtures
import constants
from authomatic.providers import oauth2
conf = fixtures.get_configuration('vk')
PICTURE = re.compile(r'http://[A-Za-z0-9]+\.vk\.me/[A-Za-z0-9-/]+\.jpg')
CONFIG = {
'login_xpath': '//*[@id="box"]/div/input[6]',
'password_xpath': '//*[@id="box"]/div/... | daherk2/authomatic | tests/functional_tests/expected_values/vk.py | Python | mit | 2,230 |
#!/usr/bin/env python
"""
Layer images above one another using alpha blending
"""
from __future__ import division
from pylab import *
def func3(x,y):
return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
# make these smaller to increase the resolution
dx, dy = 0.05, 0.05
x = arange(-3.0, 3.0, dx)
y = arange(-3.0, 3.0, d... | lthurlow/Network-Grapher | proj/external/matplotlib-1.2.1/lib/mpl_examples/pylab_examples/layer_images.py | Python | mit | 1,153 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, unbalanced-tuple-unpacking, len-as-condition
import re
import pytest
from ..pattern import StringPattern, RePattern, FunctionalPattern, REGEX_AVAILABLE
from ..match import Match
class TestStringPatter... | dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Libraries/Shared/rebulk/test/test_pattern.py | Python | gpl-3.0 | 29,324 |
from __future__ import print_function, division, absolute_import
import numpy as np
import mdtraj as md
__all__ = ['map_drawn_samples']
def map_drawn_samples(selected_pairs_by_state, trajectories, top=None):
"""Lookup trajectory frames using pairs of (trajectory, frame) indices.
Parameters
----------
... | rmcgibbo/msmbuilder | msmbuilder/utils/draw_samples.py | Python | lgpl-2.1 | 2,656 |
"""
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
from numpy.testing import assert_raises
from scipy.spatial import distance
from sklearn.utils.testing import assert_equal
from sklearn.cluster.dbscan_ import DBSCAN, dbscan
from .common import generate_clustered_data
from sklearn.metrics... | chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/cluster/tests/test_dbscan.py | Python | apache-2.0 | 4,963 |
#!/usr/bin/env python
#
# 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
# "L... | rkq/cxxexp | third-party/src/thrift-0.9.1/test/py/SerializationTest.py | Python | mit | 14,969 |
#! /usr/bin/env python
#
# Example program using irc.client.
#
# Copyright (C) 1999-2002 Joel Rosdahl
#
# This library 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 2.1 of the Licens... | waseem18/oh-mainline | vendor/packages/irc/scripts/servermap.py | Python | agpl-3.0 | 4,670 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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',
... | photoninger/ansible | lib/ansible/modules/network/netscaler/netscaler_cs_vserver.py | Python | gpl-3.0 | 40,794 |
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import os
import sys
try:
from django.contrib.staticfiles.handlers import StaticFilesHandler
USE_STATICFILES = 'django.contrib.staticfiles' in settings.INSTALLED_APPS
except Impor... | rtucker-mozilla/inventory | vendor-local/src/django-extensions/django_extensions/management/commands/runserver_plus.py | Python | bsd-3-clause | 4,895 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import os
import threading
import types
import warning... | viger/docker | proxy/proxy/code/default/python27/1.0/lib/win32/cryptography/hazmat/bindings/openssl/binding.py | Python | mit | 8,168 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | wkeeling/ansible | test/units/playbook/test_role.py | Python | gpl-3.0 | 6,676 |
# 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 appl... | anilmuthineni/tensorflow | tensorflow/examples/tutorials/layers/cnn_mnist.py | Python | apache-2.0 | 5,482 |
"""SCons
The main package for the SCons software construction utility.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Softwar... | BenLand100/rat-pac | python/SCons/__init__.py | Python | bsd-3-clause | 1,625 |
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... | rajiteh/taiga-back | tests/integration/test_custom_attributes_issues.py | Python | agpl-3.0 | 7,909 |
def outer(bar=None, **kwargs):
def nested(**kwargs):
print(kwargs['foo'])
return bar | jwren/intellij-community | python/testData/intentions/convertVariadicParamOverriddenInNested_after.py | Python | apache-2.0 | 100 |
from django.conf.urls import url
from . import feeds
from . import views
urlpatterns = [
url(r'^$',
views.HomeView.as_view(),
name='demos'),
url(r'^devderby/?$',
views.devderby_landing,
name='demos_devderby_landing'),
url(r'^devderby/(?P<year>\d\d\d\d)/(?P<month>[\w]+)/?$... | biswajitsahu/kuma | kuma/demos/urls.py | Python | mpl-2.0 | 2,665 |
"""Home Assistant triggers."""
| jawilson/home-assistant | homeassistant/components/homeassistant/triggers/__init__.py | Python | apache-2.0 | 31 |
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata import periodic_table
# categories need to be strings
elements = periodic_table.elements[periodic_table.elements['group'] != "-"]
# The categorical ranges need to be strings, so convert the ... | almarklein/bokeh | sphinx/source/tutorial/solutions/periodic.py | Python | bsd-3-clause | 4,342 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Alexandre Fayolle
# Copyright 2012-2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
#... | savoirfairelinux/stock-logistics-workflow | picking_dispatch/company.py | Python | agpl-3.0 | 1,279 |
# Copyright 2015 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 ag... | vt09/bazel | tools/android/stubify_manifest_test.py | Python | apache-2.0 | 3,618 |