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 |
|---|---|---|---|---|---|
gangadharkadam/johnerp | erpnext/support/doctype/maintenance_visit/maintenance_visit.py | 32 | 3160 | # 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 frappe
from frappe import _
from erpnext.utilities.transaction_base import TransactionBase
class MaintenanceVisit(TransactionBase):
def ge... | agpl-3.0 |
tdhopper/scikit-learn | examples/model_selection/plot_roc_crossval.py | 247 | 3253 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... | bsd-3-clause |
chengjf/database-interface-doc-management | flask-demo/flask/Lib/encodings/iso2022_jp_2.py | 816 | 1061 | #
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_2')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | apache-2.0 |
danmergens/mi-instrument | mi/dataset/parser/dosta_ln_wfp_sio.py | 5 | 9371 | #!/usr/bin/env python
"""
@package mi.dataset.parser
@file marine-integrations/mi/dataset/parser/dosta_ln_wfp_sio.py
@author Christopher Fortin
@brief Parser for the dosta_ln_wfp_sio dataset driver
Release notes:
Initial Release
"""
__author__ = 'Christopher Fortin'
__license__ = 'Apache 2.0'
import struct
import n... | bsd-2-clause |
pongad/api-client-staging | generated/python/gapic-google-cloud-spanner-admin-instance-v1/docs/conf.py | 7 | 10499 | # -*- coding: utf-8 -*-
#
# gapic-google-cloud-spanner-admin-instance-v1 documentation build configuration file
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values ... | bsd-3-clause |
ericholscher/django | django/contrib/gis/management/commands/inspectdb.py | 315 | 1466 | from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_field_type(... | bsd-3-clause |
ojengwa/oh-mainline | vendor/packages/Django/tests/regressiontests/syndication/tests.py | 47 | 13086 | from __future__ import absolute_import, unicode_literals
from xml.dom import minidom
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
... | agpl-3.0 |
yanheven/nova | nova/tests/unit/scheduler/test_client.py | 17 | 7737 | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
laserson/impyla | impala/tests/conftest.py | 4 | 3160 | # Copyright 2014 Cloudera 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... | apache-2.0 |
audaciouscode/Books-Mac-OS-X | Versions/Books_3.0b4/Library of Congress Importer.app/Contents/Resources/PyZ3950/zoom.py | 30 | 37104 | #!/usr/bin/env python
"""Implements the ZOOM 1.4 API (http://zoom.z3950.org/api)
for Z39.50.
Some global notes on the binding (these will only make sense when read
after the API document):
Get/Set Option is implemented as member attribute access or
assignment. Implementations are encouraged to throw an AttributeErr... | mit |
ryanahall/django | tests/validation/tests.py | 22 | 8017 | from __future__ import unicode_literals
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.test import TestCase
from . import ValidationTestCase
from .models import (
Article, Author, GenericIPAddressTestModel, GenericIPAddrUnpackUniqueTest,
ModelToValidate,
)
class Bas... | bsd-3-clause |
ThinkOpen-Solutions/odoo | openerp/report/render/makohtml2html/__init__.py | 381 | 1084 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Joy-El/metagene_analysis | Metagene.py | 1 | 5587 | #!/usr/bin/python
"""Metagene class for metagene_counts.py
Requires:
python 2 (https://www.python.org/downloads/)
Joy-El R.B. Talbot Copyright (c) 2014
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files
(the "So... | mit |
WillemWybo/SGF_formalism | source/btstructs.py | 1 | 13261 | """
Module contains:
P3D
SNode
STree
B. Torben-Nielsen, 2013-01 @ BBP (from BTN legacy code)
"""
import copy
class P3D:
"""
Wrapper for 3D positions
A P3D contains all information required for the SWC format,
plus, order / degree / path length in case the user sets it.
""... | mit |
cgourlay/tapiriik | tapiriik/requests_lib.py | 3 | 1643 | # For whatever reason there's no built-in way to specify a global timeout for requests operations.
# socket.setdefaulttimeout doesn't work since requests overriddes the default with its own default.
# There's probably a better way to do this in requests 2.x, but...
def patch_requests_with_default_timeout(timeout):
im... | apache-2.0 |
liberorbis/libernext | apps/erpnext/erpnext/patches/v4_0/update_account_root_type.py | 39 | 1483 | # 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 frappe
def execute():
frappe.reload_doc("accounts", "doctype", "account")
account_table_columns = frappe.db.get_table_columns("Account")
... | gpl-2.0 |
secretdataz/OpenKore-Src | src/scons-local-2.0.1/SCons/Tool/javac.py | 61 | 8565 | """SCons.Tool.javac
Tool-specific initialization for javac.
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, 2010 The SCons Foundation
#... | gpl-2.0 |
ondrej-fabry/vpp-agent | ansible/action_plugins/vpp_etcd.py | 2 | 3004 | # Copyright (c) 2019 PANTHEON.tech
#
# 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 wr... | apache-2.0 |
sambyers/o365_fmc | .venv/lib/python3.6/site-packages/requests/packages/urllib3/util/timeout.py | 292 | 9757 | from __future__ import absolute_import
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
import time
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# u... | gpl-3.0 |
mitocw/edx-platform | openedx/core/djangoapps/theming/paver_helpers.py | 5 | 2260 | """
This file contains helpers for paver commands, Django is not initialized in paver commands.
So, django settings, models etc. can not be used here.
"""
import os
from path import Path
def get_theme_paths(themes, theme_dirs):
"""
get absolute path for all the given themes, if a theme is no found
at m... | agpl-3.0 |
mlperf/training_results_v0.7 | NVIDIA/benchmarks/maskrcnn/implementations/pytorch/tests/checkpoint.py | 4 | 4645 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from collections import OrderedDict
import os
from tempfile import TemporaryDirectory
import unittest
import torch
from torch import nn
from maskrcnn_benchmark.utils.model_serialization import load_state_dict
from maskrcnn_benchmark.utils.checkpo... | apache-2.0 |
fedjo/thesis | project/aat/object_detection/utils/dataset_util.py | 21 | 2617 | # 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 |
madhurrajn/samashthi | lib/gevent/_ssl3.py | 9 | 21931 | # Wrapper module for _ssl. Written by Bill Janssen.
# Ported to gevent by Denis Bilenko.
"""SSL wrapper for socket objects on Python 3.
For the documentation, refer to :mod:`ssl` module manual.
This module implements cooperative SSL socket wrappers.
"""
from __future__ import absolute_import
import ssl as __ssl__
_... | bsd-3-clause |
Adamssss/projectEuler | Problem 001-150 Python/pb061.py | 1 | 1640 | import math
import time
t1 = time.time()
# p8,59 > 9999
# p8,18 < 1000
gons = []
for i in range(19,59):
o = i*(3*i-2)
a = o//100
b = o%100
gons.append([[a,b],[8]])
#p7,64 > 9999
#p7,20 < 1000
for i in range(21,64):
h = i*(5*i-3)//2
a = h//100
b = h%100
gons.append([[a,b],[7]])
#p6,71... | mit |
MasonLeeBack/PolyEngine | thirdparty/vulkan/shaderc/third_party/googletest/googletest/scripts/fuse_gtest_files.py | 28 | 8901 | #!/usr/bin/env python
#
# Copyright 2009, 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 |
altaetran/bayesianoracle | tests/quadraticBayesianAveraging/2Dexample_multiple.py | 1 | 2463 | import numpy as np
import bayesianoracle as bo
from pprint import pprint as pp
ndim = 2
bmao = bo.optimizer.QuadraticBMAOptimizer(ndim=ndim)
for i in xrange(100):
H = np.array([[ 1389.4217, 1151.5168],
[ 1151.5168, 36896.3534]])
g = np.array([ 643.2191, 6206.7597])+np.random.normal(0... | apache-2.0 |
tpo/ansible | lib/ansible/module_utils/facts/network/hpux.py | 232 | 3015 | # 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 in the hope that ... | gpl-3.0 |
giuliov/ansible | lib/ansible/playbook/__init__.py | 108 | 3720 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
dannagarcia/sjp-v3 | public/js/vendor/psy/psysh/test/tools/gen_unvis_fixtures.py | 536 | 3120 | #! /usr/bin/env python3
import sys
from os.path import abspath, expanduser, dirname, join
from itertools import chain
import json
import argparse
from vis import vis, unvis, VIS_WHITE
__dir__ = dirname(abspath(__file__))
OUTPUT_FILE = join(__dir__, '..', 'fixtures', 'unvis_fixtures.json')
# Add custom fixtures her... | gpl-3.0 |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/pythonwin/pywin/Demos/app/basictimerapp.py | 17 | 6377 | # basictimerapp - a really simple timer application.
# This should be run using the command line:
# pythonwin /app demos\basictimerapp.py
import win32ui
import win32api
import win32con
import sys
from pywin.framework import app, cmdline, dlgappcore, cmdline
import timer
import time
import string
class TimerAppDialog(d... | apache-2.0 |
taedori81/django-oscar | src/oscar/apps/dashboard/reports/utils.py | 57 | 1232 | from oscar.core.loading import get_class, get_classes
OrderReportGenerator = get_class('order.reports', 'OrderReportGenerator')
ProductReportGenerator, UserReportGenerator \
= get_classes('analytics.reports', ['ProductReportGenerator',
'UserReportGenerator'])
OpenBasketRepor... | bsd-3-clause |
seem-sky/linux | tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
molobrakos/home-assistant | homeassistant/components/isy994/lock.py | 8 | 3205 | """Support for ISY994 locks."""
import logging
from typing import Callable
from homeassistant.components.lock import DOMAIN, LockDevice
from homeassistant.const import STATE_LOCKED, STATE_UNKNOWN, STATE_UNLOCKED
from homeassistant.helpers.typing import ConfigType
from . import ISY994_NODES, ISY994_PROGRAMS, ISYDevice... | apache-2.0 |
greenlaw110/FrameworkBenchmarks | frameworks/Python/apidaora/app.py | 7 | 3772 | import asyncio
import asyncpg
import os
import jinja2
from logging import getLogger
from apidaora import appdaora, html, route, text
from random import randint
from operator import itemgetter
from typing import TypedDict, Optional
logger = getLogger(__name__)
READ_ROW_SQL = 'SELECT "randomnumber" FROM "world" WHERE... | bsd-3-clause |
pybel/pybel | src/pybel/struct/filters/node_predicates/activities.py | 1 | 1791 | # -*- coding: utf-8 -*-
"""Pre-defined predicates for nodes."""
from ..utils import part_has_modifier
from ...graph import BELGraph
from ....constants import ACTIVITY, DEGRADATION, SOURCE_MODIFIER, TARGET_MODIFIER, TRANSLOCATION
from ....dsl import BaseEntity
__all__ = [
'has_edge_modifier',
'has_activity',
... | mit |
fhaoquan/kbengine | kbe/src/lib/python/Lib/http/cookiejar.py | 63 | 75791 | r"""HTTP cookie handling for web clients.
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyt... | lgpl-3.0 |
caot/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/sitemaps/georss.py | 291 | 2156 | from django.core import urlresolvers
from django.contrib.sitemaps import Sitemap
class GeoRSSSitemap(Sitemap):
"""
A minimal hook to produce sitemaps for GeoRSS feeds.
"""
def __init__(self, feed_dict, slug_dict=None):
"""
This sitemap object initializes on a feed dictionary (as would b... | apache-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sekizai/tests.py | 5 | 13919 | from __future__ import with_statement
from difflib import SequenceMatcher
import os
from unittest import TestCase
import sys
from django import template
from django.conf import settings
from django.template.loader import render_to_string
import pep8
from sekizai.context import SekizaiContext
from sekizai.helpers impo... | agpl-3.0 |
adusca/treeherder | tests/etl/test_buildbot.py | 1 | 58707 | import pytest
from treeherder.etl import buildbot
slow = pytest.mark.slow
buildernames = [
('Android 2.2 Armv6 mozilla-inbound build',
{'build_type': 'opt',
'job_type': 'build',
'name': {'group_name': 'unknown',
'group_symbol': '?',
'name': 'Build',
'... | mpl-2.0 |
willingc/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_line_blocks.py | 18 | 7739 | #! /usr/bin/env python
# $Id: test_line_blocks.py 7638 2013-03-22 13:25:46Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTestSui... | agpl-3.0 |
flask-restful/flask-restful | flask_restful/inputs.py | 1 | 9118 | from calendar import timegm
from datetime import datetime, time, timedelta
from email.utils import parsedate_tz, mktime_tz
import re
import aniso8601
import pytz
# Constants for upgrading date-based intervals to full datetimes.
START_OF_DAY = time(0, 0, 0, tzinfo=pytz.UTC)
END_OF_DAY = time(23, 59, 59, 999999, tzinfo... | bsd-3-clause |
shipci/boto | boto/resultset.py | 20 | 6557 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
chandler14362/panda3d | direct/src/leveleditor/ObjectPropertyUI.py | 6 | 25139 | """
UI for object property control
"""
import wx
import os
import math
from wx.lib.embeddedimage import PyEmbeddedImage
from wx.lib.scrolledpanel import ScrolledPanel
from wx.lib.agw.cubecolourdialog import *
from direct.wxwidgets.WxSlider import *
from pandac.PandaModules import *
from . import ObjectGlobals as OG
fr... | bsd-3-clause |
troismph/matasano-challenges | src/challenge16.py | 1 | 1374 | #!/bin/python
import urllib, urlparse
from converts import encrypt_aes_128_cbc, decrypt_aes_128_cbc
import os
KEY_LEN = 16
KEY = bytearray(os.urandom(KEY_LEN))
PREFIX = "comment1=cooking%20MCs;userdata="
POSTFIX = ";comment2=%20like%20a%20pound%20of%20bacon"
def oracle(usr_dat):
plain = bytearray(PREFIX + urlli... | gpl-3.0 |
ianyh/heroku-buildpack-python-opencv | vendor/pip-1.5.4/pip/_vendor/requests/packages/charade/sjisprober.py | 1182 | 3734 | ######################## 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 |
vktr/alfred | api/alfred/blueprints/leases.py | 1 | 3122 | """
alfred.blueprints.leases
~~~~~~~~~~~~~~~~~~~~~~~~
API endpoints for leases.
"""
import random
import uuid
from datetime import datetime, timedelta
from bson.objectid import ObjectId
from flask import Blueprint, jsonify, request
from alfred import database
from alfred.errors import InvalidUsage
from a... | mit |
sam81/wavpy | prep-release/release.py | 1 | 1934 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import getopt, datetime, os, subprocess, sys
os.chdir('../')
def main(argv):
try:
opts, args = getopt.getopt(argv, "m:", ["message="])
except getopt.GetoptError:
sys.exit(2)
for opt, arg in opts:
if opt in ("-m", "--message"):
... | gpl-3.0 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/tools/test-server.py | 107 | 7513 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | apache-2.0 |
insequent/libcalico | calico_containers/pycalico/datastore_errors.py | 3 | 1879 | # Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | apache-2.0 |
jpaalasm/pyglet | tools/wraptypes/yacc.py | 29 | 83190 | #-----------------------------------------------------------------------------
# ply: yacc.py
#
# Author(s): David M. Beazley (dave@dabeaz.com)
# Modifications for pyglet by Alex Holkner (alex.holkner@gmail.com) (<ah>)
#
# Copyright (C) 2001-2006, David M. Beazley
#
# This library is free software; you can redistribute... | bsd-3-clause |
matthiascy/panda3d | direct/src/particles/ParticleEffect.py | 8 | 7708 |
from panda3d.core import *
# Leave these imports in, they may be used by ptf files.
from panda3d.physics import *
from . import Particles
from . import ForceGroup
from direct.directnotify import DirectNotifyGlobal
class ParticleEffect(NodePath):
notify = DirectNotifyGlobal.directNotify.newCategory('ParticleEffe... | bsd-3-clause |
gnulinooks/sympy | sympy/plotting/plot.py | 5 | 12674 | from sympy import Integer
from threading import RLock
# it is sufficient to import "pyglet" here once
from sympy.thirdparty import import_thirdparty
pyglet = import_thirdparty("pyglet")
from pyglet.gl import *
from plot_object import PlotObject
from plot_axes import PlotAxes
from plot_window import PlotWindow
from ... | bsd-3-clause |
7WebPages/django-allauth | allauth/socialaccount/providers/weibo/tests.py | 71 | 1182 | from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import WeiboProvider
class WeiboTests(create_oauth2_tests(registry.by_id(WeiboProvider.id))):
def get_mocked_response(self):
return Mocke... | mit |
sacharya/nova | nova/tests/pci/test_pci_request.py | 4 | 10886 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Intel 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.o... | apache-2.0 |
PugglePay/ansible-modules-extras | network/f5/bigip_node.py | 4 | 14409 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
kakunbsc/enigma2.1 | lib/python/Components/ServiceList.py | 1 | 7082 | from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from skin import parseColor, parseFont
from enigma import eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import resolveFilename, SCOPE_CURRENT... | gpl-2.0 |
BT-rmartin/odoo | addons/product_visible_discount/product_visible_discount.py | 54 | 6170 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
PongPi/isl-odoo | openerp/addons/base/res/res_font.py | 322 | 7559 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Nothing-Dev/android_kernel_lge_jagnm_lp | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
epssy/hue | desktop/core/ext-py/Django-1.6.10/tests/m2m_regress/tests.py | 58 | 4127 | from __future__ import absolute_import
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import (SelfRefer, Tag, TagCollection, Entry, SelfReferChild,
SelfReferChildSibling, Worksheet, RegressionModelSplit, Line)
class M2MRegressionTests(Tes... | apache-2.0 |
louietsai/python-for-android | python-modules/twisted/twisted/words/protocols/jabber/client.py | 52 | 12562 | # -*- test-case-name: twisted.words.test.test_jabberclient -*-
#
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import defer
from twisted.words.xish import domish, xpath, utility
from twisted.words.protocols.jabber import xmlstream, sasl, error
from twisted.word... | apache-2.0 |
lucifering/webshell | php/phpkit-1.0/phpkitcli.py | 26 | 4381 | #!/usr/bin/python
import argparse
import requests
import sys
help = """Connects to a phpkit backdoor and provides file upload or shell access"""
parser = argparse.ArgumentParser(description=help)
parser.add_argument("--url", help="URL of backdoor", required=True)
parser.add_argument("--mode", help="UPLOAD or SHELL", d... | gpl-3.0 |
AlpacaDB/chainer | tests/chainer_tests/functions_tests/array_tests/test_broadcast.py | 1 | 4712 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
@testing.parameterize(
{'in_shapes': [(3, 1, 5), (1, 2, 5)], 'out_shape': (3, 2,... | mit |
adelton/django | tests/many_to_many/tests.py | 204 | 21896 | from __future__ import unicode_literals
from django.db import transaction
from django.test import TestCase
from django.utils import six
from .models import Article, InheritedArticleA, InheritedArticleB, Publication
class ManyToManyTests(TestCase):
def setUp(self):
# Create a couple of Publications.
... | bsd-3-clause |
schroeder-dewitt/polyomino-self-assembly | test/GeneticAlgorithm/templates/fitness/main.test13.py | 14 | 8681 | import pycuda.autoinit
import pycuda.driver as drv
import numpy
import time
from pycuda.compiler import SourceModule
from jinja2 import Environment, PackageLoader
def main():
numpy.set_printoptions(precision=4,
threshold=10000,
linewidth=150)
#Set up global timer... | apache-2.0 |
hbwzhsh/scrapy | tests/test_pipeline_files.py | 11 | 7962 | import os
import time
import hashlib
import warnings
from tempfile import mkdtemp
from shutil import rmtree
from twisted.trial import unittest
from twisted.internet import defer
from scrapy.pipelines.files import FilesPipeline, FSFilesStore
from scrapy.item import Item, Field
from scrapy.http import Request, Response... | bsd-3-clause |
jbedorf/tensorflow | tensorflow/python/training/checkpoint_utils_test.py | 13 | 16415 | # 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 |
Sylrob434/CouchPotatoServer | libs/requests/packages/charade/__init__.py | 200 | 2221 | ######################## BEGIN LICENSE BLOCK ########################
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later ve... | gpl-3.0 |
gwongz/flask-apiblueprint | docs/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | bsd-3-clause |
fredj/graphite-web | webapp/graphite/render/grammar.py | 8 | 1494 | from graphite.thirdparty.pyparsing import *
ParserElement.enablePackrat()
grammar = Forward()
expression = Forward()
# Literals
intNumber = Combine(
Optional('-') + Word(nums)
)('integer')
floatNumber = Combine(
Optional('-') + Word(nums) + Literal('.') + Word(nums)
)('float')
aString = quotedString('string')
... | apache-2.0 |
Jordonbc/GlassOS | Glass_OS/build/lib/GlassOS/libaries/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## 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 |
heliumpigs/snowball | shared/cache.py | 1 | 3407 | # Copyright 2009 Yusuf Simonson
# This file is part of Snowball.
#
# Snowball 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) any
# later version.
#
... | agpl-3.0 |
davy39/eric | ThirdParty/Pygments/pygments/lexers/dotnet.py | 2 | 24981 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
import re
from pygments.lexer import RegexLe... | gpl-3.0 |
mixxorz/wagtail | wagtail/images/widgets.py | 3 | 1371 | import json
from django import forms
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from wagtail.admin.staticfiles import versioned_static
from wagtail.admin.widgets import AdminChooser
from wagtail.images import get_image_model
class AdminImageChooser(Ad... | bsd-3-clause |
remyzane/flask_http_api | docs/conf.py | 1 | 9495 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Flask http api documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 16 11:33:29 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | apache-2.0 |
lfalvarez/votai | backend_citizen/tests/agenda_form_and_views_tests.py | 1 | 6581 | # coding=utf-8
from elections.tests import VotaInteligenteTestCase as TestCase
from django.urls import reverse
from agenda.forms import ActivityForm
from django.contrib.auth.models import User
import datetime
from agenda.models import Activity
from django.utils import timezone
from django.contrib.contenttypes.models im... | gpl-3.0 |
JackGavin13/octoprint-test-not-finished | src/octoprint/filemanager/util.py | 9 | 6227 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
im... | agpl-3.0 |
Therp/partner-contact | partner_external_maps/partner_external_maps.py | 22 | 8595 | # -*- coding: utf-8 -*-
##############################################################################
#
# Partner External Maps module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redi... | agpl-3.0 |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/models/gated_autoencoder.py | 39 | 22638 | """
Factored Gated AutoEncoder Class.
This code is adapted from the implementation of Roland Memisevic,
specifically from the paper:
"Gradient-based learning of higher-order image features"
(http://www.iro.umontreal.ca/~memisevr/code/rae/index.html).
And the autoencoder implementation of Pylearn2.
"""
__authors__ = "... | bsd-3-clause |
amyvmiwei/kbengine | kbe/src/lib/python/Tools/scripts/gprof2html.py | 36 | 2203 | #! /usr/bin/env python3
"""Transform gprof(1) output into useful HTML."""
import re, os, sys, cgi, webbrowser
header = """\
<html>
<head>
<title>gprof output (%s)</title>
</head>
<body>
<pre>
"""
trailer = """\
</pre>
</body>
</html>
"""
def add_escapes(filename):
with open(filename) as fp:
for line ... | lgpl-3.0 |
AlexHill/django | tests/staticfiles_tests/test_liveserver.py | 11 | 3248 | """
A subset of the tests in tests/servers/tests exercicing
django.contrib.staticfiles.testing.StaticLiveServerCase instead of
django.test.LiveServerTestCase.
"""
import os
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
from django.utils.six.moves.urllib.reques... | bsd-3-clause |
jbedorf/tensorflow | tensorflow/python/training/tracking/base.py | 3 | 36688 | """An object-local variable management scheme."""
# 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/l... | apache-2.0 |
hzlf/openbroadcast | website/apps/alibrary/migrations/0050_auto__del_field_playlist_main_image.py | 1 | 40411 | # -*- coding: 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):
# Deleting field 'Playlist.main_image'
db.delete_column('alibrary_playlist', 'main_image_id')
def back... | gpl-3.0 |
foreni-packages/golismero | thirdparty_libs/django/template/loader_tags.py | 111 | 10172 | from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils import six
register = Library()
BLOCK_CONTEXT_KEY = 'block_context... | gpl-2.0 |
jasonmccampbell/numpy-refactor-sprint | benchmarks/benchmark.py | 45 | 1366 | from timeit import Timer
class Benchmark(dict):
"""Benchmark a feature in different modules."""
def __init__(self,modules,title='',runs=3,reps=1000):
self.module_test = dict((m,'') for m in modules)
self.runs = runs
self.reps = reps
self.title = title
def __setitem__(self,... | bsd-3-clause |
ptisserand/portage | pym/portage/cache/anydbm.py | 10 | 2986 | # Copyright 2005-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Author(s): Brian Harring (ferringb@gentoo.org)
from __future__ import absolute_import
try:
import anydbm as anydbm_module
except ImportError:
# python 3.x
import dbm as anydbm_module
try:
import dbm.gnu a... | gpl-2.0 |
nyov/dmide | core/panels/menubar.py | 1 | 8607 | import core
from core import *
class DMIDE_MenuBar(wx.MenuBar):
def __init__(self, window=None):
wx.MenuBar.__init__(self, wx.MB_DOCKABLE)
self.installMenuService()
def installMenuService(self):
""" Build a MenuBar for the top-level window as read from an XML file """
if os.path.exists(os.path.join(wx.Get... | bsd-3-clause |
bradh/samba | third_party/waf/wafadmin/Tools/gdc.py | 32 | 1207 | #!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
import sys
import Utils, ar
from Configure import conftest
@conftest
def find_gdc(conf):
conf.find_program('gdc', var='D_COMPILER', mandatory=True)
@conftest
def common_flags_gdc(conf):
v = conf.env
# _DFLAGS _DIMPORTFLAGS
# for mory info... | gpl-3.0 |
ville-k/tensorflow | tensorflow/contrib/keras/python/keras/layers/noise.py | 39 | 3671 | # 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 |
cherez/youtube-dl | youtube_dl/extractor/canalc2.py | 14 | 1821 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import parse_duration
class Canalc2IE(InfoExtractor):
IE_NAME = 'canalc2.tv'
_VALID_URL = r'https?://(?:www\.)?canalc2\.tv/video/(?P<id>\d+)'
_TEST = {
'url': 'http://www.canalc2.tv/... | unlicense |
aizlewood/PIE-patternlab | 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 |
tomv564/LSP | plugin/core/edit.py | 1 | 2186 | from .logging import debug
from .typing import List, Dict, Any, Iterable, Optional, Tuple
from .url import uri_to_filename
import operator
# tuple of start, end, newText, version
TextEdit = Tuple[Tuple[int, int], Tuple[int, int], str, Optional[int]]
def parse_workspace_edit(workspace_edit: Dict[str, Any]) -> Dict[st... | mit |
halfwit/qutebrowser | tests/unit/utils/test_standarddir.py | 2 | 13148 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
anaconda/abuselogbot | wikitools/category.py | 4 | 3953 | # -*- coding: utf-8 -*-
# Copyright 2008-2013 Alex Zaddach (mrzmanwiki@gmail.com)
# This file is part of wikitools.
# wikitools 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... | gpl-3.0 |
ehirt/odoo | addons/account/report/__init__.py | 381 | 1513 | # -*- 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 |
dpmatthews/rose | metomi/rose/suite_engine_procs/cylc.py | 3 | 27140 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2012-2019 British Crown (Met Office) & Contributors.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under t... | gpl-3.0 |
karthik-sethuraman/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_connectivity_reversion_mode.py | 4 | 1113 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server import util
class TapiConnectivityReversionMode(Model):
"""NOTE: This class is auto generated by... | apache-2.0 |
jamiefolsom/edx-platform | lms/djangoapps/teams/migrations/0004_auto__add_field_courseteam_discussion_topic_id__add_field_courseteam_l.py | 46 | 6547 | # -*- coding: utf-8 -*-
import pytz
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseTeam.last_activity_at'
db.add_column('t... | agpl-3.0 |
wjchen84/lfd | lfd/transfer/transfer.py | 2 | 13026 | from __future__ import division
import settings
import numpy as np
from lfd.demonstration import demonstration
from lfd.environment import sim_util
from lfd.transfer import planning
class TrajectoryTransferer(object):
def __init__(self, sim,
beta_pos=settings.BETA_POS,
gamma=se... | bsd-2-clause |
qbektrix/pyglet | contrib/wydget/wydget/widgets/button.py | 29 | 9576 | import xml.sax.saxutils
from pyglet.gl import *
from pyglet import clock
from pyglet.window import key, mouse
from wydget import element, event, util, anim, data, loadxml
from wydget.widgets.label import ImageCommon, Label
class ButtonCommon(object):
is_focusable = True
is_pressed = False
is_over = Fals... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.