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 |
|---|---|---|---|---|---|
BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/tests/test_panelnd.py | 2 | 3445 | # -*- coding: utf-8 -*-
import nose
from pandas.core import panelnd
from pandas.core.panel import Panel
from pandas.util.testing import assert_panel_equal
import pandas.util.testing as tm
class TestPanelnd(tm.TestCase):
def setUp(self):
pass
def test_4d_construction(self):
# create a 4D
... | mit |
harikishen/addons-server | src/olympia/amo/tasks.py | 1 | 2584 | import datetime
from django.core.mail import EmailMessage, EmailMultiAlternatives
import olympia.core.logger
from olympia import amo
from olympia.activity.models import ActivityLog
from olympia.amo.celery import task
from olympia.amo.utils import get_email_backend
from olympia.bandwagon.models import Collection
from ... | bsd-3-clause |
sctjkc01/ofCourse | ofcourse/participants.py | 1 | 3800 | import os
from datetime import datetime, date, timedelta
from urlparse import urlparse
import yaml
from flask import Blueprint, redirect
from flask.ext.mako import render_template
import ofcourse
from ofcourse.util import app_path, get_hw_keys
participants_bp = Blueprint('participants_bp',
... | apache-2.0 |
doduytrung/odoo-8.0 | addons/account/wizard/account_validate_account_move.py | 381 | 3203 | # -*- 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 |
akarki15/mozillians | vendor-local/lib/python/unidecode/x07e.py | 252 | 4682 | data = (
'Xia ', # 0x00
'Yuan ', # 0x01
'Zong ', # 0x02
'Xu ', # 0x03
'Nawa ', # 0x04
'Odoshi ', # 0x05
'Geng ', # 0x06
'Sen ', # 0x07
'Ying ', # 0x08
'Jin ', # 0x09
'Yi ', # 0x0a
'Zhui ', # 0x0b
'Ni ', # 0x0c
'Bang ', # 0x0d
'Gu ', # 0x0e
'Pan ', # 0x0f
'Zhou ', # 0x1... | bsd-3-clause |
MartinSavc/scikit-learn | sklearn/neighbors/classification.py | 132 | 14388 | """Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by ... | bsd-3-clause |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/drawing/fill.py | 10 | 10642 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Bool,
Integer,
Set,
NoneSet,
Typed,
MinMax,
Sequence,
)
from openpyxl.descriptors.excel import Relation
from op... | apache-2.0 |
django-danceschool/django-danceschool | danceschool/discounts/tests.py | 1 | 20249 | from django.urls import reverse
from django.utils import timezone
from datetime import timedelta
from danceschool.core.constants import REG_VALIDATION_STR, updateConstant
from danceschool.core.utils.tests import DefaultSchoolTestCase
from danceschool.core.models import Invoice, Registration
from .models import (
... | bsd-3-clause |
lsinfo/odoo | addons/l10n_ma/__init__.py | 430 | 1071 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
ISBX/isbx-loopback-cms | vendor/js-beautify/python/jsbeautifier/__init__.py | 9 | 83180 | from __future__ import print_function
import sys
import os
import getopt
import re
import string
import errno
import copy
from jsbeautifier.__version__ import __version__
#
# The MIT License (MIT)
# Copyright (c) 2007-2013 Einar Lielmanis and contributors.
# Permission is hereby granted, free of charge, to any perso... | mit |
smurfix/DaBroker | dabroker/base/transport/__init__.py | 1 | 4226 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division, unicode_literals
##
## This file is part of DaBroker, a distributed data access manager.
##
## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>,
## it is licensed under the GPLv3. See the file `README.rst` fo... | gpl-3.0 |
GrandmasterK/XScheduler | venv/lib/python2.7/site-packages/flask/templating.py | 783 | 4707 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... | mit |
Tennyson53/SUR | magnum/tests/unit/common/cert_manager/test_local.py | 3 | 5314 | # Copyright 2014 Rackspace US, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
iocast/vectorformats | vectorformats/formats/dxf.py | 2 | 1362 | from dxfwrite import DXFEngine as dxf
from .format import Format
class DXF(Format):
_drawing = None
def encode(self, features, **kwargs):
tmpFile = kwargs["tmpFile"]
if len(features) > 0:
self._drawing = dxf.drawing(tmpFile)
self._drawing.add_layer("... | mit |
joelsmith/openshift-tools | ansible/roles/lib_openshift_3.2/build/src/oc_user.py | 13 | 4702 | # vim: expandtab:tabstop=4:shiftwidth=4
# pylint: skip-file
# pylint: disable=too-many-instance-attributes
class OCUser(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
kind = 'users'
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
config,
... | apache-2.0 |
vaidap/zulip | zerver/webhooks/slack/view.py | 3 | 1608 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message, create_stream_if_needed
from zerver.lib.response import json_success, json_err... | apache-2.0 |
tbekolay/neurotools | examples/single_neuron/CRF_neuron_vs_signal.py | 3 | 3070 | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
CRF_neuron_vs_signal.py
Testing the mean firing rate of a fiber for different signal strengths.
Prints to a figure the mean firing rate for the output (ON and OFF) as a function
of the different parameter values. It's similar to a CRF function.
Results illustrate that
... | gpl-2.0 |
chrisjaquet/FreeCAD | src/Mod/Path/PathScripts/nc/dynapath.py | 30 | 1067 | import nc
import iso
import math
import datetime
import time
from format import Format
now = datetime.datetime.now()
class Creator(iso.Creator):
def __init__(self):
iso.Creator.__init__(self)
self.output_tool_definitions = False
self.m_codes_on_their_own_line = True
s... | lgpl-2.1 |
MattFaus/CrowdTube-Connector | youtube.py | 1 | 6824 | import os
import urlparse
from lib import gdata
import lib.gdata.youtube.client
import secrets
GDATA_API_CLIENT_ID = 'CrowdTube-Connector'
class YouTubeCaptionEditor(object):
def __init__(self, google_email, google_password, youtube_username):
self.youtube_username = youtube_username
self.youtub... | mit |
40223136/w17test1 | static/Brython3.1.3-20150514-095342/Lib/logging/config.py | 739 | 35619 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-3.0 |
flamholz/thrift | lib/py/src/protocol/TProtocol.py | 75 | 10848 | #
# 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 |
qtumproject/qtum | test/functional/feature_filelock.py | 8 | 1833 | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Check that it's not possible to start a second bitcoind instance using the same datadir or wallet."""
i... | mit |
nickpack/reportlab | src/reportlab/pdfbase/pdfform.py | 3 | 17084 |
"""Support for Acrobat Forms in ReportLab documents
This module is somewhat experimental at this time.
Includes basic support for
textfields,
select fields (drop down lists), and
check buttons.
The public interface consists of functions at the moment.
At some later date these operations may b... | bsd-3-clause |
a-parhom/edx-platform | common/djangoapps/student/tests/test_password_policy.py | 2 | 14639 | # -*- coding: utf-8 -*-
"""
This test file will verify proper password policy enforcement, which is an option feature
"""
import json
from importlib import import_module
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.urls import reverse
from django.test import TestCas... | agpl-3.0 |
alaski/nova | nova/scheduler/filters/exact_disk_filter.py | 18 | 1846 | # Copyright (c) 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 ... | apache-2.0 |
mlperf/training_results_v0.5 | v0.5.0/google/cloud_v2.512/resnet-tpuv2-512/code/resnet/model/tpu/models/official/resnet/resnet_main.py | 5 | 27064 | # 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 |
eaudeweb/xhtml2pdf | setup_version.py | 61 | 1771 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
vlachoudis/sl4a | python/src/Lib/encodings/cp850.py | 593 | 34361 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | apache-2.0 |
fredrikw/scipy | scipy/weave/examples/cast_copy_transpose.py | 100 | 5687 | """ Cast Copy Tranpose is used in numpy LinearAlgebra.py to convert
C ordered arrays to Fortran order arrays before calling Fortran
functions. A couple of C implementations are provided here that
show modest speed improvements. One is an "inplace" transpose that
does an in memory transpose of an array... | bsd-3-clause |
gmalmquist/pants | tests/python/pants_test/backend/codegen/tasks/test_ragel_gen.py | 12 | 2331 | # coding=utf-8
# Copyright 2014 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... | apache-2.0 |
yinchunlong/abelkhan-1 | ext/c++/thirdpart/c++/boost/tools/build/src/build/feature.py | 11 | 33759 | # Status: ported, except for unit tests.
# Base revision: 64488
#
# Copyright 2001, 2002, 2003 Dave Abrahams
# Copyright 2002, 2006 Rene Rivera
# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost... | mit |
rockfruit/bika.lims | bika/lims/browser/analysisrequest/results_not_requested.py | 1 | 2747 | # This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
from AccessControl import getSecurityManager
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.permissions import *
from bika.lims.browser.analysisreq... | agpl-3.0 |
qnib/QNIBCollect | src/diamond/collectors/traceroute/traceroute.py | 7 | 3878 | # coding=utf-8
"""
Collect icmp round trip times per hop
#### Dependencies
* libparistraceroute1 (as paris-traceroute)
"""
import re
import diamond.collector
from subprocess import Popen, PIPE
class TracerouteCollector(diamond.collector.ProcessCollector):
def get_default_config_help(self):
config_... | apache-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/pygments/lexers/modula2.py | 23 | 52564 | # -*- coding: utf-8 -*-
"""
pygments.lexers.modula2
~~~~~~~~~~~~~~~~~~~~~~~
Multi-Dialect Lexer for Modula-2.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include
from pygments.util... | mit |
LongSeanSilvr/DC_Metro_Tracker | development_version/src/general_intents.py | 1 | 1923 | import build_response as br
# ======================================================================================================================
# Skill Behavior: Welcome Response
# ======================================================================================================================
class Welcome... | gpl-3.0 |
Sorsly/subtle | google-cloud-sdk/lib/googlecloudsdk/command_lib/ml/predict_utilities.py | 3 | 3913 | # 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 ag... | mit |
jaredculp/faker | faker/providers/address/es/__init__.py | 15 | 3305 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
## List of Countries https://www.un.org/es/members/
countries = (
'Afganistán', 'Albania', 'Alemania', 'Andorra', 'Angola',
'Antigua y Barbuda', 'Arabi... | mit |
GNOME/libgxps | regtest/TestReferences.py | 1 | 3535 | # TestReferences.py
#
# Copyright (C) 2011 Carlos Garcia Campos <carlosgc@gnome.org>
#
# 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 ... | lgpl-2.1 |
HyechurnJang/archon | archon/view/core.py | 2 | 10791 | # -*- coding: utf-8 -*-
################################################################################
# _____ _ _____ _ #
# / ____(_) / ____| | | #
# | | _ ___ ___ ___ | (___ _ _ ___... | apache-2.0 |
chouseknecht/ansible | test/units/modules/network/f5/test_bigip_firewall_dos_profile.py | 22 | 3200 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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 json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
dakrauth/picker | picker/forms.py | 1 | 6144 | from django import forms
from django.utils import timezone
from django.utils.module_loading import import_string
from . import models as picker
from . import utils
_picker_widget = None
encoded_game_key = 'game_{}'.format
TIE_KEY = '__TIE__'
def decoded_game_key(value):
return int(value.replace('game_', ''))
... | mit |
waytai/odoo | addons/crm/report/report_businessopp.py | 377 | 6269 | # -*- 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 |
MyRobotLab/pyrobotlab | home/pedrosenarego/zorba/gestures/addknowledge.py | 3 | 1333 | import os
import sys
import fileinput
import os.path
def addKnowledge(category,pattern):
#### change somethings to make sense############
pattern = pattern.replace('my', 'your')
#### Clean the ending </aiml>############
for line in fileinput.input('/home/pedro/myrobotLab/myrobotLab-1.0.1461/develo... | apache-2.0 |
ch33kybutt/kernel_skipjack_tuna | 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 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.2/tests/modeltests/aggregation/tests.py | 46 | 20519 | import datetime
from decimal import Decimal
from django.db.models import Avg, Sum, Count, Max, Min
from django.test import TestCase, Approximate
from models import Author, Publisher, Book, Store
class BaseAggregateTestCase(TestCase):
fixtures = ["initial_data.json"]
def test_empty_aggregate(self):
... | mit |
mims2707/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/atom/core.py | 80 | 20759 | #!/usr/bin/env python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
tkem/mopidy-local-sqlite | mopidy_local_sqlite/library.py | 2 | 9430 | from __future__ import unicode_literals
import hashlib
import logging
import operator
import os
import os.path
import sqlite3
import sys
from mopidy import local
from mopidy.exceptions import ExtensionError
from mopidy.local import translator
from mopidy.models import Ref, SearchResult
import uritools
from . import... | apache-2.0 |
ynkjm/ryu | ryu/contrib/ncclient/transport/errors.py | 77 | 1293 | # Copyright 2009 Shikhar Bhushan
#
# 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 writin... | apache-2.0 |
amerlyq/piony | piony/config/argparser.py | 1 | 2747 | from argparse import ArgumentParser, RawDescriptionHelpFormatter
import piony
from piony.common.exceptions import InputError
class ArgParser(object):
def __init__(self):
self.ps = ArgumentParser(prog=piony.__appname__,
formatter_class=RawDescriptionHelpFormatter,
... | gpl-3.0 |
gautam1858/tensorflow | tensorflow/python/training/adagrad_test.py | 22 | 15078 | # 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 |
Stan1989/volatility | volatility/plugins/gui/vtypes/xp.py | 50 | 16283 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | gpl-2.0 |
nesterione/scikit-learn | doc/datasets/mldata_fixture.py | 367 | 1183 | """Fixture module to skip the datasets loading when offline
Mock urllib2 access to mldata.org and create a temporary data folder.
"""
from os import makedirs
from os.path import join
import numpy as np
import tempfile
import shutil
from sklearn import datasets
from sklearn.utils.testing import install_mldata_mock
fr... | bsd-3-clause |
strahlc/exaile | xlgui/main.py | 1 | 43837 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
chvogl/tardis | tardis/io/config_reader.py | 1 | 40145 | # Module to read the rather complex config data
import logging
import os
import pprint
from astropy import constants, units as u
import numpy as np
import pandas as pd
import yaml
import tardis
from tardis.io.model_reader import read_density_file, \
calculate_density_after_time, read_abundances_file
from tardis.... | bsd-3-clause |
vitor-alves/pixel-canvas-bot | packages/chardet/langhungarianmodel.py | 269 | 12592 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
ShownX/incubator-mxnet | example/rcnn/rcnn/io/rpn.py | 34 | 10297 | # 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 |
zyxcambridge/RecordExistence | code/web/node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/usr/bin/env python
# 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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | mit |
shellderp/sublime-robot-plugin | lib/robot/running/runkwregister.py | 2 | 1734 | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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 |
PokemonGoF/PokemonGo-Bot-Desktop | build/pywin/Lib/hmac.py | 70 | 4588 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from operator import _compare_digest as compare_digest
trans_5C = "".join ([chr (x ^ 0x5C) for x in xrange(256)])
trans_36 = "".join ([chr (x ^ 0x36) for x in x... | mit |
h3biomed/ansible | lib/ansible/modules/database/postgresql/postgresql_idx.py | 2 | 15109 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Andrey Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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 = {... | gpl-3.0 |
Parrot-Developers/bybop | src/Bybop_NetworkAL.py | 2 | 4049 | import socket
import struct
import threading
class DataType:
ACK=1
DATA=2
DATA_LOW_LATENCY=3
DATA_WITH_ACK=4
class NetworkAL(object):
"""
Alternate implementation of the ARNetworkAL protocol, for Wifi devices.
This implementations is fully compliant with the protocol, and has no major
... | bsd-3-clause |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/contrib/comments/views/moderation.py | 210 | 5204 | from __future__ import absolute_import
from django import template
from django.conf import settings
from django.contrib import comments
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.comments import signals
from django.contrib.comments.views.utils import next_redirec... | mit |
gavoski/audacity | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/xlcxx.py | 330 | 1222 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlcxx(conf):
cxx=conf.find_program(['xlc++_r','xlc++'],var='CXX')
cxx=conf.cmd_to_list(cx... | gpl-2.0 |
amw2104/fireplace | fireplace/cards/classic/paladin.py | 1 | 2853 | from ..utils import *
##
# Hero Powers
# Reinforce (Uther Lightbringer)
class CS2_101:
activate = Summon(CONTROLLER, "CS2_101t")
# Reinforce (Uther Skin 1)
class CS2_101_H1:
activate = CS2_101.activate
##
# Minions
# Guardian of Kings
class CS2_088:
play = Heal(FRIENDLY_HERO, 6)
# Argent Protector
class EX1... | agpl-3.0 |
google/contentbox | third_party/django/contrib/formtools/wizard/storage/base.py | 216 | 3949 | from django.core.files.uploadedfile import UploadedFile
from django.utils.datastructures import MultiValueDict
from django.utils.functional import lazy_property
from django.utils import six
from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured
class BaseStorage(object):
step_key ... | apache-2.0 |
renyi533/tensorflow | tensorflow/python/keras/mixed_precision/experimental/policy.py | 1 | 25763 | # Copyright 2019 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 |
Ted1993/Flasky | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 1778 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# 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 License, or (at your option) any later ve... | mit |
PrismTech/opensplice | build/docs/DDSTutorial/source/conf.py | 2 | 8804 | # -*- coding: utf-8 -*-
#
# Vortex OpenSplice Tutorial build configuration file, created by
# ReST Editor on 24-Mar-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
# autogenerated file.
#
# All configuration ... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/networkmanagement/v1/networkmanagement-v1-py/google/cloud/network_management_v1/services/reachability_service/transports/grpc.py | 1 | 21150 | # -*- 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 |
VlachosGroup/VlachosGroupAdditivity | pgradd/DrawMol.py | 1 | 2230 | """
=========================================
Defenition to draw RDKIT mol object (:mod:`pgradd.DrawMol`)
=========================================
Coverts a rdkit mol object to a svg image and display.
"""
from rdkit import Chem
from rdkit.Chem import rdDepictor
from rdkit.Chem.Draw import rdMolDraw2D
from IPython.... | mit |
aldebaran/qibuild | python/qitest/parsers.py | 1 | 7334 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Collection of parser fonctions for qitests actions """
from __future__ import absolute_import
from __future__ import un... | bsd-3-clause |
pekeler/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_pep352.py | 51 | 9655 | import unittest
import __builtin__
import exceptions
import warnings
from test.test_support import run_unittest
import os
from platform import system as platform_system
def ignore_message_warning():
"""Ignore the DeprecationWarning for BaseException.message."""
warnings.resetwarnings()
warnings.filterwarni... | apache-2.0 |
ahmed-mahran/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Part.py | 37 | 19486 | #._cv_part guppy.heapy.Part
class Format(object):
__slots__ = 'impl', 'mod'
def __init__(self, impl):
self.impl = impl
self.mod = impl.mod
def get_formatted_row(self, row):
fr = self.get_stat_data(row)
rows = []
rs = row.name.split('\n')
subsequent_indent = len(fr)*' '
rows.extend(self.mod.wrap(
... | apache-2.0 |
yfried/ansible | test/units/plugins/action/test_raw.py | 45 | 3763 | # (c) 2016, Saran Ahluwalia <ahlusar.ahluwalia@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) any... | gpl-3.0 |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractCurrentlyTLingBuniMi.py | 1 | 1148 | def extractCurrentlyTLingBuniMi(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if item['title'].startswith('[BNM]'):
return buildReleaseMessageWithType(item, 'Bu ni Mi wo Sasagete Hyaku to ... | bsd-3-clause |
Dhivyap/ansible | lib/ansible/modules/web_infrastructure/taiga_issue.py | 47 | 10952 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Alejandro Guirao <lekumberri@gmail.com>
# 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.... | gpl-3.0 |
OptiPop/external_chromium_org_third_party_skia | gm/rename_config.py | 20 | 3431 | #!/usr/bin/python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility to rename a config in some subset of our GM expectation files.
Created for http://skbug.com/2752 ('split existing "gpu" GM ... | bsd-3-clause |
ychfan/tensorflow | tensorflow/contrib/distributions/python/ops/vector_exponential_linear_operator.py | 10 | 10517 | # 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 |
yfried/ansible | lib/ansible/modules/monitoring/icinga2_host.py | 35 | 9960 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This module is proudly sponsored by CGI (www.cgi.com) and
# KPN (www.kpn.com).
# 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_METADA... | gpl-3.0 |
xcgspring/AXUI | test/test_driver/windows/test_Translater.py | 1 | 1731 |
import sys
import unittest
class TestTranslater(unittest.TestCase):
@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
def test_coordinate_identifier(self):
import AXUI.driver.windows.Translater as translater
from AXUI.parsing.identifier_parsing import identi... | apache-2.0 |
christiansandberg/canopen | test/test_emcy.py | 1 | 2212 | import unittest
from canopen import emcy
class TestEmcyConsumer(unittest.TestCase):
def test_emcy_list(self):
emcy_node = emcy.EmcyConsumer()
emcy_node.on_emcy(0x81, b'\x01\x20\x02\x00\x01\x02\x03\x04', 1473418396.0)
emcy_node.on_emcy(0x81, b'\x10\x90\x01\x00\x01\x02\x03\x04', 1473418397.... | mit |
hlin117/scikit-learn | doc/tutorial/machine_learning_map/svg2imagemap.py | 360 | 3411 | #!/usr/local/bin/python
"""
This script converts a subset of SVG into an HTML imagemap
Note *subset*. It only handles <path> elements, for which it only pays
attention to the M and L commands. Futher, it only notices the "translate"
transform.
It was written to generate the examples in the documentation f... | bsd-3-clause |
arnedesmedt/dotfiles | .config/sublime-text-3/Packages.symlinkfollow/pygments/all/pygments/lexers/tcl.py | 47 | 5398 | # -*- coding: utf-8 -*-
"""
pygments.lexers.tcl
~~~~~~~~~~~~~~~~~~~
Lexers for Tcl and related languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token import... | mit |
medallia/aurora | src/main/python/apache/aurora/config/resource.py | 2 | 3436 | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | apache-2.0 |
Froff/TFY4115-Simulering | python/Simulation.py | 1 | 1185 | from math import sqrt
import Slope
class Simulation:
SIM_STEP_SIZE = 0.0001
const_g = -981
def __init__ (self, slope, **kwargs):
self.slope = slope
self.t = [0]
self.x = [Simulation.SIM_STEP_SIZE]
self.mom_inertia_coefficient = 0
for name, value in kwargs.items():
... | mit |
Fl0rianFischer/sme_odoo | addons/l10n_pl/__openerp__.py | 19 | 1191 | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (C) 2009 - now Grzegorz Grzelak grzegorz.grzelak@openglobe.pl
{
'name' : 'Poland - Accounting',
'version' : '1.02',
'author' : 'Grzegorz Grzelak (OpenGLOBE)',
'website': 'http://www.openglo... | gpl-3.0 |
kampanita/pelisalacarta | python/main-classic/channels/pelisdanko.py | 3 | 14488 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para PelisDanko
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
import sys
from core import config
from core im... | gpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1A/instances/10_0_workflow_full_10files_primary_3sh_3rs_noannot_with_proj_3s_range/generalinfo_0/GeneralInfo_0.py | 50 | 1207 | #!/usr/bin/env python
"""
This activity wants to answer:
- which time interval was analysed?
- how many items has this interval?
"""
# Connection with SciWonc-Dataflow module
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_GeneralInfo_0
# connector and config
client = DataStoreClient("mong... | gpl-3.0 |
mdanielwork/intellij-community | python/helpers/pydev/tests_pydevd_runfiles/test_pydevdio.py | 26 | 1184 | import sys
import os
import unittest
class Test(unittest.TestCase):
def test_it(self):
#make it as if we were executing from the directory above this one (so that we can use jycompletionserver
#without the need for it being in the pythonpath)
#(twice the dirname to get the previous level... | apache-2.0 |
tchernomax/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_boot_manager.py | 11 | 12392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
#
# 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__ ... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/gkehub/v1alpha2/gkehub-v1alpha2-py/google/cloud/gkehub_v1alpha2/services/gke_hub/pagers.py | 1 | 5811 | # -*- 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 |
wuhengzhi/chromium-crosswalk | tools/json_schema_compiler/js_externs_generator_test.py | 15 | 8773 | #!/usr/bin/env python
# Copyright 2015 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 idl_schema
import json_parse
from js_externs_generator import JsExternsGenerator
from datetime import datetime
import model
impo... | bsd-3-clause |
erccarls/vectorsearch | vectorsearch/word2vec.py | 1 | 4242 | from __future__ import division # py3 "true division"
import logging
import sys
import os
import heapq
from timeit import default_timer
from copy import deepcopy
from collections import defaultdict
import threading
import itertools
import gensim
from gensim.utils import keep_vocab_item
try:
from queue import Qu... | apache-2.0 |
CloudBreadPaPa/azure-ml-python-seminar | code/python/ml-Iris.py | 1 | 1412 | import urllib2
# If you are using Python 3+, import urllib instead of urllib2
import json
data = {
"Inputs": {
"input1":
{
"ColumnNames": ["Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width", "Species"],
"Values": [ [ "1", "... | mit |
kaiix/depot_tools | tests/trychange_unittest.py | 43 | 6250 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for trychange.py."""
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.pat... | bsd-3-clause |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/syndication/views.py | 113 | 8515 | from __future__ import unicode_literals
from calendar import timegm
from django.conf import settings
from django.contrib.sites.models import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.template import loader, Te... | apache-2.0 |
andyfaff/scipy | scipy/sparse/csgraph/tests/test_shortest_path.py | 17 | 12026 | import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from pytest import raises as assert_raises
from scipy.sparse.csgraph import (shortest_path, dijkstra, johnson,
bellman_ford, construct_dist_matrix,
NegativeCycle... | bsd-3-clause |
pieterlexis/pdns | build-scripts/cherry-pick-pr.py | 4 | 1840 | #!/usr/bin/env python3
import requests
import sys
import subprocess
import argparse
def get_commits(pr):
try:
res = requests.get('https://api.github.com/repos/PowerDNS/pdns/pulls/'
'{}/commits'.format(pr)).json()
return [c['sha'] for c in res]
except (ValueError, re... | gpl-2.0 |
snasoft/QtCreatorPluginsPack | Bin/3rdParty/vera/bin/lib/Queue.py | 188 | 8561 | """A multi-producer, multi-consumer queue."""
from time import time as _time
try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
from collections import deque
import heapq
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
class Empty(Exception):
"... | lgpl-3.0 |
schwehr/gdal-autotest2 | python/ogr/georss_test.py | 1 | 15293 | # MOE:insert #!/usr/bin/env python
# Copyright 2018 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
#
# Unl... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.