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 |
|---|---|---|---|---|---|
patrick-nicholson/spark | python/pyspark/statcounter.py | 130 | 5115 | #
# 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 |
suiyuan2009/tensorflow | tensorflow/python/kernel_tests/conv1d_test.py | 97 | 2169 | # 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 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.10.0-0.29.0/roles/lib_utils/test/test_load_and_handle_cert.py | 78 | 2030 | '''
Unit tests for the load_and_handle_cert method
'''
import datetime
import os
import sys
import pytest
MODULE_PATH = os.path.realpath(os.path.join(__file__, os.pardir, os.pardir, 'library'))
sys.path.insert(1, MODULE_PATH)
# pylint: disable=import-error,wrong-import-position,missing-docstring
# pylint: disable=i... | apache-2.0 |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/encodings/__init__.py | 406 | 5698 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... | gpl-2.0 |
brunolimawd/talk-nodebots-roll-out | node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
frossigneux/blazar | climate/api/root.py | 2 | 1499 | # Copyright (c) 2014 Bull.
#
# 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 |
brchiu/tensorflow | tensorflow/python/debug/cli/command_parser.py | 79 | 17451 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
hybrideagle/django | django/contrib/gis/geos/prototypes/io.py | 309 | 9480 | import threading
from ctypes import POINTER, Structure, byref, c_char, c_char_p, c_int, c_size_t
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_sized_string, check_st... | bsd-3-clause |
lynndotconfig/server-tools | base_optional_quick_create/model.py | 41 | 2507 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | agpl-3.0 |
niklasberglund/freesprints | source/freesprints/__init__.py | 1 | 9191 | import pygame, sys
import pygame.font
from pygame.locals import *
import logging
import fs_menu
import helpers as helpers
import plugins
import os.path
import race
import hardware
import defaults
import logging
from rainbow_logging_handler import RainbowLoggingHandler
DISPLAY_RESOLUTION = (1024, 768)
# platform-speci... | mit |
kingvuplus/PE-gui | e2reactor.py | 29 | 5262 | # enigma2 reactor: based on pollreactor, which is
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Maintainer: U{Felix Domke<mailto:tmbinc@elitedvb.net>}
"""
# System imports
import select, errno, sys
# Twisted imports
from twisted.python import log, failure
from twisted.interne... | gpl-2.0 |
pburdet/hyperspy | hyperspy/_signals/eds.py | 1 | 21939 | # -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
matrix65536/kosmosfs | src/python/kfscp/kfscp.py | 11 | 8528 | #
# $Id$
#
# Copyright 2006 Kosmix Corp.
#
# Author: Blake Lewis (Kosmix Corp.)
#
# This file is part of Kosmos File System (KFS).
#
# 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://w... | apache-2.0 |
gurneyalex/OpenUpgrade | addons/project/tests/__init__.py | 121 | 1126 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
dansomething/vim-snippets | pythonx/vimsnippets.py | 41 | 2928 | """Helper methods used in UltiSnips snippets."""
import string, vim
def complete(tab, opts):
"""
get options that start with tab
:param tab: query string
:param opts: list that needs to be completed
:return: a string that start with tab
"""
msg = "({0})"
if tab:
opts = [m[len... | mit |
ajm-asiaa/test | carta/scriptedClient/tests/test_image.py | 6 | 1942 | import os
import time
import Image
import carta.cartavis as cartavis
import pyautogui
import ImageUtil
def test_saveImage(cartavisInstance, cleanSlate):
"""
Test that an image can be saved from the GUI.
"""
cartavisInstance.setImageLayout()
i = cartavisInstance.getImageViews()
filename = '/tmp... | gpl-2.0 |
hujiajie/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flakytests_unittest.py | 13 | 3176 | # Copyright 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.
import flakytests
from webkitpy.common.checkout.scm.scm_mock import MockSCM
from webkitpy.layout_tests.layout_package import bot_test_expectations
from webk... | bsd-3-clause |
jagguli/intellij-community | python/lib/Lib/site-packages/django/db/models/related.py | 231 | 3157 | from django.utils.encoding import smart_unicode
from django.db.models.fields import BLANK_CHOICE_DASH
class BoundRelatedObject(object):
def __init__(self, related_object, field_mapping, original):
self.relation = related_object
self.field_mappings = field_mapping[related_object.name]
def templ... | apache-2.0 |
stevedh/queryutils | queryutils/user.py | 1 | 2181 |
from json import JSONEncoder
class User(object):
def __init__(self, name):
self.name = name
self.sessions = {}
self.queries = []
class VerboseUserEncoder(JSONEncoder):
def encode(self, obj):
user_dict = {}
user_dict['name'] = obj.name
session_dict = {}
... | bsd-3-clause |
daavery/audacity | lib-src/lv2/lv2/waflib/Configure.py | 181 | 9880 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shlex,sys,time
from waflib import ConfigSet,Utils,Options,Logs,Context,Build,Errors
try:
from urllib import request
except ImportError:
from urllib import urlopen
... | gpl-2.0 |
Gagnon06/StrategyIA | RULEngine/Communication/protobuf/google/protobuf/internal/message_test.py | 6 | 29543 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... | mit |
ejpbruel/servo | tests/wpt/web-platform-tests/websockets/handlers/echo_wsh.py | 163 | 1219 | #!/usr/bin/python
from mod_pywebsocket import msgutil
from mod_pywebsocket import common
_GOODBYE_MESSAGE = u'Goodbye'
def web_socket_do_extra_handshake(request):
# This example handler accepts any request. See origin_check_wsh.py for how
# to reject access from untrusted scripts based on origin value.
if... | mpl-2.0 |
js0701/chromium-crosswalk | third_party/simplejson/ordered_dict.py | 1039 | 3370 | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | bsd-3-clause |
mbroadst/debian-qpid-proton | examples/python/proton_tornado.py | 12 | 3592 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | apache-2.0 |
LeMeteore/python_koans-1 | python3/libs/colorama/winterm.py | 523 | 4206 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL = 0... | mit |
jeffreyjinfeng/scrapy | scrapy/pipelines/media.py | 122 | 4947 | from __future__ import print_function
import logging
from collections import defaultdict
from twisted.internet.defer import Deferred, DeferredList
from twisted.python.failure import Failure
from scrapy.utils.defer import mustbe_deferred, defer_result
from scrapy.utils.request import request_fingerprint
from scrapy.ut... | bsd-3-clause |
carolFrohlich/nipype | nipype/pipeline/plugins/tests/test_debug.py | 2 | 1618 | # -*- coding: utf-8 -*-
import os
import nipype.interfaces.base as nib
from tempfile import mkdtemp
from shutil import rmtree
from nipype.testing import assert_raises, assert_false
import nipype.pipeline.engine as pe
class InputSpec(nib.TraitedSpec):
input1 = nib.traits.Int(desc='a random int')
input2 = nib.... | bsd-3-clause |
sigma-random/peach | Peach/Agent/network.py | 3 | 6903 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import threading
import os
import re
import socket
from Peach.agent import Monitor
try:
def search_file... | mpl-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/test/test_class.py | 86 | 18371 | "Test the functionality of Python classes implementing operators."
import unittest
from test import test_support
testmeths = [
# Binary operations
"add",
"radd",
"sub",
"rsub",
"mul",
"rmul",
"div",
"rdiv",
"mod",
"rmod",
"divmod",
"rdivmod",
"pow",
"rpow",
... | gpl-3.0 |
DANCEcollaborative/forum-xblock | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/db/models/options.py | 92 | 21544 | import re
from bisect import bisect
from django.conf import settings
from django.db.models.related import RelatedObject
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.models.fields.proxy import OrderWrt
from django.db.models.loa... | mit |
wdv4758h/ZipPy | lib-python/3/fileinput.py | 5 | 14366 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | bsd-3-clause |
infosiftr/openxenmanager | window_host.py | 2 | 27126 | # -----------------------------------------------------------------------
# OpenXenManager
#
# Copyright (C) 2009 Alberto Gonzalez Rodriguez alberto@pesadilla.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 Soft... | gpl-2.0 |
mahendra-r/edx-platform | common/test/acceptance/tests/video/test_video_events.py | 50 | 13897 | """Ensure videos emit proper events"""
import datetime
import json
import ddt
import unittest
from ..helpers import EventsTestMixin
from .test_video_module import VideoBaseTest
from ...pages.lms.video.video import _parse_time_str
from openedx.core.lib.tests.assertions.events import assert_event_matches, assert_event... | agpl-3.0 |
FederatedAI/FATE | python/federatedml/statistic/intersect/rsa_cache/redis_adaptor.py | 2 | 2586 | #
# Copyright 2019 The FATE 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 appli... | apache-2.0 |
lmazuel/azure-sdk-for-python | azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/operation.py | 2 | 1096 | # 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 |
ajhager/copycat | copycat/workspace/string.py | 1 | 12784 | # Copyright (c) 2007-2017 Joseph Hager.
#
# Copycat is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License,
# as published by the Free Software Foundation.
#
# Copycat is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; with... | gpl-2.0 |
noahlittle/noahlittle.github.io | iCTRL/var/mobile/pentest/exploits/iCTRL/cupp/cupp.py | 1 | 55986 | #!/usr/bin/python
#
# [Program]
#
# CUPP 3.1
# Common User Passwords Profiler
#
#
#
# [Author]
#
# Muris Kurgas aka j0rgan
# j0rgan [at] remote-exploit [dot] org
# http://www.remote-exploit.org
# http://www.azuzi.me
#
#
#
# [License]
#
# This program is free software; you can redistribute it and/or modify
# ... | apache-2.0 |
Feverup/ansible-modules-extras | notification/typetalk.py | 54 | 3717 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
BozhkoAlexander/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/builddir/gyptest-all.py | 185 | 2706 | #!/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.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | gpl-3.0 |
kajgan/e2 | lib/python/Components/Converter/ConditionalShowHide.py | 53 | 1460 | from enigma import eTimer
from Converter import Converter
class ConditionalShowHide(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
args = argstr.split(',')
self.invert = "Invert" in args
self.blink = "Blink" in args
if self.blink:
self.blinktime = len(args) == 2 and args... | gpl-2.0 |
bealdav/OCB | addons/share/wizard/__init__.py | 448 | 1067 | # -*- 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 |
uranusjr/django | django/contrib/admin/templatetags/admin_urls.py | 26 | 1773 | from urllib.parse import parse_qsl, urlparse, urlunparse
from django import template
from django.contrib.admin.utils import quote
from django.urls import Resolver404, get_script_prefix, resolve
from django.utils.http import urlencode
register = template.Library()
@register.filter
def admin_urlname(value, arg):
... | bsd-3-clause |
ISCDtoolbox/FaciLe | pipeline/createDatabase.py | 1 | 2873 | import os
import sys
import numpy as np
from copy import deepcopy
import argparse
#Parallel
import subprocess as sp
import multiprocessing as mp
sys.path.append(os.path.join(os.path.dirname(__file__),"../projects/tools"))
import msh
import executable_paths as exe
def parse():
parser = argparse.ArgumentParser(de... | gpl-3.0 |
thaim/ansible | test/units/modules/network/check_point/test_cp_mgmt_access_layer_facts.py | 19 | 2859 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dist... | mit |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/email/quoprimime.py | 246 | 10848 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... | gpl-2.0 |
weimingtom/python-for-android | python3-alpha/python3-src/Lib/multiprocessing/process.py | 45 | 9778 | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... | apache-2.0 |
iain-peddie/well-behaved-python | tests/WellBehavedPythonTests/Discovery/ModuleExaminerTests.py | 1 | 3114 | #!/usr/bin/env python3
# Copyright 2013 Iain Peddie inr314159@hotmail.com
#
# This file is part of WellBehavedPython
#
# WellBehavedPython 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 v... | gpl-3.0 |
HBehrens/feedsanitizer | django/utils/autoreload.py | 71 | 4279 | # Autoreloading launcher.
# Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org).
# Some taken from Ian Bicking's Paste (http://pythonpaste.org/).
#
# Portions copyright (c) 2004, CherryPy Team (team@cherrypy.org)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with ... | mit |
MapofLife/MOL | app/mapreduce/lib/pipeline/handlers.py | 65 | 1049 | #!/usr/bin/env python
#
# Copyright 2010 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 applicable law o... | bsd-3-clause |
m3z/HT | openstack_dashboard/dashboards/admin/instances/tests.py | 1 | 6158 | # 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 |
40223226/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/urllib/parse.py | 735 | 35170 | """Parse (absolute and relative) URLs.
urlparse module is based upon the following RFC specifications.
RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, Decemb... | gpl-3.0 |
mrquim/repository.mrquim | plugin.video.Rising.Tides/commonresolvers.py | 186 | 31372 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2014 lambda
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 ... | gpl-2.0 |
danielneis/osf.io | website/addons/osfstorage/views.py | 10 | 8711 | from __future__ import unicode_literals
import httplib
import logging
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from flask import request
from framework.auth import Auth
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_signed
from websit... | apache-2.0 |
hainm/MSMs | code/sandbox/tica_kde_svm.py | 3 | 2319 | from sklearn.covariance import EllipticEnvelope
import sklearn.neighbors
from sklearn.svm import OneClassSVM
import os
from msmbuilder import example_datasets, cluster, msm, featurizer, lumping, utils, dataset, decomposition
sysname = os.path.split(os.getcwd())[-1]
dt = 0.25
tica_lagtime = 400
regularization_string = ... | gpl-2.0 |
dariemp/odoo | addons/survey/wizard/__init__.py | 385 | 1026 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
QualiSystems/Azure-Shell | package/cloudshell/cp/azure/domain/common/vm_details_provider.py | 1 | 5896 | from azure.mgmt.compute.models import StorageAccountTypes
from cloudshell.cp.core.models import VmDetailsProperty, VmDetailsData, VmDetailsNetworkInterface
from cloudshell.cp.azure.domain.vm_management.operations.deploy_operation import get_ip_from_interface_name
class VmDetailsProvider(object):
def __init__(sel... | apache-2.0 |
fengjian/libinjection | src/sqlparse2c.py | 3 | 3800 | #!/usr/bin/env python
#
# Copyright 2012, 2013 Nick Galbreath
# nickg@client9.com
# BSD License -- see COPYING.txt for details
#
"""
Converts a libinjection JSON data file to a C header (.h) file
"""
import sys
def toc(obj):
""" main routine """
print """
#ifndef LIBINJECTION_SQLI_DATA_H
#define LIBINJEC... | bsd-3-clause |
Peddle/hue | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/openssl/hmac.py | 7 | 2910 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/hmac.h>
"""
TYPES = """
typedef ... HMA... | apache-2.0 |
geekboxzone/lollipop_external_chromium_org | chrome/test/chromedriver/embed_mobile_devices_in_cpp.py | 43 | 1418 | #!/usr/bin/env python
# Copyright 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.
"""Embeds standalone JavaScript snippets in C++ code.
The script requires the OverridesView file from WebKit that lists the known
mobi... | bsd-3-clause |
inconvergent/differential-cloud | modules/helpers.py | 1 | 1866 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
def get_args():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'--procs',
type=int,
default=4,
help='number of processors.'
)
parser.add_argument(
'--nearl',
type=float,
de... | mit |
SpaceHotDog/Flask_API | test_bucketlist.py | 1 | 3171 | # test_bucketlist.py
import unittest
import os
import json
from app import create_app, db
class BucketlistTestCase(unittest.TestCase):
"""This class represents the bucketlist test case"""
def setUp(self):
"""Define test variables and initialize app."""
self.app = create_app(config_name="testi... | unlicense |
fyfcauc/android_external_chromium-org | tools/telemetry/telemetry/core/util.py | 23 | 4884 | # 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.
import inspect
import logging
import os
import socket
import sys
import time
class TimeoutException(Exception):
pass
def GetBaseDir():
main_module... | bsd-3-clause |
apacha/OMR-Datasets | omrdatasettools/OmrDataset.py | 1 | 11026 | from enum import Enum, auto
from typing import Dict
class OmrDataset(Enum):
"""
The available OMR datasets that can be automatically downloaded with Downloader.py
"""
#: The Audiveris OMR dataset from https://github.com/Audiveris/omr-dataset-tools, Copyright 2017 by Hervé Bitteur under AGPL-3.0 l... | mit |
hastexo/edx-platform | lms/djangoapps/course_api/blocks/transformers/tests/test_milestones.py | 7 | 8893 | """
Tests for ProctoredExamTransformer.
"""
import ddt
from milestones.tests.utils import MilestonesTestCaseMixin
from mock import Mock, patch
from nose.plugins.attrib import attr
from gating import api as lms_gating_api
from lms.djangoapps.course_blocks.transformers.tests.helpers import CourseStructureTestCase
from o... | agpl-3.0 |
almeidapaulopt/erpnext | erpnext/stock/__init__.py | 23 | 1794 | from __future__ import unicode_literals
import frappe
install_docs = [
{"doctype":"Role", "role_name":"Stock Manager", "name":"Stock Manager"},
{"doctype":"Role", "role_name":"Item Manager", "name":"Item Manager"},
{"doctype":"Role", "role_name":"Stock User", "name":"Stock User"},
{"doctype":"Role", "role_name":"Q... | gpl-3.0 |
james08m/PiPhona | log.py | 2 | 1282 | __author__ = 'J08M'
import pickle
from utilities import *
# Log class
class Log:
def __init__(self):
self.logs = ["Create log"]
self.size = 1
# Add a string to the logs list
def add(self, log):
self.logs.append("[" + getTimeToSecondes() + "] " + log)
self.size ... | gpl-3.0 |
mixturemodel-flow/tensorflow | tensorflow/contrib/stat_summarizer/python/stat_summarizer_test.py | 123 | 2884 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
khrapovs/datastorage | datastorage/compustat.py | 1 | 2589 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Short interest dynamics
"""
from __future__ import print_function, division
import os
import zipfile
import datetime as dt
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
path = os.getenv("HOME") + '/Dropbox/Research/data/Compustat/data/'
#... | mit |
sgraham/nope | third_party/colorama/src/colorama/tests/ansitowin32_test.py | 5 | 6445 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
try:
# python3
from io import StringIO
except ImportError:
# python2
import StringIO
try:
# with unittest2 installed, presumably is Python <= 2.6
from unittest2 import TestCase, main
except ImportError:
# without uni... | bsd-3-clause |
nanditav/15712-TensorFlow | tensorflow/tensorboard/backend/handler.py | 14 | 21208 | # 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 |
Yethiel/re-volt-addon | io_revolt/parameters_in.py | 1 | 4567 | """
Name: parameters_in
Purpose: Importing cars using the parameters.txt file
Description:
Imports entire cars using the carinfo module.
"""
if "bpy" in locals():
import imp
imp.reload(common)
imp.reload(carinfo)
imp.reload(prm_in)
import os
import bpy
import bmesh
from mathutil... | gpl-3.0 |
wolcomm/rptk | rptk/base.py | 1 | 3743 | # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved.
#
# The contents of this file are licensed under the Apache License version 2.0
# (the "License"); you may not use this file except in compliance with the
# License.
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
tigerneil/deepy | experiments/attention_models/first_glimpse.py | 5 | 1691 | import time
import logging
from deepy import TrainerConfig
from deepy.dataset import MnistDataset, MiniBatches
from deepy.trainers import LearningRateAnnealer
from first_glimpse_model import get_network
from first_glimpse_trainer import FirstGlimpseTrainer
from deepy.utils import Timer
logging.basicConfig(level=loggi... | mit |
grevutiu-gabriel/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/__init__.py | 129 | 1865 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
jusdng/odoo | openerp/tools/cache.py | 226 | 6865 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
eltonkent/android-quill | jni/libhpdf-2.3.0RC2/if/python/demo/raw_image_demo.py | 32 | 3894 | ###
## * << Haru Free PDF Library 2.0.0 >> -- raw_image_demo.c
## *
## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
## *
## * Permission to use, copy, modify, distribute and sell this software
## * and its documentation for any purpose is hereby granted without fee,
## * provided that ... | gpl-3.0 |
stylianos-kampakis/scikit-learn | sklearn/externals/joblib/logger.py | 359 | 5135 | """
Helpers for logging.
This module needs much love to become useful.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import print_function
import time
import sys
import os
import shutil
import logging
impo... | bsd-3-clause |
platinhom/DailyTools | scripts/ESES_ElementArea.py | 1 | 3679 | #! /usr/bin/env python
# -*- coding: utf8 -*-
# Author: Platinhom; Last Updated: 2015-09-10
# Calculate each element surface area by MS_Intersection and also match the atomic area results to the pqr file.
# Usage: python ESES_ElementArea.py file.pqr
#
# Need: MS_Intersection (partition version)
# Note: Only for PQR fo... | gpl-2.0 |
ea4gja/mrig | mrig/mrig.py | 1 | 1349 | #!/usr/bin/env python
#
# File: mrig.py
# Version: 1.0
#
# mrig: main program
# Copyright (c) 2016 German EA4GJA
#
# 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 Licen... | gpl-2.0 |
israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/cracked.py | 170 | 3213 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
str_to_int,
)
class CrackedIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cracked\.com/video_(?P<id>\d+)_[\da-z-]+\.html'
_TESTS = [{
'url': 'http://www.cracked.com/... | gpl-3.0 |
paulashford1975/clearfog-388-kernel-4.5.4 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
syl20bnr/nupic | tests/integration/py2/nupic/opf/opf_description_template_test/experiments/gym/description.py | 17 | 1447 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
dongritengfei/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/watchlist.py | 132 | 3393 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
mattt416/neutron | neutron/tests/functional/agent/l3/test_keepalived_state_change.py | 24 | 2853 | # Copyright (c) 2015 Red Hat 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 a... | apache-2.0 |
openfun/configuration | playbooks/callback_plugins/sqs.py | 41 | 5868 | # Copyright 2013 John Jarvis <john@jarv.org>
#
# 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 versio... | agpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/gdata/tests/gdata_tests/calendar_test.py | 41 | 39080 | #!/usr/bin/python
#
# Copyright (C) 2006 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 applicable law ... | agpl-3.0 |
salomon1184/bite-project | deps/gdata-python-client/src/gdata/acl/data.py | 98 | 1893 | #!/usr/bin/python
#
# Copyright (C) 2009 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 applicable law ... | apache-2.0 |
sunlianqiang/kbengine | kbe/src/lib/python/Lib/test/test_crashers.py | 116 | 1210 | # Tests that the crashers in the Lib/test/crashers directory actually
# do crash the interpreter as expected
#
# If a crasher is fixed, it should be moved elsewhere in the test suite to
# ensure it continues to work correctly.
import unittest
import glob
import os.path
import test.support
from test.script_helper impor... | lgpl-3.0 |
TuSimple/mxnet | example/sparse/matrix_factorization/data.py | 14 | 2340 | # 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 |
munnerz/CouchPotatoServer | libs/CodernityDB/hash_index.py | 81 | 33813 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | gpl-3.0 |
csmengwan/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/ParameterFlattening/autorestparameterflattening/operations/availability_sets.py | 5 | 3247 | # 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 |
girving/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/vector_sinh_arcsinh_diag_test.py | 25 | 10036 | # 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 |
jamezpolley/pip | pip/_vendor/html5lib/serializer/htmlserializer.py | 436 | 12855 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
try:
from functools import reduce
except ImportError:
pass
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities, xmlEntities
from .. imp... | mit |
citrix-openstack-build/oslo.concurrency | oslo/concurrency/openstack/common/fixture/logging.py | 73 | 1117 | # 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 agreed to in writing, softw... | apache-2.0 |
vyos/wpa | wpa_supplicant/examples/wpas-dbus-new-getall.py | 114 | 1742 | #!/usr/bin/python
import dbus
import sys, os
import time
import gobject
def main():
bus = dbus.SystemBus()
wpas_obj = bus.get_object("fi.w1.wpa_supplicant1",
"/fi/w1/wpa_supplicant1")
props = wpas_obj.GetAll("fi.w1.wpa_supplicant1",
dbus_interface=dbus.PROPERTIES_IFACE)
print "GetAll(fi.w1.wpa_supplican... | gpl-2.0 |
ppwwyyxx/tensorflow | tensorflow/python/keras/optimizers.py | 3 | 30372 | # 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 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/lib2to3/pgen2/token.py | 77 | 1264 | #! /usr/bin/env python3
"""Token constants (from "token.h")."""
# Taken from Python (r53757) and modified to include some tokens
# originally monkeypatched in by pgen2.tokenize
#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
... | lgpl-3.0 |
rledisez/shinken | contrib/livestatus/splitlivelogs.py | 18 | 2388 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 |
spatialdev/onadata | onadata/apps/logger/migrations/0020_auto__chg_field_instance_uuid.py | 13 | 8321 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Instance.uuid'
db.alter_column('odk_logger_instance', 'uuid', self.gf('django.db.models.... | bsd-2-clause |
mmcdermo/helpinghand | server/venv/lib/python2.7/site-packages/django/contrib/flatpages/tests/test_views.py | 207 | 5659 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
LOGIN_URL='/... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.