repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
MartinStolle/quadruped-walking-gaits | tags/Simulation/Source Code/Robot.py | 2 | 20315 | '''
Author: Martin Stolle
Description: Builds and controls the Robot
'''
import ode
from visual import vector, pi, sphere, points
import vpyode
import numpy
from random import gauss, uniform
from math import *
import threading
import Constants as const
from Graph import Graph
class Robot:
def __init__(self, wor... | gpl-2.0 |
noslenfa/tdjangorest | uw/lib/python2.7/site-packages/django/contrib/localflavor/ie/ie_counties.py | 503 | 1127 | """
Sources:
Irish Counties: http://en.wikipedia.org/wiki/Counties_of_Ireland
"""
from django.utils.translation import ugettext_lazy as _
IE_COUNTY_CHOICES = (
('antrim', _('Antrim')),
('armagh', _('Armagh')),
('carlow', _('Carlow')),
('cavan', _('Cavan')),
('clare', _('Clare')),
('cork... | apache-2.0 |
V11/volcano | server/sqlmap/lib/takeover/web.py | 1 | 14805 | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import urlparse
import os
import re
import StringIO
from tempfile import mkstemp
from extra.cloak.cloak import decloak
from lib.core.agent import agent
from lib.core.common ... | mit |
jorik041/plaso | plaso/winnt/known_folder_ids.py | 4 | 17897 | # -*- coding: utf-8 -*-
"""This file contains the Windows NT Known Folder identifier definitions."""
# For now ignore the line too long errors.
# pylint: disable=line-too-long
# For now copied from:
# https://code.google.com/p/libfwsi/wiki/KnownFolderIdentifiers
# TODO: store these in a database or equiv.
DESCRIPTI... | apache-2.0 |
w1kke/pylearn2 | pylearn2/utils/exc.py | 7 | 2984 | """Exceptions used by basic support utilities."""
__author__ = "Ian Goodfellow"
import inspect
import sys
import textwrap
from pylearn2.utils.common_strings import environment_variable_essay
from theano.compat import six
class EnvironmentVariableError(Exception):
"""
An exception raised when a required envir... | bsd-3-clause |
kieferbonk/xbmc-finnish-tv | plugin.video.yleareena/osx/Crypto/SelfTest/Signature/test_pkcs1_pss.py | 113 | 20598 | # -*- coding: utf-8 -*-
#
# SelfTest/Signature/test_pkcs1_pss.py: Self-test for PKCS#1 PSS signatures
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyon... | gpl-3.0 |
birryree/servo | components/script/dom/bindings/codegen/parser/tests/test_unforgeable.py | 127 | 7163 | def WebIDLTest(parser, harness):
parser.parse("""
interface Child : Parent {
};
interface Parent {
[Unforgeable] readonly attribute long foo;
};
""")
results = parser.finish()
harness.check(len(results), 2,
"Should be a... | mpl-2.0 |
BryanCutler/spark | examples/src/main/python/streaming/stateful_network_wordcount.py | 27 | 2235 | #
# 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 |
ESS-LLP/erpnext-medical | erpnext/accounts/report/non_billed_report.py | 40 | 1801 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext import get_default_currency
from frappe.model.meta import get_field_precision
def get_ordered_to_be_billed_data... | gpl-3.0 |
damdam-s/hr | __unported__/hr_worked_days_from_timesheet/hr_employee.py | 21 | 1239 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 - 2014 Odoo Canada. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... | agpl-3.0 |
google/material-design-icons | update/venv/lib/python3.9/site-packages/fontTools/misc/testTools.py | 5 | 5433 | """Helpers for writing unit tests."""
from collections.abc import Iterable
from io import BytesIO
import os
import shutil
import sys
import tempfile
from unittest import TestCase as _TestCase
from fontTools.misc.py23 import tobytes
from fontTools.misc.xmlWriter import XMLWriter
def parseXML(xmlSnippet):
"""Parse... | apache-2.0 |
ReachingOut/unisubs | apps/auth/migrations/0007_auto__chg_field_awards_user.py | 5 | 6235 | # encoding: 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):
# Changing field 'Awards.user'
db.alter_column('auth_awards', 'user_id', self.gf('django.db.models.fie... | agpl-3.0 |
ksmaheshkumar/grr | lib/data_stores/mongo_data_store_test.py | 4 | 2079 | #!/usr/bin/env python
"""Tests the mongo data store abstraction."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib im... | apache-2.0 |
Neamar/django | tests/test_utils/tests.py | 91 | 38793 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import warnings
from django.conf.urls import url
from django.contrib.staticfiles.finders import get_finder, get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import default_stora... | bsd-3-clause |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/io/arff/arffread.py | 11 | 20186 | #! /usr/bin/env python
# Last Change: Mon Aug 20 08:00 PM 2007 J
from __future__ import division, print_function, absolute_import
import re
import itertools
import datetime
from functools import partial
import numpy as np
from scipy._lib.six import next
"""A module to read arff files."""
__all__ = ['MetaData', 'lo... | mit |
tensorflow/tensorflow | tensorflow/lite/experimental/mlir/testing/generate_examples.py | 2 | 9597 | # Copyright 2019 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 |
napkindrawing/ansible | lib/ansible/modules/network/iosxr/iosxr_user.py | 14 | 9858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... | gpl-3.0 |
lowitty/selenium | com/ericsson/xn/commons/funcutils.py | 1 | 2749 | # -*- coding: utf-8 -*-
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import StaleElementReferenceException
def find_single_widget(driver, wait_time, list_identifier):
return WebDriver... | mit |
munoz0raul/linux-toradex_ACM_iMX6 | 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 |
twobraids/socorro | webapp-django/crashstats/manage/tests/test_utils.py | 14 | 4695 | import os
from unittest import TestCase
from nose.tools import eq_
from crashstats.manage import utils
SAMPLE_CSV_FILE_PCI_DATABASE_COM = os.path.join(
os.path.dirname(__file__),
'sample-graphics.csv'
)
SAMPLE_CSV_FILE_PCI_IDS = os.path.join(
os.path.dirname(__file__),
'sample-pci.ids'
)
class Tes... | mpl-2.0 |
larsbergstrom/servo | tests/wpt/web-platform-tests/webdriver/tests/get_element_property/get.py | 16 | 3380 | import pytest
from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def get_element_property(session, element_id, prop):
return session.transport.send(
"GET", "session/{session_id}/element/{element_id}/property/{prop}".format(
session_id=sessio... | mpl-2.0 |
rahuldan/sympy | sympy/tensor/array/sparse_ndim_array.py | 20 | 5831 | from __future__ import print_function, division
import functools
import itertools
from sympy.core.sympify import _sympify
from sympy import S, Dict, flatten, SparseMatrix, Basic, Tuple
from sympy.tensor.array.mutable_ndim_array import MutableNDimArray
from sympy.tensor.array.ndim_array import NDimArray, ImmutableNDi... | bsd-3-clause |
romanoid/buck | scripts/migrations/dump.py | 4 | 5568 | #!/usr/bin/env python3
# Copyright 2018-present Facebook, 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 applic... | apache-2.0 |
ActionAgile/trellostats | tests/test_cli.py | 1 | 1063 | import os
import pytest
import shortuuid
from mock import Mock, MagicMock, patch
import click
from click.testing import CliRunner
import trellostats
from trellostats.cli import cli, token, resetdb, snapshot
from trellostats.trellostats import TrelloStatsException
from trellostats.settings import BOARD_URL, LIST_URL... | bsd-3-clause |
eeshangarg/oh-mainline | vendor/packages/anyjson/setup.py | 17 | 1349 | import sys
extra = {}
if sys.version_info >= (3, 0):
extra.update(use_2to3=True)
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
author = "Rune Halvorsen"
email = "runefh@gmail.com"
version = "0.3.1"
desc = """Wraps the best available J... | agpl-3.0 |
mm112287/2015cda-24 | static/Brython3.1.0-20150301-090019/Lib/xml/sax/_exceptions.py | 625 | 4885 | """Different kinds of SAX Exceptions"""
#in brython the 4 lines below causes an $globals['Exception'] error
#import sys
#if sys.platform[:4] == "java":
# from java.lang import Exception
#del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can con... | gpl-3.0 |
mitsuhiko/sentry | tests/sentry/db/models/test_utils.py | 9 | 1253 | from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.db.models.utils import slugify_instance
from sentry.models import Organization
class SlugifyInstanceTest(TestCase):
def test_no_conflict(self):
org = Organization(name='matt')
slugify_instance(org, 'matt')
... | bsd-3-clause |
Herna1994/android_kernel_cyanogen_msm8916 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # 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 |
aESeguridad/GERE | venv/lib/python2.7/site-packages/sqlalchemy/sql/expression.py | 34 | 5833 | # sql/expression.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines the public namespace for SQL expression constructs.
Prior to version 0... | gpl-3.0 |
x86Labs/amoco | amoco/arch/z80/spec_gb.py | 6 | 11432 | # -*- coding: utf-8 -*-
# This code is part of Amoco
# Copyright (C) 2012 Axel Tillequin (bdcht3@gmail.com)
# published under GPLv2 license
# spec_xxx files are providers for instruction objects.
# These objects are wrapped and created by disasm.py.
from amoco.logger import *
logger = Log(__name__)
from amoco.arch... | gpl-2.0 |
gunzy83/ansible-modules-extras | system/puppet.py | 60 | 8853 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
virantha/pypdfocr | pypdfocr/pypdfocr_multiprocessing.py | 1 | 1954 | #!/usr/bin/env python2.7
# Copyright 2013 Virantha Ekanayake 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 ... | apache-2.0 |
AndrewSmart/audacity | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/fixpy2.py | 332 | 1110 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
all_modifs={}
def fixdir(dir):
global all_modifs
for k in all_modifs:
for v in all_modifs[k]:
modif(os.path.join(dir,'waflib'),k,v)
def modif(dir,name,fun):
... | gpl-2.0 |
DxCx/nzbToMedia | libs/beets/dbcore/db.py | 9 | 24566 | # This file is part of beets.
# Copyright 2014, Adrian Sampson.
#
# 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, ... | gpl-3.0 |
xingniu/nlp-util | sequence-diff.py | 1 | 5138 | #!/usr/bin/env python -*- coding: utf-8 -*-
import argparse
import utils
from difflib import ndiff
MODE_CHAR = "char"
MODE_TOKEN = "token"
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-f', '--file', required=True, nar... | mit |
alsotoes/vsphere-examples | python/.venv/lib/python2.6/site-packages/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
amvtek/SqlMake | sqlmake/fileparser.py | 1 | 3515 | # -*- coding: utf-8 -*-
"""
fileparser
~~~~~~~~~~
parse SQL file making use of special comments
that defines dependencies & variables...
:copyright: (c) 2014 by sc AmvTek srl
:email: devel@amvtek.com
"""
import re
from os.path import abspath
from jinja2 import Environment # see PyPI jinja2
... | mit |
bryangraham/ipt | ipt/att.py | 1 | 39159 | # Load library dependencies
import numpy as np
import numpy.linalg
import scipy as sp
import scipy.optimize
import scipy.stats
import pandas as pd
# Import logit() command in ipt module since att() calls it
from .logit import logit
# Define att() function
#-----------------------------------------------------------... | mit |
tchen0965/structural_descriptors_repo | run_connectivity.py | 1 | 1345 | from pymatgen.core.structure import Structure
from pymatgen.analysis.structure_analyzer import VoronoiCoordFinder
import connectivity_from_structure as connectivity
__author__ = 'Tina_Chen'
__contributor__ = 'Anubhav Jain'
if __name__ == '__main__':
# path to structure file
path = 'LiCoO2.cif'
# optiona... | mit |
BRupholdt/KissTodo | todo/views.py | 1 | 16586 | # KissTodo - a simple, Django based todo management tool.
# Copyright (C) 2011 Massimo Barbieri - http://www.massimobarbieri.it
#
# 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 ... | gpl-3.0 |
kbrebanov/ansible | lib/ansible/modules/cloud/docker/docker_volume.py | 45 | 7796 | #!/usr/bin/python
# coding: utf-8
#
# Copyright 2017 Red Hat | Ansible, Alex Grönholm <alex.gronholm@nextday.fi>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'meta... | gpl-3.0 |
abhijo89/sphinxit | sphinxit/core/constants.py | 4 | 1436 | """
sphinxit.core.constants
~~~~~~~~~~~~~~~~~~~~~~~
Defines some Sphinx-specific constants.
:copyright: (c) 2013 by Roman Semirook.
:license: BSD, see LICENSE for more details.
"""
from collections import namedtuple
RESERVED_KEYWORDS = (
'AND',
'AS',
'ASC',
'AVG',
'BEGIN',
... | bsd-3-clause |
chaoallsome/pip | pip/_vendor/colorama/win32.py | 446 | 5121 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeError, ImportError):
windll = None
SetCon... | mit |
loveshell/volatility | volatility/plugins/linux/vma_cache.py | 58 | 2724 | # 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 o... | gpl-2.0 |
Salamek/cron-descriptor | cron_descriptor/ExpressionDescriptor.py | 1 | 22709 | # The MIT License (MIT)
#
# Copyright (c) 2016 Adam Schubert
#
# 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, mod... | mit |
usakhelo/FreeCAD | src/Mod/Spreadsheet/importXLSX.py | 2 | 14873 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# importXLSX.py
#
# This library imports an Excel-XLSX-file into FreeCAD.
#
# Copyright (C) 2016 Ulrich Brammer <ulrich1a@users.sourceforge.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gen... | lgpl-2.1 |
brandonPurvis/osf.io | website/addons/zotero/views.py | 8 | 3269 | # -*- coding: utf-8 -*-
from flask import request
from framework.auth.decorators import must_be_logged_in
from website.project.decorators import (
must_be_contributor_or_public,
must_have_permission,
must_not_be_registration,
must_have_addon,
)
from .provider import ZoteroCitationsProvider
@must_be... | apache-2.0 |
Chatmetaleux/MissionPlanner | Scripts/example3.py | 72 | 2556 | import sys
import math
import clr
import time
clr.AddReference("MissionPlanner")
import MissionPlanner
clr.AddReference("MissionPlanner.Utilities") # includes the Utilities class
from MissionPlanner.Utilities import Locationwp
def gps_distance(lat1, lon1, lat2, lon2):
'''return distance between two points in meters,... | gpl-3.0 |
Drooids/odoo | addons/analytic/__openerp__.py | 302 | 1891 | # -*- 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 |
mingot/datacademy_django | datacademy/accounts/migrations/0004_auto__add_teacher__del_field_datacademyprofile_favourite_snack.py | 1 | 8385 | # -*- 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):
# Adding model 'Teacher'
db.create_table(u'accounts_teacher', (
(u'id', self.gf('django.db.model... | mit |
schinke/solid-fortnight-ba | flask/venv/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.py | 412 | 39115 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from... | mit |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/django/http/utils.py | 134 | 1501 | """
Functions that modify an HTTP request or response in some way.
"""
# This group of functions are run as part of the response handling, after
# everything else, including all response middleware. Think of them as
# "compulsory response middleware". Be careful about what goes here, because
# it's a little fiddly to ... | mit |
mozilla/zamboni | mkt/comm/tests/test_models.py | 6 | 14567 | from datetime import datetime
from os import path
from django.core.exceptions import ValidationError
from django.core.urlresolvers import NoReverseMatch
from django.test.utils import override_settings
import mock
from nose.tools import eq_, ok_
import mkt
from mkt.comm.models import (CommAttachment, CommunicationNot... | bsd-3-clause |
googleapis/googleapis-gen | google/cloud/tasks/v2beta2/tasks-v2beta2-py/docs/conf.py | 3 | 12447 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
heeraj123/oh-mainline | vendor/packages/twisted/twisted/conch/test/test_keys.py | 17 | 19424 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.keys}.
"""
try:
import Crypto.Cipher.DES3
except ImportError:
# we'll have to skip these tests without PyCypto and pyasn1
Crypto = None
try:
import pyasn1
except ImportError:
pyasn1 = None
i... | agpl-3.0 |
isyippee/nova | nova/cells/filters/__init__.py | 61 | 2105 | # Copyright (c) 2012-2013 Rackspace Hosting
# 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
#
# Unles... | apache-2.0 |
fintech-circle/edx-platform | common/test/acceptance/tests/studio/test_studio_help.py | 1 | 43324 | """
Test the Studio help links.
"""
from unittest import skip
from nose.plugins.attrib import attr
from common.test.acceptance.fixtures.course import XBlockFixtureDesc
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.studio.asset_index import AssetIndexPage
fro... | agpl-3.0 |
asascience-open/ooi-ui-services | ooiservices/app/uframe/assets_remote_resources.py | 1 | 4930 |
"""
Asset Management - Asset Remote Resources routes.
Routes:
[GET] /remote_resources/<int:asset_id> # Get all remote resources for asset using asset id.
[GET] /remote_resources/<string:asset_uid> # Get all remote resources for asset using asset uid.
[GET] /remote_resource/<int:resource_id> ... | apache-2.0 |
Mozhuowen/brython | www/src/Lib/test/test_email/test_policy.py | 34 | 13040 | import io
import types
import textwrap
import unittest
import email.policy
import email.parser
import email.generator
from email import headerregistry
def make_defaults(base_defaults, differences):
defaults = base_defaults.copy()
defaults.update(differences)
return defaults
class PolicyAPITests(unittest.T... | bsd-3-clause |
js0701/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/third_party/dns/__init__.py | 215 | 1293 | # Copyright (C) 2003-2007, 2009 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS... | bsd-3-clause |
RossBrunton/django | django/contrib/auth/handlers/modwsgi.py | 537 | 1344 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... | bsd-3-clause |
yangchaogit/boto | boto/ec2/autoscale/tag.py | 173 | 3379 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 ... | mit |
Juanpf/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_add_success.py | 61 | 1785 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessAddParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<add type="success" participant="{{jid}}"></add>
... | gpl-3.0 |
2014c2g2/2015cda | static/Brython3.1.1-20150328-091302/Lib/_string.py | 625 | 1112 | """string helper module"""
import re
class __loader__(object):
pass
def formatter_field_name_split(fieldname):
"""split the argument as a field name"""
_list=[]
for _name in fieldname:
_parts = _name.split('.')
for _item in _parts:
is_attr=False #fix me
if re.... | gpl-3.0 |
ibm-messaging/iot-python | test/testUtils/__init__.py | 2 | 2972 | # *****************************************************************************
# Copyright (c) 2018 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | epl-1.0 |
thumt/THUMT | thumt/utils/convert_params.py | 1 | 3165 | # coding=utf-8
# Copyright 2017-2020 The THUMT Authors
# Modified from torch.nn.utils.convert_parameters.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
def params_to_vec(parameters):
r"""Convert parameters to one vector
Arguments... | bsd-3-clause |
unbornchikken/genevo-python | genevo/optimizers/population.py | 1 | 6041 | import torch
from .organization import Organization
from .dna import dna
from ..tex import tex
class Population:
def __init__(self, owner):
assert hasattr(owner, 'make_seed_dna') and callable(owner.make_seed_dna)
assert hasattr(owner, 'calculate_fitness') and callable(owner.calculate_fitness)
... | apache-2.0 |
tquizzle/Sick-Beard | lib/hachoir_parser/video/mpeg_video.py | 90 | 22604 | """
Moving Picture Experts Group (MPEG) video version 1 and 2 parser.
Information:
- http://www.mpucoder.com/DVD/
- http://dvd.sourceforge.net/dvdinfo/
- http://www.mit.jyu.fi/mweber/leffakone/software/parsempegts/
- http://homepage.mac.com/rnc/EditMpegHeaderIFO.html
- http://standards.iso.org/ittf/PubliclyAvailableSt... | gpl-3.0 |
coderb0t/CouchPotatoServer | libs/xmpp/features.py | 199 | 8578 | ## features.py
##
## Copyright (C) 2003-2004 Alexey "Snake" Nezhdanov
##
## 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 2, or (at your option)
## any later versio... | gpl-3.0 |
StephenWeber/ansible | lib/ansible/modules/cloud/openstack/os_stack.py | 15 | 9214 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2016, Mathieu Bultel <mbultel@redhat.com>
# (c) 2016, Steve Baker <sbaker@redhat.com>
#
# This module 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 ... | gpl-3.0 |
tiancj/emesene | emesene/e3/dummy/Worker.py | 1 | 13811 | # -*- coding: utf-8 -*-
import Queue
import random
import e3
import gobject
import time
import logging
log = logging.getLogger('dummy.Worker')
class Worker(e3.Worker):
'''dummy Worker implementation to make it easy to test emesene'''
def __init__(self, session, proxy, use_http=False, use_ipv6=False):
... | gpl-3.0 |
HonzaKral/django | tests/queries/tests.py | 14 | 154710 | from __future__ import unicode_literals
import datetime
import pickle
import unittest
from collections import OrderedDict
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import DEFAULT_DB_ALIAS, connection
from django.db.models import F, Q, Count
from django.db.models.sql.... | bsd-3-clause |
rjhunter8285/nsc-cloudproject-s22016 | api/FlaskApp/FlaskApp/python_modules/oauthlib/oauth2/rfc6749/parameters.py | 86 | 15901 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods related to `Section 4`_ of the OAuth 2 RFC.
.. _`Section 4`: http://tools.ietf.org/html/rfc6749#section-4
"""
from __future__ import absolute_import, unicode_literals
import json
import os
i... | apache-2.0 |
aarchiba/scipy | benchmarks/benchmarks/optimize.py | 4 | 19341 | from __future__ import division, print_function, absolute_import
import os
import time
import inspect
import json
import traceback
from collections import defaultdict, OrderedDict
import numpy as np
try:
import scipy.optimize
from scipy.optimize.optimize import rosen, rosen_der, rosen_hess
from scipy.opt... | bsd-3-clause |
4eek/edx-platform | openedx/core/djangoapps/credit/views.py | 9 | 13671 | """
Views for the credit Django app.
"""
import json
import datetime
import logging
from django.conf import settings
from django.http import (
HttpResponse,
HttpResponseBadRequest,
HttpResponseForbidden,
Http404
)
from django.utils.decorators import method_decorator
from django.views.decorators.csrf im... | agpl-3.0 |
sjb3/python_koans | python2/runner/sensei.py | 51 | 9889 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import re
import sys
import os
import glob
import helper
from mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResult):
... | mit |
tomaslaz/Analysis-Toolkit | thirdparty/JPype-0.5.4.2/examples/jms/testJpypePublisher.py | 4 | 1213 | from jpype import *
import time
NUMMSGS = 10
def pyPublisher (javaNamingFactory="weblogic.jndi.WLInitialContextFactory",
javaNamingProvider="t3://158.188.40.21:7001",
connectionFactory="weblogic.jms.ConnectionFactory",
topicName="defaultTopic"):
retur... | gpl-3.0 |
hungpham2511/toppra | tests/tests/lpsolvers/seidel/test_lp2d.py | 1 | 8272 | import toppra.solverwrapper.cy_seidel_solverwrapper as seidel
import numpy as np
from numpy import array
import pytest
import cvxpy as cvx
testdata_correct = [
([1, 2, 3.0], None, None, None, [-1, -1], [1, 1], [-1, 1],
1, 6, [1, 1], [-2, -4]),
([-2, 2, 2.0], None, None, None, [-1, -1], [1, 1], [-1, 1],
... | mit |
MarcusTherkildsen/HackThisSite | prog_missions/4/main.py | 1 | 3379 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 07 22:10:39 2015
@author: Marcus Therkildsen
"""
from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
def deg2rad(deg_in):
return deg_in*np.pi/180
def xy(r,phi):
return r*np.cos(phi), r*np.sin(phi)
if __name__ == '__main__':
#... | mit |
XiaosongWei/crosswalk-test-suite | wrt/wrt-sharedmode-android-tests/inst.apk.py | 19 | 6532 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
TEST_PREFIX = os.environ['HOME']
PARAMETERS = None
ADB_CMD = "adb"
def do... | bsd-3-clause |
lym/allura-git | Allura/allura/controllers/secure.py | 3 | 1060 | # -*- 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 Apach... | apache-2.0 |
braysia/covertrack | covertrack/cell.py | 1 | 4510 | import numpy as np
from skimage.measure import regionprops
from copy import deepcopy
PROP_SAVE = ['area', 'cell_id', 'convex_area', 'corr_x', 'corr_y', 'cv_intensity',
'eccentricity', 'equivalent_diameter', 'euler_number', 'extent', 'filled_area',
'major_axis_length', 'max_intensity', 'mean_i... | mit |
hezuoguang/ZGVL | WLServer/api/function.py | 1 | 14259 | # -*- coding: UTF-8 -*-
__author__ = 'weimi'
from api.models import *
from django.db.models import Q
import hashlib
import re
import json
from qiniu import Auth
access_key = "MDWzu5EOTAbqoJp5EGxGcdksEcSLnixxAcGsbv2v"
secret_key = "IujhqwUXdusrrLYooPA4WZdJtS7RR6r65TALg2p_"
bucket_name = "weiliao"
pwdfix = "weimi"
photo... | apache-2.0 |
kawamon/hue | desktop/core/ext-py/python-openid-2.2.5/openid/test/linkparse.py | 87 | 2894 | from openid.consumer.html_parse import parseLinkAttrs
import os.path
import codecs
import unittest
def parseLink(line):
parts = line.split()
optional = parts[0] == 'Link*:'
assert optional or parts[0] == 'Link:'
attrs = {}
for attr in parts[1:]:
k, v = attr.split('=', 1)
if k[-1] =... | apache-2.0 |
daltonmaag/robofab | Lib/robofab/misc/arrayTools.py | 9 | 5159 | #
# Various array and rectangle tools, but mostly rectangles, hence the
# name of this module (not).
#
"""
Rewritten to elimate the numpy dependency
"""
import math
def calcBounds(array):
"""Return the bounding rectangle of a 2D points array as a tuple:
(xMin, yMin, xMax, yMax)
"""
if len(array) == 0... | bsd-3-clause |
ttfseiko/openerp-trunk | openerp/addons/decimal_precision/__openerp__.py | 179 | 1721 | # -*- encoding: 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 G... | agpl-3.0 |
jose36/plugin.video.ProyectoLuzDigital | servers/upafile.py | 35 | 3133 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para upafile
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | apache-2.0 |
sparkslabs/kamaelia | Sketches/RJL/bittorrent/BitTorrent/launchmany-console.py | 4 | 2524 | #!/usr/bin/env python
# The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/li... | apache-2.0 |
unreal666/outwiker | plugins/markdown/markdown/markdown_plugin_libs/pygments/lexers/dsls.py | 6 | 33339 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dsls
~~~~~~~~~~~~~~~~~~~~
Lexers for various domain-specific languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, RegexLexer, ... | gpl-3.0 |
dgoedkoop/QGIS | python/core/additions/edit.py | 57 | 1528 | # -*- coding: utf-8 -*-
"""
***************************************************************************
edit.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
********************************************... | gpl-2.0 |
goldcoin/Goldcoin-GLD | qa/rpc-tests/invalidtxrequest.py | 2 | 2578 | #!/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.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.comptool import Tes... | mit |
sujoykroy/motion-picture | editor/MotionPicture/shapes/image_seq_shape.py | 1 | 2120 | from ..commons import *
from .image_shape import ImageShape
import os
from .. import settings as Settings
class ImageSeqShape(ImageShape):
TYPE_NAME = "ImageSeq"
def __init__(self, anchor_at, border_color, border_width, fill_color, width, height, corner_radius):
super(ImageSeqShape, self).__init__(
... | gpl-3.0 |
mglukhikh/intellij-community | python/testData/MockSdk3.2/python_stubs/_io.py | 64 | 45316 | # encoding: utf-8
# module _io calls itself io
# from (built-in)
# by generator 1.125
"""
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. ... | apache-2.0 |
beezee/GAE-Django-site | django/contrib/auth/tests/models.py | 318 | 1493 | from django.conf import settings
from django.test import TestCase
from django.contrib.auth.models import User, SiteProfileNotAvailable
class ProfileTestCase(TestCase):
fixtures = ['authtestdata.json']
def setUp(self):
"""Backs up the AUTH_PROFILE_MODULE"""
self.old_AUTH_PROFILE_MODULE = getattr... | bsd-3-clause |
rubencabrera/odoo | openerp/modules/graph.py | 260 | 7763 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
mistio/libcloud | libcloud/test/dns/test_godaddy.py | 18 | 7260 | # 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 use ... | apache-2.0 |
samzhang111/scikit-learn | sklearn/naive_bayes.py | 11 | 28770 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... | bsd-3-clause |
PandaWei/tp-libvirt | libvirt/tests/src/virsh_cmd/volume/virsh_vol_create.py | 1 | 6363 | import os
import logging
from virttest import virsh, libvirt_storage, libvirt_xml
from virttest.utils_test import libvirt as utlv
from autotest.client.shared import error
from autotest.client import utils
from provider import libvirt_version
def run(test, params, env):
"""
Test virsh vol-create command to cov... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/330_test_print.py | 34 | 4682 | """Test correct operation of the print function.
"""
# In 2.6, this gives us the behavior we want. In 3.0, it has
# no function, but it still must parse correctly.
from __future__ import print_function
import unittest
from test import support
try:
# 3.x
from io import StringIO
except ImportError:
# 2.x... | gpl-3.0 |
jocave/snapcraft | snapcraft/tests/test_commands_help.py | 2 | 5384 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.