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 |
|---|---|---|---|---|---|
ThinkOpen-Solutions/odoo | addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py | 332 | 13610 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
liumusicforever/mxnet-yolo | tools/rand_sampler.py | 19 | 10403 | import numpy as np
import math
class RandSampler(object):
"""
Random sampler base class, used for data augmentation
Parameters:
----------
max_trials : int
maximum trials, if exceed this number, give up anyway
max_sample : int
maximum random crop samples to be generated
"""... | mit |
OpenTreeOfLife/otindex | dev_scripts/sampleQueries.py | 3 | 15505 | import psycopg2 as psy
import sqlalchemy
from sqlalchemy import text
from sqlalchemy.dialects.postgresql import JSON,JSONB
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import ProgrammingError
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
relationship,
aliase... | bsd-2-clause |
chanyoonzhu/eatquik | chardet/chardistribution.py | 289 | 9411 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
milinbhakta/flaskmaterialdesign | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## 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-2.0 |
myarjunar/inasafe | safe/gui/tools/wizard/step_kw43_threshold.py | 3 | 9699 | # coding=utf-8
"""InaSAFE Wizard Step Threshold."""
from collections import OrderedDict
from functools import partial
import logging
from PyQt4.QtGui import QDoubleSpinBox, QHBoxLayout, QLabel
from qgis.core import QgsRasterBandStats
from safe.utilities.i18n import tr
from safe import messaging as m
from safe.defini... | gpl-3.0 |
ShineFan/odoo | addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py | 374 | 5518 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
natanovia/zulip | analytics/management/commands/analyze_mit.py | 115 | 3527 | from __future__ import absolute_import
from optparse import make_option
from django.core.management.base import BaseCommand
from zerver.models import Recipient, Message
from zerver.lib.timestamp import timestamp_to_datetime
import datetime
import time
import logging
def compute_stats(log_level):
logger = logging.... | apache-2.0 |
Ictp/indico | indico/MaKaC/webinterface/common/contribFilters.py | 1 | 15399 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | gpl-3.0 |
viralex/openmm_engine | Engine/TextureManager.py | 1 | 4804 | import sys, os
import io, math, numpy
from Lod import *
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from PIL import Image
import logging, logging.config
class TextureManager(object):
'''Texture loading and rendering class'''
def __init__(self, lm):
logging.config.fil... | gpl-2.0 |
cournape/numscons | numscons/scons-local/scons-local-1.2.0/SCons/Tool/aixc++.py | 1 | 2719 | """SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009... | bsd-3-clause |
hyperkitty/hyperkitty | hyperkitty/migrations/0003_thread_starting_email.py | 2 | 1109 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def find_starting_email(apps, schema_editor): # pylint: disable-msg=unused-argument
# We can't import the Thread model directly as it may be a newer
# version than this migration expects. We use the histo... | gpl-3.0 |
undoware/neutron-drive | google_appengine/lib/django_1_2/tests/modeltests/m2m_signals/tests.py | 89 | 14283 | """
Testing signals emitted on changing m2m relations.
"""
from django.db import models
from django.test import TestCase
from models import Part, Car, SportsCar, Person
class ManyToManySignalsTest(TestCase):
def m2m_changed_signal_receiver(self, signal, sender, **kwargs):
message = {
'instan... | bsd-3-clause |
pitch-sands/i-MPI | flask/Lib/site-packages/chardet/mbcssm.py | 982 | 19608 | ######################## 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... | bsd-3-clause |
adedayo/intellij-community | python/helpers/coverage/report.py | 214 | 3031 | """Reporter foundation for Coverage."""
import fnmatch, os
from coverage.codeunit import code_unit_factory
from coverage.files import prep_patterns
from coverage.misc import CoverageException, NoSource, NotPython
class Reporter(object):
"""A base class for all reporters."""
def __init__(self, coverage, confi... | apache-2.0 |
micle2018/OCCULT | Core/Banner.py | 1 | 5423 | #! /usr/bin/env python2.7
import random, os, time
def LinuxBanner():
from Core.Color import LinuxColor, LinuxStatus
os.system('clear')
banner = random.randint(1,7)
if banner == 1 :
b = LinuxColor['LCYAN']+""" _ _
| | |
___ ___ ___ _ _| | |_
... | gpl-3.0 |
fastavro/fastavro | tests/test_schema_evolution.py | 1 | 20400 | from fastavro import writer as fastavro_writer
from fastavro.read import SchemaResolutionError
from fastavro.utils import generate_one
import fastavro
import pytest
from io import BytesIO
schema_dict_a = {
"namespace": "example.avro2",
"type": "record",
"name": "evtest",
"fields": [{"name": "a", "typ... | mit |
kevin-coder/tensorflow-fork | tensorflow/python/autograph/pyct/testing/codegen_test.py | 47 | 1364 | # 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 |
tiborsimko/invenio-deposit | setup.py | 1 | 5374 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015, 2016, 2017 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 (at your optio... | gpl-2.0 |
chand3040/cloud_that | common/test/data/capa/prog2.py | 270 | 109956 | # prog2
# Make this file long, since that seems to affect how uploaded files are
# handled in webob or cgi.FieldStorage.
moby_dick_ten_chapters = """
CHAPTER 1. Loomings.
Call me Ishmael. Some years ago--never mind how long precisely--having
little or no money in my purse, and nothing particular to interest me on
s... | agpl-3.0 |
gumanisto/sphinxsearch | misc/resolve.py | 75 | 1055 | #
# $Id$
#
import sys, re
if len(sys.argv)!=3:
print 'Usage: python resolve.py BACKTRACE SYMBOLS'
sys.exit(0)
def myopen(name):
if name == '-':
return sys.stdin
fh = open(name, 'r')
if not fh:
print 'FATAL: failed to open %s' % name
sys.exit(1)
return fh
syms = []
fp = myopen(sys.argv[2])
for line in fp... | gpl-2.0 |
lihui7115/ChromiumGStreamerBackend | build/android/gyp/write_ordered_libraries.py | 43 | 4095 | #!/usr/bin/env python
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Writes dependency ordered list of native libraries.
The list excludes any Android system libraries, as those are not bundled with... | bsd-3-clause |
ecino/compassion-modules | sbc_compassion/controllers/b2s_image.py | 2 | 2238 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py... | agpl-3.0 |
SchrodingersGat/kicad-footprint-generator | scripts/Connector/Connector_JST/conn_jst_vh_tht_top.py | 1 | 8155 | #!/usr/bin/env python3
'''
kicad-footprint-generator 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.
kicad-footprint-generator is distribut... | gpl-3.0 |
VielSoft/odoo | addons/purchase/report/purchase_report.py | 137 | 7689 | # -*- 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 |
atul-bhouraskar/django | tests/gis_tests/gis_migrations/test_operations.py | 284 | 7957 | from __future__ import unicode_literals
from django.contrib.gis.db.models import fields
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration import Migration
from django.db.migrations.state import ProjectState
from django.test ... | bsd-3-clause |
gareging/SDN_Framework | ryu/ofproto/ofproto_v1_5.py | 6 | 76210 | # Copyright (C) 2012,2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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
#
# ht... | apache-2.0 |
muharif/vpp | test/resources/libraries/python/ssh.py | 1 | 4055 | # Copyright (c) 2015 Cisco and/or its affiliates.
# 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 |
ageron/tensorflow | tensorflow/contrib/factorization/python/ops/gmm.py | 44 | 6857 | # 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 |
Permutatrix/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/service-worker-csp-worker.py | 62 | 5024 | bodyDefault = '''
importScripts('worker-testharness.js');
importScripts('test-helpers.sub.js');
importScripts('/common/get-host-info.sub.js');
var host_info = get_host_info();
test(function() {
var import_script_failed = false;
try {
importScripts(host_info.HTTPS_REMOTE_ORIGIN +
base_path() + 'e... | mpl-2.0 |
NateBrune/bitcoin-fio | qa/rpc-tests/test_framework/socks5.py | 182 | 5701 | # Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
from __future__ import print_function, division, unicode_literals
import socket, threading, Q... | mit |
saurabh6790/omni-apps | accounts/report/general_ledger/general_ledger.py | 9 | 6133 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt
from webnotes import _
def execute(filters=None):
account_details = {}
for acc in webnotes.co... | agpl-3.0 |
Liamraystanley/dropbin | lib/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
stackforge/python-monascaclient | monascaclient/v2_0/notifications.py | 2 | 2317 | # (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
# Copyright 2017 FUJITSU LIMITED
#
# 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/LICE... | apache-2.0 |
roadhead/django-registration | registration/backends/simple/__init__.py | 53 | 2212 | from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth import login
from django.contrib.auth.models import User
from registration import signals
from registration.forms import RegistrationForm
class SimpleBackend(object):
"""
A registration backend which implem... | bsd-3-clause |
ojengwa/django-1 | tests/flatpages_tests/test_middleware.py | 290 | 8134 | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... | bsd-3-clause |
PKRoma/python-for-android | pythonforandroid/bootstraps/common/build/build.py | 3 | 32656 | #!/usr/bin/env python3
import json
from os.path import (
dirname, join, isfile, realpath,
relpath, split, exists, basename
)
from os import listdir, makedirs, remove
import os
import shlex
import shutil
import subprocess
import sys
import tarfile
import tempfile
import time
from distutils.version import Loose... | mit |
ankitml/underscore | tests/test_arrays.py | 1 | 1607 | import unittest
from underscore import array as _
from itertools import chain
class TestFlatten(unittest.TestCase):
def test_flat_list(self):
l = [1,2,3,4]
flat = list(_.flatten(l))
self.assertEqual(l,flat)
def test_flat_generator(self):
l = range(0, 10)
flat = _.flat... | mit |
miguelgrinberg/heat | heat/engine/constraints.py | 4 | 21479 | #
# 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 |
DazWorrall/ansible | lib/ansible/plugins/terminal/dellos9.py | 71 | 2779 | #
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell 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) an... | gpl-3.0 |
ivandevp/django | tests/responses/tests.py | 226 | 4171 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.http import HttpResponse
from django.http.response import HttpResponseBase
from django.test import SimpleTestCase
UTF8 = 'utf-8'
ISO88591 = 'iso-8859-1'
class HttpResponseBaseTests(SimpleTestCase):
def ... | bsd-3-clause |
ssssam/rdflib | rdflib/plugins/parsers/pyRdfa/rdfs/process.py | 23 | 11566 | # -*- coding: utf-8 -*-
"""
@organization: U{World Wide Web Consortium<http://www.w3.org>}
@author: U{Ivan Herman<a href="http://www.w3.org/People/Ivan/">}
@license: This software is available for use under the
U{W3C® SOFTWARE NOTICE AND LICENSE<href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231"... | bsd-3-clause |
chromium/gyp | test/mac/gyptest-rebuild.py | 12 | 1384 | #!/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.
"""
Verifies that app bundles are rebuilt correctly.
"""
from __future__ import print_function
import TestGyp
import sys
if sys.platform... | bsd-3-clause |
cleett/plyer | plyer/platforms/macosx/notification.py | 4 | 1097 | from plyer.facades import Notification
import Foundation
import objc
import AppKit
class OSXNotification(Notification):
def _notify(self, **kwargs):
NSUserNotification = objc.lookUpClass('NSUserNotification')
NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
notificat... | mit |
kgao/MediaDrop | mediadrop/lib/tests/current_url_test.py | 2 | 3571 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2014 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
Jgarcia-IAS/SITE | openerp/addons/base/ir/ir_needaction.py | 455 | 2704 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
vaygr/ansible | lib/ansible/modules/cloud/azure/azure_rm_keyvault.py | 30 | 20114 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@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 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/operations/_bgp_service_communities_operations.py | 1 | 5134 | # 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 |
mlavin/django | django/contrib/gis/gdal/libgdal.py | 32 | 3612 | import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib.gis')
# Custom library path set?
try:
... | bsd-3-clause |
dudonwai/dudonsblog | Lib/site-packages/django/test/utils.py | 82 | 20173 | import logging
import re
import sys
import time
import warnings
from contextlib import contextmanager
from functools import wraps
from unittest import skipIf, skipUnless
from xml.dom.minidom import Node, parseString
from django.apps import apps
from django.conf import UserSettingsHolder, settings
from django.core impo... | mit |
ict-felix/stack | vt_manager_kvm/src/python/vt_manager_kvm/urls.py | 1 | 7077 | from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
from common.rpc4django.utils import rpc_url
import re
admin.autodiscover()
from vt_manager_kvm.utils.ThemeManager import ThemeManager
from vt_manager_kvm.communication.southCommInterface import *
from vt_manager_... | apache-2.0 |
smishenk/blink-crosswalk | Source/build/scripts/make_element_type_helpers.py | 24 | 3087 | #!/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.
import sys
from collections import defaultdict
import hasher
import in_generator
import name_utilities
import template_expander
from ... | bsd-3-clause |
nhomar/odoo-mirror | addons/account/company.py | 384 | 2814 | # -*- 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 |
ojake/django | django/utils/version.py | 344 | 2445 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | bsd-3-clause |
Yen-Chung-En/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py | 632 | 3008 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | gpl-3.0 |
Weicong-Lin/pymo-global | android/pgs4a-0.9.6/python-install/lib/python2.7/lib-tk/Tkdnd.py | 198 | 11488 | """Drag-and-drop support for Tkinter.
This is very preliminary. I currently only support dnd *within* one
application, between different windows (or within the same window).
I an trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc. I also hope that
this wi... | mit |
sannecottaar/burnman | burnman/anisotropy.py | 5 | 17005 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import matplotlib.p... | gpl-2.0 |
Jonwing/morphling | morphling/scanner.py | 1 | 3194 | # coding: utf-8
import re
from itertools import chain
from .token import blocks_default, list_items, block_footnotes, inlines_default, inline_htmls
class Scanner(object):
'''
scanner to do the actual parsing job
'''
# default regex: parse default blocks
default_regex = blocks_default
# list_... | mit |
40223114/w16 | static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testcallable.py | 739 | 4234 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import unittest
from unittest.test.testmock.support import is_instance, X, SomeClass
from unittest.mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableM... | agpl-3.0 |
blindroot/django | django/contrib/auth/password_validation.py | 57 | 7538 | from __future__ import unicode_literals
import gzip
import os
import re
from difflib import SequenceMatcher
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.encoding import ... | bsd-3-clause |
emuikernel/WNR2000v4 | git_home/linux-2.6.git/scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/lines_bars_and_markers/multicolored_line.py | 1 | 2345 | '''
==================
Multicolored lines
==================
This example shows how to make a multi-colored line. In this example, the line
is colored based on its derivative.
'''
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib.colors import ListedC... | mit |
mrquim/repository.mrquim | script.module.unidecode/lib/unidecode/x082.py | 252 | 4649 | data = (
'Yao ', # 0x00
'Yu ', # 0x01
'Chong ', # 0x02
'Xi ', # 0x03
'Xi ', # 0x04
'Jiu ', # 0x05
'Yu ', # 0x06
'Yu ', # 0x07
'Xing ', # 0x08
'Ju ', # 0x09
'Jiu ', # 0x0a
'Xin ', # 0x0b
'She ', # 0x0c
'She ', # 0x0d
'Yadoru ', # 0x0e
'Jiu ', # 0x0f
'Shi ', # 0x10
'Tan ... | gpl-2.0 |
pyfa-org/Pyfa | eos/saveddata/fighter.py | 1 | 19217 | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... | gpl-3.0 |
nikolas/edx-platform | common/lib/xmodule/xmodule/exceptions.py | 171 | 1339 | class InvalidDefinitionError(Exception):
pass
class NotFoundError(Exception):
pass
class ProcessingError(Exception):
'''
An error occurred while processing a request to the XModule.
For example: if an exception occurs while checking a capa problem.
'''
pass
class InvalidVersionError(Ex... | agpl-3.0 |
conan-io/conan | conans/test/unittests/source/merge_directories_test.py | 1 | 4964 | # coding=utf-8
import os
import shutil
import unittest
from os.path import join
from conans import load
from conans.test.utils.test_files import temp_folder
from conans.util.files import mkdir, save, merge_directories
class MergeDirectoriesTest(unittest.TestCase):
def setUp(self):
self.source = temp_fol... | mit |
yin-xuanHuang/ML_with_imageNet | multithreads_download_from_url_files.py | 1 | 7864 | '''
此程式的工作:
1. 多執行緒抓圖片url
* 如果下載中意外停止,可以先使用update_url.py
來快速清理已經下載的連結,讓下載時間縮短。
工作方式:
one thread put(file.readline)
other thread get() , parse, requests and download images
'''
import os
import queue
import threading
import time
import requests
# 設定總執行緒數
num_threads = 31
# 等待put thread 先處理一陣子,在加入 get threads,秒
... | mit |
nlloyd/SubliminalCollaborator | libs/twisted/python/urlpath.py | 60 | 3421 | # -*- test-case-name: twisted.test.test_paths -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
import urlparse
import urllib
class URLPath:
def __init__(self, scheme='', netloc='localhost', path='',
query='', fragment=''):
self.scheme = scheme or 'http'
... | apache-2.0 |
switchboardOp/ansible | lib/ansible/utils/module_docs_fragments/cloudstack.py | 175 | 2631 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 René Moser <mail@renemoser.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
Yelp/yelp_clog | tests/test_handlers.py | 1 | 4310 | # -*- coding: utf-8 -*-
# Copyright 2015 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
Aminakh/or-tools | examples/python/circuit.py | 32 | 3246 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
guokeno0/vitess | test/initial_sharding.py | 1 | 22410 | #!/usr/bin/env python
#
# Copyright 2013, 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.
# This test simulates the first time a database has to be split:
# - we start with a keyspace with a single shard and a single table
# - we ad... | bsd-3-clause |
dendisuhubdy/tensorflow | tensorflow/contrib/gan/python/eval/python/eval_utils.py | 74 | 1200 | # 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 |
lshain-android-source/external-chromium_org | tools/telemetry/telemetry/core/chrome/cros_browser_backend.py | 23 | 14747 | # 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 logging
import os
import subprocess
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.backends import brow... | bsd-3-clause |
karllessard/tensorflow | tensorflow/python/autograph/pyct/transformer.py | 5 | 17038 | # 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 |
paulczar/magnum | magnum/tests/unit/conductor/handlers/test_bay_conductor.py | 4 | 35832 | # Copyright 2014 NEC Corporation. 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 l... | apache-2.0 |
gvb/odoo | addons/l10n_ec/__openerp__.py | 260 | 1695 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
dseeliger/pmx | example_scripts/test_opt.py | 3 | 1285 | import sys, os
from pmx import *
options = [
Option( "-s", "string", "default_string", "Description of what this string options is doing"),
Option("-f", "float", 3.1415,"Description of what this float option is doing"),
Option("-i","int",42,"Description of what this int option is doing"),
Option("-b","... | lgpl-3.0 |
torufuru/oolhackathon | ryu/tests/unit/cmd/test_manager.py | 20 | 2112 | # Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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
#
... | apache-2.0 |
mribeirodantas/nsuchat | client.py | 1 | 8414 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of NSUChat, the Not So Unsafe Chat.
#
# Copyright (©) 2014 Marcel Ribeiro Dantas
#
# <mribeirodantas at fedoraproject.org>
#
# NSUChat is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# publi... | gpl-3.0 |
Stanford-Online/edx-ora2 | openassessment/xblock/test/test_leaderboard.py | 3 | 15266 | # -*- coding: utf-8 -*-
"""
Tests for leaderboard handlers in Open Assessment XBlock.
"""
import json
from random import randint
from urlparse import urlparse
import boto
from boto.s3.key import Key
import mock
from moto import mock_s3
from django.core.cache import cache
from django.test.utils import override_setting... | agpl-3.0 |
johnnygaddarr/zulip | zerver/lib/cache_helpers.py | 120 | 4368 | from __future__ import absolute_import
# This file needs to be different from cache.py because cache.py
# cannot import anything from zerver.models or we'd have an import
# loop
from django.conf import settings
from zerver.models import Message, UserProfile, Stream, get_stream_cache_key, \
Recipient, get_recipient... | apache-2.0 |
mathDR/reading-text-in-the-wild | DICT2/extract_dictnet_weights.py | 1 | 3397 | import numpy as np
import scipy.io as sio
# Taken from http://stackoverflow.com/questions/7008608/scipy-io-loadmat-nested-structures-i-e-dictionaries
def loadmat(filename):
'''
this function should be called instead of direct sio.loadmat
as it cures the problem of not properly recovering python dictionarie... | gpl-3.0 |
ageron/tensorflow | tensorflow/contrib/tpu/__init__.py | 23 | 2619 | # 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 |
LokiCoder/Sick-Beard | sickbeard/providers/ezrss.py | 9 | 6024 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 |
tswast/google-cloud-python | vision/google/cloud/vision_helpers/__init__.py | 4 | 3361 | # Copyright 2017, Google LLC 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 a... | apache-2.0 |
ehealthafrica-ci/formhub | odk_viewer/models/xform_parser.py | 7 | 4449 | # I'm going to move all that data dictionary work that has been done
# in odk_logger.models.XForm over to here.
class OldXFormParser(object):
def __init__(self, xml):
assert type(xml)==str or type(xml)==unicode, u"xml must be a string"
self.doc = minidom.parseString(xml)
self.root_node = se... | bsd-2-clause |
eduNEXT/edunext-ecommerce | ecommerce/extensions/api/v2/tests/views/test_user_management.py | 1 | 3432 | from __future__ import absolute_import
import json
import ddt
import mock
from django.urls import reverse
from six.moves import range
from ecommerce.tests.factories import UserFactory
from ecommerce.tests.testcases import TestCase
JSON_CONTENT_TYPE = 'application/json'
@ddt.ddt
@mock.patch('django.conf.settings.U... | agpl-3.0 |
rybesh/pybtex | pybtex/__version__.py | 1 | 1145 | # Copyright (c) 2007, 2008, 2009, 2010, 2011 Andrey Golovizin
#
# 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 to use, copy, ... | mit |
a-doumoulakis/tensorflow | tensorflow/contrib/ndlstm/python/misc.py | 121 | 3612 | # 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 |
aerickson/ansible | lib/ansible/modules/cloud/google/gce_eip.py | 70 | 6857 | #!/usr/bin/python
# Copyright 2017 Google 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 vers... | gpl-3.0 |
muffl0n/ansible-modules-extras | cloud/amazon/ec2_vpc_igw.py | 36 | 4608 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
yafeunteun/wikipedia-spam-classifier | revscoring/revscoring/languages/tests/test_indonesian.py | 1 | 2768 | import pickle
from nose.tools import eq_
from .. import indonesian
from ...datasources import revision_oriented
from ...dependencies import solve
from .util import compare_extraction
BAD = [
"anjing",
"bajingan",
"bangsat",
"bispak",
"bloon", "blo'on",
"brengsek", "brengsex",
"bencong",
... | mit |
murrown/cyder | cyder/cydns/txt/tests/test_models.py | 2 | 1857 | from django.core.exceptions import ValidationError
from cyder.base.tests import ModelTestMixin, TestCase
from cyder.core.ctnr.models import Ctnr
from cyder.cydns.txt.models import TXT
from cyder.cydns.domain.models import Domain
from cyder.core.ctnr.models import Ctnr
class TXTTests(TestCase, ModelTestMixin):
de... | bsd-3-clause |
jmighion/ansible | lib/ansible/modules/notification/telegram.py | 99 | 3268 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Artem Feofanov <artem.feofanov@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
oesterle/Espruino | scripts/serial_monitor_bytes.py | 8 | 1036 | #!/usr/bin/python
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 on... | mpl-2.0 |
wadobo/timebank | main/admin.py | 2 | 1104 | # -*- coding: utf-8 -*-
# Copyright (C) 2010 Daniel Garcia Moreno <dani@danigm.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | agpl-3.0 |
Etzos/PlushieBot | amarok.py | 2 | 1037 | import dbus
class MprisPlaying:
def __init__(self):
self.artist = self.title = self.album = self.status = None
self.metadata = self.playbackstatus = None
self.bus = dbus.SessionBus()
def getData(self, interface, path):
stop = False
try:
mpris = self.bus.get... | gpl-3.0 |
mcella/django | tests/admin_changelist/tests.py | 29 | 37484 | from __future__ import unicode_literals
import datetime
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import IncorrectLookupParameters
from django.contrib.admin.templatetags.admin_list import pagination
from django.contrib.admin.tests import AdminS... | bsd-3-clause |
VigTech/Vigtech-Services | env/lib/python2.7/site-packages/django/conf/locale/pl/formats.py | 115 | 1147 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y'
TIME_FORMAT = 'H:i'
DATETI... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.