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 |
|---|---|---|---|---|---|
mburakergenc/Malware-Detection-using-Machine-Learning | cuckoo/modules/machinery/vmware.py | 1 | 9138 | # Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file was originally produced by Mike Tu.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import glob
import logging
import subprocess
import os.pat... | mit |
YajunQiu/three.js | utils/exporters/blender/addons/io_three/exporter/__init__.py | 178 | 2661 | import os
import sys
import traceback
from .. import constants, logger, exceptions, dialogs
from . import scene, geometry, api, base_classes
def _error_handler(func):
def inner(filepath, options, *args, **kwargs):
level = options.get(constants.LOGGING, constants.DEBUG)
version = options.get('... | mit |
j-carl/ansible | lib/ansible/executor/action_write_locks.py | 140 | 1911 | # (c) 2016 - Red Hat, Inc. <info@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | gpl-3.0 |
capturePointer/OpenCC | deps/gtest-1.7.0/test/gtest_xml_outfiles_test.py | 2526 | 5340 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
sontek/rethinkdb | external/v8_3.30.33.16/tools/testrunner/local/commands.py | 65 | 5069 | # 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
# notice, this list of conditi... | agpl-3.0 |
manisandro/QGIS | python/pyplugin_installer/qgsplugininstallerrepositorydialog.py | 77 | 2976 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerrepositorydialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright ... | gpl-2.0 |
joshimio/blog | node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/tango.py | 363 | 7096 | # -*- coding: utf-8 -*-
"""
pygments.styles.tango
~~~~~~~~~~~~~~~~~~~~~
The Crunchy default Style inspired from the color palette from
the Tango Icon Theme Guidelines.
http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines
Butter: #fce94f #edd400 #c4a000
Orange: #fcaf3e ... | mit |
bjolivot/ansible | lib/ansible/plugins/terminal/nxos.py | 41 | 1842 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
huaj1101/ML-PY | ML_IN_ACTION/C6/svmMLiA.py | 1 | 15888 | from numpy import *
from time import sleep
def loadDataSet(fileName):
dataMat = []; labelMat = []
fr = open(fileName)
for line in fr.readlines():
lineArr = line.strip().split('\t')
dataMat.append([float(lineArr[0]), float(lineArr[1])])
labelMat.append(float(lineArr[2]))
return d... | apache-2.0 |
davidjb/sqlalchemy | examples/postgis/postgis.py | 30 | 9003 | from sqlalchemy.types import UserDefinedType, _Binary, TypeDecorator
from sqlalchemy.sql import expression, type_coerce
from sqlalchemy import event, Table
import binascii
# Python datatypes
class GisElement(object):
"""Represents a geometry value."""
def __str__(self):
return self.desc
def __re... | mit |
davidgbe/scikit-learn | examples/neighbors/plot_approximate_nearest_neighbors_scalability.py | 225 | 5719 | """
============================================
Scalability of Approximate Nearest Neighbors
============================================
This example studies the scalability profile of approximate 10-neighbors
queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200``
when varying the number of sa... | bsd-3-clause |
mibanescu/pulp | playpen/certs/create_client_cert.py | 11 | 1874 | #!/usr/bin/env python
# Reference: Blog post from Jason Dobies
# http://blog.pulpproject.org/2011/05/18/pulp-protected-repositories/
import os
import sys
from base import run_command, get_parser
def create_client_key(client_key):
cmd = "openssl genrsa -out %s 2048" % (client_key)
return run_command(cmd)
de... | gpl-2.0 |
jessie935513/omaha | installers/generate_resource_script.py | 65 | 2015 | #!/usr/bin/python2.4
#
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
ameily/paramiko | paramiko/agent.py | 3 | 12764 | # Copyright (C) 2003-2007 John Rochester <john@jrochester.org>
#
# This file is part of paramiko.
#
# Paramiko 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 ... | lgpl-2.1 |
RCMRD/geonode | geonode/catalogue/models.py | 2 | 5080 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
ceb8/astroquery | astroquery/casda/core.py | 1 | 15152 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# 1. standard library imports
from io import BytesIO
from urllib.parse import unquote
import time
from xml.etree import ElementTree
from datetime import datetime, timezone
# 2. third party imports
import astropy.units as u
import astropy.coordinates as c... | bsd-3-clause |
lucienfostier/gaffer | python/GafferTest/NameValuePlugTest.py | 4 | 14807 | ##########################################################################
#
# Copyright (c) 2019, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
rismalrv/edx-platform | openedx/core/djangoapps/credit/migrations/0010_add_creditrequirementstatus_history.py | 80 | 13950 | # -*- coding: utf-8 -*-
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 model 'HistoricalCreditRequirementStatus'
db.create_table('credi... | agpl-3.0 |
muxi/grpc | tools/buildgen/plugins/grpc_shadow_boringssl.py | 2 | 1219 | # Copyright 2018 gRPC 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 or agreed to in writing... | apache-2.0 |
timlinux/geonode | geonode/contrib/geosites/tests.py | 8 | 10593 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
ykwd/thrift | tutorial/py/PythonClient.py | 68 | 2125 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
smurn/cprojecttemplate | gmock-1.7.0/gtest/test/gtest_env_var_test.py | 2408 | 3487 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
croatproject/Croat | external/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/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... | lgpl-3.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/django-1.4/django/contrib/gis/tests/relatedapp/models.py | 121 | 1715 | from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... | lgpl-3.0 |
farmer-martin/ardupilot | Tools/ardupilotwaf/px4.py | 4 | 11047 | #!/usr/bin/env python
# encoding: utf-8
"""
Waf tool for PX4 build
"""
from waflib import Errors, Logs, Task, Utils
from waflib.TaskGen import after_method, before_method, feature
import os
import shutil
import sys
_dynamic_env_data = {}
def _load_dynamic_env_data(bld):
bldnode = bld.bldnode.make_node('modules/... | gpl-3.0 |
valentin-krasontovitsch/ansible | lib/ansible/modules/windows/win_uri.py | 13 | 6899 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Corwin Brown <corwin@corwinbrown.com>
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
LumPenPacK/NetworkExtractionFromImages | win_build/nefi2_win_amd64_msvc_2015/site-packages/numpy/distutils/command/build.py | 187 | 1618 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... | bsd-2-clause |
tomkralidis/QGIS | python/plugins/processing/modeler/ModelerGraphicItem.py | 19 | 9366 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerGraphicItem.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
ryanduan/duanyongwang | controller/auth.py | 1 | 1065 | # -*- coding: utf-8 -*-
"""
Description
"""
__author__ = 'awang'
from controller.base_controller import BaseController
from models.terror import TError
from models.user import User
class AuthController(BaseController):
""""""
url = r'/dyw/login/?'
def post(self, *args, **kwargs):
""""""
... | apache-2.0 |
girving/meld | vc/cdv.py | 4 | 1787 | ### Copyright (C) 2009 Vincent Legoll <vincent.legoll@gmail.com>
### Redistribution and use in source and binary forms, with or without
### modification, are permitted provided that the following conditions
### are met:
###
### 1. Redistributions of source code must retain the above copyright
### notice, this list... | gpl-2.0 |
BrainDamage/Flexget | flexget/plugins/filter/imdb.py | 6 | 8222 | from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
from flexget.utils.log import log_once
log = logging.getLogger('imdb')
class FilterImdb(object):
"""
This plugin allows filtering based on IMDB score, votes and genres... | mit |
csdl/makahiki | makahiki/apps/widgets/participation/tests.py | 2 | 1493 | """Scoreboard Test."""
import datetime
from django.core.urlresolvers import reverse
from django.test import TransactionTestCase
from apps.managers.challenge_mgr import challenge_mgr
from apps.utils import test_utils
from apps.widgets.participation import participation
from apps.managers.cache_mgr import cache_mgr
cl... | mit |
XiaosongWei/chromium-crosswalk | chrome/test/ispy/client/boto_bucket.py | 24 | 2728 | # 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.
"""Implementation of CloudBucket using Google Cloud Storage as the backend."""
import os
import sys
# boto requires depot_tools/third_party be in the path. ... | bsd-3-clause |
pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/markers.py | 72 | 7573 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pkg_resources.e... | gpl-2.0 |
SCOAP3/invenio | invenio/base/testsuite/test_scripts_config.py | 17 | 4733 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2014 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 option) any later v... | gpl-2.0 |
todaychi/hue | desktop/core/ext-py/python-oauth2/example/server.py | 375 | 7669 | """
The MIT License
Copyright (c) 2007 Leah Culver
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, modify, merge, publis... | apache-2.0 |
jakeylube95/namebench | nb_third_party/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | apache-2.0 |
Makhonin/Ardupilot | Tools/autotest/param_metadata/wikiemit.py | 239 | 2531 | #!/usr/bin/env python
import re
from param import *
from emit import Emit
# Emit docs in a form acceptable to the APM wiki site
class WikiEmit(Emit):
def __init__(self):
wiki_fname = 'Parameters.wiki'
self.f = open(wiki_fname, mode='w')
preamble = '''#summary Dynamically generated lis... | gpl-3.0 |
ChanderG/scikit-learn | sklearn/datasets/__init__.py | 176 | 3671 | """
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... | bsd-3-clause |
JianyuWang/nova | nova/objects/hv_spec.py | 18 | 1832 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
kennethgillen/ansible | lib/ansible/modules/network/illumos/ipadm_addr.py | 20 | 12093 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@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 L... | gpl-3.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/test/test_math.py | 1 | 39890 | # Python test set -- math module
# XXXX Should not do tests around zero only
from test.test_support import run_unittest, verbose
import unittest
import math
import os
import sys
import random
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
# locate file with test values
if __na... | mit |
837278709/metro-openerp | metro_sale/sale_metro.py | 2 | 18229 | # -*- encoding: utf-8 -*-
from osv import fields,osv
from openerp import netsvc
import openerp.addons.decimal_precision as dp
from openerp.addons.metro.utils import set_seq_o2m
from openerp.tools.translate import _
class sale_order(osv.osv):
_inherit="sale.order"
_name="sale.order"
def _order_line_wit... | agpl-3.0 |
angadpc/Alexa-Project- | twilio/rest/taskrouter/v1/workspace/event.py | 1 | 16344 | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import ... | mit |
sadanandb/pmt | src/pyasm/widget/dynamic_loader_page.py | 6 | 3644 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
tutumcloud/python-social-auth | social/backends/openstreetmap.py | 83 | 1920 | """
OpenStreetMap OAuth support.
This adds support for OpenStreetMap OAuth service. An application must be
registered first on OpenStreetMap and the settings
SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET
must be defined with the corresponding values.
More info: http://wiki.openstreetmap.org/wiki/... | bsd-3-clause |
apache/beam | sdks/python/apache_beam/internal/metrics/cells_test.py | 5 | 2543 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
kho0810/likelion_Web | lib/jinja2/testsuite/tests.py | 497 | 2865 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.tests
~~~~~~~~~~~~~~~~~~~~~~
Who tests the tests?
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
env = Environm... | apache-2.0 |
Bysmyyr/chromium-crosswalk | tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/cloudsearch2/test_connection.py | 114 | 8278 | #!/usr/bin env python
from tests.unit import AWSMockServiceTestCase
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
class TestCloudSearchCreateDomain(AWSMockServiceTestCase):
connection_class = CloudSearchConnection
def default_body(self):
retu... | bsd-3-clause |
axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/crcmod/predefined.py | 72 | 9600 | #-----------------------------------------------------------------------------
# Copyright (c) 2010 Craig McQueen
#
# 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, includ... | apache-2.0 |
orangeduck/PyAutoC | Python27/Lib/xdrlib.py | 197 | 5563 | """Implements (a subset of) Sun XDR -- eXternal Data Representation.
See: RFC 1014
"""
import struct
try:
from cStringIO import StringIO as _StringIO
except ImportError:
from StringIO import StringIO as _StringIO
__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
# exceptions
class Error(Exceptio... | bsd-2-clause |
gohin/django | django/contrib/gis/gdal/feature.py | 439 | 4153 | from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... | bsd-3-clause |
gupta137/blockly | i18n/common.py | 204 | 7619 | #!/usr/bin/python
# Code shared by translation conversion scripts.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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 |
Hackplayers/Empire-mod-Hpys-tests | lib/modules/powershell/privesc/gpp.py | 2 | 2577 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-GPPPassword',
'Author': ['@obscuresec'],
'Description': ('Retrieves the plaintext password and other information for '
'accoun... | bsd-3-clause |
kasioumis/invenio | invenio/legacy/webcomment/webinterface.py | 1 | 47066 | # -*- coding: utf-8 -*-
# Comments and reviews for records.
# This file is part of Invenio.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 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... | gpl-2.0 |
BioinfUD/K-mersCL | src/utils/extract_metrics.py | 1 | 3825 | import pandas as pd
import numpy as np
from sys import argv
import re
def extract_nvidia_max_memory(merged_file):
return np.nanmax(merged_file['GPU'])
def extract_anytool_max_memory(merged_file):
return (np.nanmax(merged_file['MEM']) - np.nanmin(merged_file['MEM']))/1000.0
def extract_kmc_time(log_file):
... | mit |
harisibrahimkv/django | django/forms/widgets.py | 1 | 35400 | """
HTML Widget classes
"""
import copy
import datetime
import re
from itertools import chain
from django.conf import settings
from django.forms.utils import to_current_timezone
from django.templatetags.static import static
from django.utils import datetime_safe, formats
from django.utils.dates import MONTHS
from dja... | bsd-3-clause |
dhalperi/incubator-beam | sdks/python/apache_beam/transforms/write_ptransform_test.py | 2 | 4183 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
kuri65536/python-for-android | python-modules/twisted/twisted/protocols/tls.py | 60 | 14449 | # -*- test-case-name: twisted.protocols.test.test_tls,twisted.internet.test.test_tls,twisted.test.test_sslverify -*-
# Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of a TLS transport (L{ISSLTransport}) as an L{IProtocol}
layered on top of any L{ITransport} implementatio... | apache-2.0 |
shacker/django | tests/template_tests/filter_tests/test_autoescape.py | 513 | 1342 | from django.test import SimpleTestCase
from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
"""
Filters decorated with stringfilter still respect is_safe.
"""
@setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'})
def test_autoescape_string... | bsd-3-clause |
dex4er/django | django/db/models/fields/subclassing.py | 227 | 1815 | """
Convenience routines for creating non-trivial Field subclasses, as well as
backwards compatibility utilities.
Add SubfieldBase as the metaclass for your Field subclass, implement
to_python() and the other necessary methods and everything will work
seamlessly.
"""
class SubfieldBase(type):
"""
A metaclass ... | bsd-3-clause |
hendrycks/error-detection | Appendix_B_Cautious_Classification/POS/helper_functions_twitter.py | 2 | 5432 | # Dan Hendrycks, Feb 29th
import numpy as np
import io
# Problems 1 and 2
def embeddings_to_dict(filename):
'''
:param filename: the file name of the word embeddings | file is assumed
to follow this format: "word[tab]dimension 1[space]dimension 2[space]...[space]dimension 50"
:return: a dictionary wi... | mit |
ovnicraft/odoo | addons/board/controllers.py | 348 | 1970 | # -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, menu_id, act... | agpl-3.0 |
OCA/account-analytic | purchase_analytic/tests/test_purchase_analytic.py | 1 | 1969 | # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
from datetime import datetime
class TestPurchaseAnalytic(TransactionCase):
def setUp(self):
super(TestPurchaseAnalytic, self... | agpl-3.0 |
mortada/scipy | scipy/sparse/csgraph/tests/test_connected_components.py | 144 | 3265 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal, assert_array_almost_equal
from scipy.sparse import csgraph
def test_weak_connections():
Xde = np.array([[0, 1, 0],
[0, 0, 0],
[0, 0, 0]])
Xsp = ... | bsd-3-clause |
ckirby/django | django/template/__init__.py | 198 | 2022 | """
Django's support for templates.
The django.template namespace contains two independent subsystems:
1. Multiple Template Engines: support for pluggable template backends,
built-in backends and backend-independent APIs
2. Django Template Language: Django's own template engine, including its
built-in loaders, ... | bsd-3-clause |
Gandi24/nocaptcha | nocaptcha/forms.py | 1 | 3462 | from django import forms
from django.forms.widgets import Input, HiddenInput
import time
import hashlib
from random import sample, randint, shuffle
from django.core.exceptions import ValidationError
class HiddenWidget(Input):
is_hidden = True
def __init__(self, *args, **kwargs):
super(HiddenWidget, sel... | mit |
hfp/tensorflow-xsmm | tensorflow/python/training/checkpointable/data_structures.py | 3 | 27632 | """Checkpointable data structures."""
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | apache-2.0 |
klim-iv/phantomjs-qt5 | src/webkit/Tools/Scripts/webkitpy/style/filter_unittest.py | 124 | 9830 | # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions... | bsd-3-clause |
KristianJensen/cameo | tests/test_cobrapy_compatibility.py | 1 | 1243 | # Copyright 2014 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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 requi... | apache-2.0 |
jendap/tensorflow | tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | 5 | 22737 | # 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 |
UManPychron/pychron | pychron/core/ui/qt/table_editor.py | 1 | 2814 | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | apache-2.0 |
jburtondev/domulize | venv/lib/python2.7/site-packages/flask/testsuite/ext.py | 563 | 5156 | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
try:
from imp import reload as reload_module
except ImportError:
reload... | gpl-2.0 |
OpenPathView/batchPanoMaker | tests/unit/model/test_cameraImage.py | 1 | 2236 | # coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# ... | gpl-3.0 |
f3r/scikit-learn | examples/svm/plot_separating_hyperplane.py | 294 | 1273 | """
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | bsd-3-clause |
south-coast-science/scs_dev | src/scs_dev/aws_topic_subscriber.py | 1 | 5436 | #!/usr/bin/env python3
"""
Created on 7 Oct 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
DESCRIPTION
The aws_topic_subscriber utility is used to select subscribed data from the output of the aws_mqtt_client script, and
make it available to a listening process.
The aws_topic_subscriber script is n... | mit |
abarnert/zerorpc-python | tests/test_server.py | 72 | 5945 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
WoLpH/celery | celery/bin/base.py | 1 | 6768 | import os
import sys
from optparse import OptionParser, make_option as Option
import celery
class Command(object):
"""Base class for command line applications.
:keyword app: The current app.
:keyword get_app: Callable returning the current app if no app provided.
"""
#: Arg list used in help.
... | bsd-3-clause |
FedoraScientific/salome-med | src/MEDLoader/Swig/MEDLoaderDataForTest.py | 1 | 36872 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2014 CEA/DEN, EDF R&D
#
# 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 la... | lgpl-2.1 |
MaslowCNC/GroundControl | UIElements/screenControls.py | 2 | 2374 | from kivy.uix.floatlayout import FloatLayout
from kivy.uix.popup import Popup
from UIElements.otherFeatures import OtherFeatures
from DataStructures.makesmithInitFuncs import MakesmithInitFuncs
from UIElements.buttonTemplate ... | gpl-3.0 |
sestrella/ansible | lib/ansible/executor/powershell/module_manifest.py | 15 | 15759 | # (c) 2018 Ansible Project
# 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
import base64
import errno
import json
import os
import pkgutil
import random
import re
from distutils.versio... | gpl-3.0 |
gooddata/openstack-nova | nova/tests/unit/virt/ironic/test_driver.py | 2 | 174658 | # Copyright 2015 Red Hat, Inc.
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/L... | apache-2.0 |
nitzmahone/ansible | test/units/playbook/test_play_context.py | 16 | 7555 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import ... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.3/django/contrib/gis/geos/prototypes/coordseq.py | 624 | 3112 | from ctypes import c_double, c_int, c_uint, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR
from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
## Error-checking routines specific to coordinate seq... | mit |
rcarrillocruz/ansible | lib/ansible/modules/network/iosxr/iosxr_config.py | 1 | 11122 | #!/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... | gpl-3.0 |
kawamon/hue | desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/SelfTest/Hash/test_RIPEMD160.py | 5 | 2675 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/test_RIPEMD160.py: Self-test for the RIPEMD-160 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the exten... | apache-2.0 |
turbokongen/home-assistant | tests/components/sonos/test_media_player.py | 2 | 2138 | """Tests for the Sonos Media Player platform."""
import pytest
from homeassistant.components.sonos import DOMAIN, media_player
from homeassistant.core import Context
from homeassistant.exceptions import Unauthorized
from homeassistant.setup import async_setup_component
async def setup_platform(hass, config_entry, co... | apache-2.0 |
Monithon/Monithon-2.0 | projects/migrations/0005_auto_20150208_2233.py | 1 | 25168 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0004_auto_20150208_2107'),
]
operations = [
migrations.AlterField(
model_name='monitorable',
... | gpl-2.0 |
Sebelino/pyromhackit | pyromhackit/thousandcurses/codec.py | 1 | 20221 | #!/usr/bin/env python
"""
Encoding/decoding functions.
An encoding function maps a bytestring to a unicode string.
A decoding function maps a unicode string to a bytestring.
Encoders/decoders are bijective -- each encoder has a inverse decoder function,
and vice versa.
"""
import sys
import os
import typing
from ite... | gpl-3.0 |
yprez/python-social-auth | social/tests/backends/test_mixcloud.py | 92 | 2434 | import json
from social.tests.backends.oauth import OAuth2Test
class MixcloudOAuth2Test(OAuth2Test):
backend_path = 'social.backends.mixcloud.MixcloudOAuth2'
user_data_url = 'https://api.mixcloud.com/me/'
expected_username = 'foobar'
access_token_body = json.dumps({
'access_token': 'foobar',
... | bsd-3-clause |
tswast/google-cloud-python | language/google/cloud/language_v1/proto/language_service_pb2.py | 2 | 133578 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/language_v1/proto/language_service.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf imp... | apache-2.0 |
acq4/acq4 | acq4/pyqtgraph/graphicsItems/PlotItem/PlotItem.py | 3 | 44637 | # -*- coding: utf-8 -*-
import sys
import weakref
import numpy as np
import os
from ...Qt import QtGui, QtCore, QT_LIB
from ... import pixmaps
from ... import functions as fn
from ...widgets.FileDialog import FileDialog
from .. PlotDataItem import PlotDataItem
from .. ViewBox import ViewBox
from .. AxisItem import Axis... | mit |
sredmond/acmpy | examples/cs106a/2-simplepython/graphical/target.py | 1 | 1437 | #!/usr/bin/env python
"""CS106A Assignment 2 Example: Target
This program draws an centered archery target with alternating concentric red and white circles.
"""
from campy.graphics.gwindow import GWindow
from campy.graphics.gobjects import GOval
# Radius of the outermost circle (in pixels).
OUTER_RADIUS = 72 # 72 p... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/wheel/test/test_ranking.py | 565 | 1496 | import unittest
from wheel.pep425tags import get_supported
from wheel.install import WheelFile
WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl"
def make_wheel(name, ver, pyver, abi, arch):
name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi,
arch=arch)
return WheelFile(name... | gpl-3.0 |
ArtsiomCh/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | 58 | 71789 | # 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 |
richardnpaul/FWL-Website | lib/python2.7/site-packages/PIL/SgiImagePlugin.py | 18 | 2102 | #
# The Python Imaging Library.
# $Id$
#
# SGI image file handling
#
# See "The SGI Image File Format (Draft version 0.97)", Paul Haeberli.
# <ftp://ftp.sgi.com/graphics/SGIIMAGESPEC>
#
# History:
# 1995-09-10 fl Created
#
# Copyright (c) 2008 by Karsten Hiddemann.
# Copyright (c) 1997 by Secret Labs AB.
# Copyright ... | gpl-3.0 |
AlexandraMercier/RULEngine | Communication/protobuf/google/protobuf/internal/enum_type_wrapper.py | 237 | 3554 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | mit |
apocalypsebg/odoo | addons/crm/wizard/crm_phonecall_to_meeting.py | 381 | 2704 | # -*- 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 |
github-account-because-they-want-it/django | tests/lookup/models.py | 235 | 2178 | """
The lookup API
This demonstrates features of the database API.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class Alarm(models.Model):
desc = models.CharField(max_length=100)
time = mo... | bsd-3-clause |
AngryDevelopersLLC/res-core | res/core/__init__.py | 1 | 1625 | # -*- coding: utf-8 -*-
"""
Resystem common service package.
Released under New BSD License.
Copyright © 2015, Vadim Markovtsev :: Angry Developers LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.