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 |
|---|---|---|---|---|---|
wackerl91/luna | resources/lib/nvhttp/cryptoprovider/abstractcryptoprovider.py | 1 | 1303 | import os
from abc import ABCMeta, abstractmethod
class AbstractCryptoProvider(object):
__metaclass__ = ABCMeta
def __init__(self, host_context_service):
self.host_context_service = host_context_service
self._current_host = None
@abstractmethod
def get_cert_path(self):
self._... | gpl-3.0 |
ivandevp/django | tests/deprecation/tests.py | 199 | 7253 | from __future__ import unicode_literals
import os
import unittest
import warnings
from django.test import SimpleTestCase
from django.test.utils import reset_warning_registry
from django.utils import six
from django.utils.deprecation import RenameMethodsBase
from django.utils.encoding import force_text
class RenameM... | bsd-3-clause |
sudosurootdev/external_chromium_org | tools/telemetry/telemetry/page/actions/loop_unittest.py | 32 | 2181 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.core import util
from telemetry.page.actions import loop
from telemetry.unittest import tab_test_case
AUDIO_... | bsd-3-clause |
kylemaa/Futuro | futuro/apps/first_app/migrations/0001_initial.py | 1 | 2015 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-06 14:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | mit |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/reloop-closured/lib/python2.7/encodings/hex_codec.py | 528 | 2309 | """ Python 'hex_codec' Codec - 2-digit hex content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, binascii
### Codec APIs
def hex_encode(... | apache-2.0 |
kerozene/limnoria-plugins | Cayenne/plugin.py | 3 | 5305 | # -*- coding: utf-8 -*-
"""
Cayenne - Displays cat facts or cat gifs based on probability
Copyright (c) 2015, butterscotchstallion
All rights reserved.
"""
import supybot.utils as utils
from supybot.commands import *
import supybot.ircmsgs as ircmsgs
import supybot.callbacks as callbacks
import random
import datetime
... | mit |
CanalTP/navitia | source/tyr/tests/integration/dataset_delete_by_type_test.py | 2 | 6204 | # coding: utf-8
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non ending quest to... | agpl-3.0 |
fsalamero/pilas | pilasengine/actores/deslizador_horizontal.py | 5 | 3143 | # -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
from pilasengine.actores.actor import Actor
from pilasengine import colores
ALTURA = 15
class D... | lgpl-3.0 |
lightbase/LBSociam | get_access_token.py | 10 | 3179 | #!/usr/bin/env python
#
# Copyright 2007-2013 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | gpl-2.0 |
pastebt/you-get | src/you_get/extractors/kugou.py | 19 | 1978 | #!/usr/bin/env python
__all__ = ['kugou_download']
from ..common import *
from json import loads
from base64 import b64decode
import re
import hashlib
def kugou_download(url, output_dir=".", merge=True, info_only=False):
if url.lower().find("5sing")!=-1:
#for 5sing.kugou.com
html=get_html(url)
... | mit |
bhouston/three.js | utils/exporters/blender/addons/io_three/__init__.py | 60 | 31178 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | mit |
UstadMobile/exelearning-extjs5-mirror | twisted/python/dist.py | 14 | 9910 | """
Distutils convenience functionality.
"""
import sys, os
from distutils import sysconfig
from distutils.command import build_scripts, install_data, build_ext, build_py
from distutils.errors import CompileError
from distutils import core
twisted_subprojects = ["conch", "flow", "lore", "mail", "names",
... | gpl-2.0 |
Ensembles/ert | python/python/ert_gui/ertwidgets/analysismodulevariablespanel.py | 3 | 6670 | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file 'analysismodulevariablespanel.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 ver... | gpl-3.0 |
appsembler/edx-platform | lms/djangoapps/survey/tests/test_utils.py | 13 | 4072 | """
Python tests for the Survey models
"""
from collections import OrderedDict
from django.contrib.auth.models import User
from django.test.client import Client
from survey.models import SurveyForm
from survey.utils import is_survey_required_for_course, is_survey_required_and_unanswered
from xmodule.modulestore.test... | agpl-3.0 |
xinxian0458/dcos | packages/bootstrap/extra/dcos_internal_utils/utils.py | 12 | 1151 | import fcntl
import logging
import os
log = logging.getLogger(__name__)
def read_file_line(filename):
with open(filename, 'r') as f:
return f.read().strip()
class Directory:
def __init__(self, path):
self.path = path
def __enter__(self):
log.info('Opening {}'.format(self.path))... | apache-2.0 |
Motrixi/rtbkit-public | jml/tsne/__init__.py | 21 | 1133 | import _tsne
def vectors_to_distances(array):
return _tsne.vectors_to_distances(array)
def distances_to_probabilities(array, tolerance=1e-5, perplexity=30.0):
return _tsne.distances_to_probabilities(array, tolerance, perplexity)
def tsne_core(array, num_dims=2, **kwargs):
return _tsne.tsne(array, num_... | apache-2.0 |
abdulqayyum/deepnet | eigenmat/eigenmat.py | 10 | 44821 | import os, pdb, platform, time, warnings
import ctypes as ct
import numpy as np
if platform.system() == 'Windows':
_eigenmat = ct.cdll.LoadLibrary('libeigenmat.dll')
elif platform.system() == 'Darwin':
_eigenmat = ct.cdll.LoadLibrary('libeigenmat.dylib')
else:
_eigenmat = ct.cdll.LoadLibrary('libeigenmat.so')
_... | bsd-3-clause |
0k/OpenUpgrade | addons/warning/migrations/8.0.1.0/post-migration.py | 11 | 1794 | # -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, an open source suite of business apps
# This module copyright (C) 2015 bloopark systems (<http://bloopark.de>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
JioEducation/edx-platform | common/djangoapps/config_models/utils.py | 14 | 2544 | """
Utilities for working with ConfigurationModels.
"""
from django.apps import apps
from rest_framework.parsers import JSONParser
from rest_framework.serializers import ModelSerializer
from django.contrib.auth.models import User
def get_serializer_class(configuration_model):
""" Returns a ConfigurationModel seri... | agpl-3.0 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/Crypto/SelfTest/Random/OSRNG/__init__.py | 118 | 2082 | # -*- coding: utf-8 -*-
#
# SelfTest/Random/OSRNG/__init__.py: Self-test for OSRNG modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedica... | apache-2.0 |
ryanGT/sympy | sympy/functions/special/error_functions.py | 5 | 2369 |
from sympy.core.basic import Basic, S, C, sympify
from sympy.core.function import Function
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.core.cache import cacheit
from sympy.utilities.decorator import deprecated
###############################################################################
###... | bsd-3-clause |
zlpure/CS231n | assignment2/cs231n/features.py | 30 | 4807 | import matplotlib
import numpy as np
from scipy.ndimage import uniform_filter
def extract_features(imgs, feature_fns, verbose=False):
"""
Given pixel data for images and several feature functions that can operate on
single images, apply all feature functions to all images, concatenating the
feature vectors fo... | mit |
lz1988/django-web2015 | tests/regressiontests/expressions_regress/tests.py | 46 | 15966 | """
Spanning tests for all the operations that F() expressions can perform.
"""
from __future__ import absolute_import
import datetime
from django.db import connection
from django.db.models import F
from django.test import TestCase, Approximate, skipUnlessDBFeature
from .models import Number, Experiment
class Expr... | bsd-2-clause |
ericli1989/ali_kernel | scripts/gtp/getmod.py | 4 | 4750 | #!/usr/bin/python
# This script is used by GDB to load the symbols from Linux kernel modules
# GPL
# Copyright(C) KGTP team (https://code.google.com/p/kgtp/), 2011, 2012
#Set special mod_search_dir
#set $mod_search_dir="dir"
#Clear special mod_search_dir
#set $mod_search_dir=(void)1
#Not ignore gtp.ko
#set $ignore_gt... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_08_01/aio/operations/_operations.py | 1 | 4679 | # 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 may ... | mit |
apyrgio/ganeti | lib/hooksmaster.py | 7 | 10789 | #
#
# Copyright (C) 2006, 2007, 2011, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | bsd-2-clause |
alinbalutoiu/tempest | tempest/api/compute/servers/test_delete_server.py | 8 | 7593 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
motion2015/edx-platform | openedx/core/djangoapps/user_api/tests/test_middleware.py | 152 | 4415 | """Tests for user API middleware"""
from mock import Mock, patch
from unittest import TestCase
from django.http import HttpResponse
from django.test.client import RequestFactory
from student.tests.factories import UserFactory, AnonymousUserFactory
from ..tests.factories import UserCourseTagFactory
from ..middleware ... | agpl-3.0 |
pipermerriam/populus | tests/contract-provider/test_is_contract_available.py | 1 | 2146 | def test_contract_availability_with_no_dependencies(chain, math):
provider = chain.provider
chain.registrar.set_contract_address('Math', math.address)
is_available = provider.is_contract_available('Math')
assert is_available is True
def test_contract_availability_when_not_registered(chain):
prov... | mit |
adw0rd/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/gdal/geomtype.py | 404 | 2967 | from django.contrib.gis.gdal.error import OGRException
#### OGRGeomType ####
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0 : 'Unknown',
1 : 'Point',
2 ... | gpl-3.0 |
BuildingLink/sentry | tests/acceptance/test_dashboard.py | 6 | 1366 | from __future__ import absolute_import
from django.utils import timezone
from sentry.testutils import AcceptanceTestCase
class DashboardTest(AcceptanceTestCase):
def setUp(self):
super(DashboardTest, self).setUp()
self.user = self.create_user('foo@example.com')
self.org = self.create_org... | bsd-3-clause |
vFense/vFenseAgent-nix | agent/deps/rpm/Python-2.7.5/lib/python2.7/distutils/command/sdist.py | 68 | 18556 | """distutils.command.sdist
Implements the Distutils 'sdist' command (create a source distribution)."""
__revision__ = "$Id$"
import os
import string
import sys
from glob import glob
from warnings import warn
from distutils.core import Command
from distutils import dir_util, dep_util, file_util, archive_util
from di... | lgpl-3.0 |
brew/fruitynutters | webapps/fruitynutters/cart/order_form.py | 1 | 6798 | # -*- coding: utf-8 -*-
from rtfng.Elements import StyleSheet, Document
from rtfng.Styles import TextStyle, ParagraphStyle
from rtfng.PropertySets import (TextPropertySet,
ParagraphPropertySet,
BorderPropertySet,
FramePrope... | mit |
hsteinhaus/ardupilot | mk/PX4/Tools/genmsg/test/test_genmsg_msg_loader.py | 215 | 29225 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009, Willow Garage, 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... | gpl-3.0 |
mingkim/QuesCheetah | main/migrations/0001_initial.py | 1 | 2967 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0006_require_contenttypes_0002'),
]
operations = [
migrations.CreateModel(
... | mit |
HalcyonChimera/osf.io | website/mails/presends.py | 5 | 2856 | # -*- coding: utf-8 -*-
from django.utils import timezone
from website import settings
def no_addon(email):
return len([addon for addon in email.user.get_addons() if addon.config.short_name != 'osfstorage']) == 0
def no_login(email):
from osf.models.queued_mail import QueuedMail, NO_LOGIN_TYPE
sent = Que... | apache-2.0 |
openqt/algorithms | leetcode/python/lc008-string-to-integer-atoi.py | 1 | 2597 | # coding=utf-8
import unittest
"""8. String to Integer (atoi)
https://leetcode.com/problems/string-to-integer-atoi/description/
Implement `atoi` which converts a string to an integer.
The function first discards as many whitespace characters as necessary until
the first non-whitespace character is found. Then, start... | gpl-3.0 |
NeilGirdhar/glx | demonstration/geometry.py | 1 | 2764 | import numpy as np
from rectangle import Rect
from glx import BoundedOrthoView, OrthoProjection, Viewport
class Geometry:
"""
A Geometry manages all of the viewports and measurement-related variables
for a widget.
"""
DEFAULT_ZOOM = [100.0, 100.0]
LAYOUT_BORDER = 0
ZOOM_RANGE = [[0.1, 10.... | mit |
lepistone/odoo | addons/sale_stock/company.py | 384 | 1524 | # -*- 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 |
colloquium/spacewalk | client/solaris/smartpm/smart/interface.py | 4 | 5110 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | gpl-2.0 |
i5o/openshot-sugar | openshot/openshot/uploads/youtube/gdata/media/__init__.py | 221 | 12093 | # -*-*- encoding: utf-8 -*-*-
#
# This is gdata.photos.media, implementing parts of the MediaRSS spec in gdata structures
#
# $Id: __init__.py 81 2007-10-03 14:41:42Z havard.gulldahl $
#
# Copyright 2007 Håvard Gulldahl
# Portions copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | gpl-3.0 |
rakeshadr/zk-branch-3.4 | src/contrib/huebrowser/zkui/src/zkui/forms.py | 114 | 1209 | # 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 |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/idlelib/IOBinding.py | 70 | 19745 | import os
import types
import shlex
import sys
import codecs
import tempfile
import tkinter.filedialog as tkFileDialog
import tkinter.messagebox as tkMessageBox
import re
from tkinter import *
from tkinter.simpledialog import askstring
from idlelib.configHandler import idleConf
from codecs import BOM_UTF8
# Try sett... | lgpl-3.0 |
lushfuture/Phys-Comp | five-test/node_modules/johnny-five/junk/firmata-latest/node_modules/serialport/node_modules/node-gyp/legacy/tools/gyp/pylib/gyp/common.py | 39 | 14000 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import with_statement
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing decorator. It'll blo... | mit |
derekjchow/models | research/attention_ocr/python/demo_inference_test.py | 3 | 5075 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import demo_inference
import tensorflow as tf
from tensorflow.python.training import monitored_session
_CHECKPOINT = 'model.ckpt-399731'
_CHECKPOINT_URL = 'http://download.tensorflow.org/models/attention_ocr_2017_08_09.tar.gz'
class DemoInferenceTest(tf.test.TestCase):
def... | apache-2.0 |
atosorigin/ansible | test/units/module_utils/facts/system/distribution/test_parse_distribution_file_Slackware.py | 35 | 1118 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import pytest
from ansible.module_utils.facts.system.distribution i... | gpl-3.0 |
cjhak/b2share | invenio/b2share/modules/b2deposit/b2share_model/metadata/euon_metadata_config.py | 2 | 2380 | # -*- coding: utf-8 -*-
from invenio.ext.sqlalchemy import db
from datetime import date
domain = "euon"
display_name = "Ontology"
table_name = 'EUON'
image = 'domain-euon.png'
kind = 'project'
domaindesc = 'Ontological data.'
# note that fields will need more stuff like validators later
fields = [
{'name': ... | gpl-2.0 |
iemejia/incubator-beam | sdks/python/apache_beam/typehints/typed_pipeline_test_py3.py | 1 | 13504 | #
# 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 |
asen6/amartyasenguptadotcom | django/db/backends/sqlite3/introspection.py | 160 | 5815 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL types t... | bsd-3-clause |
terhorst/psmcpp | smcpp/spline/bspline.py | 2 | 4264 | import numpy as np
import scipy.interpolate
import math
import numbers
from .cubic import CubicSpline
from .common import polyval
def _align(p1, p2):
'''
Given PPoly's :p1:, :p2:, return tuple :(q1, q2): such that q1 and
q2 have the same breakpoints and represent p1 and p2, respectively.
It's assume... | gpl-3.0 |
googlehim/linux | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
googleapis/googleapis-gen | google/pubsub/v1/pubsub-v1-py/google/pubsub_v1/services/subscriber/transports/grpc.py | 1 | 37606 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
jamesrp/pyeq2 | Models_3D/Simple.py | 3 | 85319 | from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
# pyeq2 is a collection of equations expressed as Python classes
#
# Copyright (C) 2013 James R. Phillips
# 2548 Vera Cruz Drive
# Birmingham, AL 35235 USA
#
# email: zunzun@zunzun.com
#
... | bsd-2-clause |
ttakamura/chainer | chainer/optimizers/ada_delta.py | 2 | 1309 | import numpy
from chainer import cuda, Optimizer
class AdaDelta(Optimizer):
"""Zeiler's ADADELTA.
See: http://www.matthewzeiler.com/pubs/googleTR2012/googleTR2012.pdf
"""
def __init__(self, rho=0.95, eps=1e-6):
self.rho = rho
self.eps = eps
def init_state_cpu(self, param, grad):
... | mit |
dpshelio/sunpy | sunpy/visualization/animator/line.py | 2 | 7232 | import numpy as np
from sunpy.visualization.animator.base import ArrayAnimator, edges_to_centers_nd
__all__ = ['LineAnimator']
class LineAnimator(ArrayAnimator):
"""
Create a matplotlib backend independent data explorer for 1D plots.
The following keyboard shortcuts are defined in the viewer:
* 'l... | bsd-2-clause |
infirmary/suds | suds/wsdl.py | 197 | 31503 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
nycholas/ask-undrgz | src/ask-undrgz/django/contrib/comments/views/moderation.py | 307 | 5037 | from django import template
from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required, permission_required
from utils import next_redirect, confirmation_view
from django.contrib import comments
from django.contrib.commen... | bsd-3-clause |
sounak98/coala-bears | bears/scala/ScalaLintBear.py | 4 | 1428 | from os.path import abspath, dirname, join
from coalib.bearlib.abstractions.Linter import linter
scalastyle_config_file = join(dirname(abspath(__file__)),
'scalastyle_config.xml')
@linter(executable='java',
output_format='regex',
output_regex=r'(?P<severity>warning) fi... | agpl-3.0 |
afaheem88/tempest_neutron | tempest/cli/simple_read_only/object_storage/test_swift.py | 7 | 3514 | # Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
BarraQDA/nvivotools | Norm2RQDA.py | 1 | 3105 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 Jonathan Schultz
#
# 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 lat... | gpl-3.0 |
EricMuller/mywebmarks-backend | requirements/twisted/Twisted-17.1.0/src/twisted/web/test/test_util.py | 16 | 12590 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.util}.
"""
from __future__ import absolute_import, division
import gc
from twisted.python.failure import Failure
from twisted.trial.unittest import SynchronousTestCase, TestCase
from twisted.internet import defer
fro... | mit |
broferek/ansible | lib/ansible/modules/cloud/vmware/vmware_guest.py | 1 | 149611 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version... | gpl-3.0 |
KousikaGanesh/purchaseandInventory | openerp/addons/l10n_mx/__init__.py | 975 | 1058 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
seanchen/taiga-back | taiga/base/management/commands/test_emails.py | 18 | 7384 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 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... | agpl-3.0 |
bqbn/addons-server | src/olympia/activity/migrations/0005_auto_20200625_1139.py | 6 | 1424 | # Generated by Django 2.2.13 on 2020-06-25 11:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activity', '0004_auto_20191125_1659'),
]
operations = [
migrations.AlterField(
model_name='activitylog',
name='acti... | bsd-3-clause |
aringh/odl | odl/contrib/tensorflow/examples/tensorflow_operator_matrix.py | 3 | 1544 | """Example of how to convert a tensorflow layer to an ODL operator.
In this example we take a tensorflow layer (given by matrix multiplication)
and convert it into an ODL operator.
"""
from __future__ import print_function
import tensorflow as tf
import numpy as np
import odl
import odl.contrib.tensorflow
sess = tf.... | mpl-2.0 |
bbozhev/flask-test | flask/lib/python2.7/site-packages/whoosh/lang/paicehusk.py | 96 | 6788 | """This module contains an object that implements the Paice-Husk stemming
algorithm.
If you just want to use the standard Paice-Husk stemming rules, use the
module's ``stem()`` function::
stemmed_word = stem(word)
If you want to use a custom rule set, read the rules into a string where the
rules are separated by... | mit |
archf/ansible | contrib/inventory/nova.py | 109 | 7029 | #!/usr/bin/env python
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.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
# ... | gpl-3.0 |
OS2World/APP-INTERNET-torpak_2 | Lib/binhex.py | 12 | 15077 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | mit |
srluge/SickRage | sickbeard/clients/transmission_client.py | 6 | 5192 | # coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 vers... | gpl-3.0 |
6112/project-euler | problems/062.py | 1 | 1229 | # encoding=utf-8
## SOLVED 2014/11/18
## 127035954683
# The cube, 41063625 (3453), can be permuted to produce two other cubes:
# 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube
# which has exactly three permutations of its digits which are also cube.
# Find the smallest cube for which exac... | mit |
zwily/zulip | docs/conf.py | 120 | 9641 | # -*- coding: utf-8 -*-
#
# zulip-contributor-docs documentation build configuration file, created by
# sphinx-quickstart on Mon Aug 17 16:24:04 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | apache-2.0 |
weese/seqan | util/py_lib/seqan/dddoc/core.py | 18 | 37011 | #!/usr/bin/env python
import copy
import operator
import os
import os.path
import pickle
import string
import sys
# Constant for C++ files.
FILETYPE_CPP = 2
# Constant for DDDOC files.
FILETYPE_DDDOC = 1
# Constant for none of the above.
FILETYPE_OTHER = 0
SOURCE_ENCODING = 'iso8859-1'
# Extension of C++ files.
CPP... | bsd-3-clause |
Cadair/ginga | ginga/misc/plugins/WCSMatch.py | 3 | 14148 | #
# WCSMatch.py -- WCSMatch plugin for Ginga reference viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga import GingaPlugin
from ginga.gw import Widget... | bsd-3-clause |
ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/checkers/unittest_strings.py | 1 | 2787 | # Copyright (c) 2015-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2018 Lucas Cimon <lucas.cimon@gmail.com>
# Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
# Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyrig... | mit |
alexforencich/python-ivi | ivi/dmm.py | 2 | 25453 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-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 |
mach327/chirp_fork | chirp/bandplan_iaru_r3.py | 3 | 5452 | # Copyright 2013 Sean Burford <sburford@google.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 3 of the License, or
# (at your option) any later version.
#
# This program i... | gpl-3.0 |
eiabea/bitmonero | src/crypto/crypto_ops_builder/ref10CommentedCombined/base2.py | 77 | 1231 | b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493
def expmod(b,e,m):
if e == 0: return 1
t = expmod(b,e/2,m)**2 % m
if e & 1: t = (t*b) % m
return t
def inv(x):
return expmod(x,q-2,q)
d = -121665 * inv(121666)
I = expmod(2,(q-1)/4,q)
def xrecover(y):
xx = (y*y-1) * inv(d*y*y+1)... | bsd-3-clause |
Cyrillic327/p2pool | p2pool/util/fixargparse.py | 283 | 1630 | from __future__ import absolute_import
import argparse
import sys
class FixedArgumentParser(argparse.ArgumentParser):
'''
fixes argparse's handling of empty string arguments
and changes @filename behaviour to accept multiple arguments on each line
'''
def _read_args_from_files(self, arg_strings)... | gpl-3.0 |
tangyibin/goblin-core | riscv/llvm/3.5/cfe-3.5.0.src/bindings/python/tests/cindex/test_cursor_kind.py | 42 | 1817 | from clang.cindex import CursorKind
def test_name():
assert CursorKind.UNEXPOSED_DECL.name is 'UNEXPOSED_DECL'
def test_get_all_kinds():
kinds = CursorKind.get_all_kinds()
assert CursorKind.UNEXPOSED_DECL in kinds
assert CursorKind.TRANSLATION_UNIT in kinds
assert CursorKind.VARIABLE_REF in kinds
... | bsd-3-clause |
mlperf/training_results_v0.7 | Intel/benchmarks/minigo/8-nodes-32s-cpx-tensorflow/ml_perf/utils.py | 1 | 8122 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
simon-fu/pjproject-adv | tests/pjsua/scripts-call/301_ice_public_a.py | 59 | 1052 | # $Id: 301_ice_public_a.py 2392 2008-12-22 18:54:58Z bennylp $
#
from inc_cfg import *
# Note:
# - need --dis-codec to make INVITE packet less than typical MTU
uas_args = "--null-audio --id=\"<sip:test1@pjsip.org>\" --registrar=sip:sip.pjsip.org --username=test1 --password=test1 --realm=pjsip.org --proxy=\"sip:sip.p... | gpl-2.0 |
neumerance/cloudloon2 | openstack_dashboard/dashboards/project/access_and_security/security_groups/tables.py | 6 | 5801 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... | apache-2.0 |
beck/django | django/db/backends/oracle/compiler.py | 407 | 2180 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query clas... | bsd-3-clause |
googleapis/python-dialogflow | samples/snippets/detect_intent_stream_test.py | 1 | 1124 | # Copyright 2017, Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | apache-2.0 |
wdingx/pan-genome-analysis | scripts/sf_core_tree_build.py | 2 | 4272 | import os, sys, time, random, glob, subprocess, shutil
from sf_miscellaneous import times, check_dependency
from ete2 import Tree
from sf_geneCluster_align_makeTree import mpm_tree
def resolve_polytomies(infileName, outfileName):
newickString=open(infileName, 'rb').readline().rstrip().replace('[&R] ', '')
tree... | gpl-3.0 |
agend/elliptics | tests/pytests/test_recovery.py | 1 | 27021 | #!/usr/bin/env python
# =============================================================================
# 2013+ Copyright (c) Kirill Smorodinnikov <shaitkir@gmail.com>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | lgpl-3.0 |
smarkwell/asuswrt-merlin | release/src/router/samba36/lib/dnspython/examples/reverse.py | 74 | 1336 | #!/usr/bin/env python
# Usage: reverse.py <zone_filename>...
#
# This demo script will load in all of the zones specified by the
# filenames on the command line, find all the A RRs in them, and
# construct a reverse mapping table that maps each IP address used to
# the list of names mapping to that address. The table... | gpl-2.0 |
TLOIN-3X-WIP/android_kernel_samsung_msm8660-common | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
geofft/pyasn1 | pyasn1/codec/ber/decoder.py | 1 | 37959 | # BER decoder
from pyasn1.type import tag, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, isOctetsType
from pyasn1 import debug, error
class AbstractDecoder:
protoComponent = None
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet,
... | bsd-2-clause |
yograterol/django | tests/urlpatterns_reverse/namespace_urls.py | 160 | 2533 | from django.conf.urls import include, url
from . import views
from .tests import URLObject
testobj1 = URLObject('testapp', 'test-ns1')
testobj2 = URLObject('testapp', 'test-ns2')
default_testobj = URLObject('testapp', 'testapp')
otherobj1 = URLObject('nodefault', 'other-ns1')
otherobj2 = URLObject('nodefault', 'othe... | bsd-3-clause |
tomevans/planetc | planetc/transit.py | 1 | 22091 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import pdb, sys, os
from . import keporb, ma02
from . import phys_consts as consts
# 15Jul2013 TME:
# Actually, I think I worked out that the 'bug' mentioned
# in the previous comment was an artefact of the equations,
# r... | gpl-2.0 |
benspaulding/django | django/contrib/localflavor/ro/forms.py | 8 | 6772 | # -*- coding: utf-8 -*-
"""
Romanian specific form helpers.
"""
from __future__ import absolute_import, unicode_literals
from django.contrib.localflavor.ro.ro_counties import COUNTIES_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError, Field, RegexField, Select
from django... | bsd-3-clause |
javiercantero/streamlink | src/streamlink/plugins/common_swf.py | 7 | 1130 | from collections import namedtuple
from io import BytesIO
from streamlink.utils import swfdecompress
from streamlink.packages.flashmedia.types import U16LE, U32LE
__all__ = ["parse_swf"]
Rect = namedtuple("Rect", "data")
Tag = namedtuple("Tag", "type data")
SWF = namedtuple("SWF", "frame_size frame_rate frame_count ... | bsd-2-clause |
helldorado/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_find.py | 16 | 4730 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, Ansible Project
# 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 |
hbrunn/OpenUpgrade | addons/board/__openerp__.py | 114 | 1763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
pwmarcz/django | tests/dates/tests.py | 27 | 3668 | from __future__ import unicode_literals
import datetime
from django.db.models.fields import FieldDoesNotExist
from django.test import TestCase
from django.utils import six
from .models import Article, Comment, Category
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.obje... | bsd-3-clause |
podemos-info/odoo | addons/caldav/calendar_collection.py | 9 | 3583 | # -*- 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 |
bgris/ODL_bgris | lib/python3.5/site-packages/networkx/readwrite/graphml.py | 33 | 21280 | """
*******
GraphML
*******
Read and write graphs in GraphML format.
This implementation does not support mixed graphs (directed and unidirected
edges together), hyperedges, nested graphs, or ports.
"GraphML is a comprehensive and easy-to-use file format for graphs. It
consists of a language core to describe the stru... | gpl-3.0 |
sudosurootdev/external_chromium_org | tools/telemetry/telemetry/core/platform/mac_platform_backend.py | 26 | 6066 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ctypes
import os
import time
from telemetry import decorators
from telemetry.core.platform import platform_backend
from telemetry.core.platform impor... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.