repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
sencha/chromium-spacewalk | tools/perf/page_sets/gmail_alt_threadlist_conversation.py | 33 | 2558 | # 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 re
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
def _CreateXpathFunction(xpath):
return ... | bsd-3-clause |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/numpy/lib/tests/test_type_check.py | 103 | 10247 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.compat import long
from numpy.testing import (
TestCase, assert_, assert_equal, assert_array_equal, run_module_suite
)
from numpy.lib.type_check import (
common_type, mintypecode, isreal, iscomplex, isposinf, isn... | apache-2.0 |
cryptickp/heat | heat_integrationtests/functional/test_default_parameters.py | 8 | 3035 | # 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
# d... | apache-2.0 |
jch1/models | object_detection/anchor_generators/grid_anchor_generator_test.py | 21 | 2950 | # 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 |
oe-alliance/oe-alliance-enigma2 | lib/python/Screens/Timershift.py | 16 | 11636 | from Screens.Screen import Screen
from Screens.Setup import setupdom
from Screens.LocationBox import TimeshiftLocationBox
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.config import config, configfile, ConfigYesNo, ConfigNothing, ConfigSelection, getConfigListEntry
from Co... | gpl-2.0 |
HyperBaton/ansible | lib/ansible/plugins/action/fail.py | 122 | 1477 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... | gpl-3.0 |
nimisha-srinivasa/RTP | src/phase2/gen_representative_index/gen_super.py | 1 | 2108 | #!/usr/bin/python3
#this python script generates the super_index
import pickle
import sys
path_to_target_dir = "./target/"
path_to_utils_dir = "./src/utils/"
## change your whole dataset path here
path_data = sys.argv[1]
# create dictionary 'dic' for vdrelation
dic = {}
dv_dic = {}
with open(path_to_target_dir + '... | apache-2.0 |
ivan73/smarthome | plugins/dlms/__init__.py | 4 | 7029 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2013 KNX-User-Forum e.V. http://knx-user-forum.de/
#########################################################################
# ... | gpl-3.0 |
ocefpaf/iris | lib/iris/fileformats/um_cf_map.py | 5 | 106777 | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
#
# DO NOT EDIT: AUTO-GENERATED
# Created on 29 November 2019 14:11 from
# http://www.metarelate.net/metOcean
# at commit 448f... | lgpl-3.0 |
40223134/0512 | static/Brython3.1.1-20150328-091302/Lib/datetime.py | 628 | 75044 | """Concrete date/time and related types.
See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""
import time as _time
import math as _math
def _cmp(x, y):
return 0 if x == y else 1 if x > y else -1
MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059 # date.max.toordinal()... | gpl-3.0 |
mahinthjoe/bedrock | bedrock/newsletter/tests/test_views.py | 21 | 29540 | # 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 json
import uuid
from django.http import HttpResponse
from django.test.client import RequestFactory
import baske... | mpl-2.0 |
geshuning/lib | unit_testing/gtest-1.7.0/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
schlueter/ansible | test/units/modules/network/onyx/test_onyx_linkagg.py | 17 | 4547 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests.mock import patch
from ansible.modules.network.on... | gpl-3.0 |
viruxel/ansible-modules-extras | windows/win_acl.py | 63 | 4336 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015, Phil Schwartz <schwartzmx@gmail.com>
# Copyright 2015, Trond Hindenes
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GN... | gpl-3.0 |
bikeshare/bikeshare-web | javascript/OpenLayers-2.13.1/tests/selenium/remotecontrol/selenium.py | 254 | 69389 |
"""
Copyright 2006 ThoughtWorks, 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 agreed to in writing, sof... | gpl-2.0 |
lintzc/gpdb | src/test/tinc/tincrepo/mpp/models/sql_performance_tc.py | 9 | 20308 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
lightningwolf/Flask-JqueryUiBootstrap | flask_jqueryuibootstrap/__init__.py | 1 | 1024 | #!/usr/bin/env python
# coding=utf8
from flask import Blueprint
try:
from wtforms.fields import HiddenField
def is_hidden_field_filter(field):
return isinstance(field, HiddenField)
except ImportError:
def HiddenField():
pass
def is_hidden_field_filter(field):
raise RuntimeErro... | mit |
kushview/libjuce | waflib/extras/c_emscripten.py | 55 | 2528 | #!/usr/bin/env python
# -*- coding: utf-8 vi:ts=4:noexpandtab
import subprocess, shlex, sys
from waflib.Tools import ccroot, gcc, gxx
from waflib.Configure import conf
from waflib.TaskGen import after_method, feature
from waflib.Tools.compiler_c import c_compiler
from waflib.Tools.compiler_cxx import cxx_compiler
f... | gpl-2.0 |
amenonsen/ansible | hacking/build_library/build_ansible/commands.py | 29 | 1541 | # coding: utf-8
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from abc import ABCMeta, abstractmethod, abstractp... | gpl-3.0 |
douban/code | tests/pulls/test_web_ui.py | 3 | 2157 | # encoding: UTF-8
import os
from vilya.models.project import CodeDoubanProject
from vilya.models.pull import PullRequest
from tests.base import TestApp
from mock import patch
import tests
from tests.base import TestCase
from tests.utils import clone, mock_method
data_path = os.path.join(os.path.dirname(tests.__file... | bsd-3-clause |
ImageEngine/gaffer | python/GafferSceneUITest/RotateToolTest.py | 6 | 17104 | ##########################################################################
#
# Copyright (c) 2017, John Haddon. 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 so... | bsd-3-clause |
akshitsoota/Chicago-Crime-Data | dataprocessor.py | 1 | 6412 | import shutil, json, time, sys, csv, os
# PROGRESS BAR STUFF
# Reference: https://gist.github.com/vladignatyev/06860ec2040cb497f0f3
def progress(count, total, status=''):
bar_len = 60
filled_len = int(round(bar_len * count / float(total)))
percents = round(100.0 * count / float(total), 1)
if filled_l... | mit |
eduNEXT/edx-platform | lms/djangoapps/grades/course_grade.py | 3 | 13380 | """
CourseGrade Class
"""
from abc import abstractmethod
from collections import OrderedDict, defaultdict
from ccx_keys.locator import CCXLocator
from django.conf import settings
from lazy import lazy
from openedx.core.lib.grade_utils import round_away_from_zero
from xmodule import block_metadata_utils
from .confi... | agpl-3.0 |
googleinterns/schemaorg-generator | protogenerator/utils/constants.py | 1 | 2080 | # 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... | apache-2.0 |
nephomaniac/eutester | testcases/cloud_admin/3-2/Euca5033.py | 6 | 2599 | '''
Created on Oct 9, 2012
@author: mmunn
Unit test : EUCA-5033 Cannot detach root EBS volume from stopped instance
This test assumes you have created and registered an ebs-image
you can use:
create_bfebs_img_test.py
--url h... | bsd-2-clause |
ashhher3/invenio | modules/bibformat/lib/elements/bfe_appears_in_collections.py | 35 | 1840 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 ... | gpl-2.0 |
IsaacHaze/tweepy | tweepy/cache.py | 64 | 12909 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import print_function
import time
import datetime
import threading
import os
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
except ImportError:
# python 2.4
import md5 ... | mit |
kytvi2p/Sigil | 3rdparty/python/Lib/test/test_importlib/import_/test_packages.py | 84 | 4605 | from .. import util
from . import util as import_util
import sys
import unittest
import importlib
from test import support
class ParentModuleTests:
"""Importing a submodule should import the parent modules."""
def test_import_parent(self):
with util.mock_spec('pkg.__init__', 'pkg.module') as mock:
... | gpl-3.0 |
eeshangarg/oh-mainline | vendor/packages/whoosh/src/whoosh/__init__.py | 16 | 2063 | # Copyright 2008 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | agpl-3.0 |
Codefans-fan/odoo | addons/crm/res_partner.py | 47 | 4790 | # -*- 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 |
MarkusHackspacher/unknown-horizons | horizons/world/building/path.py | 1 | 2878 | # ###################################################
# Copyright (C) 2008-2017 The Unknown Horizons Team
# team@unknown-horizons.org
# This file is part of Unknown Horizons.
#
# Unknown Horizons is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | gpl-2.0 |
BartSaelen/kubb_match | kubb_match/service/tournament_service.py | 1 | 2821 | # -*- coding: utf-8 -*-
from kubb_match.data.models import Round, GridPosition
from kubb_match.service.battle_service import BattleService
from kubb_match.service.knock_out_service import KnockOutService
class TournamentService(object):
def __init__(self, data_manager):
self.data_manager = data_manager
... | apache-2.0 |
zhmz90/git | contrib/svn-fe/svnrdump_sim.py | 328 | 2044 | #!/usr/bin/python
"""
Simulates svnrdump by replaying an existing dump from a file, taking care
of the specified revision range.
To simulate incremental imports the environment variable SVNRMAX can be set
to the highest revision that should be available.
"""
import sys
import os
if sys.hexversion < 0x02040000:
# T... | gpl-2.0 |
bguillot/OpenUpgrade | addons/purchase/__init__.py | 439 | 1185 | # -*- 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... | agpl-3.0 |
ArcherSys/ArcherSys | Lib/test/test_pulldom.py | 1 | 37541 | <<<<<<< HEAD
<<<<<<< HEAD
import io
import unittest
import sys
import xml.sax
from xml.sax.xmlreader import AttributesImpl
from xml.dom import pulldom
from test.support import run_unittest, findfile
tstfile = findfile("test.xml", subdir="xmltestdata")
# A handy XML snippet, containing attributes, a namespace prefi... | mit |
hkhpub/show_and_tell_korean | webdemo/webdemo/settings.py | 1 | 3274 | """
Django settings for webdemo project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | mit |
kaynfiretvguru/Eldritch | plugin.video.youtube/resources/lib/kodion/items/utils.py | 27 | 1871 | import json
__author__ = 'bromix'
from .video_item import VideoItem
from .directory_item import DirectoryItem
from .audio_item import AudioItem
from .image_item import ImageItem
def from_json(json_data):
"""
Creates a instance of the given json dump or dict.
:param json_data:
:return:
"""
d... | gpl-2.0 |
andmos/ansible | test/units/modules/network/dellos6/dellos6_module.py | 52 | 2516 | # (c) 2016 Red Hat Inc.
#
# 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.
#
# Ansible is dis... | gpl-3.0 |
smithsps/LawsonAPI | old/src/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
hzlf/openbroadcast | website/apps/django_date_extensions/tests.py | 1 | 4994 | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
from fields import ApproximateDate
import unittest
class PastAndFuture(unittest.TestCase):
def test_setting_both(self):
self.assertRaises(ValueError, ApproximateDate, past=True, future=True )
def test_setting_with_dates(self):
... | gpl-3.0 |
Anonymouslemming/ansible | lib/ansible/utils/module_docs_fragments/netapp.py | 63 | 3287 | #
# (c) 2016, Sumit Kumar <sumit4@netapp.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 versi... | gpl-3.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/numpy/distutils/cpuinfo.py | 40 | 22989 | #!/usr/bin/env python
"""
cpuinfo
Copyright 2002 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) license. See LICENSE.txt that came with
this distribution for specifics.
NO WARRANTY IS EXP... | apache-2.0 |
fairbird/OpenPLI-TSimage | lib/python/Components/Converter/RdsInfo.py | 163 | 1649 | from enigma import iRdsDecoder, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
class RdsInfo(Converter, object):
RASS_INTERACTIVE_AVAILABLE = 0
RTP_TEXT_CHANGED = 1
RADIO_TEXT_CHANGED = 2
def __init__(self, type):
Converter.__init__(self, type)
self... | gpl-2.0 |
KMTsvetanov/Zend2all | node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | bsd-3-clause |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/ctypes/test/test_anon.py | 264 | 2051 | import unittest
from ctypes import *
class AnonTest(unittest.TestCase):
def test_anon(self):
class ANON(Union):
_fields_ = [("a", c_int),
("b", c_int)]
class Y(Structure):
_fields_ = [("x", c_int),
("_", ANON),
... | mit |
oudalab/phyllo | phyllo/extractors/passio_perpetuaDB.py | 1 | 2535 | import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
def main():
# The collection URL below.
collURL = 'http://www.thelatinlibrary.com/perp.html'
collOpen = urllib.request.urlopen(collURL)
collSOUP = BeautifulSoup(collOpen, 'html5lib')
author = ... | apache-2.0 |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/django/contrib/auth/tests/test_views.py | 22 | 33423 | import itertools
import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.admin.models import LogEntry
from django.contrib.auth.models import User
from django.core import mail
from django.core.urlresolvers import reverse, NoReve... | mit |
n0trax/ansible | lib/ansible/constants.py | 3 | 4412 | # Copyright (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
... | gpl-3.0 |
sigmavirus24/pip | tests/lib/__init__.py | 4 | 21080 | from __future__ import absolute_import
from contextlib import contextmanager
import os
import sys
import re
import textwrap
import site
import scripttest
import virtualenv
from tests.lib.path import Path, curdir, u
DATA_DIR = Path(__file__).folder.folder.join("data").abspath
SRC_DIR = Path(__file__).abspath.folder.... | mit |
gogozs/shadowsocks | tests/test_udp_src.py | 1009 | 2482 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
ppwwyyxx/tensorflow | tensorflow/python/debug/lib/debug_graph_reconstruction_test.py | 4 | 7605 | # 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 |
kevclarx/ansible | lib/ansible/plugins/action/eos_config.py | 126 | 4193 | #
# Copyright 2015 Peter Sprygada <psprygada@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... | gpl-3.0 |
haoqili/MozSecWorld | vendor-local/packages/django-csp/csp/views.py | 1 | 1229 | import json
from django.core.mail import mail_admins
from django.http import HttpResponse, HttpResponseBadRequest
from django.template import loader, Context
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from csp import build_policy
@csrf_exempt
@require_... | bsd-3-clause |
deepmind/launchpad | launchpad/flags.py | 1 | 1758 | # Lint as: python3
# Copyright 2020 DeepMind Technologies Limited. 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
#
# ... | apache-2.0 |
filias/django | tests/annotations/tests.py | 22 | 19583 | from __future__ import unicode_literals
import datetime
from decimal import Decimal
from django.core.exceptions import FieldDoesNotExist, FieldError
from django.db.models import (
BooleanField, CharField, Count, DateTimeField, ExpressionWrapper, F, Func,
IntegerField, Sum, Value,
)
from django.db.models.funct... | bsd-3-clause |
hungle90/flexx | flexx/pyscript/tests/test_parser1.py | 20 | 10770 | from pytest import raises
from flexx.util.testing import run_tests_if_main
from flexx.pyscript import JSError, py2js, evaljs, evalpy, Parser
from flexx import pyscript
def nowhitespace(s):
return s.replace('\n', '').replace('\t', '').replace(' ', '')
class TestParser(Parser):
def function_foo_foo(self... | bsd-2-clause |
scorphus/thefuck | thefuck/utils.py | 2 | 9186 | import atexit
import os
import pickle
import re
import shelve
import sys
import six
from decorator import decorator
from difflib import get_close_matches as difflib_get_close_matches
from functools import wraps
from .logs import warn, exception
from .conf import settings
from .system import Path
DEVNULL = open(os.devn... | mit |
hustodemon/spacewalk | backend/server/test/unit-test/rhnSQL/test_server_registration.py | 2 | 9344 | #!/usr/bin/python
#
# Copyright (c) 2008--2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should... | gpl-2.0 |
dhxkgozj/DirEngine | lib/pyelftools/elftools/construct/lib/container.py | 23 | 3949 | """
Various containers.
"""
from collections import MutableMapping
from pprint import pformat
def recursion_lock(retval, lock_name = "__recursion_lock__"):
def decorator(func):
def wrapper(self, *args, **kw):
if getattr(self, lock_name, False):
return retval
setattr... | bsd-3-clause |
georgewhewell/CouchPotatoServer | libs/html5lib/trie/py.py | 817 | 1763 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... | gpl-3.0 |
altsen/diandiyun-platform | common/djangoapps/django_comment_common/tests.py | 22 | 2121 | from django.test import TestCase
from django_comment_common.models import Role
from student.models import CourseEnrollment, User
class RoleAssignmentTest(TestCase):
"""
Basic checks to make sure our Roles get assigned and unassigned as students
are enrolled and unenrolled from a course.
"""
def s... | agpl-3.0 |
cmvelo/ansible-modules-extras | windows/win_iis_webapplication.py | 153 | 1896 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
KohlsTechnology/ansible | lib/ansible/plugins/callback/osx_say.py | 60 | 2867 | # (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | gpl-3.0 |
putcn/Paddle | tools/timeline.py | 4 | 7120 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
dmilith/SublimeText3-dmilith | Packages/sublime_lib/st3/sublime_lib/_util/enum.py | 1 | 1739 | from functools import partial
from .._compat.enum import EnumMeta, Enum, Flag
from .._compat.typing import Any, Callable, Optional
__all__ = ['ExtensibleConstructorMeta', 'construct_with_alternatives', 'construct_union']
class ExtensibleConstructorMeta(EnumMeta):
def __call__(cls, *args: Any, **kwargs: Any) ->... | mit |
brijeshkesariya/odoo | addons/crm/validate_email.py | 462 | 5978 | # RFC 2822 - style email validation for Python
# (c) 2012 Syrus Akbary <me@syrusakbary.com>
# Extended from (c) 2011 Noel Bush <noel@aitools.org>
# for support of mx and user check
# This code is made available to you under the GNU LGPL v3.
#
# This module provides a single method, valid_email_address(),
# which return... | agpl-3.0 |
chen0510566/MissionPlanner | Lib/site-packages/numpy/distutils/npy_pkg_config.py | 53 | 13468 | import sys
if sys.version_info[0] < 3:
from ConfigParser import SafeConfigParser, NoOptionError
else:
from configparser import SafeConfigParser, NoOptionError
import re
import os
import shlex
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
'read_config', 'parse_flags']
_VAR = re... | gpl-3.0 |
securestate/king-phisher | king_phisher/client/dialogs/__init__.py | 5 | 1853 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/client/dialogs/__init__.py
#
# 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
# ... | bsd-3-clause |
dboonz/polymode | Polymode/Solver.py | 5 | 24557 | # _*_ coding=utf-8 _*_
#
#---------------------------------------------------------------------------------
#Copyright © 2009 Andrew Docherty
#
#This program is part of Polymode.
#Polymode is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the ... | gpl-3.0 |
hopeall/odoo | addons/website_mail/__openerp__.py | 379 | 1623 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
SpatialMetabolomics/SM_distributed | sm/engine/msm_basic/msm_basic_search.py | 2 | 2848 | from collections import OrderedDict
import pandas as pd
from sm.engine.util import SMConfig
from sm.engine.msm_basic.formula_imager_segm import compute_sf_images
from sm.engine.msm_basic.formula_img_validator import sf_image_metrics
from sm.engine.search_algorithm import SearchAlgorithm
import logging
logger = loggin... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Cipher/_mode_cbc.py | 2 | 10971 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | apache-2.0 |
joxeankoret/diaphora | pygments/lexers/c_cpp.py | 21 | 9415 | # -*- coding: utf-8 -*-
"""
pygments.lexers.c_cpp
~~~~~~~~~~~~~~~~~~~~~
Lexers for C/C++ languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
this... | agpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/10_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_range_old/calculateratio_3/CalculateRatioCpuMemory_3.py | 33 | 4757 | #!/usr/bin/env python
"""
This activity will calculate the ratio between CPU request and Memory request by (job ID, task index, event type).
These fields are optional and could be null.
"""
# It will connect to DataStoreClient
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import math
import sys
#######... | gpl-3.0 |
frreiss/tensorflow-fred | tensorflow/python/keras/layers/serialization.py | 5 | 8496 | # 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 |
selfcommit/gaedav | pyxml/dom/html/HTMLDocument.py | 4 | 11651 | ########################################################################
#
# File Name: HTMLDocument.py
#
#
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved.
See http://4suite.com/COPYRIGHT for license and copyright informati... | lgpl-2.1 |
trik/djangae | djangae/blobstore_service.py | 6 | 3015 | import os
import threading
import logging
import re
blobstore_service = None
server = None
from wsgiref.simple_server import WSGIRequestHandler
class NoLogRequestHandler(WSGIRequestHandler):
def log_request(self, code='-', size='-'):
"""Normally logs an accepted request. Bug given
that this is ... | bsd-3-clause |
seanli9jan/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_embedding.py | 4 | 44967 | # 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 |
emnik/Pocket-Science-Lab | Measurements-using-expeyes.py | 2 | 3053 | '''
These are procedures for measuring various parameters using ExpEYES Jr
'''
'''
From croplus.py
'''
def measurecap():
msg(_('Starting Capacitance Measurement..'))
cap = p.measure_cap()
if cap == None:
msg(_('Error: Capacitance too high or short to ground'),'red')
return
g.disp(_('I... | gpl-3.0 |
Bysmyyr/chromium-crosswalk | third_party/tlslite/tlslite/mathtls.py | 40 | 11303 | # Authors:
# Trevor Perrin
# Dave Baggett (Arcode Corporation) - MD5 support for MAC_SSL
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""Miscellaneous helper functions."""
from .utils.compat import *
from .utils.cryptomath im... | bsd-3-clause |
tody411/ImageViewerFramework | ivf/ui/tool/normal_constraint_tool.py | 1 | 7515 | # -*- coding: utf-8 -*-
## @package ivf.ui.tool.normal_constraint_tool
#
# ivf.ui.tool.normal_constraint_tool utility package.
# @author tody
# @date 2016/02/08
import numpy as np
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from ivf.ui.tool.base_tool import BaseTool
from ivf.scene.normal_cons... | mit |
gzzhanghao/mitmproxy | test/pathod/tutils.py | 3 | 3641 | import tempfile
import re
import shutil
import requests
from six.moves import cStringIO as StringIO
from six.moves import urllib
from six import BytesIO
from netlib import tcp
from netlib import utils
from netlib import tutils
from pathod import language
from pathod import pathoc
from pathod import pathod
from pathod... | mit |
rodrigods/keystone | setup.py | 608 | 1045 | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unle... | apache-2.0 |
viru/ansible-modules-core | cloud/amazon/ec2_vpc_net.py | 88 | 9882 | #!/usr/bin/python
# 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.
#
# Ansible is distributed... | gpl-3.0 |
Shopify/dd-agent | tests/checks/integration/test_cassandra.py | 46 | 2080 | # stdlib
import threading
import time
from types import ListType
import unittest
# 3p
from nose.plugins.attrib import attr
# project
from aggregator import MetricsAggregator
from dogstatsd import Server
from jmxfetch import JMXFetch
from tests.checks.common import Fixtures
STATSD_PORT = 8121
class DummyReporter(th... | bsd-3-clause |
biodrone/plex-desk | desk/flask/lib/python3.4/site-packages/babel/messages/pofile.py | 136 | 16320 | # -*- coding: utf-8 -*-
"""
babel.messages.pofile
~~~~~~~~~~~~~~~~~~~~~
Reading and writing of files in the ``gettext`` PO (portable object)
format.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
import re
from babel.messages.catalog import... | mit |
ledtvavs/repository.ledtv | script.tvguide.Vader/unidecode/x022.py | 165 | 4329 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'-', ... | gpl-3.0 |
mindriot101/bokeh | bokeh/sampledata/unemployment1948.py | 5 | 1954 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
Obus/scikit-learn | sklearn/decomposition/tests/test_factor_analysis.py | 222 | 3055 | # Author: Christian Osendorfer <osendorf@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Licence: BSD3
import numpy as np
from sklearn.utils.testing import assert_warns
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing im... | bsd-3-clause |
jounex/hue | desktop/core/ext-py/boto-2.38.0/boto/elastictranscoder/layer1.py | 148 | 44082 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | apache-2.0 |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/lib-tk/test/runtktests.py | 61 | 4100 | """
Use this module to get and run all tk tests.
Tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.test_support
this_dir_... | mit |
GoogleCloudPlatform/datacatalog-connectors-bi | google-datacatalog-looker-connector/src/google/datacatalog_connectors/looker/sync/metadata_synchronizer.py | 1 | 16983 | #!/usr/bin/python
#
# 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 ag... | apache-2.0 |
pdellaert/ansible | lib/ansible/modules/cloud/azure/azure_rm_availabilityset.py | 27 | 10824 | #!/usr/bin/python
#
# Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.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.1',
... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/bs4/builder/_lxml.py | 4 | 9594 | # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
try:
from collections.abc import Callable # Python 3.6
except ImportError , e:
from collections import Callable
from io import BytesIO
fro... | gpl-3.0 |
taknevski/tensorflow-xsmm | tensorflow/contrib/bayesflow/python/ops/stochastic_variables.py | 103 | 6065 | # 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 |
joerocklin/gem5 | ext/ply/test/yacc_inf.py | 174 | 1278 | # -----------------------------------------------------------------------------
# yacc_inf.py
#
# Infinite recursion
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tokens
# Parsing... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/powerbidedicated/azure-mgmt-powerbidedicated/azure/mgmt/powerbidedicated/_configuration.py | 1 | 3345 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
mojones/Axelrod | axelrod/mock_player.py | 2 | 1425 | import copy
import axelrod
from axelrod import Player, update_histories, Actions
C, D = Actions.C, Actions.D
class MockPlayer(Player):
"""Creates a mock player that enforces a particular next move for a given
player."""
def __init__(self, player, move):
# Need to retain history for opponents t... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/ipv6_express_route_circuit_peering_config.py | 1 | 2352 | # 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 |
TangXT/edx-platform | cms/djangoapps/contentstore/management/commands/cleanup_assets.py | 204 | 1226 | """
Script for removing all redundant Mac OS metadata files (with filename ".DS_Store"
or with filename which starts with "._") for all courses
"""
import logging
from django.core.management.base import BaseCommand
from xmodule.contentstore.django import contentstore
log = logging.getLogger(__name__)
class Command... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.