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 |
|---|---|---|---|---|---|
import cv2
import numpy as np
def hsv_hist(roi,
lower_color_bound,
upper_color_bound,
color_channel,
bin_nb,
channel_range):
hsv_roi = cv2.cvtColor(roi, cv2.COLOR_BGR2HSV)
mask = cv2.inRange(hsv_roi, np.array(lower_color_bound), np.array(upper_c... | vwrobel/cvtools | cvtools/processes/featurer/hsv_hist.py | Python | mit | 499 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Comunitea Servicios Tecnológicos S.L.
# $Omar Castiñeira Saavedra$ <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | jgmanzanas/CMNT_004_15 | project-addons/product_stock_unsafety/mrp.py | Python | agpl-3.0 | 2,058 |
import os
import uuid
import httplib
import datetime
import jwe
import jwt
import furl
from flask import request
from flask import redirect
from flask import make_response
from modularodm.exceptions import NoResultsFound
from modularodm import Q
from framework import sentry
from framework.auth import cas
from framewo... | kch8qx/osf.io | website/addons/base/views.py | Python | apache-2.0 | 23,401 |
def max_contig_sum(L):
""" L, a list of integers, at least one positive
Returns the maximum sum of a contiguous subsequence in L """
max_contiguous_sum = 0
point = 0
for subsequence in range(len(L)):
current_subsequence = []
for index, number in enumerate(L[point:]):
if n... | Mdlkxzmcp/various_python | MITx/6002x/quiz_max_contig_sum.py | Python | mit | 1,639 |
"""
WSGI config for spa_movies project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | davgibbs/movies-spa | apps/spa_movies/wsgi.py | Python | gpl-3.0 | 397 |
import xml.etree.cElementTree as ET
from whoosh.fields import Schema, TEXT, KEYWORD
from whoosh.index import create_in
import shelve, os, sys
import cPickle
"""
Internal Stack Exchange - Indexer
---------------------------------
This module scans the available datadumps in the /Datadumps directory,
and... | Ranlevi/InternalSE | Sources/Indexer.py | Python | gpl-2.0 | 16,807 |
"""The Quantitative Imaging Profile (*QiPr*) REST server."""
__version__ = '6.2.12'
"""
The one-based major.minor.patch version. Minor and patch
version numbers begin at 1.
"""
| ohsu-qin/qirest | qirest/__init__.py | Python | bsd-2-clause | 178 |
# Copyright (c) 2018, Henrique Miranda
# All rights reserved.
#
# This file is part of the yambopy project
#
from yambopy import *
from math import sqrt
from time import time
from yambopy.tools.string import marquee
from yambopy.tools.funcs import abs2, lorentzian, gaussian
class YamboDipolesDB():
"""
Class to... | henriquemiranda/yambo-py | yambopy/dbs/dipolesdb.py | Python | bsd-3-clause | 9,640 |
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
from testrunner.local import testsuite
from testrunner.objects import testcase
FILES_PATTERN = re.compile(r"//\s+Files:(.*)")
MODULE_... | fceller/arangodb | 3rdParty/V8/v7.1.302.28/test/debugger/testcfg.py | Python | apache-2.0 | 2,660 |
# vi:set ts=8 sts=4 sw=4 et tw=80:
#
# Copyright (C) 2007 Xavier de Gaye.
#
# 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 version.
#
# This pr... | newclear/vim-pyclewn | pyclewn/clewn/evtloop.py | Python | gpl-2.0 | 6,023 |
#!/usr/bin/env python3
from collections import Counter
def are_anagrams(*args):
'return True if args are anagrams'
if len(args) < 2:
raise TypeError("expected 2 or more arguments")
c = Counter(args[0])
return all(c == Counter(a) for a in args[1:])
arg1 = "appel apple aplep leapp".split()
#pri... | kmad1729/python_notes | gen_progs/are_anagram.py | Python | unlicense | 432 |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | ravibhure/ansible | lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py | Python | gpl-3.0 | 16,757 |
from collections import deque
from numpy import array as ar
import numpy
class Bonus(object):
def __init__(self,gdim,sd = 0.2, nTurn=50,scoreModif=1,col = (160,160,160,200),colNiddle = (30,30,30,200)):
self.nTurn = nTurn
self.gdim = gdim
self.scoreModif = scoreModif
self.sd = sd
... | qgeissmann/ouroboros | bonus.py | Python | gpl-3.0 | 1,195 |
from tests.modules.ffi.base import BaseFFITest
from rpython.rtyper.lltypesystem.llmemory import (
cast_ptr_to_adr as ptr2adr, cast_adr_to_int as adr2int)
class TestMemoryPointer(BaseFFITest):
def test_its_superclass_is_Pointer(self, space):
assert self.ask(
space, "FFI::MemoryPointer.sup... | topazproject/topaz | tests/modules/ffi/test_memory_pointer.py | Python | bsd-3-clause | 1,775 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "image_bank.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| kgantsov/image_bank | manage.py | Python | gpl-2.0 | 253 |
'''
This file contains the manually chosen admin forms, as needed for an easy-to-use
editor.
'''
from django.contrib import admin
from django.conf import settings
from metashare.repository.editor import admin_site as editor_site
from metashare.repository.editor.resource_editor import ResourceModelAdmin, \
LicenceM... | JuliBakagianni/CEF-ELRC | metashare/repository/editor/manual_admin_registration.py | Python | bsd-3-clause | 11,138 |
import os
from quads.model import Cloud, Host
from quads.tools.ssh_helper import SSHHelper
LSHW_OUTPUT_DIR = "/var/www/html/lshw/"
def run_lshw(hostname: str, file_path: str) -> None:
"""
Connect via SSHHElper with the remote host and run lshw command
:param hostname: the remote host FQDN
:param fil... | redhat-performance/quads | quads/tools/lshw.py | Python | gpl-3.0 | 1,287 |
"""TLS Lite + asyncore."""
import asyncore
from gdata.tlslite.TLSConnection import TLSConnection
from AsyncStateMachine import AsyncStateMachine
class TLSAsyncDispatcherMixIn(AsyncStateMachine):
"""This class can be "mixed in" with an
L{asyncore.dispatcher} to add TLS support.
This class essentially si... | CollabQ/CollabQ | vendor/gdata/tlslite/integration/TLSAsyncDispatcherMixIn.py | Python | apache-2.0 | 4,739 |
# -*- coding: utf-8 -*-
""" Provides class to run TankCore from python """
import logging
import os
import sys
import time
import traceback
import fnmatch
from pkg_resources import resource_filename
from ..core import tankcore
class ApiWorker:
""" Worker class that runs tank core via python """
def __i... | nnugumanov/yandex-tank | yandextank/api/apiworker.py | Python | lgpl-2.1 | 6,566 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | TuSimple/mxnet | python/mxnet/ndarray/sparse.py | Python | apache-2.0 | 62,018 |
#!/usr/bin/env python
'''
decode RCDA messages from a log and optionally play back to a serial port. The RCDA message is
captures RC input bytes when RC_OPTIONS=16 is set
'''
import struct
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__)
parser.add_argument("--condition", default=None... | ArduPilot/ardupilot | Tools/scripts/rcda_decode.py | Python | gpl-3.0 | 1,487 |
#!/usr/bin/env python
#-
# Copyright (c) 2006 Verdens Gang AS
# Copyright (c) 2006-2015 Varnish Software AS
# All rights reserved.
#
# Author: Poul-Henning Kamp <[email protected]>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condition... | varnish/Varnish-Cache | lib/libvcc/generate.py | Python | bsd-2-clause | 28,728 |
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#
# 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; version 2 of the License.
#
# This program is distributed in th... | mysql/mysql-utilities | mysql-test/t/copy_user.py | Python | gpl-2.0 | 8,697 |
"""Example of filter functions
String values from templated files and objects are passed through this function. Values can be manipulated and passed
back to be used as jinja2 templated values.
"""
class FilterFunctions(object):
def test_filtering(self, contents): # pylint: disable=no-self-use
"""Functio... | Bridgewater/appetite | tests/filters/example.py | Python | apache-2.0 | 468 |
import urllib
import volatility.addrspace as addrspace
from PyFDP import FDP
class PyFDPAddressSpace(addrspace.BaseAddressSpace):
"""
FDP AddressSpace for volatility
"""
order = 1
def __init__(self, base, config, layered=False, **kwargs):
addrspace.BaseAddressSpace.__init__(self, base, ... | Winbagility/Winbagility | bindings/python/PyFDP/volFDP.py | Python | mit | 1,709 |
#!/usr/bin/env python
import numpy as np
import tensorflow as tf
# Model parameters
W = tf.Variable([.3])
b = tf.Variable([-.3])
# Model input and output
x = tf.placeholder(tf.float32)
linear_model = W * x + b
y = tf.placeholder(tf.float32)
# loss
loss = tf.reduce_sum(tf.square(linear_model - y))
# optimizer
optim... | DeercoderResearch/PhD | TensorFlow/ex2/complete_code.py | Python | mit | 804 |
#! /usr/bin/env python
## @package pygraylog.server
# This package is used to manage Graylog servers using its remote API thanks to requests.
#
import requests
import pygraylog
#from pygraylog.users import User
## The class used to connect against a Grafana instance
class Server:
## This is the constructor.
def __... | MisterG/pygraylog | pygraylog/server.py | Python | gpl-3.0 | 2,067 |
from django.apps import AppConfig
class OaConfig(AppConfig):
name = 'oa'
| htwenhe/DJOA | oa/apps.py | Python | mit | 79 |
from contrib.rfc3736 import builder
from contrib.rfc3736.constants import *
from scapy.all import *
from veripy.assertions import *
from veripy.models import ComplianceTestCase
class DHCPv6Helper(ComplianceTestCase):
def build_dhcpv6_advertisement(self, s, server, client, options=True, ias=True, T1=300, T2=300):... | mwrlabs/veripy | contrib/rfc3736/dhcpv6.py | Python | gpl-3.0 | 10,704 |
from popit.views.base import BasePopitView
from popit.serializers import LinkSerializer
from popit.models import Link
from popit.models import Person
from popit.models import Organization
from popit.models import Post
from popit.models import Membership
from popit.models import OtherName
from popit.models import Identi... | Sinar/popit_ng | popit/views/citation.py | Python | agpl-3.0 | 12,404 |
# -*- 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... | sasha-gitg/python-aiplatform | google/cloud/aiplatform/v1/schema/trainingjob/definition/__init__.py | Python | apache-2.0 | 4,992 |
import unittest
import pysal
from pysal.spatial_dynamics import ergodic
import numpy as np
class SteadyState_Tester(unittest.TestCase):
def setUp(self):
self.p = np.matrix([[.5, .25, .25], [.5, 0, .5], [.25, .25, .5]])
def test_steady_state(self):
obs = ergodic.steady_state(self.p).tolist()
... | badjr/pysal | pysal/spatial_dynamics/tests/test_ergodic.py | Python | bsd-3-clause | 1,837 |
# Copyright 2009-2014 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster 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 ... | muccg/StarCluster-plugins | plugins/slurm.py | Python | gpl-3.0 | 4,667 |
#!/home/mark/myResearch/django-farmersale/farmersale-env/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| MarkTseng/django-farmersale | farmersale-env/bin/django-admin.py | Python | mit | 174 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('djunin', '0023_auto_20160522_0657'),
]
operations = [
migrations.... | ercpe/djunin | djunin/migrations/0024_auto_20160708_0439.py | Python | gpl-3.0 | 1,011 |
# sqlalchemy/__init__.py
# Copyright (C) 2005-2017 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
from .sql import (
alias,
all_,
and_,
any_,
asc,
bet... | weisongchen/flaskapp | venv/lib/python2.7/site-packages/sqlalchemy/__init__.py | Python | mit | 2,217 |
#!/usr/bin/python
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
from urllib import urlopen
import requests
import getpass
from string import Template
import sys
i... | credits-currency/credits | qa/pull-tester/pull-tester.py | Python | mit | 8,944 |
import unittest, sys
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_browse as h2b
from h2o_test import find_file, dump_json, verboseprint
expectedZeros = [0, 4914, 656, 24603, 38665, 124, 13, 5, 1338, 51, 320216, 551128, 327648, 544044, 577981,
573487, 576189, 5686... | bikash/h2o-dev | py2/testdir_single_jvm/test_parse_covtype_2.py | Python | apache-2.0 | 3,121 |
# -*- coding: utf-8 -*-
"""
eve.flaskapp
~~~~~~~~~~~~
This module implements the central WSGI application object as a Flask
subclass.
:copyright: (c) 2015 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
import eve
import sys
import os
import copy
from flask import Flask
f... | amagdas/eve | eve/flaskapp.py | Python | bsd-3-clause | 34,822 |
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'll
... | edisonlz/fruit | web_project/base/site-packages/django/db/backends/postgresql_psycopg2/creation.py | Python | apache-2.0 | 3,814 |
from json import dumps
def test_ffflash_access_for_with_empty_paths(tmpdir, fffake):
f = fffake(
tmpdir.join('api_file.json'),
nodelist=tmpdir.join('nodelist.json'),
rankfile=tmpdir.join('rankfile.json'),
sidecars=[tmpdir.join('side.yaml'), tmpdir.join('cars.yaml')]
)
asse... | spookey/ffflash | tests/main/test_ffflash_access_for.py | Python | bsd-3-clause | 1,297 |
#!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import os
import re
import sys
import urllib
"""Logpuzzle exercise
Given an apache logfile, ... | vancouverwill/google-python-exercises | logpuzzle/logpuzzle.py | Python | apache-2.0 | 2,823 |
# coding=utf-8
# TestBenchmarkSwiftDictionary.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# S... | apple/swift-lldb | packages/Python/lldbsuite/test/benchmarks/swiftdictionary/TestBenchmarkSwiftDictionary.py | Python | apache-2.0 | 2,461 |
from lnst.Common.DeviceError import DeviceError
from lnst.Devices.Device import Device
from lnst.Devices.BridgeDevice import BridgeDevice
from lnst.Devices.OvsBridgeDevice import OvsBridgeDevice
from lnst.Devices.BondDevice import BondDevice
from lnst.Devices.TeamDevice import TeamDevice
from lnst.Devices.MacvlanDevice... | jpirko/lnst | lnst/Devices/__init__.py | Python | gpl-2.0 | 1,504 |
# Django settings for redeer project.
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'redeer.db',
'USER': '',
'PASSWORD': '',
... | davidszotten/redeer | redeer/settings.py | Python | mit | 4,840 |
# The content of this file was generated using the Python profile of libCellML 0.2.0.
from enum import Enum
from math import *
__version__ = "0.3.0"
LIBCELLML_VERSION = "0.2.0"
STATE_COUNT = 3
VARIABLE_COUNT = 19
class VariableType(Enum):
VARIABLE_OF_INTEGRATION = 1
STATE = 2
CONSTANT = 3
COMPUTED... | nickerso/libcellml | tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py | Python | apache-2.0 | 4,820 |
class InvalidMetadataError(Exception):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class NoFilesToBackUpError(Exception):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) | harsh8398/pybackup | pybackup/errors.py | Python | mit | 244 |
from flask.ext.wtf import Form
from wtforms import StringField, TextField
from wtforms.validators import DataRequired
class addForm(Form):
subject = StringField('subject', validators=[DataRequired()])
code = StringField('code', validators=[DataRequired()])
homework = TextField('homework', validators=[DataR... | Cuiyn/018works | app/forms.py | Python | gpl-2.0 | 331 |
import sys
from os.path import join, isfile
import os
import urllib.request
from zipfile import ZipFile
from win32com.shell import shell, shellcon
# download chrome driver
if not isfile('chromedriver.exe'):
chrome_driver_zipfilename = 'chromedriver_win32.zip'
chrome_driver_url='http://chromedriver.storage.... | bigjonroberts/webkiosk | install.py | Python | mit | 1,636 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <[email protected]>
# Copyright (C) Gabriel Potter <[email protected]>
# This program is published under a GPLv2 license
"""
Python 2 and 3 link classes.
"""
from __future__ import absolute_impor... | 6WIND/scapy | scapy/compat.py | Python | gpl-2.0 | 4,048 |
'''
Created on Sep 11, 2014
@author: Yintao Song
'''
from __future__ import print_function, division, absolute_import
from .globals import *
import numpy as np
from math import cos, sin, radians
def lp2B(a, b, c, beta):
"""lattice parameters to base, for monoclinic"""
B = np.array([[a,0,0],[0,b,0],[c*np.cos(r... | yintaosong/spacegroup | bonds/utils.py | Python | mit | 1,050 |
"""
This file is meant to make it easy to load the main features of
MoviePy by simply typing:
>>> from moviepy.editor import *
In particular it will load many effects from the video.fx and audio.fx
folders and turn them into VideoClip methods, so that instead of
>>> clip.fx( vfx.resize, 2 ) or equivalently vfx.resize... | kerstin/moviepy | moviepy/editor.py | Python | mit | 3,760 |
# import libraries
import numpy, pylab
from pylab import *
# plot DOF convergence graph
axis('equal')
pylab.title("Error convergence")
pylab.xlabel("CPU time")
pylab.ylabel("Error [%]")
data = numpy.loadtxt("conv_cpu_h1_aniso.dat")
x = data[:, 0]
y = data[:, 1]
loglog(x, y, "-s", label="h1-FEM (aniso)")
data = numpy.l... | hanak/hermes2d | doc/src/img/smooth-aniso-x/plot_graph_cpu.py | Python | gpl-2.0 | 917 |
#!/usr/bin/env python
"""server-net.py
Network server to handle network connections and pass commands
to projector emulators
"""
__version__ = '0.0.2'
_v = __version__.split(".")
__version_hex__ = int(_v[0]) << 24 | \
int(_v[1]) << 16 | \
int(_v[2]) << 8
import thread
import threa... | alisonken1/pyProjector | projector/test/server-net.py | Python | gpl-2.0 | 7,205 |
# Copyright (C) 2019 Compassion CH
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import html
from odoo import models, _
class MailMessage(models.Model):
"""
Extend the mail composer so that it can send message to archived partner,
and put back the selected partner in the claim in case i... | CompassionCH/compassion-modules | crm_request/models/mail_message.py | Python | agpl-3.0 | 2,051 |
"""
@file static_tree_like_tables.py
"""
from ..DatabaseSetup.base import Base
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
class AA(Base):
__tablename__ = "table_name_a_a"
id = Column(Integer, primary_key=True)
name = Column(String(250), nullable=F... | ernestyalumni/Propulsion | T1000/T1000/Model/static_tree_like_tables.py | Python | gpl-2.0 | 504 |
#__author__ = 'FuWei'
from __future__ import print_function, division
import sys
import pdb
from os import listdir
from os.path import isfile, join
# from table import *
class o(object):
def __init__(i, **filed):
i.__dict__.update(filed)
return i
class Row(object):
def __init__(i,data):
i.x = data[:-1]
... | ST-Data-Mining/crater | wei/data.py | Python | mit | 2,913 |
#!/usr/bin/env python
import argparse
import csv
import os.path
import sys
try:
__import__('yomeka')
except ImportError:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
__import__('yomeka')
from yomeka.classic.omeka_classic_rest_api_client import OmekaClassicRestApiClient... | minorg/yomeka | bin/yomeka_cli.py | Python | bsd-2-clause | 3,363 |
#! /usr/bin/env python2
#######################################################################
# #
# Copyright 2014 Cristian C Lalescu #
# #
# This ... | chichilalescu/py3Dpdf | examples/vector_field.py | Python | gpl-3.0 | 3,252 |
import json
import webapp2
import logging
from google.appengine.ext import ndb
import ndbTools
import modelInventory
import modelUser
import modelStore
import modelSupplier
import modelPaymentMethod
import modelPurchaser
import modelSaleTransaction
import modelTest
class RestHandler(webapp2.RequestHandler):
def ... | jmtoung/26p | main.py | Python | apache-2.0 | 6,943 |
# coding=utf-8
"""Daily searcher module."""
from __future__ import unicode_literals
import logging
import threading
from builtins import object
from datetime import date, datetime, timedelta
from medusa import app, common
from medusa.db import DBConnection
from medusa.helper.common import try_int
from medusa.helper... | fernandog/Medusa | medusa/search/daily.py | Python | gpl-3.0 | 4,443 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Data/AssetDigestEntry.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... | polzy/PokeManager | pogo/POGOProtos/Data/AssetDigestEntry_pb2.py | Python | mit | 4,026 |
#-------------------------------------------------------------------------------
# Name: process_DNAI
# Purpose:
#
# Author: Ramakrishna
#
# Created: 17/04/2014
# Copyright: (c) Ramakrishna 2014
# Licence: <your licence>
#----------------------------------------------------------------------------... | brkrishna/freelance | bolly_reviews/process_ETC.py | Python | gpl-2.0 | 2,339 |
# Third-party
import astropy.units as u
import numpy as np
import pytest
# Custom
from ....potential import (NullPotential, NFWPotential,
HernquistPotential, KuzminPotential,
ConstantRotatingFrame, StaticFrame)
from ....dynamics import PhaseSpacePosition, combine
f... | adrn/gary | gala/dynamics/nbody/tests/test_nbody.py | Python | mit | 7,395 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Laurawly/tvm-1 | tests/python/contrib/test_cmsisnn/test_softmax.py | Python | apache-2.0 | 4,949 |
# Copyright 2012 Michael Still and Canonical 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
#
# ... | viggates/nova | nova/tests/virt/libvirt/test_imagecache.py | Python | apache-2.0 | 37,204 |
"""Cobertura Jenkins plugin coverage report collector base classes."""
from abc import ABC
from base_collectors import JenkinsPluginCollector
from model import SourceMeasurement, SourceResponses
class CoberturaJenkinsPluginBaseClass(JenkinsPluginCollector, ABC): # skipcq: PYL-W0223
"""Base class for Cobertura ... | ICTU/quality-time | components/collector/src/source_collectors/cobertura_jenkins_plugin/base.py | Python | apache-2.0 | 1,062 |
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from rudi.models import Team
LABEL_STREET = _("Straße")
LABEL_POSTAL_CODE = _("PLZ")
LABEL_CITY = _("Stadt")
LABEL_DOORBELL... | lexxodus/rudi | forms.py | Python | agpl-3.0 | 4,287 |
__author__ = 'Ivan'
from django import forms
from lite_note import models
class NoteCreateForm(forms.ModelForm):
class Meta:
model = models.Note
fields = ('title', 'category', 'note', )
class NoteForm(forms.ModelForm):
is_favorite = forms.BooleanField()
is_public = forms.BooleanField()
... | Shiwin/LiteNote | lite_note/forms.py | Python | gpl-2.0 | 390 |
"""This module implements a class that..."""
from __future__ import print_function, unicode_literals
from builtins import map
import logging
import re
from kivy.app import App
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.properties import StringProperty
from kivy.uix.popup import Popup
... | hajicj/MUSCIMarker | MUSCIMarker/objid_selection.py | Python | apache-2.0 | 5,487 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ESCOM.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| CallmeTorre/Idalia | ESCOM/manage.py | Python | apache-2.0 | 248 |
import click
from groceries import __version__
from groceries.config import Wizard
from groceries.utils import Item
@click.group()
@click.option('-c', '--config', default='.groceries.yml',
envvar='GROCERIES_CONFIG', callback=Wizard(),
help='Location of the configuration file.')
@click.pas... | Mytho/groceries-cli | groceries/core.py | Python | mit | 1,497 |
def agts(queue):
bulk = queue.add('bulk.py', ncpus=4, walltime=6)
surf = queue.add('surface.py', ncpus=4, walltime=6)
sigma = queue.add('sigma.py', deps=[bulk, surf])
queue.add('fig2.py', deps=sigma, creates='fig2.png')
| robwarm/gpaw-symm | doc/tutorials/jellium/jellium.agts.py | Python | gpl-3.0 | 236 |
"""
Django settings for dojob project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | oxente/dojob | dojob/settings.py | Python | gpl-2.0 | 1,969 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1, 6))
fib = 0
for num in it:
fib += num
self.assertEqual(15, fib)
def test_iterating_with_next(self):
... | bnmalcabis/testpy | python2/koans/about_iteration.py | Python | mit | 3,274 |
# 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... | aldian/tensorflow | tensorflow/python/keras/distribute/keras_premade_models_test.py | Python | apache-2.0 | 3,689 |
#-------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions ... | enthought/traitsgui | enthought/pyface/dock/dock_window_shell.py | Python | bsd-3-clause | 7,733 |
from tests.Dispatcher.DataCreator import CreateDeviceData
import json
import unittest
from bin.Devices.Containers.ContainersDevice import ContainersDevice
from bin.Devices.Containers.ContainersManager import EventlessContainersManager, NullContainersManager, \
ContainersManager
from bin.Devices.Containers.Container... | rCorvidae/OrionPI | src/tests/Devices/Containers/TestContainersDeviceAndManager.py | Python | mit | 2,509 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
... | benemery/wagtail | wagtail/wagtailusers/south_migrations/0001_initial.py | Python | bsd-3-clause | 356 |
from debian_tools.debian_tools import DebianTools
def test_run_without_arguments() -> None:
try:
DebianTools([])
assert False
except SystemExit as exception:
assert str(exception) == '1'
def test_run_with_help_argument() -> None:
try:
DebianTools(['--help'])
asser... | FunTimeCoding/debian-tools | tests/test_debian_tools.py | Python | mit | 1,513 |
from workalendar.core import WesternCalendar, ChristianMixin
from workalendar.core import MON, TUE, FRI
from datetime import date
class Australia(WesternCalendar, ChristianMixin):
"Australia"
include_good_friday = True
include_easter_monday = True
include_queens_birthday = False
include_labour_day... | ChrisStevens/workalendar | workalendar/oceania.py | Python | mit | 9,639 |
#!/usr/bin/env python
import Queue
import argparse
import json
import os
import traceback
import yaml
from Tkinter import *
from twisted.internet import protocol, utils, task, tksupport, reactor
from twisted.python import failure
from cStringIO import StringIO
import urllib2
# from datetime import datetime
# from urll... | Gustra/tiny-dash | bin/tiny-dash.py | Python | mit | 24,479 |
# 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... | alsrgv/tensorflow | tensorflow/python/ops/distributions/util.py | Python | apache-2.0 | 55,467 |
import socket
#Define the different cases that this listener will respond to
#The listener responds to commands in the format {command arg 1, arg 2, ... arg n}
def network_command(recvString):
#get the command, it should be the first word
recvComm = recvString.split()
#Check which command was recieved, if not re... | otoolebrian/Watering-Can | raspberry/listener/WCListener.py | Python | apache-2.0 | 1,127 |
import logging
from autotest.client.shared import error
from virttest import aexpect
from virttest import utils_misc
from virttest import env_process
@error.context_aware
def run(test, params, env):
"""
KVM reboot test:
1) Log into a guest with virtio data disk
2) Format the disk and copy file to it
... | uni-peter-zheng/tp-qemu | qemu/tests/readonly_disk.py | Python | gpl-2.0 | 2,593 |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class ImageList(QListWidget):
def __init__(self, *args, **kwargs):
super(ImageList, self).__init__(*args, **kwargs)
self.setViewMode(QListView.IconMode)
self.setIconSize(QSize(100, 100))
self.setSpa... | bluec0re/pascal-utils | widgets.py | Python | gpl-3.0 | 1,267 |
"""Performance example of running native ASTRA vs using ODL for reconstruction.
In this example, a 512x512 image is reconstructed using the Conjugate Gradient
Least Squares method on the GPU.
In general, ASTRA is faster than ODL since it does not need to perform any
copies and all arithmetic is performed on the GPU. ... | odlgroup/odl | examples/tomo/backends/astra_performance_cuda_parallel_2d_cg.py | Python | mpl-2.0 | 2,904 |
# -*- coding: utf-8 -*-
import re
from django import forms
from django.contrib.auth.models import User
from django.forms import formset_factory
from django.forms.widgets import TextInput
from django.utils import timezone
from dal import autocomplete
from tagging.fields import TagField
import accounts.utils
from bulb... | enjaz/enjaz | bulb/forms.py | Python | agpl-3.0 | 15,723 |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2011 - 2014 by Wilbert Berendsen
#
# 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
... | shimpe/frescobaldi | frescobaldi_app/rhythm/rhythm.py | Python | gpl-2.0 | 2,875 |
import time
from core import logger
from core.auto_process.common import ProcessResult
from core.auto_process.managers.sickbeard import SickBeard
import requests
class PyMedusa(SickBeard):
"""PyMedusa class."""
def __init__(self, sb_init):
super(PyMedusa, self).__init__(sb_init)
def _create_ur... | clinton-hall/nzbToMedia | core/auto_process/managers/pymedusa.py | Python | gpl-3.0 | 6,117 |
#!env/bin/python
# -*- coding: utf8 -*-
# Utility to merge two versions of the same sqlite3 database.
#Copyright (C) 2015 J. Pablo Navarro
#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 Softw... | helfio/sqlite_merger | main.py | Python | gpl-2.0 | 3,579 |
"""
Authentication example using Flask-Login
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This provides a simple example of using Flask-Login as the authentication
framework which can guard access to certain API endpoints.
This requires the following Python libraries to be installed:
* Flask
... | dnordberg/flask-restless | examples/server_configurations/authentication/__main__.py | Python | agpl-3.0 | 4,483 |
# This file is part of the django-environ.
#
# Copyright (c) 2021, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
# For the full copyright and license information, please view
# the LICENSE.txt file that was distributed with this source code.
from envi... | joke2k/django-environ | tests/fixtures.py | Python | mit | 3,765 |
# encoding: utf-8
# module samba.dcerpc.drsblobs
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/drsblobs.so
# by generator 1.135
""" drsblobs DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class ExtendedErrorInfo(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs):... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/drsblobs/ExtendedErrorInfo.py | Python | gpl-2.0 | 2,097 |
# Gambit scripts
#
# Copyright (C) USC Information Sciences Institute
# Author: Nibir Bora <[email protected]>
# URL: <http://cbg.isi.edu/>
# For license information, see LICENSE
import os
import sys
import csv
import math
import nltk
import shutil
import anyjson
import psycopg2
import itertools
import cPickle as pickle
i... | nbir/gambit-scripts | scripts/nba_predictions/src/data.py | Python | apache-2.0 | 7,811 |
from django.core.management.base import BaseCommand
from theapps.sitemaps import ping_google
class Command(BaseCommand):
help = "Ping google with an updated sitemap, pass optional url of sitemap"
def execute(self, *args, **options):
if len(args) == 1:
sitemap_url = args[0]
else:
... | thepian/theapps | theapps/sitemaps/management/commands/ping_google.py | Python | gpl-3.0 | 396 |
#
# 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... | irinabov/debian-qpid-proton | python/tests/proton_tests/reactor.py | Python | apache-2.0 | 19,807 |
# -*- coding: utf-8 -*-
# Copyright (c) 2005-2008, California Institute of Technology
# Copyright (c) 2017, Albert-Ludwigs-Universität Freiburg
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
... | strawlab/drosophila_eye_map | drosophila_eye_map/make_buchner_interommatidial_distance_figure.py | Python | bsd-2-clause | 7,446 |
# -*- coding: utf-8 -*-
# The definition of an OrObject
class OrObject(object):
overrides = {}
def __init__(self, name="[anon]", classobj=None):
assert type(name) == type(""), "Name must be a string"
self.dict = {}
self.set("$$name", name)
self.set("$$class", classobj)
d... | pavpanchekha/oranj | oranj/core/objects/orobject.py | Python | gpl-3.0 | 6,197 |
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from rest_framework import reverse
from druidapi.query.models import QueryModel
from models import Result
from forms import SearchForm
imp... | nalabelle/druid-django | frontend/views.py | Python | mit | 1,868 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.