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 |
|---|---|---|---|---|---|
sahilshekhawat/pydy | examples/inertia_of_torus/inertia_of_torus.py | 7 | 2067 | """Derivation of central inertia of a uniform density torus.
See Kane & Levinson, 1985, Chapter 3, Section 3 for further background.
"""
from sympy import integrate, pi, Matrix, symbols
from sympy.physics.mechanics import dot, cross, inertia, ReferenceFrame
phi, theta, s, R, r, m = symbols('phi theta s R r m')
# V... | bsd-3-clause |
MorganBauer/gcjcupcake | commands/gcj_cupcake/DataManager.py | 1 | 2201 | # -*- coding: utf-8 -*-
#
# GCJ Cupcake by jbernadas
# Copyright (C) 2010 Jorge Bernadas (jbernadas@gmail.com)
#
# 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... | gpl-3.0 |
HalescodeLLC/django-munsell | munsell/mcolor/tests.py | 1 | 3821 | import logging
from django.core.urlresolvers import resolve
from django.template.loader import render_to_string
from django.test import TestCase
from django.http import HttpRequest
from .views import home_page, results_page
from .models import MunsellColor
# Create your tests here.
class HomePageTest(TestCase):
... | mit |
apple/llvm-project | lldb/test/API/functionalities/reproducers/fs-case-sensitivity/TestReproducerFSCaseSensitivity.py | 4 | 2194 | """
Test if the reproducer correctly detects whether the file system is case sensitive.
"""
import lldb
import tempfile
from lldbsuite.test import lldbtest_config
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ReproducerFileSystemSensitivityTes... | apache-2.0 |
alete89/PyCGI | src/gui/treeView.py | 1 | 6215 | from PyQt4 import QtGui, QtCore
from ..logic import core
import shutil as shu
import os
class TreeView(QtGui.QTreeView):
def __init__(self, window_instance):
super(TreeView, self).__init__()
self.window = window_instance
self.fsmodel = QtGui.QFileSystemModel(self)
self.fsmodel.setR... | gpl-3.0 |
kustodian/ansible | lib/ansible/plugins/connection/buildah.py | 23 | 6237 | # Based on the docker connection plugin
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Connection plugin for building container images using buildah tool
# https://github.com/projectatomic/buildah
#
# Written by: Tomas Tomecek (htt... | gpl-3.0 |
VielSoft/odoo | addons/project/wizard/__init__.py | 381 | 1075 | # -*- 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 |
caioserra/apiAdwords | examples/adspygoogle/dfp/v201302/get_all_user_team_associations.py | 3 | 1933 | #!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
Belgabor/django | django/utils/formats.py | 20 | 4641 | import decimal
import datetime
from django.conf import settings
from django.utils.translation import get_language, to_locale, check_for_language
from django.utils.importlib import import_module
from django.utils.encoding import smart_str
from django.utils import dateformat, numberformat, datetime_safe
def get_format_... | bsd-3-clause |
stevenmizuno/QGIS | tests/src/python/test_qgssinglesymbolrenderer.py | 17 | 3133 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgssinglesymbolrenderer.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Matthias Kuhn
Email : matthias at opengis dot ch
*****... | gpl-2.0 |
unioslo/cerebrum | contrib/no/uit/process_sito_email.py | 1 | 8156 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2019 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | gpl-2.0 |
40223211/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/__init__.py | 900 | 2718 | """
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.
This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the resu... | gpl-3.0 |
sanketloke/scikit-learn | examples/tree/unveil_tree_structure.py | 67 | 4824 | """
=========================================
Understanding the decision tree structure
=========================================
The decision tree structure can be analysed to gain further insight on the
relation between the features and the target to predict. In this example, we
show how to retrieve:
- the binary t... | bsd-3-clause |
ujjwalwahi/odoo | addons/point_of_sale/report/pos_details.py | 72 | 9373 | # -*- 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 |
jwkozel/demobx | boxsdk/network/default_network.py | 7 | 2014 | # coding: utf-8
from __future__ import unicode_literals
import requests
import time
from .network_interface import Network, NetworkResponse
class DefaultNetwork(Network):
"""Implementation of the network interface using the requests library."""
def __init__(self):
super(DefaultNetwork, self).__ini... | apache-2.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/scipy/sparse/linalg/_norm.py | 83 | 5867 | """Sparse matrix norms.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.sparse import issparse
from numpy.core import Inf, sqrt, abs
__all__ = ['norm']
def _sparse_frobenius_norm(x):
if np.issubdtype(x.dtype, np.complexfloating):
sqnorm = abs(x).power... | apache-2.0 |
xyuanmu/XX-Net | python3.8.2/Lib/email/feedparser.py | 26 | 22780 | # Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org
"""FeedParser - An email feed parser.
The feed parser implements an interface for incrementally parsing an email
message, line by line. This has advantages for certain applications, such as
thos... | bsd-2-clause |
akchinSTC/systemml | projects/breast_cancer/breastcancer/preprocessing.py | 3 | 27672 | #-------------------------------------------------------------
#
# 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... | apache-2.0 |
hcsturix74/django | django/middleware/clickjacking.py | 87 | 1988 | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
class XFrameOptionsMiddleware(object):
"""
Middleware that sets the X-Frame-Options HTTP head... | bsd-3-clause |
giantoak/docent-learner | src/admin/admin.py | 1 | 2189 | import cgi
import re
import json
configfile = "/var/www/html/docent-learner/var/config/config.json"
def application(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/html; charset=utf-8')]
message = ""
config = {}
try:
config_file = open(configfile, 'r')
config_r... | apache-2.0 |
emijrp/pywikibot-core | tests/bot_tests.py | 6 | 13347 | # -*- coding: utf-8 -*-
"""Bot tests."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
#
import sys
import pywikibot
import pywikibot.bot
from tests.aspects import (
unittest, DefaultSiteTestCase, SiteAttributeTest... | mit |
nanolearningllc/edx-platform-cypress | common/test/acceptance/pages/lms/discussion.py | 36 | 25473 | from contextlib import contextmanager
from bok_choy.javascript import wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from .course_page import CoursePage
class DiscussionPageMixin(object):
def is_ajax_finished(self):
return self.browser.execute... | agpl-3.0 |
salbrandi/patella | patella/tablereader.py | 1 | 1851 | """
This module is for reading the html tables that list world leaders off of varying webpages.
It is not very dynamic or robust, and has priority for updates.
More tables of FEs from countries around the world will be added so users can compare their data sets to different
world leaders.
"""
import pandas as pd
# A... | mit |
dyoung418/tensorflow | tensorflow/tools/quantization/quantize_graph.py | 63 | 57187 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
yograterol/Simulated-Annealing | recocido_simulado.py | 1 | 3700 | """
Implementacion del algoritmo de recocido simulado
para la materia electiva Computacion Emergente
@author Yohan Graterol <yograterol@fedoraproject.org> 2013
"""
from collections import deque
from math import exp
try:
from numpy.random import (permutation, random_sample)
from numpy import (log, matrix, array... | bsd-3-clause |
suttond/MODOI | ase/phasediagram.py | 2 | 20868 | from __future__ import division, print_function
import fractions
import functools
import re
import numpy as np
from scipy.spatial import ConvexHull, Delaunay
import ase.units as units
from ase.atoms import string2symbols
from ase.utils import hill
_solvated = []
def parse_formula(formula):
aq = formula.endswi... | lgpl-3.0 |
wilebeast/FireFox-OS | B2G/gecko/media/webrtc/trunk/tools/gyp/test/win/gyptest-cl-buffer-security-check.py | 344 | 1612 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure buffer security check setting is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Tes... | apache-2.0 |
utn-frm-si/reservas | app_reservas/models/imagenCarrusel.py | 2 | 1561 | # coding=utf-8
import os
from django.db import models
def establecer_destino_archivo_imagen(instance, filename):
"""
Establece la ruta de destino para el archivo de imagen cargado a la instancia.
"""
# Almacena el archivo en:
# 'app_reservas/carruseles/<carrusel>/<imagen>'
ruta_archivos_ubic... | mit |
Netflix-Skunkworks/napalm-base | test/unit/validate/test_unit.py | 1 | 10802 | """Tests for the validate methods."""
import pytest
from napalm_base import validate
_compare_getter = [
(
{"list": ["\d{2}", 1, 2]},
[1, 2, 33],
{u'complies': True, u'extra': [], u'missing': [], u'present': ['\d{2}', 1, 2]}
),
(
{"list": [1, 2, 3]},
[1, 2, 3, 4, 5]... | apache-2.0 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/boto/sdb/db/property.py | 17 | 24935 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | mit |
ShassAro/ShassAro | DockerAdmin/dockerVirtualEnv/lib/python2.7/site-packages/django/db/backends/utils.py | 52 | 6379 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(objec... | gpl-2.0 |
TeamEOS/external_skia | tools/find_bad_images_in_skps.py | 172 | 7405 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script will take as an argument either a list of skp files or a
set of directories that contains skp files. It will then test each
skp... | bsd-3-clause |
nfcpy/ndeflib | tests/test_text.py | 1 | 3339 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division
import ndef
import pytest
import _test_record_base
def pytest_generate_tests(metafunc):
_test_record_base.generate_tests(metafunc)
class TestTextRecord(_test_record_base._TestRecordBase):
RECORD = ndef.text.TextRecord
ATTRIB = "t... | isc |
LIMXTEC/DMDv3 | qa/rpc-tests/mempool_coinbase_spends.py | 143 | 3850 | #!/usr/bin/env python2
# Copyright (c) 2014 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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coin... | mit |
billwanjohi/ansible-modules-core | utilities/assert.py | 80 | 1392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 Lice... | gpl-3.0 |
todaychi/hue | apps/oozie/src/oozie/migrations/0016_auto__add_field_coordinator_job_properties.py | 36 | 23680 | # 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):
# Adding field 'Coordinator.job_properties'
db.add_column('oozie_coordinator', 'job_properties', self.gf('django.d... | apache-2.0 |
upgrades-migrations/preupgrade-assistant | preupg/script_api.py | 2 | 23078 | # -*- coding: utf-8 -*-
"""
python API for content writers
USAGE
*****
Best way is to import all functions from this module:
from script_api import *
These functions are available:
* logging functions -- log_*
* log message to stdout
* logging risk functions -- log_*_risk
* log risk level -- so administrator kno... | gpl-3.0 |
tomlof/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 43 | 10272 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
mvanderkolff/xhtml2pdf | test/linkloading.py | 154 | 12563 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
apple/llvm-project | lldb/test/API/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py | 4 | 3113 | """
Test that dynamic values update their child count correctly
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class DynamicValueChildCountTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... | apache-2.0 |
gchp/django | tests/expressions/models.py | 261 | 1925 | """
Tests for F() query expression syntax.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField... | bsd-3-clause |
8l/beri | cheritest/trunk/tests/fpu/test_fpu_x_disabled.py | 2 | 2018 | #-
# Copyright (c) 2013 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | apache-2.0 |
joshrule/LOTlib | LOTlib/Inference/Samplers/MemoizedMHSampler.py | 2 | 1277 | from cachetools import LRUCache
from LOTlib.Miscellaneous import Infinity
from MetropolisHastings import MHSampler
class MemoizedMHSampler(MHSampler):
"""
Same as MHSampler, but the values of compute_posterior are cached via LRUCache
"""
def __init__(self, h0, data, memoize=Infinity, **kwargs):
... | gpl-3.0 |
rdowinton/scrapy | tests/test_middleware.py | 30 | 2326 | from twisted.trial import unittest
from scrapy.settings import Settings
from scrapy.exceptions import NotConfigured
from scrapy.middleware import MiddlewareManager
class M1(object):
def open_spider(self, spider):
pass
def close_spider(self, spider):
pass
def process(self, response, requ... | bsd-3-clause |
kmad1729/website | django/contrib/localflavor/se/forms.py | 311 | 5623 | # -*- coding: utf-8 -*-
"""
Swedish specific Form helpers
"""
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
from django.contrib.localflavor.se.utils import (id_number_checksum,
validate_id_birthday, format_personal_id_numbe... | bsd-3-clause |
rubencabrera/odoo | addons/base_import_module/tests/test_module/__openerp__.py | 377 | 1290 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
vjpai/grpc | src/python/grpcio_tests/tests_aio/interop/methods.py | 8 | 17741 | # Copyright 2019 The 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 writ... | apache-2.0 |
JonathanLevi/fabric | bddtests/steps/sdk_impl.py | 35 | 1364 | import os
import re
import time
import copy
import base64
from datetime import datetime, timedelta
import sys, requests, json
import bdd_test_util
from grpc.beta import implementations
import fabric_pb2
import chaincode_pb2
import devops_pb2
SDK_NODE_APP_REST_PORT = 8080
def buildUrl(context, ipAddress, path):
... | apache-2.0 |
briancurtin/python-openstacksdk | openstack/tests/unit/workflow/test_proxy.py | 1 | 2321 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
pczerkas/tempest | tempest/api/identity/admin/v3/test_list_users.py | 7 | 4408 | # Copyright 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/LICENSE-2.... | apache-2.0 |
codemac/servo | tests/wpt/harness/wptrunner/browsers/servodriver.py | 48 | 4743 | # 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/.
import os
import subprocess
import tempfile
from mozprocess import ProcessHandler
from .base import Browser, require_a... | mpl-2.0 |
AfonsoFGarcia/swift | swift/common/internal_client.py | 16 | 33091 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | apache-2.0 |
thezawad/kivy | examples/widgets/focus_behavior.py | 67 | 3559 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.behaviors import FocusBehavior
from kivy.graphics import Color, Rectangle
class FocusWithColor(FocusBehavior):
''' Class that when focused, changes its backgr... | mit |
telukir/PubMed2Go | full_text_index/PubMedXapian.py | 4 | 4316 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Copyright (c) 2014, Kersten Doering <kersten.doering@gmail.com>, Christian Senger <der.senger@googlemail.com>
"""
import xappy
import sys
import os
from SynonymParser import SynonymParser
from Article import Article
class PubMedXapian():
__indexCount = 0
... | isc |
cevaris/pants | tests/python/pants_test/backend/jvm/tasks/reports/test_junit_html_report.py | 9 | 5119 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | apache-2.0 |
CarterFendley/2015-robot | robot/common/sensor.py | 1 | 4226 | import wpilib
from common.distance_sensors import SharpIR2Y0A02, SharpIRGP2Y0A41SK0F, CombinedSensor
from networktables import NetworkTable
class Sensor:
def __init__(self, tote_motor, can_motor):
self.sd = NetworkTable.getTable('SmartDashboard')
self.toteLimitLSensor = wpili... | apache-2.0 |
mcuringa/py-tutor | pytutor/tutor/editor_views.py | 1 | 9647 | import random
import json
import difflib
from django.template import loader, Context
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from django.core import serializers
from django.contrib import messages... | agpl-3.0 |
itoed/fabric | sites/shared_conf.py | 19 | 1039 | from os.path import join
from datetime import datetime
import alabaster
# Alabaster theme + mini-extension
html_theme_path = [alabaster.get_path()]
extensions = ['alabaster']
# Paths relative to invoking conf.py - not this shared file
html_static_path = [join('..', '_shared_static')]
html_theme = 'alabaster'
html_th... | bsd-2-clause |
AlexanderLang/OpenAutomatedFarm | FarmGUI/farmgui/models/ParameterSetpointLog.py | 1 | 3845 | """
Created on Feb 15, 2014
@author: alex
"""
from sqlalchemy import Column
from sqlalchemy.types import BigInteger
from sqlalchemy.types import SmallInteger
from sqlalchemy.types import DateTime
from sqlalchemy.types import Float
from sqlalchemy import ForeignKey
from .meta import Base
class ParameterSetpointLog(... | gpl-3.0 |
scascketta/LostNumber | LostNumber/handle_msg.py | 1 | 4767 | from redis import StrictRedis
from LostNumber import app
import process_msg
import details
r = StrictRedis(host=details.redis_addr, port=details.redis_port)
logger = app.logger
def is_num_registered(num):
return r.sismember('registered_nums', num)
def register_num(data):
"""Adds a number to our list of reg... | mit |
Curious72/sympy | examples/advanced/curvilinear_coordinates.py | 96 | 3691 | #!/usr/bin/env python
"""
This example shows how to work with coordinate transformations, curvilinear
coordinates and a little bit with differential geometry.
It takes polar, cylindrical, spherical, rotating disk coordinates and others
and calculates all kinds of interesting properties, like Jacobian, metric
tensor, ... | bsd-3-clause |
mega-force/xbmc | lib/gtest/scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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... | gpl-2.0 |
kenwang815/KodiPlugins | script.module.oceanktv/lib/youtube_dl/extractor/yam.py | 17 | 4213 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
float_or_none,
month_by_abbreviation,
ExtractorError,
get_element_by_attribute,
)
class YamIE(InfoExtractor):
IE_DESC = '蕃薯藤yam天空部落'
... | gpl-2.0 |
rnaveiras/vault | vendor/github.com/ugorji/go/codec/test.py | 181 | 4029 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | mpl-2.0 |
alexus37/AugmentedRealityChess | pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGL/raw/GLES2/OES/get_program_binary.py | 8 | 1053 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import... | mit |
vishnu-kumar/PeformanceFramework | tests/unit/plugins/openstack/context/network/test_network.py | 8 | 4433 | # Copyright 2014: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
ryanbackman/zulip | zerver/management/commands/export.py | 5 | 5741 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser, RawTextHelpFormatter
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
import os
import shutil
import subprocess
... | apache-2.0 |
tencentyun/Cloud-Image-Migration-Tool | usr/sbin/oss_job_manager.py | 1 | 4204 | #!/usr/bin/env python
###############################################################################
# Copyright (c) 2015 Tencent Inc.
# Distributed under the MIT license
# (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
#
# Project: Cloud Image Migration Tool
# Filename: os... | mit |
TeamBasedLearning/Service | pgtbl/accounts/models.py | 1 | 5059 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import (
AbstractBaseUser, PermissionsMixin, BaseUserManager
)
import uuid
class UserProfileManager(BaseUserManager):
"""
Object manager is another class that we can use to help manage the ... | gpl-3.0 |
linvictor88/vse-lbaas-driver | quantum/tests/unit/nec/test_trema_driver.py | 3 | 13624 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org... | apache-2.0 |
LiuLang/bcloud | bcloud/Downloader.py | 10 | 11869 |
# Copyright (C) 2014-2015 LiuLang <gsushzhsosgsu@gmail.com>
# Use of this source code is governed by GPLv3 license that can be found
# in http://www.gnu.org/licenses/gpl-3.0.html
import json
import multiprocessing
import os
from queue import Queue
import re
import threading
import time
import traceback
from urllib i... | gpl-3.0 |
appliedx/edx-platform | lms/djangoapps/instructor_task/tasks.py | 28 | 12671 | """
This file contains tasks that are designed to perform background operations on the
running state of a course.
At present, these tasks all operate on StudentModule objects in one way or another,
so they share a visitor architecture. Each task defines an "update function" that
takes a module_descriptor, a particula... | agpl-3.0 |
liuyonggg/learning_python | leetcode/expressionAddOperator.py | 1 | 2979 | '''
Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value.
Examples:
"123", 6 -> ["1+2+3", "1*2*3"]
"232", 8 -> ["2*3+2", "2+3*2"]
"105", 5 -> ["1*0+5","10-5"]
"00", 0 -> ["0+0",... | mit |
vvw/linearAlgebra-coursera | assignment 7/matrix-hw7/mat.py | 24 | 4760 | from vec import Vec
def getitem(M, k):
"Returns the value of entry k in M. The value of k should be a pair."
assert k[0] in M.D[0] and k[1] in M.D[1]
if (k[0], k[1]) in M.f.keys():
return M.f[(k[0], k[1])]
else:
return 0
def setitem(M, k, val):
"Sets the element of v with label k... | mit |
defionscode/ansible | test/units/modules/network/nxos/test_nxos_ospf_vrf.py | 44 | 2763 | # (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 dis... | gpl-3.0 |
schleichdi2/OPENNFR-6.0-CORE | bitbake/lib/bb/tests/utils.py | 5 | 17025 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Tests for utils.py
#
# Copyright (C) 2012 Richard Purdie
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Fr... | gpl-2.0 |
bealdav/OCB | addons/stock_account/wizard/stock_invoice_onshipping.py | 120 | 6111 | # -*- 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 |
MCMic/Sick-Beard | cherrypy/__init__.py | 35 | 20462 | """CherryPy is a pythonic, object-oriented HTTP framework.
CherryPy consists of not one, but four separate API layers.
The APPLICATION LAYER is the simplest. CherryPy applications are written as
a tree of classes and methods, where each branch in the tree corresponds to
a branch in the URL path. Each method i... | gpl-3.0 |
amarandon/opencore | opencore/models/tests/test_attachments.py | 4 | 2026 | # Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz.org
# 2010-2011 Large Blue
# Fergus Doyle: fergus.doyle@largeblue.com
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version ... | gpl-2.0 |
thisismyrobot/dsa | src/binary_tree.py | 1 | 1762 | """ A binary tree implementation.
"""
class Node(object):
""" A binary tree node.
"""
def __init__(self, data, left=None, right=None):
self.data = data
self.left = left
self.right = right
def __str__(self):
return str(self.data)
class BinaryTree(objec... | unlicense |
sol-ansano-kim/minimap | minimap/mayaFunction.py | 1 | 4363 | from maya import cmds
from maya import OpenMayaUI
from maya import OpenMaya
import os
## TODO
class View(object):
def __init__(self):
super(View, self).__init__()
self.view = OpenMayaUI.M3dView.active3dView()
self.camera = OpenMaya.MDagPath()
self.view.getCamera(self.camera)
de... | gpl-2.0 |
jkugler/ansible | lib/ansible/plugins/action/group_by.py | 172 | 1401 | # Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 ve... | gpl-3.0 |
energicryptocurrency/energi | contrib/devtools/clang-format-diff.py | 142 | 6190 | #!/usr/bin/env python
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ===========================================================... | mit |
zerobatu/edx-platform | common/lib/xmodule/xmodule/crowdsource_hinter.py | 177 | 17456 | """
Adds crowdsourced hinting functionality to lon-capa numerical response problems.
Currently experimental - not for instructor use, yet.
"""
import logging
import json
import random
import copy
from pkg_resources import resource_string
from lxml import etree
from xmodule.x_module import XModule, STUDENT_VIEW
fro... | agpl-3.0 |
Asalle/coala | tests/settings/SettingTest.py | 1 | 5508 | import os
import re
import unittest
from collections import OrderedDict
from coalib.bearlib.languages import Language
from coalib.settings.Setting import (
Setting, path, path_list, url, typed_dict, typed_list, typed_ordered_dict,
glob, glob_list,
language,
)
from coalib.parsing.Globbing import glob_escape... | agpl-3.0 |
joequery/django | django/views/debug.py | 18 | 46801 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... | bsd-3-clause |
pdellaert/ansible | test/units/module_utils/hwc/test_hwc_utils.py | 19 | 1152 | # -*- coding: utf-8 -*-
from units.compat import unittest
from ansible.module_utils.hwc_utils import (HwcModuleException, navigate_value)
class HwcUtilsTestCase(unittest.TestCase):
def test_navigate_value(self):
value = {
'foo': {
'quiet': {
'tree': 'test',... | gpl-3.0 |
vladikoff/fxa-mochitest | tests/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py | 805 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | mpl-2.0 |
cpennington/edx-platform | lms/djangoapps/mobile_api/decorators.py | 4 | 2478 | """
Decorators for Mobile APIs.
"""
import functools
from django.http import Http404
from opaque_keys.edx.keys import CourseKey
from rest_framework import status
from rest_framework.response import Response
from lms.djangoapps.courseware.courses import get_course_with_access
from lms.djangoapps.courseware.coursewar... | agpl-3.0 |
JohannesBuchner/doit | doit/cmd_info.py | 3 | 4162 | """command doit info - display info on task metadata"""
import pprint
from .cmd_base import DoitCmdBase
from .exceptions import InvalidCommand
opt_hide_status = {
'name': 'hide_status',
'long': 'no-status',
'type': bool,
'default': False,
'help': """Hides reasons why this task would be executed.... | mit |
garyd203/flying-circus | src/flyingcircus/_raw/opsworks.py | 1 | 8157 | """Raw representations of every data type in the AWS OpsWorks service.
See Also:
`AWS developer guide for OpsWorks
<https://docs.aws.amazon.com/opsworks/latest/userguide/index.html>`_
This file is automatically generated, and should not be directly edited.
"""
from attr import attrib
from attr import attrs
... | lgpl-3.0 |
bl4ckdu5t/registron | old/e2etests/common/maketests.py | 9 | 3403 | #!/usr/bin/env python
# Copyright (C) 2011, Hartmut Goebel
# Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published... | mit |
tquilian/exelearningTest | tools/po2json.py | 11 | 10686 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Transecma is a Python solution for javascript internationalization,
written in 2012 by Nando Florestan.
Babel already has a javascript extractor (a function that goes through
javascript code finding translation strings and writing them to a
.POT translation template fi... | gpl-2.0 |
googleinterns/learnbase | learnbase/src/main/webapp/WEB-INF/Lib/unittest/test/test_suite.py | 111 | 12069 | import unittest
import sys
from .support import LoggingResult, TestEquality
### Support code for Test_TestSuite
################################################################
class Test(object):
class Foo(unittest.TestCase):
def test_1(self): pass
def test_2(self): pass
def test_3(self... | apache-2.0 |
sestrella/ansible | lib/ansible/modules/network/junos/junos_l2_interfaces.py | 20 | 9497 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is au... | gpl-3.0 |
teeple/pns_server | work/install/Python-2.7.4/Parser/asdl.py | 10 | 11320 | """An implementation of the Zephyr Abstract Syntax Definition Language.
See http://asdl.sourceforge.net/ and
http://www.cs.princeton.edu/research/techreps/TR-554-97
Only supports top level module decl, not view. I'm guessing that view
is intended to support the browser and I'm not interested in the
browser.
Changes... | gpl-2.0 |
chombourger/efup | external/nss/external_tests/google_test/gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mpl-2.0 |
jeremiahmarks/sl4a | python/src/Lib/weakref.py | 62 | 10087 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | apache-2.0 |
dermoth/gramps | gramps/plugins/tool/check.py | 1 | 129149 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011 Tim G L Lyons
# Copyright (C) 2012 Michiel D. Nauta
#
# This program is free software; you can redistri... | gpl-2.0 |
codeman38/toggldesktop | third_party/googletest-read-only/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/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... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.