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 |
|---|---|---|---|---|---|
neishm/EC-CAS-diags | eccas_diags/interfaces/data_scanner.py | 1 | 33411 | ###############################################################################
# Copyright 2016 - Climate Research Division
# Environment and Climate Change Canada
#
# This file is part of the "EC-CAS diags" package.
#
# "EC-CAS diags" is free software: you can redistribute it and/or modify
# it under... | lgpl-3.0 |
nexiles/odoo | addons/stock_dropshipping/__openerp__.py | 260 | 2037 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
popazerty/enigma2 | lib/python/Tools/Transponder.py | 2 | 10136 | from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersCable, eDVBFrontendParametersTerrestrial
from Components.NimManager import nimmanager
def ConvertToHumanReadable(tp, tunertype = None):
ret = { }
if tunertype is None:
tunertype = tp.get("tuner_type", "None")
if tunertype == "DVB-S":
ret[... | gpl-2.0 |
gautamkmr/incubator-mxnet | python/mxnet/io.py | 1 | 32297 | # 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 |
delletenebre/xbmc-addon-kilogramme | script.module.beautifulsoup4/lib/bs4/diagnose.py | 63 | 6747 | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __vers... | gpl-3.0 |
nthien/pulp | server/pulp/server/db/migrations/0005_unit_last_updated.py | 4 | 1208 | # -*- coding: utf-8 -*-
#
# Copyright © 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... | gpl-2.0 |
bclau/nova | nova/scheduler/filters/core_filter.py | 27 | 4005 | # Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2012 Justin Santa Barbara
#
# 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.ap... | apache-2.0 |
ptisserand/ansible | lib/ansible/modules/network/aci/aci_interface_policy_leaf_policy_group.py | 14 | 18369 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.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_... | gpl-3.0 |
phalt/django | django/contrib/gis/gdal/prototypes/ds.py | 189 | 4413 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p
from django.contrib.gis.gdal.envelope import OGREnvelope
from djan... | bsd-3-clause |
sebasmannem/ceph_openstack_centos_ansible | roles/controller/files/secure_mariadb.py | 2 | 1653 | #!/usr/bin/env python2
import socket
import pymysql
import argparse
parser = argparse.ArgumentParser(description='Do everything that mysql_secure_installation does, but then better.')
parser.add_argument('-p', '--password', dest='password', help='Password for root. 1: change it to this. 2: use this if previous pw doe... | gpl-3.0 |
js850/PyGMIN | pygmin/transition_states/_nebdriver.py | 1 | 11990 | import logging
import numpy as np
from pygmin.transition_states import NEB, NEBPar
from pygmin.transition_states._NEB import distance_cart
from interpolate import InterpolatedPath, interpolate_linear
from pygmin.utils.events import Signal
all = ["NEBDriver"]
logger = logging.getLogger("pygmin.connect.neb")
#def cal... | gpl-3.0 |
arjclark/cylc | lib/isodatetime/data.py | 3 | 88442 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# (C) British Crown Copyright 2013-2018 Met Office.
#
# This program 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 Sof... | gpl-3.0 |
bguillot/OpenUpgrade | addons/hr_timesheet_invoice/__init__.py | 442 | 1101 | # -*- 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 |
wasade/networkx | networkx/drawing/tests/test_pylab.py | 45 | 1137 | """
Unit tests for matplotlib drawing functions.
"""
import os
from nose import SkipTest
import networkx as nx
class TestPylab(object):
@classmethod
def setupClass(cls):
global plt
try:
import matplotlib as mpl
mpl.use('PS',warn=False)
import matplotli... | bsd-3-clause |
wenLiangcan/fanyi.py | fanyi/__main__.py | 1 | 1197 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import threading
from os import path
from .metadata import version
from .services import iciba, youdao
from .textui import colored, show
def print_help():
"""Print help message.
"""
print(colored.cyan('usage:... | gpl-3.0 |
conductor-tutti/space_for_us | lib/werkzeug/utils.py | 145 | 22826 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2014 ... | apache-2.0 |
duhzecca/cinder | cinder/api/views/types.py | 28 | 1450 | # Copyright 2012 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
markrawlingson/SickRage | lib/chardet/sbcsgroupprober.py | 50 | 3540 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
gururajl/deep-learning | language-translation/problem_unittests.py | 61 | 20562 | import numpy as np
import tensorflow as tf
from tensorflow.python.layers.core import Dense
import itertools
import collections
import helper
def _print_success_message():
print('Tests Passed')
def test_text_to_ids(text_to_ids):
test_source_text = 'new jersey is sometimes quiet during autumn , and it is snow... | mit |
michalsenkyr/spark | examples/src/main/python/mllib/isotonic_regression_example.py | 100 | 2394 | #
# 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 |
odoousers2014/odoo | addons/event_sale/models/sale_order.py | 3 | 5917 | # -*- coding: utf-8 -*-
from openerp import api
from openerp.osv import fields, osv
class sale_order(osv.osv):
_inherit = "sale.order"
def action_button_confirm(self, cr, uid, ids, context=None):
# TDE note: This method works on a list of one id (see sale/sale.py) so working on ids[0] seems safe.
... | agpl-3.0 |
rudix-mac/rudix | Utils/darwin_synthesize_distribution.py | 1 | 3201 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2013-2017 Rudá Moura (Rudix)
# Author: Rudá Moura <ruda.moura@gmail.com>
#
# Synthesize a Distribution file.
#
import sys
from getopt import getopt
Distribution = '''<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-script minSpecVersion="1.000... | bsd-3-clause |
traveloka/ansible | lib/ansible/compat/__init__.py | 332 | 1088 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
diogocs1/comps | web/addons/mrp_operations/report/mrp_wc_barcode.py | 381 | 1501 | # -*- 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... | apache-2.0 |
newrocknj/horizon | openstack_dashboard/dashboards/identity/users/panel.py | 44 | 1119 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | apache-2.0 |
NelisVerhoef/scikit-learn | examples/cluster/plot_dict_face_patches.py | 337 | 2747 | """
Online learning of a dictionary of parts of faces
==================================================
This example uses a large dataset of faces to learn a set of 20 x 20
images patches that constitute faces.
From the programming standpoint, it is interesting because it shows how
to use the online API of the sciki... | bsd-3-clause |
endlessm/chromium-browser | tools/tcmalloc/print-live-objects.py | 10 | 2588 | #!/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.
"""Symbolizes and prints live objects as recorded by tcmalloc's
HeapProfilerDumpLiveObjects.
"""
from __future__ import print_func... | bsd-3-clause |
wfxiang08/sqlalchemy | test/engine/test_ddlevents.py | 27 | 25692 |
from sqlalchemy.testing import assert_raises, assert_raises_message
from sqlalchemy.schema import DDL, CheckConstraint, AddConstraint, \
DropConstraint
from sqlalchemy import create_engine
from sqlalchemy import MetaData, Integer, String, event, exc, text
from sqlalchemy.testing.schema import Table
from sqlalchemy... | mit |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/PIL/XbmImagePlugin.py | 18 | 2452 | #
# The Python Imaging Library.
# $Id$
#
# XBM File handling
#
# History:
# 1995-09-08 fl Created
# 1996-11-01 fl Added save support
# 1997-07-07 fl Made header parser more tolerant
# 1997-07-22 fl Fixed yet another parser bug
# 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.4)
# 2001-05-13 fl Ad... | apache-2.0 |
mohammed-alfatih/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/ins-del-datetime.py | 141 | 8457 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"date-year-0000": "0000-12-09",
"date-month-00": "2002-00-15",
"date-month-13": "2002-13-15",
"date-0005-02-29": "0005-02-29",
"date... | mpl-2.0 |
GameKinger123x/mtasa-blue | vendor/google-breakpad/src/testing/scripts/generator/cpp/keywords.py | 1157 | 2004 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 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... | gpl-3.0 |
tudarmstadt-lt/QASelection | src/main/resources/scripts/check.py | 1 | 11158 | import HTMLParser
import re
import itertools
import sys
cachedStopWords = {"a", "as", "able", "about", "above", "according", "accordingly", "across", "actually", "after", "afterwards", "again", "against", "aint", "all", "allow", "allows", "almost", "alone", "along", "already", "also", "although", "always", "am", "amon... | apache-2.0 |
franekp/ankidict | ankidict/thirdparty/mhlib.py | 22 | 33434 | """MH interface -- purely object-oriented (well, almost)
Executive summary:
import mhlib
mh = mhlib.MH() # use default mailbox directory and profile
mh = mhlib.MH(mailbox) # override mailbox location (default from profile)
mh = mhlib.MH(mailbox, profile) # override mailbox and profile
mh.error(format, ...)... | agpl-3.0 |
dtaht/ns-3-dev | src/tap-bridge/examples/tap-wifi-virtual-machine.py | 137 | 4041 | # -*- Mode: Python; -*-
#
# Copyright 2010 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be usefu... | gpl-2.0 |
pmrowla/gumiyabot | gumiyabot/__main__.py | 1 | 4441 | # -*- coding: utf-8 -*-
import argparse
import asyncio
import configparser
import os.path
import sys
import irc3
from .bancho import BanchoConnection
def run(config_file='config.ini', debug=False):
config = configparser.ConfigParser()
config.read(config_file)
if 'gumiya' not in config:
sys.exit(... | mit |
QuantumElephant/horton | horton/meanfield/utils.py | 4 | 4223 | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | gpl-3.0 |
ozgurturkiye/istihzapython | 22.Listelerin-ve-Demetlerin-Metotlari/Listelerin ve Demetlerin Metotları.py | 1 | 2392 | #Kaynak: http://belgeler.istihza.com/py3/listelerin_ve_demetlerin_metotlari.html
#append() Bir listeye öğe eklemek için kullanıyoruz.
#append() metodu yalnızca tek parametre alır.
##Yani bu metodu kullanarak bir listeye birden fazla öğe ekleyemezsiniz:
liste = ["elma", "armut", "çilek"]
liste.append("erik") #result:... | gpl-3.0 |
tarballs-are-good/sympy | sympy/functions/__init__.py | 2 | 1700 | """A functions module, includes all the standard functions.
Combinatorial - factorial, fibonacci, harmonic, bernoulli...
Elementary - hyperbolic, trigonometric, exponential, floor and ceiling, sqrt...
Special - gamma, zeta,spherical harmonics...
"""
from sympy.core.basic import Basic
import combinatorial
import eleme... | bsd-3-clause |
dodonator/area51 | Kryptotests/OneTimePad/Beta/v0.4(D)OneTimePad.py | 1 | 12660 | #coding: utf-8
# Momentan in der Entwicklung befindliche Version!
import os
import random
import time
import datetime
import sys
import uuid
os.system('clear')
class oneTimePad(object):
def __init__(self):
NCF = noCryptoFunctions()
self.alphabet = NCF.alphabetGenerierung()
def steganoKrypto(self,klartext,gehei... | gpl-3.0 |
ice1x/restream | flask/lib/python2.7/encodings/iso8859_10.py | 593 | 13845 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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_table)
def decode(self,input,errors... | bsd-3-clause |
alhashash/odoo | addons/edi/models/res_currency.py | 8 | 2825 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
andela-ifageyinbo/django | django/utils/timesince.py | 409 | 2671 | from __future__ import unicode_literals
import calendar
import datetime
from django.utils.html import avoid_wrapping
from django.utils.timezone import is_aware, utc
from django.utils.translation import ugettext, ungettext_lazy
TIMESINCE_CHUNKS = (
(60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')),
... | bsd-3-clause |
nolanliou/tensorflow | tensorflow/python/ops/spectral_grad.py | 102 | 6990 | # 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 |
pombredanne/gensim | gensim/models/phrases.py | 1 | 12052 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automatically detect common phrases (multiword expressions) from a stream of sentences.
The phrases are collocations (frequently co-occurring tokens). See [1]_ for the
exact formula.
For examp... | lgpl-2.1 |
dkoeb/f-spot | tools/copyrightify.py | 8 | 5248 | #!/usr/bin/env python
# Small tool to add copyright headers, used in the GPL -> MIT X11 transition.
#
# TODO: Add support for updating the headers
# TODO: Make sure the header isn't counted when figuring out contributors.
import os
import re
import sys
import subprocess
license_block = "//\n"
license_block += "// @... | mit |
solarjoe/numpy | numpy/polynomial/polynomial.py | 3 | 52599 | """
Objects for dealing with polynomials.
This module provides a number of objects (mostly functions) useful for
dealing with polynomials, including a `Polynomial` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with polynomial objects is in
the do... | bsd-3-clause |
cube2matrix/Krypton | test/networkx/algorithms/bipartite/tests/test_redundancy.py | 59 | 1223 | # test_redundancy.py - unit tests for the bipartite.redundancy module
#
# Copyright 2015 Jeffrey Finkelstein <jeffrey.finkelstein@gmail.com>.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Unit tests for the :mod:`networkx.algorithms.bipart... | gpl-2.0 |
ccook5/open-av-controller | testing/web.py test/kramer.py | 2 | 7168 |
import socket
import time
UDP_IP = "172.16.112.210"
UDP_PORT = 5000
class kramer_matrix_p2000:
def __init__(self, dest_ip_address, dest_udp_port, machine_num):
self.dest_ip_address = dest_ip_address
self.dest_ip_port = dest_udp_port
self.machine_num = machine_num
... | gpl-2.0 |
tdtrask/ansible | lib/ansible/modules/cloud/google/gcp_target_proxy.py | 99 | 10199 | #!/usr/bin/python
# Copyright 2017 Google 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
xkollar/spacewalk | client/rhel/rhn-client-tools/src/up2date_client/config.py | 1 | 12109 | # This file is a portion of the Red Hat Update Agent
# Copyright (c) 1999--2015 Red Hat, Inc. Distributed under GPL
#
# Authors:
# Cristian Gafton <gafton@redhat.com>
# Adrian Likins <alikins@redhat.com>
#
"""
This module includes the Config and Up2date Config classes use by the
up2date agent to hold con... | gpl-2.0 |
acercado/jd-ph-cms | jd-ph-cms/users/admin.py | 183 | 1048 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... | bsd-3-clause |
winstonschroeder77/fitch- | fitch_app/main.py | 1 | 2908 |
import RPi.GPIO as GPIO, atexit
FITCH_PIN_BUT1 = 14
FITCH_PIN_RGBLEDS = 12
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
import gettext
import sys
import os
import appinfo
import app
def parse_commandline():
"""Parses the command line; returns options and filenames.
If --version, --help or invalid opti... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/scrapy/middleware.py | 68 | 2901 | import logging
from collections import defaultdict
from scrapy.exceptions import NotConfigured
from scrapy.utils.misc import load_object
from scrapy.utils.defer import process_parallel, process_chain, process_chain_both
logger = logging.getLogger(__name__)
class MiddlewareManager(object):
"""Base class for impl... | mit |
inclement/vispy | examples/basics/scene/one_cam_two_scenes.py | 17 | 1679 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-3-clause |
SteveViss/readthedocs.org | readthedocs/privacy/backend.py | 5 | 6593 |
from django.db import models
from guardian.shortcuts import get_objects_for_user
from readthedocs.builds.constants import BRANCH
from readthedocs.builds.constants import TAG
from readthedocs.builds.constants import LATEST
from readthedocs.builds.constants import LATEST_VERBOSE_NAME
from readthedocs.builds.constants ... | mit |
alexandrucoman/labs | python/solutii/anda_ungureanu/sincronizare.py | 5 | 1417 | #!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""
Programul sincronizezaza doua path-uri catre astfel
orice fisier adaugat in unul dintre path-uri este
automat copiat in celalalt path.
"""
from __future__ import print_function
import os
import sys
from shutil import copy
def sincronizare_functie(path1, path2):
"... | mit |
ericxk/MachineLearningExercise | perceptron.py | 1 | 1068 | # -*- coding:utf-8 -*-
########################################
# perceptron: perceptron
# Author : xuke
# Date : 2015-12-16
########################################
import matplotlib.pyplot as plt
import numpy
def sign(x,w,b):
res = b
for i in xrange(len(x)-1):
res += x[i+1]*w[i]
return res
def perceptron(dat... | mit |
charlesccychen/beam | sdks/python/apache_beam/runners/dataflow/native_io/iobase.py | 6 | 10660 | #
# 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 |
837468220/python-for-android | python-modules/twisted/twisted/conch/test/test_mixin.py | 62 | 1110 | # -*- twisted.conch.test.test_mixin -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import time
from twisted.internet import reactor, protocol
from twisted.trial import unittest
from twisted.test.proto_helpers import StringTransport
from twisted.conch import mixin
class TestB... | apache-2.0 |
ronfung/incubator-airflow | airflow/contrib/hooks/vertica_hook.py | 60 | 1381 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
takaaptech/sky_engine | third_party/cython/src/Cython/Plex/Transitions.py | 99 | 6161 | #
# Plex - Transition Maps
#
# This version represents state sets direcly as dicts
# for speed.
#
from sys import maxint as maxint
class TransitionMap(object):
"""
A TransitionMap maps an input event to a set of states.
An input event is one of: a range of character codes,
the empty string (representing... | bsd-3-clause |
mnahm5/django-estore | Lib/site-packages/boto3/docs/utils.py | 19 | 5710 | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | mit |
kthordarson/CouchPotatoServer | libs/pyasn1/type/char.py | 172 | 2043 | # ASN.1 "character string" types
from pyasn1.type import univ, tag
class NumericString(univ.OctetString):
tagSet = univ.OctetString.tagSet.tagImplicitly(
tag.Tag(tag.tagClassUniversal, tag.tagFormatSimple, 18)
)
class PrintableString(univ.OctetString):
tagSet = univ.OctetString.tagSet.tagImpli... | gpl-3.0 |
umitproject/openmonitor-aggregator | django/core/urlresolvers.py | 65 | 20847 | """
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a tuple in this format:
(view_function, function_args, function_kwargs)
"""
import re
from threading import local
from django.http import Http40... | agpl-3.0 |
daf/OWSLib | owslib/swe/observation/sos100.py | 3 | 11842 | import cgi
from owslib.etree import etree
from datetime import datetime
from urllib import urlencode
from owslib import ows
from owslib.crs import Crs
from owslib.fes import FilterCapabilities
from owslib.util import openURL, testXMLValue, nspath_eval, nspath, extract_time
from owslib.namespaces import Namespaces
def ... | bsd-3-clause |
mbrubeck/servo | tests/wpt/web-platform-tests/webdriver/tests/element_click/bubbling.py | 18 | 4398 | from tests.support.asserts import assert_success
from tests.support.inline import inline
def element_click(session, element):
return session.transport.send(
"POST", "/session/{session_id}/element/{element_id}/click".format(
session_id=session.session_id,
element_id=element.id))
d... | mpl-2.0 |
Itxaka/st2 | st2common/st2common/exceptions/db.py | 10 | 1337 | # 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... | apache-2.0 |
gselva/thumbor | thumbor/handlers/image_resource.py | 11 | 2698 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import datetime
from thumbor.handlers import ImageApiHandler
from th... | mit |
robovm/robovm-studio | python/helpers/profiler/thriftpy3/protocol/TProtocolDecorator.py | 44 | 1543 | #
# 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 |
aaschaer/globus-sdk-python | globus_sdk/transfer/paging.py | 1 | 13750 | import logging
import six
from globus_sdk.response import GlobusResponse
from globus_sdk.transfer.response import IterableTransferResponse
logger = logging.getLogger(__name__)
class PaginatedResource(GlobusResponse, six.Iterator):
"""
A ``PaginatedResource`` is an iterable response which implements the Pyth... | apache-2.0 |
thimslugga/apistar | tests/test_routing.py | 1 | 4869 | import pytest
from apistar import App, Include, Route, exceptions, http, schema
from apistar.routing import Path, URLPathArgs
from apistar.test import TestClient
class MaxLength(schema.String):
max_length = 5
def found():
return {
'message': 'Found'
}
def path_params(args: URLPathArgs, var: i... | bsd-3-clause |
Manojkumar91/odoo_inresto | addons/website_forum_doc/controllers/main.py | 54 | 3424 | # -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from openerp.addons.website.models.website import slug
class WebsiteDoc(http.Controller):
@http.route(['/forum/how-to', '/forum/how-to/<model("forum.documentation.toc"):toc>'], type='http', auth="public", website=True)
def toc... | agpl-3.0 |
offlinehacker/flumotion | flumotion/component/encoders/dirac/dirac.py | 2 | 2558 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free ... | gpl-2.0 |
geowurster/Acronym | acronym/cmdl/acro_vector/subcommand_cplayer.py | 1 | 15647 | #!/usr/bin/env python
# This document is part of Acronym
# https://github.com/geowurster/Acronym
# =================================================================================== #
#
# New BSD License
#
# Copyright (c) 2014, Kevin D. Wurster
# All rights reserved.
#
# Redistribution and use in source and bi... | bsd-3-clause |
bobjects/BobStack | bobstack/sipmessaging/__init__.py | 1 | 4741 | from classproperty import classproperty
from strongRandomStringServer import StrongRandomStringServer
from sipURI import SIPURI
from sipHeaderField import SIPHeaderField
from integerSIPHeaderField import IntegerSIPHeaderField
from concreteheaderfields import ContentLengthSIPHeaderField
from concreteheaderfields import ... | apache-2.0 |
markrawlingson/SickRage | lib/unidecode/x054.py | 251 | 4583 | data = (
'Mie ', # 0x00
'Xu ', # 0x01
'Mang ', # 0x02
'Chi ', # 0x03
'Ge ', # 0x04
'Xuan ', # 0x05
'Yao ', # 0x06
'Zi ', # 0x07
'He ', # 0x08
'Ji ', # 0x09
'Diao ', # 0x0a
'Cun ', # 0x0b
'Tong ', # 0x0c
'Ming ', # 0x0d
'Hou ', # 0x0e
'Li ', # 0x0f
'Tu ', # 0x10
'Xiang ... | gpl-3.0 |
frohoff/Empire | lib/modules/powershell/situational_awareness/network/bloodhound.py | 2 | 6471 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-BloodHound',
'Author': ['@harmj0y', '@_wald0', '@cptjesus'],
'Description': ('Execute BloodHound data collection.'),
'Background' : True,
... | bsd-3-clause |
hainm/statsmodels | statsmodels/miscmodels/tests/test_tarma.py | 37 | 4301 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 04 23:44:33 2013
Author: Josef Perktold
"""
import numpy as np
from numpy.testing import assert_allclose
from statsmodels.tsa.arima_process import arma_generate_sample
from statsmodels.miscmodels.tmodel import TArma
from statsmodels.tsa.arma_mle import Arma
#from stats... | bsd-3-clause |
akaariai/django | tests/test_runner/test_discover_runner.py | 97 | 6079 | import os
from contextlib import contextmanager
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... | bsd-3-clause |
jdparkins/MasiPlot | hapi.py | 1 | 628709 | # -*- coding: utf-8 -*-
'''
This module provides an access to the HITRAN data.
Data is downloaded and cached.
This module serves as a simple database manager frontend.
API is aimed to be RESTful, which means that interaction
between local API and remote data-server will be held
via sending RESTful queries... | gpl-3.0 |
Alecto3-D/testable-greeter | bb-master/sandbox/lib/python3.5/site-packages/buildbot/secrets/providers/file.py | 5 | 3352 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mit |
thaim/ansible | test/units/module_utils/basic/test_atomic_move.py | 41 | 9772 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
# (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
... | mit |
adw0rd/lettuce-py3 | tests/functional/language_specific_features/test_zh-CN.py | 1 | 6472 | # -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falc達o <gabriel@nacaolivre.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 Foundatio... | gpl-3.0 |
levilucio/SyVOLT | UMLRT2Kiltera_MM/Properties/from_thesis/HMM11_if_CompleteLHS.py | 1 | 4833 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM11_if_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HMM11_if_CompleteLHS.
"""
# Flag ... | mit |
broferek/ansible | lib/ansible/modules/cloud/vultr/vultr_user.py | 12 | 8406 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
puttarajubr/commcare-hq | custom/opm/health_status.py | 1 | 23646 | from django.utils.translation import ugettext as _
from dimagi.utils.decorators.memoized import memoized
from .utils import normal_format, format_percent
class HealthStatus(object):
# maps method name to header
method_map = [
('awc', "AWC"),
('beneficiaries', "Total # of Beneficiaries Regis... | bsd-3-clause |
dakcarto/QGIS | python/console/console_sci.py | 9 | 27253 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
Python Console for QGIS
-------------------
begin : 2012-09-10
copyright : (C) 2012 by Salvatore Larosa
email : lrssvtml (at) gmail (dot) com
***... | gpl-2.0 |
knabar/openmicroscopy | components/tools/OmeroPy/test/integration/scriptstest/test_rand.py | 6 | 2914 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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... | gpl-2.0 |
wsyzxcn/tornado | tornado/test/tcpserver_test.py | 21 | 2292 | from __future__ import absolute_import, division, print_function
import socket
from tornado import gen
from tornado.iostream import IOStream
from tornado.log import app_log
from tornado.stack_context import NullContext
from tornado.tcpserver import TCPServer
from tornado.test.util import skipBefore35, exec_test
from ... | apache-2.0 |
wbc2010/django1.2.5 | tests/regressiontests/templates/nodelist.py | 50 | 1121 | from unittest import TestCase
from django.template.loader import get_template_from_string
from django.template import VariableNode
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_template_from_string(source)
vars = template.n... | bsd-3-clause |
jmesteve/asterisk | openerp/addons/board/board.py | 18 | 6632 | # -*- 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 |
soellman/copernicus | cpc/util/rng.py | 2 | 1489 | # This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Soft... | gpl-2.0 |
tima/ansible | lib/ansible/playbook/role/requirement.py | 81 | 8216 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/policy/v2015_10_01_preview/operations/policy_assignments_operations.py | 2 | 30936 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
aaldaber/owid-grapher | grapher_admin/various_scripts/change_iae_sources.py | 1 | 1242 | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
import grapher_admin.wsgi
from grapher_admin.models import Source
import unidecode
import json
count = 0
all_sources = Source.objects.all()
for each in all_sources:
if 'iea.org' in each.description.lower() or 'iea stat' in each.description... | mit |
jcurbelo/networkx | networkx/algorithms/operators/tests/test_unary.py | 86 | 1328 | from nose.tools import *
import networkx as nx
from networkx import *
def test_complement():
null=null_graph()
empty1=empty_graph(1)
empty10=empty_graph(10)
K3=complete_graph(3)
K5=complete_graph(5)
K10=complete_graph(10)
P2=path_graph(2)
P3=path_graph(3)
P5=path_graph(5)
P10=p... | bsd-3-clause |
kjaym/pypif | pypif/util/read_view.py | 2 | 4837 | from pypif.obj.common.property import Property
from pypif.obj.common.quantity import Quantity
from pypif.obj.common.display_item import DisplayItem
from pypif.obj.common.id import Id
from pypif.obj.common.instrument import Instrument
from pypif.obj.common.license import License
from pypif.obj.common.method import Meth... | apache-2.0 |
xiaoyaozi5566/GEM5_DRAMSim2 | src/mem/ruby/network/simple/SimpleNetwork.py | 15 | 1944 | # Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... | bsd-3-clause |
jor-/scipy | scipy/_lib/six.py | 2 | 7461 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2012 Benjamin Peterson
#
# 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 with... | bsd-3-clause |
r-owen/TUI | TUI/TUIPrefs.py | 1 | 18805 | #!/usr/bin/env python
"""A set of preferences for TUI
To Do:
- Fix the bug that (at least on MacOS X with aqua Tk 8.4.1) the labels
for the various prefs have their own font, which is not the main font
History:
2002-03-08 ROwen First release
2002-11-13 ROwen If the user has a home directory, the prefs file ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.