repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Darkmoth/python-django-4 | refs/heads/master | Thing/env/Lib/site-packages/django/conf/locale/bs/formats.py | 702 | # -*- 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. N Y.'
TIME_FORMAT = 'G:i'
DATE... |
UOMx/edx-platform | refs/heads/master | common/djangoapps/util/sandboxing.py | 162 | import re
from django.conf import settings
# We'll make assets named this be importable by Python code in the sandbox.
PYTHON_LIB_ZIP = "python_lib.zip"
def can_execute_unsafe_code(course_id):
"""
Determine if this course is allowed to run unsafe code.
For use from the ModuleStore. Checks the `course_i... |
eerorika/ansible | refs/heads/issue_23379 | test/units/module_utils/test_facts.py | 24 | # 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 ... |
BorgERP/borg-erp-6of3 | refs/heads/master | verticals/garage61/acy_homeowners_association_crm/__openerp__.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 Acysos S.L. (http://acysos.com) All Rights Reserved.
# Ignacio Ibeas <ignacio@acysos.com>
# $Id$
#
# This program i... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/component/droid/shared_advanced_droid_frame.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_advanced_droid_frame.iff"
result.attribute_t... |
pwoodworth/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/where.py | 309 | from django.db.models.fields import Field, FieldDoesNotExist
from django.db.models.sql.constants import LOOKUP_SEP
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.where import Constraint, WhereNode
from django.contrib.gis.db.models.fields import GeometryField
class GeoConstraint(Con... |
adazey/Muzez | refs/heads/master | libs/nltk/sentiment/sentiment_analyzer.py | 1 | # coding: utf-8
#
# Natural Language Toolkit: Sentiment Analyzer
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Pierpaolo Pantone <24alsecondo@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A SentimentAnalyzer is a tool to implement and facilitate Sentiment Analysis t... |
suraj-jayakumar/lstm-rnn-ad | refs/heads/master | src/testdata/random_data_15min_ts/lstm_ad_random_test.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 23 14:28:22 2016
@author: suraj
"""
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense
from keras.layers.recurrent import LSTM
from keras.models import Graph
from keras.models import model_from_json
f... |
maniteja123/sympy | refs/heads/master | sympy/plotting/plot_implicit.py | 83 | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... |
mtanski/samba | refs/heads/master | lib/subunit/python/iso8601/test_iso8601.py | 92 | import iso8601
def test_iso8601_regex():
assert iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z")
def test_timezone_regex():
assert iso8601.TIMEZONE_REGEX.match("+01:00")
assert iso8601.TIMEZONE_REGEX.match("+00:00")
assert iso8601.TIMEZONE_REGEX.match("+01:20")
assert iso8601.TIMEZONE_REGEX.mat... |
qt911025/pw_module_system | refs/heads/pw | process_skills.py | 6 | import process_common as pc
import process_operations as po
import module_skills
def process_entry(processor, txt_file, entry, index):
txt_file.write("skl_%s %s %d %d %s\r\n" % (entry[0], pc.replace_spaces(entry[1]), entry[2], entry[3], pc.replace_spaces(entry[4])))
export = po.make_export(data=module_skills.skills... |
nathanial/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/db/models/signals.py | 63 | from django.dispatch import Signal
class_prepared = Signal(providing_args=["class"])
pre_init = Signal(providing_args=["instance", "args", "kwargs"])
post_init = Signal(providing_args=["instance"])
pre_save = Signal(providing_args=["instance", "raw"])
post_save = Signal(providing_args=["instance", "raw", "created"])... |
tobinjt/Flexget | refs/heads/develop | flexget/tests/api_tests/test_rejected_api.py | 4 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import copy
from datetime import datetime
from flexget.api.app import base_message
from flexget.components.rejected.api import ObjectsContainer as OC
from flexget.manager ... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/configservice/layer1.py | 56 | # Copyright (c) 2015 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 ... |
bottompawn/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_urllib2_localnet.py | 60 | import base64
import os
import email
import urllib.parse
import urllib.request
import http.server
import unittest
import hashlib
from test import support
threading = support.import_module('threading')
try:
import ssl
except ImportError:
ssl = None
here = os.path.dirname(__file__)
# Self-signed cert file for... |
uppalk1/RackHD | refs/heads/master | test/tests/redfish10/test_redfish10_api_schemas.py | 5 | '''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
'''
import fit_path # NOQA: unused import
import os
import sys
import subprocess
import fit_common
# Select test group here using @attr
from nose.plugins.attrib import attr
@attr(all=True, regression=True, smoke=True)
class redfish10_api_schemas(fit_common.un... |
LaMi-/pmatic | refs/heads/master | ccu_pkg/python/lib/python2.7/encodings/cp875.py | 593 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
RackSec/ansible | refs/heads/devel | lib/ansible/plugins/connection/chroot.py | 35 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... |
OMNIL-Infinity/volatility | refs/heads/master | volatility/plugins/mac/netstat.py | 44 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 ... |
dreamsxin/ubuntu-tweak | refs/heads/master | ubuntutweak/run_test.py | 4 | #!/usr/bin/python
# Ubuntu Tweak - PyGTK based desktop configuration tool
#
# Copyright (C) 2007-2008 TualatriX <tualatrix@gmail.com>
#
# Ubuntu Tweak 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 ve... |
emon10005/sympy | refs/heads/master | sympy/functions/combinatorial/numbers.py | 52 | """
This module implements some special functions that commonly appear in
combinatorial contexts (e.g. in power series); in particular,
sequences of rational numbers such as Bernoulli and Fibonacci numbers.
Factorials, binomial coefficients and related functions are located in
the separate 'factorials' module.
"""
fr... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/building/player/shared_player_guildhall_generic_style_01.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/player/shared_player_guildhall_generic_style_01.iff"
result.attribu... |
ESS-LLP/erpnext-healthcare | refs/heads/master | erpnext/patches/v6_0/fix_outstanding_amount.py | 87 | # 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 erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
def execute():
for dt, party_field, account_field in ((... |
Metaswitch/horizon | refs/heads/master | openstack_dashboard/dashboards/project/access_and_security/floating_ips/forms.py | 68 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... |
KMUX-Project/KMUX | refs/heads/master | kmux/test/TestJinjaInclusion.py | 1 | import unittest
import jinja2
class TestJinjaInclusion(unittest.TestCase):
temploader = jinja2.FileSystemLoader(
"/Users/julian/Repositories/julian.kmux/test/")
env = jinja2.Environment(loader=temploader)
template = env.get_template("childtemplate3")
print(template.render())
|
azureplus/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/userfield.py | 56 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2009 Søren Roug, European Environment Agency
#
# This is free software. You may redistribute it under the terms
# of the Apache license and the GNU General Public License Version
# 2 or at your option any later version.
#
# This program is distributed in t... |
rootfs/Rusthon | refs/heads/master | regtests/c++/pointers_returns_array.py | 5 | '''
returns array of arrays
'''
with pointers:
def make_array() -> []int:
arr = new([]int( 1,2,3,4 ))
return arr
def test_array( arr:[]int ):
print( arr[0] )
print( arr[1] )
print( arr[2] )
print( arr[3] )
def main():
a = make_array()
print('arr length:', len(a))
test_array(a) |
Godiyos/python-for-android | refs/heads/master | python-modules/twisted/twisted/pair/ip.py | 55 | # -*- test-case-name: twisted.pair.test.test_ip -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Support for working directly with IP packets"""
import struct
import socket
from twisted.internet import protocol
from twisted.pair import raw
from zope.interface import implem... |
Adarnof/adarnauth-whsales | refs/heads/master | whsales/views.py | 1 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django_extras.contrib.auth.shortcuts import get_owned_objec... |
jobsafran/mediadrop | refs/heads/master | mediadrop/lib/decorators.py | 2 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 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 ... |
digsig-ng/linux-digsig | refs/heads/working | scripts/tracing/draw_functrace.py | 14679 | #!/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 ... |
dudonwai/dudonsblog | refs/heads/master | Lib/site-packages/setuptools/tests/test_integration.py | 125 | """Run some integration tests.
Try to install a few packages.
"""
import glob
import os
import sys
import pytest
from setuptools.command.easy_install import easy_install
from setuptools.command import easy_install as easy_install_pkg
from setuptools.dist import Distribution
from setuptools.compat import urlopen
d... |
tensorflow/probability | refs/heads/main | tensorflow_probability/python/bijectors/pad.py | 1 | # Copyright 2019 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
apocalypsebg/odoo | refs/heads/8.0 | addons/bus/bus.py | 325 | # -*- coding: utf-8 -*-
import datetime
import json
import logging
import select
import threading
import time
import random
import simplejson
import openerp
from openerp.osv import osv, fields
from openerp.http import request
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
_logger = logging.getLogger(__... |
rhelmer/socorro | refs/heads/master | alembic/versions/4a068f8838c6_bug_959731_update_product_versions_.py | 14 | """bug 959731 update_product_versions() refresh
Revision ID: 4a068f8838c6
Revises: 2c48009040da
Create Date: 2014-01-14 12:42:25.587189
"""
# revision identifiers, used by Alembic.
revision = '4a068f8838c6'
down_revision = '514789372d99'
from alembic import op
from socorro.lib import citexttype, jsontype, buildtype... |
akosel/incubator-airflow | refs/heads/master | airflow/contrib/example_dags/example_winrm_operator.py | 20 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
Senseg/Py4A | refs/heads/master | python-modules/twisted/twisted/test/process_tester.py | 137 | """Test program for processes."""
import sys, os
test_file_match = "process_test.log.*"
test_file = "process_test.log.%d" % os.getpid()
def main():
f = open(test_file, 'wb')
# stage 1
bytes = sys.stdin.read(4)
f.write("one: %r\n" % bytes)
# stage 2
sys.stdout.write(bytes)
sys.stdout.... |
newerthcom/savagerebirth | refs/heads/master | libs/python-2.72/Lib/test/test_py3kwarn.py | 90 | import unittest
import sys
from test.test_support import check_py3k_warnings, CleanImport, run_unittest
import warnings
if not sys.py3kwarning:
raise unittest.SkipTest('%s must be run with the -3 flag' % __name__)
try:
from test.test_support import __warningregistry__ as _registry
except ImportError:
def ... |
olympian94/gstudio | refs/heads/mongokit | gnowsys-ndf/gnowsys_ndf/ndf/views/adminDesignerDashboard.py | 5 | ''' -- imports from installed packages -- '''
from django.http import StreamingHttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, render
from django.template import RequestContext
from django.contrib.auth.models import User
from django.contrib.auth.decorators import user_passes_test
fr... |
koyadovic/Dia | refs/heads/master | predictive/systems/statistical/analysis/groupings/shape_insulins.py | 1 | # -*- coding: utf-8 -*-
from ...tools.shapes import Shape
from dia.models import InsulinAdministration, InsulinType
class ShapeInsulin(Shape):
"""
Sirve de envoltura al objeto InsulinAdministration
añadiendo los shapes
"""
def __init__(self, insulin):
assert isinstance(insulin, InsulinAdm... |
reinaH/osf.io | refs/heads/develop2 | website/addons/osfstorage/__init__.py | 20 | #!/usr/bin/env python
# encoding: utf-8
from . import routes, views, model, oldels
MODELS = [
oldels.OsfStorageFileTree,
oldels.OsfStorageFileRecord,
model.OsfStorageFileNode,
model.OsfStorageGuidFile,
model.OsfStorageFileVersion,
model.OsfStorageNodeSettings,
model.OsfStorageTrashedFileNo... |
Outernet-Project/outernet-metadata | refs/heads/master | outernet_metadata/validator.py | 1 | """
Validator to use a library
Copyright 2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
import validators
from . import values
VALIDATOR = validators.spec_vali... |
almeidapaulopt/erpnext | refs/heads/develop | erpnext/patches/v7_0/update_conversion_factor_in_supplier_quotation_item.py | 53 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('buying', 'doctype', 'supplier_quotation_item')
frappe.db.sql("""update
`tabSupplier Quotation Item` as sqi_t,
(select sqi.item_code as item_code, sqi.uom as uom, ucd.conversion_factor as conversion_factor
from `tabS... |
tisimst/ad | refs/heads/master | ad/__init__.py | 3 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 11 12:52:09 2013
@author: tisimst
"""
import math
import cmath
import copy
from random import randint
from numbers import Number
try:
import numpy
numpy_installed = True
except ImportError:
numpy_installed = False
__version_info__ = (1, 3, ... |
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping | refs/heads/master | ext/mcpat/regression/regression.py | 43 | #!/usr/bin/env python
# Copyright (c) 2010-2013 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# not... |
wujuguang/scrapy | refs/heads/master | scrapy/pqueues.py | 2 | import hashlib
import logging
from collections import namedtuple
from queuelib import PriorityQueue
from scrapy.utils.reqser import request_to_dict, request_from_dict
logger = logging.getLogger(__name__)
def _path_safe(text):
"""
Return a filesystem-safe version of a string ``text``
>>> _path_safe('s... |
mapr/hue | refs/heads/hue-3.9.0-mapr | desktop/core/ext-py/thrift-0.9.1/src/TMultiplexedProcessor.py | 146 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
cetic/ansible | refs/heads/devel | lib/ansible/modules/windows/win_msg.py | 22 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... |
zhxwmessi/or-tools | refs/heads/master | examples/python/data/nonogram_regular/nonogram_nonunique.py | 74 | # 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 applica... |
acconrad/jquery-expander | refs/heads/master | node_modules/grunt-jasmine-task/node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/runner.py | 177 | #!/usr/bin/env python
import argparse
import deflate
import inflate
from colorama import Fore
testDir = 'test-files'
outDir = 'test-outs'
allPassed = True
parser = argparse.ArgumentParser(description='Process command-line arguments')
parser.add_argument('--test', metavar='path/to/file', type=str, default='both', na... |
andela-ifageyinbo/django | refs/heads/master | tests/admin_inlines/urls.py | 810 | from django.conf.urls import url
from . import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
]
|
nielsbuwen/ilastik | refs/heads/master | ilastik/applets/deviationFromMean/deviationFromMeanGui.py | 4 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... |
wonwon0/StrategyIA | refs/heads/dev | RULEngine/Game/Team.py | 2 | # Under MIT License, see LICENSE.txt
from RULEngine.Game.Player import Player
from RULEngine.Util.constant import PLAYER_PER_TEAM
from RULEngine.Util.team_color_service import TeamColor
class Team:
def __init__(self, team_color, kalman_type="friend"):
assert kalman_type in ["friend", "enemy"]
sel... |
Lyleo/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/collections.py | 69 | """
Classes for the efficient drawing of large collections of objects that
share most properties, e.g. a large number of line segments or
polygons.
The classes are not meant to be as flexible as their single element
counterparts (e.g. you may not be able to select all line styles) but
they are meant to be fast for com... |
ghmajx/asuswrt-merlin | refs/heads/374.43_2-update | release/src/router/samba-3.6.13/source4/scripting/python/samba/provision/__init__.py | 19 |
# Unix SMB/CIFS implementation.
# backend code for provisioning a Samba4 server
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009
# Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009
#
# Based on the original in EJS:
# Copyright (C) Andrew T... |
doismellburning/edx-platform | refs/heads/master | openedx/core/djangoapps/credit/signature.py | 69 | """
Calculate digital signatures for messages sent to/from credit providers,
using a shared secret key.
The signature is calculated as follows:
1) Encode all parameters of the request (except the signature) in a string.
2) Encode each key/value pair as a string of the form "{key}:{value}".
3) Concatenate ... |
kenkit/android_kernel_htc_msm7x30 | refs/heads/cm-12.1 | tools/perf/python/twatch.py | 3213 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
JingheZ/shogun | refs/heads/master | examples/undocumented/python_modular/distance_director_euclidean_modular.py | 26 | #!/usr/bin/env python
import numpy
from modshogun import RealFeatures, MSG_DEBUG
numpy.random.seed(17)
traindat = numpy.random.random_sample((10,10))
testdat = numpy.random.random_sample((10,10))
parameter_list=[[traindat,testdat,1.2],[traindat,testdat,1.4]]
def distance_director_euclidean_modular (fm_train_real=trai... |
wuga214/Django-Wuga | refs/heads/master | env/lib/python2.7/site-packages/django/template/backends/base.py | 584 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
from django.core.exceptions import (
ImproperlyConfigured, SuspiciousFileOperation,
)
from django.template.utils import get_app_template_dirs
from django.utils._os import safe_join
from django.util... |
mlperf/inference_results_v0.7 | refs/heads/master | closed/Inspur/code/bert/tensorrt/bert_var_seqlen.py | 17 | #!/usr/bin/env python3
# Copyright (c) 2020, NVIDIA 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
#
# U... |
2014cdag1/cdag1 | refs/heads/master | wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/sax/__init__.py | 237 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... |
Stavitsky/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py | 25 | # Copyright (c) 2014 IBM Corp.
# 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... |
BitzenyCoreDevelopers/bitzeny | refs/heads/z2.0.x | test/functional/proxy_test.py | 12 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind with different proxy configuration.
Test plan:
- Start bitcoind's with different proxy c... |
dannyperry571/theapprentice | refs/heads/master | script.module.wolfpack/js2py/legecy_translators/utils.py | 96 | import sys
import unicodedata
from collections import defaultdict
def is_lval(t):
"""Does not chceck whether t is not resticted or internal"""
if not t:
return False
i = iter(t)
if i.next() not in IDENTIFIER_START:
return False
return all(e in IDENTIFIER_PART for e in i)
def is_val... |
bennlich/scikit-image | refs/heads/master | skimage/feature/_canny.py | 15 | """
canny.py - Canny Edge detector
Reference: Canny, J., A Computational Approach To Edge Detection, IEEE Trans.
Pattern Analysis and Machine Intelligence, 8:679-714, 1986
Originally part of CellProfiler, code licensed under both GPL and BSD licenses.
Website: http://www.cellprofiler.org
Copyright (c) 2003-2009 M... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/backends/angel.py | 77 | """
Angel OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/angel.html
"""
from social.backends.oauth import BaseOAuth2
class AngelOAuth2(BaseOAuth2):
name = 'angel'
AUTHORIZATION_URL = 'https://angel.co/api/oauth/authorize/'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https... |
C2SM/ncfilter.py | refs/heads/master | ncfilter.py | 2 | #!/usr/bin/env python
import sys
import os
import argparse
import datetime
from collections import OrderedDict
import numpy as np
from netCDF4 import Dataset
class NcFilter(object):
def __init__(self, origin):
'''
Read all the meta-data of the source file
into reasonable data-structures.
... |
florentx/OpenUpgrade | refs/heads/8.0 | addons/hw_escpos/__init__.py | 385 | # -*- 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... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/management/commands/startmigration.py | 129 | """
Now-obsolete startmigration command.
"""
from __future__ import print_function
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--m... |
briarfox/ShellistaExt | refs/heads/master | ShellistaExt/plugins/core/cat_plugin.py | 1 | '''cat:
Prints a file
'''
#__package__ = 'ShellistaExt.plugins.core'
from .. tools.toolbox import bash
import os
def main(self, line):
"""print file"""
args = bash(line)
if args is None:
return
elif (len(args) != 1):
print "cat: Usage: cat file"
else:
target = args[0]
if (n... |
blopker/PCLite | refs/heads/master | pclite/tests/test_async.py | 1 | import unittest
from .. import async
class TestAsync(unittest.TestCase):
def test_async_map(self):
args = [max, [1, 3, 6], [2, 2, 7]]
a = async.asyncMap(*args)
b = [x for x in map(*args)]
self.assertEqual(a, b)
|
coinwarp/dogeparty-lib | refs/heads/develop | dogepartylib/lib/messages/issuance.py | 1 | #! /usr/bin/python3
"""
Allow simultaneous lock and transfer.
"""
import struct
import decimal
D = decimal.Decimal
from dogepartylib.lib import (config, util, exceptions, util)
FORMAT_1 = '>QQ?'
LENGTH_1 = 8 + 8 + 1
FORMAT_2 = '>QQ??If'
LENGTH_2 = 8 + 8 + 1 + 1 + 4 + 4
ID = 20
# NOTE: Pascal strings are used for st... |
jcpowermac/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_config.py | 4 | #!/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 distribut... |
mcus/SickRage | refs/heads/master | lib/tornado/template.py | 142 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... |
jalaziz/ansible | refs/heads/devel | plugins/inventory/jail.py | 30 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible,
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
forart/nemesys-qos | refs/heads/master | nemesys/SysProf/RisorsaFactory.py | 9 | import Factory
import xml.etree.ElementTree as ET
from NemesysException import FactoryException, RisorsaException
def getRisorsa(path,name):
try:
ris= Factory.class_forname(path)
ris.setName(name)
except FactoryException as e:
raise RisorsaException(e)
return ris
class Risorsa(obje... |
sehmaschine/django-rest-framework | refs/heads/master | tests/test_negotiation.py | 81 | from __future__ import unicode_literals
from django.test import TestCase
from rest_framework.negotiation import DefaultContentNegotiation
from rest_framework.renderers import BaseRenderer
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
factory = APIRequestFactory()
clas... |
alsaeng/foamRemote | refs/heads/master | workspace.py | 1 | '''workspace.py - Display or create workspaces on remote server'''
import wx, paramiko
import paramiko_mods
from paramiko import AuthenticationException
import definedWxClasses, const
from foamGUI import FoamFrame
class WorkspaceWindow(wx.Dialog):
'''Dialog window'''
def __init__(self, loginInfo, *args, **k... |
epssy/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/prototypes/geom.py | 214 | from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER
from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import (
check_geom, check_minus_one, check_sized_string, check_string, check_zero)
from django.contrib.gis.geos.prototypes.threadsafe import G... |
ahmed-mahran/hue | refs/heads/master | desktop/core/ext-py/pyasn1-0.1.8/pyasn1/__init__.py | 76 | import sys
# http://www.python.org/dev/peps/pep-0396/
__version__ = '0.1.8'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later')
|
beeverycreative/BEEweb | refs/heads/master | src/octoprint/filemanager/storage.py | 1 | # 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) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
i... |
ohanetz/pyjarcmp | refs/heads/master | chdir.py | 1 | import os
from contextlib import contextmanager
@contextmanager
def chdir(new_dir):
old_dir = os.getcwd()
os.chdir(os.path.expanduser(new_dir))
try:
yield
finally:
os.chdir(old_dir)
|
Proggie02/TestRepo | refs/heads/master | tests/regressiontests/templates/filters.py | 52 | # coding: utf-8
"""
Tests for template filters (as opposed to template tags).
The tests are hidden inside a function so that things like timestamps and
timezones are only evaluated at the moment of execution and will therefore be
consistent.
"""
from __future__ import unicode_literals
from datetime import date, datet... |
mapzen/vector-datasource | refs/heads/master | integration-test/988-add-collision-rank.py | 2 | # -*- encoding: utf-8 -*-
from . import FixtureTest
# test that features get assigned the correct collision rank.
#
# note that the collision rank system has been designed to make changing ranks
# and re-arranging / re-ordering very easy. in turn, this might make these
# tests very fragile because they check the exac... |
venumech/cookiecutter | refs/heads/master | setup.py | 12 | #!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = "1.0.0"
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
if sys.argv[-1] ... |
Vvucinic/Wander | refs/heads/master | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/db/models/sql/constants.py | 633 | """
Constants specific to the SQL storage portion of the ORM.
"""
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use different
# lookup types.
QUERY_TERMS = {
'exact', 'iexact', 'contains', 'icontains', 'gt', '... |
spacedogXYZ/call-power | refs/heads/master | call_server/sync/constants.py | 2 | # User roles
SCHEDULE_NIGHTLY = 'nightly'
SCHEDULE_HOURLY = 'hourly'
SCHEDULE_IMMEDIATE = 'immediate'
SCHEDULE_CHOICES = {
SCHEDULE_NIGHTLY: SCHEDULE_NIGHTLY.capitalize(),
SCHEDULE_HOURLY: SCHEDULE_HOURLY.capitalize(),
SCHEDULE_IMMEDIATE: SCHEDULE_IMMEDIATE.capitalize(),
}
|
leifdenby/numpy | refs/heads/master | numpy/distutils/command/develop.py | 264 | """ Override the develop command from setuptools so we can ensure that our
generated files (from build_src or build_scripts) are properly converted to real
files with filenames.
"""
from __future__ import division, absolute_import, print_function
from setuptools.command.develop import develop as old_develop
class de... |
hackthis02/xbmc | refs/heads/master | tools/EventClients/lib/python/ps3/__init__.py | 909 | # -*- coding: utf-8 -*-
# File intentionally left blank
|
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/ctypes/test/test_callbacks.py | 46 | import unittest
from ctypes import *
import _ctypes_test
class Callbacks(unittest.TestCase):
functype = CFUNCTYPE
## def tearDown(self):
## import gc
## gc.collect()
def callback(self, *args):
self.got_args = args
return args[-1]
def check_type(self, typ, arg):
P... |
angelinawawrzyniak/bomberman | refs/heads/master | artifacts/super_bomb_artifact.py | 1 | from artifacts.artifact import Artifact
class SuperBombArtifact(Artifact):
SYMBOL = '^'
def make_step(self, context):
if (context.user.y, context.user.x) == (self.y, self.x):
context.dead_list.append(self)
# cyclic import solved
from super_bomb import SuperBomb
... |
rosmo/ansible | refs/heads/devel | lib/ansible/inventory/helpers.py | 120 | # (c) 2017, Ansible by RedHat 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.
#
# Ans... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/shared_mammoth_bearded_jax.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_mammoth_bearded_jax.iff"
result.attribute_template_id = 9
res... |
MoamerEncsConcordiaCa/tensorflow | refs/heads/master | tensorflow/python/ops/histogram_ops.py | 60 | # 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... |
cpaulik/scipy | refs/heads/master | scipy/special/tests/test_basic.py | 14 | # this program corresponds to special.py
### Means test is not done yet
# E Means test is giving error (E)
# F Means test is failing (F)
# EF Means test is giving error and Failing
#! Means test is segfaulting
# 8 Means test runs forever
### test_besselpoly
### test_mathieu_a
### test_mathieu_even_coef
##... |
denz/django-stored-queryset | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
from importlib import import_module
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test
def package_env(file_name, strict=False):
file_path = os.path.join(os.path.dirname(__file__), file_name)
if os.path.exists(file_path) or strict... |
40223114/2015_g4 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/webbrowser.py | 735 | from browser import window
__all__ = ["Error", "open", "open_new", "open_new_tab"]
class Error(Exception):
pass
_target = { 0: '', 1: '_blank', 2: '_new' } # hack...
def open(url, new=0, autoraise=True):
"""
new window or tab is not controllable
on the client side. autoraise not available.
""... |
dpyro/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/tests/__init__.py | 621 | # 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/.
|
xujun10110/golismero | refs/heads/master | thirdparty_libs/netaddr/strategy/eui64.py | 9 | #-----------------------------------------------------------------------------
# Copyright (c) 2008-2013, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
IEEE 64-bit EUI (E... |
yesblogger/Codewar | refs/heads/master | Regular_Expression/breadcum_generator.py | 1 | # -*- coding: utf-8 -*-
"""
Created: 30/05/2017
Author: Amartya Gupta
"""
from re import findall
def clean(url):
test = ["html", "htm", "php", "asp"]
u = findall(r"(/([\w-]+)\.?(\w+)?)", url)
if u:
if "." in u[0][0] and u[0][2] not in test:
u.pop(0)
u = [i[1] for i in u if i[1].low... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.