code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from flask import Blueprint, request
bg9_40323218 = Blueprint('bg9_40323218', __name__, url_prefix='/bg9_40323218', template_folder='templates')
head_str = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>網際 2D 鏈條繪圖</title>
<!-- IE 9: display inline SVG -->
<meta http-equiv="X-UA-Comp... | 40323250/bg9_cdw11 | users/b/g9/bg9_40323218.py | Python | agpl-3.0 | 34,761 |
from django.test import TestCase
from django.contrib.auth.models import Group, User
from django.db.models.signals import post_save, post_delete
from community.constants import COMMUNITY_ADMIN
from community.models import Community
from community.signals import manage_community_groups, remove_community_groups
from user... | exploreshaifali/portal | systers_portal/community/tests/test_signals.py | Python | gpl-2.0 | 2,832 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | brianrodri/oppia | scripts/scripts_test_utils.py | Python | apache-2.0 | 8,753 |
import re
import os
import bleach
def get_env(name):
val = os.getenv(name)
if val is None:
raise Exception("Can't find environment variable {0}.".format(name))
return val
def remove_html(text):
"""
Using bleach remove all HTML markup from text.
http://bleach.readthedocs.org/en/lates... | Brown-University-Library/vivo-data-management | vdm/utils.py | Python | mit | 1,494 |
import unittest
from katas.kyu_8.kata_example_twist import websites
class WebsitesTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(len(websites), 1000)
def test_equals_2(self):
self.assertEqual(websites.count('codewars'), 1000)
| the-zebulan/CodeWars | tests/kyu_8_tests/test_kata_example_twist.py | Python | mit | 276 |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import re
... | Azure/azure-sdk-for-python | sdk/communication/azure-communication-networktraversal/tests/_shared/testcase.py | Python | mit | 2,951 |
from .numbers import PalindromeNumber
class DoubleBasePalindrome(PalindromeNumber):
"""This class provides sum of numbers tha are palindrome
in both decimal and binary base
Examples:
>>> palindromes = DoubleBasePalindrome()
>>> palindromes.sum_palindrome_numbers()
872187"""
@... | jam182/palindrome | palindrome/doublebase.py | Python | bsd-2-clause | 1,270 |
'''
Module of Windows API for plyer.email.
'''
import os
try:
from urllib.parse import quote
except ImportError:
from urllib import quote
from plyer.facades import Email
class WindowsEmail(Email):
'''
Implementation of Windows email API.
'''
def _send(self, **kwargs):
recipient = kwa... | kivy/plyer | plyer/platforms/win/email.py | Python | mit | 1,060 |
# 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
# distribu... | digambar15/openstack-iot | iot/conductor/handlers/driver.py | Python | apache-2.0 | 1,411 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import argparse
import logging
import os
import pexpect
import shutil
import signal
import subprocess
import sys
import tempfile
import time
import traceback
from xmlrpc import client as xmlrpclib
... | ddico/odoo | setup/package.py | Python | agpl-3.0 | 23,784 |
# Author: echel0n <[email protected]>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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... | gborri/SickRage | sickrage/core/version_updater.py | Python | gpl-3.0 | 27,394 |
# 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... | thesuperzapper/tensorflow | tensorflow/contrib/keras/python/keras/initializers_test.py | Python | apache-2.0 | 5,930 |
from __future__ import unicode_literals
from django.test import TestCase
from wtl.wtparser.parsers import PodfileParser
PODFILE = """
# Example Podfile
platform :ios, '7.0'
inhibit_all_warnings!
xcodeproj `MyProject`
pod 'SSToolkit'
pod 'AFNetworking', '>= 0.5.1'
pod 'Objection', :head # 'bleeding edge'
pod 'Reje... | elegion/djangodash2013 | wtl/wtparser/tests/parsers/podfile.py | Python | mit | 1,871 |
# OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | i5o/openshot-sugar | openshot/openshot/classes/tree.py | Python | gpl-3.0 | 2,760 |
"""A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# a... | deanhiller/databus | webapp/play1.3.x/python/Lib/HTMLParser.py | Python | mpl-2.0 | 13,794 |
from __future__ import division, print_function, absolute_import
from scipy.lib.six import xrange
import scipy.special
from numpy import (logical_and, asarray, pi, zeros_like,
piecewise, array, arctan2, tan, zeros, arange, floor)
from numpy.core.umath import (sqrt, exp, greater, less, cos, add, sin,... | jsilter/scipy | scipy/signal/bsplines.py | Python | bsd-3-clause | 11,622 |
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import logging
import queue
import threading
from utils import file_path
class FileRefresherThread(object):
"""Represents a threa... | luci/luci-py | appengine/swarming/swarming_bot/bot_code/file_refresher.py | Python | apache-2.0 | 3,125 |
#===========================================================================================================================
# aims : define both 3 hidden layers model and 4 hidden layers model
#
# input : x : placeholder variable which has as column number the number of features of the training matrix con... | allspeak/api.allspeak.eu | web/project/training_api/libs/models.py | Python | mit | 10,685 |
# built-ins
import os
import argparse
from math import floor, ceil
from random import shuffle
import json
import cPickle as pck
import itertools as it
from operator import __or__, __not__
from functools import partial
import fnmatch
# external libraries
import numpy as np
from gala import imio
from scipy import spatia... | janelia-flyem/synapse-geometry | syngeo/assignments.py | Python | bsd-3-clause | 7,886 |
from setuptools import setup, find_packages
setup(
name="ssid-of-st-john",
version="0.1",
packages=find_packages(),
) | lengau/ssid-of-st-john | setup.py | Python | apache-2.0 | 130 |
# Copyright 2014 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 agreed to in... | wikimedia/integration-zuul | zuul/merger/server.py | Python | apache-2.0 | 4,031 |
"""
awslimitchecker/services/s3.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
################################################################################
Copyright 2015-2018 Jason Antman <[email protected]>
This file is part of awslimitchecker, also ... | jantman/awslimitchecker | awslimitchecker/services/s3.py | Python | agpl-3.0 | 3,754 |
# -*- coding: utf-8 -*-
import json
from functools import reduce
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_account import MultiAccount
def args(**kwargs):
return kwargs
class MegaDebridEu(MultiAccount):
__name__ = "MegaDebridEu"
__type__ = "account"
... | vuolter/pyload | src/pyload/plugins/accounts/MegaDebridEu.py | Python | agpl-3.0 | 4,359 |
class PhaseContent():
features = {}
@property
def identifier(self):
return '{s.app}:{s.phase}'.format(s=self)
def __str__(self):
return '{s.__class__.__name__} ({s.app}:{s.phase})'.format(s=self)
def has_feature(self, feature, model):
return model in self.features.get(fea... | liqd/adhocracy4 | adhocracy4/phases/contents.py | Python | agpl-3.0 | 879 |
import os
from kennyg.element import ValueCollector, Value, KeyValueCollector, KeyValue
from kennyg.sax_handler import KennyGSAXHandler
from kennyg.parser import parse, parseString
__author__ = 'brent'
def get_data_filepath(name):
return os.path.join(os.path.dirname(os.path.abspath(__file__)),"data",name)
def ... | brentpayne/kennyg | tests/test_parser.py | Python | lgpl-3.0 | 1,651 |
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[email protected]>
#
# 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 r... | openstack/designate | designate/schema/__init__.py | Python | apache-2.0 | 3,897 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | 17zuoye/luigi | luigi/contrib/scalding.py | Python | apache-2.0 | 10,382 |
# -*- coding: utf-8 -*-
import os
import sys
import socket
import struct
from nixops import known_hosts
from nixops.util import wait_for_tcp_port, ping_tcp_port
from nixops.util import attr_property, create_key_pair, generate_random_string
from nixops.nix_expr import Function, RawValue
from nixops.backends import Ma... | Bsami/nixops | nixops/backends/gce.py | Python | lgpl-3.0 | 37,799 |
import re
import fileinput
import requests
from pyes import *
# def call_es(error):
# error = error[:500]
# conn = ES('ec2-52-8-185-215.us-west-1.compute.amazonaws.com:9200')
# error = re.sub('[\W_]+', ' ', error)
# q = QueryStringQuery("ques.snippets:{}".format(error))
# results = conn.search(que... | nave91/rebot | scripts/rebot.py | Python | gpl-2.0 | 1,193 |
#!/usr/bin/env python
#
# 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, softwar... | openstack/openstack-ansible | tests/test_filesystem.py | Python | apache-2.0 | 3,436 |
import os
from os import path
from datetime import datetime
import getpass
import re
import time
from fabric.context_managers import cd, hide, settings
from fabric.operations import require, prompt, get, run, sudo, local
from fabric.state import env
from fabric.contrib import files
from fabric import utils
def _setu... | qris/mailer-dye | dye/fablib.py | Python | gpl-3.0 | 29,664 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | lakshmi-kannan/st2 | st2actions/st2actions/scheduler.py | Python | apache-2.0 | 4,884 |
from bcpp_subject_form_validators import HeartAttackFormValidator
from ..models import HeartAttack
from .form_mixins import SubjectModelFormMixin
class HeartAttackForm (SubjectModelFormMixin):
form_validator_cls = HeartAttackFormValidator
class Meta:
model = HeartAttack
fields = '__all__'
| botswana-harvard/bcpp-subject | bcpp_subject/forms/heart_attack_form.py | Python | gpl-3.0 | 319 |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Collabora Ltd
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# ... | hotdoc/hotdoc | hotdoc/extensions/gi/languages/c.py | Python | lgpl-2.1 | 2,676 |
import logging
logger = logging.getLogger(__name__)
import re
from subprocess import Popen, PIPE
version_declaration_pattern = r'\s*#\s*version\s+(\d+)\s+es\s*'
layour_qualifier_pattern = r'layout\s*\(\s*location\s*=\s*(\d+)\s*\)\s*'
sampler2DArray_pattern = r'\bsampler2DArray\b'
def Preprocess(input_text):
ver... | hantempo/GLESDep | ShaderUtility.py | Python | mit | 2,645 |
# (C) British Crown Copyright 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any later ve... | Jozhogg/iris | lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_build_cube_metadata.py | Python | lgpl-3.0 | 2,908 |
import os, sys
def get_filepaths(directory):
file_paths = [] # List which will store all of the full filepaths.
for root, directories, files in os.walk(directory):
for filename in files:
# Join the two strings in order to form the full filepath.
filepath = os.path.join(ro... | wzyuliyang/hand-write-digit-recognition-with-opencv | tools/createpath.py | Python | mit | 1,927 |
"""passlib.handlers.digests - plain hash digests
"""
#=============================================================================
# imports
#=============================================================================
# core
import hashlib
import logging; log = logging.getLogger(__name__)
# site
# pkg
from passlib.u... | morreene/tradenews | venv/Lib/site-packages/passlib/handlers/digests.py | Python | bsd-3-clause | 5,452 |
from conans import ConanFile, CMake
class AversivePlusPlusModuleConan(ConanFile):
name = "stm32cube-hal-stm32f4xx"
version = "0.1"
exports = "*"
settings = "os", "compiler", "build_type", "arch", "target"
requires = "cmsis-stm32f4xx/0.1@AversivePlusPlus/dev", "toolchain-switch/0.1@AversivePlusPlus... | AversivePlusPlus/AversivePlusPlus | modules/thirdparty/stm32cube-hal-stm32f4xx/conanfile.py | Python | bsd-3-clause | 970 |
"""
De-linearize skin weights.
.. figure:: https://github.com/robertjoosten/rjSkinningTools/raw/master/delinearWeights/README.gif
:align: center
Installation
============
Copy the **rjSkinningTools** folder to your Maya scripts directory
::
C:/Users/<USER>/Documents/maya/scripts
Usage
=====
Display U... | josephkirk/PipelineTools | packages/rjTools/delinearWeights/__init__.py | Python | bsd-2-clause | 4,744 |
# Under MIT license, see LICENSE.txt
""" Constantes concernant les tactiques. """
# Flags
INIT = 0
WIP = 1
FAILURE = 2
SUCCESS = 3
DEFAULT_TIME_TO_LIVE = 0.5
def is_complete(p_status_flag):
return p_status_flag == FAILURE or p_status_flag == SUCCESS
| agingrasc/StrategyIA | ai/STA/Tactic/tactic_constants.py | Python | mit | 256 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); ... | Ctrip-DI/Hue-Ctrip-DI | monitor/src/monitor/conf.py | Python | mit | 1,336 |
# coding=utf-8
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Item",
"_doctype": "Item",
"color": "#f39c12",
"icon": "octicon octicon-package",
"type": "link",
"link": "List/Item"
},
{
"module_name": "Customer",
"_doctype": "Custo... | adityaduggal/erpnext | erpnext/config/desktop.py | Python | gpl-3.0 | 11,448 |
"""engine.SCons.Tool.sunar
Tool-specific initialization for Solaris (Forte) ar (library archive). If CC
exists, static libraries should be built with it, so that template
instantians can be resolved.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic S... | ake-koomsin/mapnik_nvpr | scons/scons-local-2.2.0/SCons/Tool/sunar.py | Python | lgpl-2.1 | 2,593 |
import BaseHTTPServer
import SocketServer
import random
import time
from django.core.servers.basehttp import WSGIServer, WSGIRequestHandler
from django.conf import settings
class RandomWaitMixin(object):
def process_request(self, *args, **kwargs):
if getattr(settings, 'CONCURRENT_RANDOM_DELAY', None):
... | bancek/egradebook | src/lib/concurrent_server/servers.py | Python | gpl-3.0 | 1,319 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 15 15:12:48 2016
@author: acbart
"""
import matplotlib
import matplotlib.pyplot as plt
import real_estate
list_of_building = real_estate.get_buildings()
owned_VA = 0
leased_VA = 0
owned_PA = 0
leased_PA = 0
owned_MD = 0
leased_MD = 0
owned_buildings = []
leased_building... | RealTimeWeb/datasets | datasets/python/real_estate/test.py | Python | gpl-2.0 | 1,333 |
import copy
import flask
import pickle
import logging
from pprint import pprint
import os
import hashlib
from flask import Flask, request
from .pyfeed import startpoint
log = logging.getLogger()
log.level = logging.DEBUG
#fh = logging.FileHandler('/tmp/web.log')
formatter = logging.Formatter('%(asctime)s - %(name)s - ... | kushaldas/personalfeed | webfeed/__init__.py | Python | gpl-3.0 | 3,085 |
import json
data = json.load(open('input/knowit22'))
from sys import stdout
def valid(t):
ma = None
mi = None
seen_any_rect = False
for row in t:
ma_l = None
mi_l = None
seen_rect = False
in_rect = False
x = 0
for c in row:
if c:
... | matslindh/codingchallenges | knowit2016/knowit22.py | Python | mit | 1,854 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Imports
from PyQt4.QtGui import QDialog, QIcon
import ui_qtsixa_aboutw
class AboutW(QDialog, ui_qtsixa_aboutw.Ui_AboutW):
def __init__(self, *args):
QDialog.__init__(self, *args)
self.setupUi(self)
self.setWindowIcon(QIcon(":/icons/qtsixa.p... | Hannimal/raspicar | wiiController/QtSixA-1.5.1/qtsixa/gui/qtsixa_about.py | Python | unlicense | 328 |
# coding: utf-8
"""
jinja2schema.visitors.util
~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import jinja2.nodes
from ..mergers import merge
from ..model import Dictionary, Scalar, Unknown
def visit(node, macroses, config, predicted_struct_cls=Scalar, return_struct_cls=Unknown):
if isinstance(node, jinja2.nodes.Stmt):
... | aromanovich/jinja2schema | jinja2schema/visitors/util.py | Python | bsd-3-clause | 1,720 |
#! /usr/bin/env python
from __future__ import division, print_function
import pandas as pd
import sys
import os
import dill
import numpy as np
file_path = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.abspath(os.path.join(file_path, './'))
sys.path.append(lib_path)
import candle
additional_defini... | ECP-CANDLE/Benchmarks | common/calibration_main.py | Python | mit | 8,705 |
#!/usr/bin/env ipy
import clr
clr.AddReference("MyMediaLite.dll")
from MyMediaLite import *
# load the data
train_data = IO.ItemData.Read("u1.base")
test_data = IO.ItemData.Read("u1.test")
# set up the recommender
recommender = ItemRecommendation.UserKNN() # don't forget ()
recommender.K = 20
recommender.Feedback = ... | jashwanth9/Expert-recommendation-system | MyMediaLite-3.10/examples/python/item_recommendation.py | Python | apache-2.0 | 539 |
def quadratic_fitness(context, node):
return context['quadratic'][node].score(node.data.x, node.data.y)
| yarden-livnat/regulus | regulus/measures/quadratic.py | Python | bsd-3-clause | 108 |
#!/usr/bin/env python3
# TODO:
# FILES table: OBSOLETE column
# OBSOLETE says that this file was replaced by a newer version, for example checkrels may want to create a new file with only part of the output.
# Should this be a pointer to the file that replaced the obsolete one? How to signal a file that is obs... | mancoast/cado-nfs | scripts/cadofactor/wudb.py | Python | lgpl-2.1 | 73,432 |
# -*- coding: utf-8 -*-
# Copyright (C) 2005 Osmo Salomaa
#
# 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.
#
# This pr... | otsaloma/gaupol | gaupol/actions/help.py | Python | gpl-3.0 | 1,303 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click
from PIL import Image
from utils.misc import get_file_list
import re
def validate_dim(ctx, param, value):
percents = False
if value.endswith('%'):
value = value[:-1]
percents = True
if not re.match(r'^\d{1,6}(\.\d{1,6})?$', value)... | vladimirgamalian/pictools | resize.py | Python | mit | 1,240 |
# -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | henriquechehad/PySPED | pysped/nfe/leiaute/evtccenfe_100.py | Python | lgpl-2.1 | 5,642 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyRequestsMock(PythonPackage):
"""Mock out responses from the requests package."""
ho... | LLNL/spack | var/spack/repos/builtin/packages/py-requests-mock/package.py | Python | lgpl-2.1 | 567 |
# -* encoding: utf-8 *-
# 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/.
| gopythongo/gopythongo | src/py/gopythongo/shared/__init__.py | Python | mpl-2.0 | 225 |
import inspect
import asyncio
import typing as t
from .util import isasync
Feature = t.TypeVar("Feature")
SyncFeatureProvider = t.Callable[..., Feature]
AsyncFeatureProvider = t.Callable[..., t.Awaitable[Feature]]
FeatureProvider = t.Union[SyncFeatureProvider, AsyncFeatureProvider]
SyncProviderMap = t.Dict[Feature,... | xlevus/python-diana | diana/module.py | Python | mit | 3,199 |
# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2009 Rene Liebscher
#
# This program 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 3 of the License, or (at your option) any
# later ver... | arruda/pyfuzzy | fuzzy/norm/GeometricMean.py | Python | lgpl-3.0 | 1,017 |
# Copyright 2020 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... | tombstone/models | research/object_detection/dataset_tools/context_rcnn/generate_detection_data_tf1_test.py | Python | apache-2.0 | 10,558 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Tkinter import *
from ttk import Frame, Button, Style
class Example(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
sel... | RachaelT/UTDchess-RospyXbee | src/chessbot/src/gui.py | Python | mit | 775 |
# Copyright 2008 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 or agreed to in writing, ... | CubicERP/geraldo | site/newsite/site-geraldo/appengine_django/auth/tests.py | Python | lgpl-3.0 | 1,462 |
#!/usr/bin/env python
import sys
import requests
# r = requests.get('https://health.data.ny.gov/resource/child-and-adult-care-food-program-participation-beginning-2007.json?recall_id=94', headers={'X-App-Token': sys.argv[1]})
r = requests.get('https://health.data.ny.gov/resource/child-and-adult-care-food-program-part... | SUNY-Albany-CCI/NY-State-Health-Data-Code-A-Thon | python/example.py | Python | apache-2.0 | 399 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author Jonas Ohrstrom <[email protected]>
import sys
import time
import os
import socket
import string
import logging
from util import json
class DlsClient():
def __init__(self, dls_host, dls_port, dls_user, dls_pass):
self.dls_host = dls... | hzlf/openbroadcast | services/__orig_pypo/dls/dls_client.py | Python | gpl-3.0 | 3,067 |
# correlate.py Demo of retrieving signal buried in noise
# Released under the MIT licence.
# Copyright Peter Hinch 2018
# This simulates a Pyboard ADC acquiring a signal using read_timed. The signal is
# digital (switching between two fixed voltages) but is corrupted by a larger analog
# noise source.
# The output ar... | peterhinch/micropython-filters | non_realtime/correlate.py | Python | mit | 3,143 |
# Copyright (c) 2011 OpenStack Foundation
# 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 ... | openstack/nova | nova/scheduler/filters/compute_capabilities_filter.py | Python | apache-2.0 | 4,777 |
from django.db import models
class AbstractPersOAModel(models.Model):
"""
A model made for the PersOA app
"""
class Meta:
abstract = True
app_label = 'app'
| Saevon/PersOA | app/models/abstract.py | Python | mit | 190 |
from django.contrib import admin
from .models import AboutUs, Gallery
# Register your models here.
class AboutUsAdmin(admin.ModelAdmin):
fields = ['category', 'title', 'photo', 'text']
list_display = ('title','category',)
class GalleryAdmin(admin.ModelAdmin):
fields = ['category', 'title', 'photo', 'tex... | RachellCalhoun/cathotel | hotel/admin.py | Python | mit | 454 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/bb_backend/go.chromium.org/luci/common/proto/options.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.pro... | luci/luci-py | appengine/swarming/bb_backend_proto/go/chromium/org/luci/common/proto/options_pb2.py | Python | apache-2.0 | 5,626 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2022 Sébastien Helleu <[email protected]>
#
# 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 Lice... | weechat/weechat | tests/scripts/python/unparse.py | Python | gpl-3.0 | 36,671 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os.path
import sys
import tempfile
import types
import unittest
from contextlib import contextmanager
from django.template import Context, TemplateDoesNotExist
from django.template.engine import Engine
from django.test import SimpleTestCase, ignor... | vincepandolfo/django | tests/template_tests/test_loaders.py | Python | bsd-3-clause | 16,418 |
"""
<license>
CSPLN_MaryKeelerEdition; Manages images to which notes can be added.
Copyright (C) 2015, Thomas Kercheval
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... | SpaceKatt/CSPLN | scripts/reset_system.py | Python | gpl-3.0 | 2,393 |
"""Config flow to configure iss component."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_NAME, CONF_SHOW_ON_MAP
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from .binary_sensor import DEFAULT_NAME
from .const ... | rohitranjan1991/home-assistant | homeassistant/components/iss/config_flow.py | Python | mit | 2,741 |
from .submaker import Submaker
from inception.tools.signapk import SignApk
import shutil
import os
from inception.constants import InceptionConstants
class UpdatezipSubmaker(Submaker):
def make(self, updatePkgDir):
keys_name = self.getValue("keys")
signingKeys = self.getMaker().getConfig().getKeyCo... | tgalal/inception | inception/argparsers/makers/submakers/submaker_updatezip.py | Python | gpl-3.0 | 1,747 |
import unittest
import os
from katello.tests.core.action_test_utils import CLIOptionTestCase, CLIActionTestCase
from katello.tests.core.organization import organization_data
from katello.tests.core.template import template_data
import katello.client.core.template
from katello.client.core.template import Delete
from k... | iNecas/katello | cli/test/katello/tests/core/template/template_delete_test.py | Python | gpl-2.0 | 1,936 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | upworthy/luigi | test/server_test.py | Python | apache-2.0 | 5,438 |
# Copyright 2019 The Sonnet 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 applicable l... | deepmind/sonnet | sonnet/src/conformance/doctest_test.py | Python | apache-2.0 | 2,651 |
#lets try draw this tree!
decisionNode = dict(boxstyle = "sawtooth", fc="0.8")
leafNode = dict(boxstyle = "round4", fc="0.8")
arrow_args = dict(arrowstyle="<-")
def plotNode(nodeTxt, centerPt, parentPt, nodeType):
createPlot.axl.annotate(nodeTxt, xy=parentPt, xycoords="axes fraction", xytext=centerPt, textcoords="... | jenni4j/ML-from-scratch | trees/treePlotter.py | Python | mit | 2,781 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | DavidAndreev/indico | indico/modules/categories/util.py | Python | gpl-3.0 | 8,635 |
import os
import time
from cartas import Mazo, Carta
def _explicar(texto):
"""
Limpiar la pantalla y mostrar in texto recuadrado.
Args:
texto (str): Texto a mostrar en pantalla.
Examples:
::
-----------------------------------------------------
Esto es un tex... | martinber/guia-sphinx | ejemplos_sphinx/simple/magia/magia.py | Python | mit | 3,853 |
import os
import subprocess
import logging
import dateutil.parser
import collections
import xml.etree.ElementTree
import svn.constants
_logger = logging.getLogger('svn')
class CommonClient(object):
def __init__(self, url_or_path, type_, *args, **kwargs):
self.__url_or_path = url_or_path
self.__... | rnt/PySvn | svn/common.py | Python | gpl-2.0 | 15,416 |
#!/usr/bin/python2
"""
This file is part of ocean.
SEA 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.
SEA is distributed in the hope that... | neuromancer/ocean | ocean.py | Python | gpl-3.0 | 5,448 |
"""
Benchmark script to be used to evaluate the performace improvement of
the MKL with numpy.
Author: Suresh Shanmugam
"""
import os
import sys
import timeit
import numpy
from numpy.random import random
def test_eigenvalue():
"""
Test eigen value computation of a matrix
"""
i = 500
data = rando... | suresh/notes | python/mkl_benchmark.py | Python | mit | 2,320 |
from django.shortcuts import render, get_object_or_404, render_to_response, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout
from django.contrib import messages
from django.template import RequestContext
from django.http import *
from django.... | justinwiley/bluecard | idimport/views.py | Python | lgpl-3.0 | 4,968 |
# -*- 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 field 'AnswerRule.validate_with_min_value'
db.add_column(u'survey_answerrule', 'validate_with_min_v... | antsmc2/mics | survey/migrations/0083_auto__add_field_answerrule_validate_with_min_value__add_field_answerru.py | Python | bsd-3-clause | 28,210 |
# Copyright 2021 The TF-Coder 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... | google-research/tensorflow-coder | tf_coder/benchmarks/all_benchmarks.py | Python | apache-2.0 | 3,580 |
#
# Example: Find the floquet modes and quasi energies for a driven system and
# plot the floquet states/quasienergies for one period of the driving.
#
from qutip import *
from pylab import *
import time
def hamiltonian_t(t, args):
""" evaluate the hamiltonian at time t. """
H0 = args['H0']
H1 = args['H1']... | Vutshi/qutip | examples/ex_floquet_quasienergies.py | Python | gpl-3.0 | 3,299 |
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.utils.encoding import force_unicode
class CommentManager(models.Manager):
def for_model(self, model):
"""
QuerySet for all comments for a particular model (either an instance or
a class).
... | vosi/django-xcomments | comments/managers.py | Python | bsd-3-clause | 577 |
from predict import *
if __name__ == '__main__' :
# read and process data
print("Reading files...")
data = read_json(10000)
print("\nProcess data...")
X_train, X_test, Y_train, Y_test = get_processed_data(data)
# cross validation without modifying label
print("\nStart Cross Validation wi... | maggieli96/35-Final-Project | Machine Learning/main.py | Python | mit | 2,011 |
import datetime, math, sys, argparse
sys.path.append("../util")
# from osxnotifications import Notifier
from sqlalchemy import create_engine
from sqlalchemy.sql import select
from MetaModel import MetaModel
from multiprocessing import Pool
class MPTableProcessor():
def __init__(self, connection_string, tables... | mvanderkroon/cobr | profiler/MPTableProcessor.py | Python | apache-2.0 | 2,609 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from multiprocessing import Process
import os
import sys
from SimpleHTTPServer import SimpleHTTPRequestHandler
from SocketServer import TCPServer
import click
from staticpycon import utils, gen
def do_serve():
print('Listening... | PyConChina/PyConChina2017 | bin/app.py | Python | mit | 1,180 |
#!/usr/bin/env python3
# ***** BEGIN GPL LICENSE BLOCK *****
#
# 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
# of the License, or (at your option) any later version.
#
# This... | Passtechsoft/TPEAlpGen | blender/build_files/cmake/project_info.py | Python | gpl-3.0 | 7,548 |
import abc
from collections.abc import Mapping, MutableMapping
class MultiMapping(Mapping):
@abc.abstractmethod
def getall(self, key, default=None):
raise KeyError
@abc.abstractmethod
def getone(self, key, default=None):
raise KeyError
class MutableMultiMapping(MultiMapping, Mutab... | jonyroda97/redbot-amigosprovaveis | lib/multidict/_abc.py | Python | gpl-3.0 | 698 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <[email protected]>
#
# This program is free software; you can redistribute it and/or
# mod... | nielsbuwen/ilastik | ilastik/applets/dataSelection/dataLaneSummaryTableModel.py | Python | gpl-3.0 | 7,961 |
#!/usr/bin/env python
import numpy as np
import math
from multi_link_common import *
#height is probably 0 from multi_link_common.py
#total mass and total length are also defined in multi_link_common.py
num_links = 3.0
link_length = total_length/num_links
link_mass = total_mass/num_links
ee_location = np.matrix([0.,... | gt-ros-pkg/hrl-haptic-manip | hrl_common_code_darpa_m3/src/hrl_common_code_darpa_m3/robot_config/multi_link_three_planar.py | Python | apache-2.0 | 1,727 |
"""
Contains the manager class and exceptions for operations surrounding the creation,
update, and deletion on a Pulp user.
"""
from gettext import gettext as _
import re
from celery import task
from pulp.server import config
from pulp.server.async.tasks import Task
from pulp.server.db.model.auth import User
from pu... | rbramwell/pulp | server/pulp/server/managers/auth/user/cud.py | Python | gpl-2.0 | 7,971 |
from django.contrib.auth import views
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from imager_images.models import Photo
from registration.backends.hmac.views import RegistrationView
from django.views.generic.base import TemplateView
... | ilikesounds/django-imager | imagersite/views.py | Python | mit | 917 |
from django.shortcuts import render
# @todo get_http_page, returns tuple (status/headers, content)
# @todo rename get_http_status (move to core.http?)
# @todo what about fragments? normal.no/#doner
# http://docs.python-requests.org/en/latest/
import httplib
import urlparse
def get_http_status (urlstr):
url = urlp... | normalnorway/normal.no | django/core/shortcuts.py | Python | gpl-3.0 | 1,769 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.