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 apps.highcharts import views
from django.urls import path
app_name = 'highcharts'
urlpatterns = [
path('total', views.total, name='total'),
path('total-by-month', views.total_by_month, name='total_by_month'),
]
| thinkAmi/dj_ringo_tabetter | apps/highcharts/urls.py | Python | mit | 226 |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('shakeapp.views',
# Examples:
#url(r'^shakeApp/', 'shakeApp.views.index'),
url(r'^$', 'index', name= 'indexname'),
url(r'^shakeApp/$', ... | keithlee/shakeAppPyDev | urls.py | Python | bsd-3-clause | 1,525 |
import inspect
import sys
import types
from copy import deepcopy
import pickle as pypickle
try:
import cPickle as cpickle
except ImportError:
cpickle = None
if sys.version_info < (2, 6): # pragma: no cover
# cPickle is broken in Python <= 2.5.
# It unsafely and incorrectly uses relative instead of a... | frac/celery | celery/utils/serialization.py | Python | bsd-3-clause | 4,836 |
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _
from rest_framework.fields import IntegerField, empty, SkipField
class RelatedPrimaryKeyField(IntegerField):
"""
Field that validates primary key values for nested serializers.
"""
def __init_... | HelloLily/hellolily | lily/api/nested/fields.py | Python | agpl-3.0 | 2,637 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | crmccreary/openerp_server | openerp/addons/email_template/res_partner.py | Python | agpl-3.0 | 1,605 |
"""
Grabs the administration and authentication logs from the Duo Security
API and sends CEF-compliant syslog messages.
Error/Debug Logs:
Setting the 'DEBUG' flag in the conf.ini file prints all the
CEF messages to a file specified in 'DEBUG_FILE'. By default,
this is written to 'debug.log'. All exceptions are logged... | RyPeck/duo_log_grabber | duo_log_grabber.py | Python | gpl-3.0 | 7,901 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | felipenaselva/felipe.repository | script.module.placenta/lib/resources/lib/sources/en/genvideos.py | Python | gpl-2.0 | 2,967 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
from setuptools import find_packages
name = 'firecares-harvester'
package = 'harvester'
description = 'FireCARES Harvester'
url = 'https://github.com/FireCARES/harvester'
author = 'Prominent Edge'
author_email = 'contact@pr... | FireCARES/harvester | setup.py | Python | gpl-2.0 | 2,346 |
import logging
from django.conf import settings
from django.db.models.signals import pre_delete
from django.dispatch import receiver
from kuma.wiki.models import Document
from kuma.wiki.search import WikiDocumentType
from kuma.wiki.signals import render_done
from kuma.wiki.tasks import index_documents, unindex_docume... | jwhitlock/kuma | kuma/search/signal_handlers.py | Python | mpl-2.0 | 1,780 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-15 09:34
from __future__ import unicode_literals
from django.db import migrations
def rename_settings(apps, schema_editor):
"""Rename settings."""
LocalConfig = apps.get_model("core", "LocalConfig")
lc = LocalConfig.objects.first()
condi... | bearstech/modoboa | modoboa/core/migrations/0012_auto_20170215_1034.py | Python | isc | 879 |
'''
reStructuredText renderer
=========================
.. versionadded:: 1.1.0
`reStructuredText <http://docutils.sourceforge.net/rst.html>`_ is an
easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser
system.
.. warning::
This widget is highly experimental. The whole styling and
im... | manashmndl/kivy | kivy/uix/rst.py | Python | mit | 32,167 |
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frederic Rodrigo 2017 ##
## ... | tkasp/osmose-backend | modules/languages.py | Python | gpl-3.0 | 5,429 |
# -*- coding: UTF-8 -*-
"""
Name: generic_task.py
Porpose: Execute a generic task with FFmpeg
Compatibility: Python3 (Unix, Windows)
Author: Gianluca Pernigotto <jeanlucperni@gmail.com>
Copyright: (c) 2018/2022 Gianluca Pernigotto <jeanlucperni@gmail.com>
license: GPL3
Rev: Feb.14.2022
Code checker:
flake8: --ignor... | jeanslack/Videomass | videomass/vdms_threads/generic_task.py | Python | gpl-3.0 | 3,294 |
# Microsoft Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
#
# 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... | Azure/WALinuxAgent | tests/protocol/test_imds.py | Python | apache-2.0 | 30,527 |
from tastypie.resources import ModelResource, ALL
from .models import Filer, Filing
from .utils.serializer import CIRCustomSerializer
class FilerResource(ModelResource):
class Meta:
queryset = Filer.objects.all()
serializer = CIRCustomSerializer()
filtering = {'filer_id_raw': ALL}
... | myersjustinc/django-calaccess-campaign-browser | calaccess_campaign_browser/api.py | Python | mit | 545 |
#!/usr/bin/env python
"""Define object that contains the answer."""
import ast
__author__ = 'juan pablo isaza'
class Solution:
"""
Contains the data describing the solution to the puzzle.
"""
def __init__(self, function, rules, processed_rules, implementation=[]):
"""
:param functi... | jisazaTappsi/shatter | shatter/solution.py | Python | mit | 813 |
"""Linear Estimators."""
# Copyright 2015-present The Scikit Flow 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/LICENS... | natanielruiz/android-yolo | jni-build/jni/include/tensorflow/contrib/linear_optimizer/python/sdca_optimizer.py | Python | apache-2.0 | 8,681 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jkyeung/XlsxWriter | xlsxwriter/test/comparison/test_chart_display_units08.py | Python | bsd-2-clause | 1,422 |
from __future__ import unicode_literals
import os
import sys
from django.core.wsgi import get_wsgi_application
path = '/var/www'
if path not in sys.path:
sys.path.insert(0, '/var/www/testsite')
sys.path.append('/var/www/testsite/blog/')
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
PROJECT_ROOT = os.path.dirnam... | andfoy/margffoy-tuay-server | blog/wsgi.py | Python | gpl-2.0 | 543 |
import os
from contextlib import contextmanager
def traverse_parents(path, include_current=False):
if not include_current:
path = os.path.dirname(path)
previous = None
while previous != path:
yield path
previous = path
path = os.path.dirname(path)
@contextmanager
def mon... | archifix/settings | sublime/Packages/Jedi - Python autocompletion/dependencies/jedi/common/utils.py | Python | mit | 612 |
#!/usr/bin/env python
"""
Copyright (c) 2015-2017 Alan Yorinks All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
Version 3 as published by the Free Software Foundation; either
or (at your option) any later version... | MrYsLab/PyMata | examples/servo/servo_demo.py | Python | agpl-3.0 | 1,592 |
"""
Exececute custom commands
"""
import logging
from teuthology import misc as teuthology
log = logging.getLogger(__name__)
def task(ctx, config):
"""
Execute commands on a given role
tasks:
- ceph:
- kclient: [client.a]
- exec:
client.a:
- "echo 'm... | ceph/teuthology | teuthology/task/exec.py | Python | mit | 2,339 |
#!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import numpy as np
np.set_printoptions(threshold=np.nan)
import tensorflow as tf
# wrapper functions
def convolve_inner_layers(x, W, b):
x = tf.nn.conv2d(x, W, strides = [1,1,1,1], padding='SAME')
x = tf.nn.bias_add(x, b)
return tf.nn.... | michaelneuder/image_quality_analysis | bin/nets/old/working_doc.py | Python | mit | 1,986 |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def tree2str(self, t: TreeNode) -> str:
if t is None:
return ''
left = '({})'.format(self.tree2str(t.left)) if t.left o... | jiadaizhao/LeetCode | 0601-0700/0606-Construct String from Binary Tree/0606-Construct String from Binary Tree.py | Python | mit | 467 |
# -*- coding:utf-8 -*-
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
vm = test_lib.lib_get_specific_stub('e2e_mini/vm', 'vm')
vm_ops = None
vm_name_list = ['vm-' + vm.get_time_postfix() for _ in range(3)]
def test():
global vm_ops
vm_ops = vm.VM()
for vm_nam... | zstackio/zstack-woodpecker | integrationtest/vm/e2e_mini/vm/test_delete_resume_vms_batch.py | Python | apache-2.0 | 1,033 |
# -*- coding: utf-8 -*-
import random
import time
from devp2p.utils import int_to_big_endian
from devp2p import kademlia
import pytest
import gevent
random.seed(42)
class WireMock(kademlia.WireInterface):
messages = [] # global messages
def __init__(self, sender):
assert isinstance(sender, kademli... | ms83/pydevp2p | devp2p/tests/test_kademlia_protocol.py | Python | mit | 13,421 |
"""Generic testing tools.
In particular, this module exposes a set of top-level assert* functions that
can be used in place of nose.tools.assert* in method generators (the ones in
nose can not, at least as of nose 0.10.4).
Authors
-------
- Fernando Perez <Fernando.Perez@berkeley.edu>
"""
from __future__ import abs... | cloud9ers/gurumate | environment/lib/python2.7/site-packages/IPython/testing/tools.py | Python | lgpl-3.0 | 12,032 |
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""
Tools f... | nuclear-wizard/moose | python/MooseDocs/common/parse_settings.py | Python | lgpl-2.1 | 2,614 |
# -*- coding: utf-8-*-
import re
def isNegative(phrase):
"""
Returns True if the input phrase has a negative sentiment.
Arguments:
phrase -- the input phrase to-be evaluated
"""
return bool(re.search(r'\b(no(t)?|don\'t|stop|end)\b', phrase,
re.IGNORECASE))
def i... | tdmike/SASCHA | sascha/app_utils.py | Python | mit | 570 |
# Copyright 2014 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 by applicable law or... | jinhou/cuda-convnet2 | python_util/data.py | Python | apache-2.0 | 7,803 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | jcsp/manila | manila/share/__init__.py | Python | apache-2.0 | 1,027 |
"""
Feature agglomeration. Base classes and functions for performing feature
agglomeration.
"""
# Author: V. Michel, A. Gramfort
# License: BSD 3 clause
import numpy as np
from ..base import TransformerMixin
###############################################################################
# Mixin class for feature agg... | joshbohde/scikit-learn | sklearn/cluster/_feature_agglomeration.py | Python | bsd-3-clause | 2,262 |
from bson.objectid import ObjectId
import mock
from pulp.common.compat import unittest
from pulp.server import exceptions
from pulp.server.webservices.views import serializers
class TestBaseSerializer(unittest.TestCase):
def test_init_all_options(self):
"""
test with everything possible specifie... | ulif/pulp | server/test/unit/server/webservices/views/serializers/test_serializers.py | Python | gpl-2.0 | 26,811 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lothian/psi4 | psi4/driver/p4util/p4regex.py | Python | lgpl-3.0 | 1,207 |
# *-* coding:utf-8 *-*
"""Module states Pernanbuco"""
def start(st_reg_number):
"""Checks the number valiaty for the Piaui state"""
divisor = 11
if len(st_reg_number) > 9:
return False
if len(st_reg_number) < 9:
return False
sum_total = 0
peso = 9
for i in range(len... | matheuscas/pyIE | ie/pi.py | Python | mit | 618 |
# -*- coding: utf-8 -*-
#
# Acme documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 21 12:22:34 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | mmontone/acme | doc/developer-manual/conf.py | Python | mit | 10,284 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import sorl.thumbnail.fields
import embed_video.fields
import cambiaahora.utils
import ckeditor.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrati... | CARocha/plataforma_fadcanic | biblioteca/migrations/0001_initial.py | Python | mit | 3,646 |
from datetime import datetime
import geojson
from django.contrib.gis.geos import GEOSGeometry
_max_length = None
def _get_max_lengths(field_map):
from ..models import Submission
res = {}
for field in field_map:
res[field] = Submission._meta.get_field(field).max_length
return res
def parse... | shirone/angkot | angkot/route/submission/data.py | Python | agpl-3.0 | 1,535 |
# Problem 9: Special Pythagorean triplet
# https://projecteuler.net/problem=9
#
def is_pythagorean_triplet(a, b, c):
return a**2 + b**2 == c**2
# given n, generate triplet a < b < c and a + b + c = n
def abc_gf(n):
for c in range(n//3, n):
for b in range((n-c)//2, n-c):
a = ... | yehnan/project_euler_python | p009.py | Python | mit | 750 |
# coding: utf-8
# tools.py written by Duncan Murray 20/3/2014 (C) Acute Software
# Script to configure the functional toolbox of AIKIF
import os
import sys
import time
from random import randint
import aikif.toolbox.Toolbox as mod_tool
import aikif.config as mod_cfg
aikif_dir = mod_cfg.core_folder # os.path.dirname(o... | acutesoftware/AIKIF | aikif/.z_prototype/tools.py | Python | gpl-3.0 | 4,110 |
# """All things dealing strictly with the GUI."""
##
# Copyright 2013 Chad Spratt
# 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
#
... | chadspratt/AveryDB | gui.py | Python | apache-2.0 | 16,903 |
# Copyright 2017 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 base64
import logging
import six
from google.protobuf import json_format, text_format
_BASE64_ENCODING_ERROR = TypeError
if six.PY3:
i... | luci/luci-py | appengine/components/components/prpc/encoding.py | Python | apache-2.0 | 2,929 |
# 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 RYaqcaffy(RPackage):
"""Affymetrix expression data quality control and reproducibility ana... | LLNL/spack | var/spack/repos/builtin/packages/r-yaqcaffy/package.py | Python | lgpl-2.1 | 1,128 |
import collections
from supriya import CalculationRate
from supriya.ugens.MultiOutUGen import MultiOutUGen
class Rotate2(MultiOutUGen):
"""
Equal-power sound-field rotator.
::
>>> x = supriya.ugens.PinkNoise.ar() * 0.4
>>> y = supriya.ugens.LFTri.ar(frequency=880)
>>> y *= supri... | Pulgama/supriya | supriya/ugens/Rotate2.py | Python | mit | 1,034 |
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | arve0/leicascanningtemplate | docs/conf.py | Python | mit | 8,285 |
# stdlib
from datetime import datetime, timedelta
import unittest
# 3rd party
from nose.plugins.attrib import attr
import requests
import simplejson as json
from tornado.web import Application
# project
from config import get_version
from ddagent import (
APIMetricTransaction,
APIServiceCheckTransaction,
... | oneandoneis2/dd-agent | tests/core/test_transaction.py | Python | bsd-3-clause | 7,203 |
from helper import config_merger
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/'
def GlobalComputeUrl(project, collection, name):
return ''.join([
COMPUTE_URL_BASE, 'projects/', project, '/global/', collection, '/',
name
])
def ZonalComputeUrl(project, zone, collection... | aljim/deploymentmanager-samples | community/hierarchical_configuration/Organization_with_departments/systems/my_ecom_system/templates/simple_frontend.py | Python | apache-2.0 | 2,226 |
from BeautifulSoup import BeautifulSoup
import requests
import json
import argparse
class Bot:
def __init__(self, username, password):
self.username = username
self.password = password
def run(self):
self.login()
players = self.players()
self.placeOffer(players)
de... | tomave/comunio-trade-bot | tradebot.py | Python | gpl-3.0 | 2,222 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Meta) on 2016-06-23.
# 2016, SMART Health IT.
from . import element
class Meta(element.Element):
""" Metadata about a resource.
The metadata about a resource. This is content in th... | all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_1_0_6/models/meta.py | Python | bsd-3-clause | 2,174 |
#! /usr/bin/env python
########################################################################
# File : dirac-stager-monitor-file
# Author : Daniela Remenska
########################################################################
"""
Give monitoring information regarding a staging file uniquely identified with (L... | DIRACGrid/DIRAC | src/DIRAC/StorageManagementSystem/scripts/dirac_stager_monitor_file.py | Python | gpl-3.0 | 4,435 |
from openerp.tests.common import TransactionCase
from openerp import netsvc, workflow
class TestCheckJournalEntry(TransactionCase):
"""
Check journal entries when the expense product is having tax which is tax included.
"""
def setUp(self):
super(TestCheckJournalEntry, self).setUp()
... | ncliam/serverpos | openerp/addons/hr_expense/tests/test_journal_entries.py | Python | agpl-3.0 | 2,923 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable-all
import os
import re
import sys
import codecs
import shutil
import argparse
from textwrap import dedent
from chardet import detect
from pysrt import SubRipFile, SubRipTime, VERSION_STRING
def underline(string):
return "\033[4m%s\033[0m" % string
... | dantebarba/docker-media-server | plex/Subliminal.bundle/Contents/Libraries/Shared/pysrt/commands.py | Python | gpl-3.0 | 8,470 |
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
# OpenFlow 1.2 upgrade, modified for peering exchanges by Sam Russell 2013
#
# 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
#
#... | samrussell/ryu | ryu/app/spe.py | Python | apache-2.0 | 11,862 |
# The MIT License (MIT)
#
# Copyright (c) 2016 Ryan Brady <ryan@ryanbrady.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
#... | rbrady/filch | filch/utils.py | Python | mit | 2,709 |
import sys
import socket
import select
import threading
import struct
import time
class S5Req:
def __init__(self,buf):
self.ver, self.cmd, self.rsv, self.atyp = struct.unpack("BBBB", buf[0:4])
self.dst_addr = None
self.dst_port = None
def parse_port(self,buf):
if len(buf) <... | wzyuliyang/ceph-note | tools/sock5server.py | Python | mit | 5,071 |
import unittest
from db import db
from sample_data.data1 import *
from Model.URL import URL
'''
Testing URLs Model
'''
class test_URLs(unittest.TestCase):
def setUp(self):
#self.os = OS()
pass
def tearDown(self):
pass
def test_Add(self):
print "Testing Adding URLs"
count = 1
for url in urls:
m... | CMPUT404-Fall2016/cmput404-project | UnitTests/Model/test_URL_db.py | Python | gpl-3.0 | 1,752 |
# coding=utf-8
"""comment.py - Comments dialog."""
from __future__ import absolute_import
import os
import gtk
from src import encoding
_dialog = None
# Compatibility
try:
range = xrange # Python2
except NameError:
pass
class _CommentsDialog(gtk.Dialog):
def __init__(self, window):
gtk.Dial... | Cabalist/Comix | src/comment.py | Python | gpl-2.0 | 2,807 |
import mock
import unittest
from werkzeug.routing import Map, Rule
from werkzeug.test import Client
from werkzeug.wrappers import Response, BaseResponse
from lymph.testing import WebServiceTestCase
from lymph.web.interfaces import WebServiceInterface
from lymph.web.handlers import RequestHandler
from lymph.web.routin... | alazaro/lymph | lymph/tests/integration/test_web_interface.py | Python | apache-2.0 | 2,101 |
#!/usr/bin/env python
# coding=utf-8
"""111. Primes with runs
https://projecteuler.net/problem=111
Considering 4-digit primes containing repeated digits it is clear that they
cannot all be the same: 1111 is divisible by 11, 2222 is divisible by 22, and
so on. But there are nine 4-digit primes containing three ones:
... | openqt/algorithms | projecteuler/pe111-primes-with-runs.py | Python | gpl-3.0 | 1,390 |
# Copyright (c) 2018, The Jaeger 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 w... | kawamon/hue | desktop/core/ext-py/jaeger-client-4.0.0/jaeger_client/metrics/prometheus.py | Python | apache-2.0 | 2,204 |
#!/usr/bin/python
#
# file_system_utils.py
# CSTest
# Created by Ian Copland on 22/01/2015.
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Tag Games Limited
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), t... | ChilliWorks/CSTest | Tools/Scripts/file_system_utils.py | Python | mit | 4,219 |
"""
This page is in the table of contents.
Cool is a craft tool to cool the shape.
Cool works well with a stepper extruder, it does not work well with a DC motor extruder.
If enabled, before each layer that takes less then "Minimum Layer Time" to print the tool head will orbit around the printed area for 'Minimum Lay... | insidenothing/3D-Printing-Software | skein_engines/skeinforge-47/skeinforge_application/skeinforge_plugins/craft_plugins/cool.py | Python | gpl-2.0 | 19,068 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2006 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 of the... | unioslo/cerebrum | contrib/process_entity.py | Python | gpl-2.0 | 1,128 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the completion stages."""
from __future__ import print_function
from __future__ import division
from ch... | endlessm/chromium-browser | third_party/chromite/cbuildbot/stages/completion_stages.py | Python | bsd-3-clause | 30,333 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/datashare/azure-mgmt-datashare/azure/mgmt/datashare/aio/_configuration.py | Python | mit | 3,216 |
class Task(object):
def __init__(self, work, taskid=None, resumed=False):
self.taskid = taskid
self.work = work
self.resumed = resumed
def __str__(self):
if self.resumed:
resume_label = 'Resumed task'
else:
resume_label = 'New Task'
... | Clyde-fare/pbs_util | pbs_util/pbs_map_classes.py | Python | bsd-3-clause | 906 |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | talon-one/talon_one.py | talon_one/models/coupon_value.py | Python | mit | 4,124 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import remocao_ruidos
from PIL import Image
from pylab import *
import comparador
def conversoes_leitura():
#converte para extensão lida através do OCRAD
os.system("convert erosion.png erosion.pgm")
os.system("convert dilate.png dilate.pg... | jota-info/TCC_Reconhecimento_Placas_Automotivas | codigos/implementacao4.py | Python | gpl-3.0 | 1,534 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import tornado.escape
from tornado import gen
from base_handler import BaseHandler
from lib.pyrestful import mediatypes
from lib.pyrestful.rest import get, post, put, delete
from common.web_conf import API_VERSION
# user CRUD
class UserResource(BaseHandler):
... | zhkzyth/tornado-async-rest-api | api/user_handler.py | Python | mit | 1,852 |
"""
Module with Qt widgets.
"""
from .debug_info import DebugPanelWidget
from .error_tab import ErrorWidget
from .info_panel import InfoPanelPage
from .tree import TreeWidget
from .yaml_editor import YamlEditorWidget
| GeoMop/GeoMop | src/ModelEditor/ui/panels/__init__.py | Python | gpl-3.0 | 218 |
#!/usr/bin/env python
import sys
from operator import itemgetter
prev_index = None
value_list = []
for line in sys.stdin:
curr_index, index, value = line.rstrip().split("\t")
index, value = map(int,[index,value])
if curr_index == prev_index:
value_list.append((index,value))
else:
if p... | amberm291/WordCount | reducer.py | Python | mit | 1,158 |
print "aaa" | joakimzhang/qa_study | robotframework_plugin/test.py | Python | apache-2.0 | 11 |
"""Tests for scripts in the Tools directory.
This file contains regression tests for some of the scripts found in the
Tools directory of a Python checkout or tarball, such as reindent.py.
"""
import os
import runpy
import sys
import unittest
import shutil
from cStringIO import StringIO
import subprocess
import syscon... | HiSPARC/station-software | user/python/Lib/test/test_tools.py | Python | gpl-3.0 | 12,366 |
"""Module provider for Namesilo"""
import logging
from xml.etree import ElementTree
import requests
from lexicon.exceptions import AuthenticationError
from lexicon.providers.base import Provider as BaseProvider
LOGGER = logging.getLogger(__name__)
NAMESERVER_DOMAINS = ["namesilo.com"]
def provider_parser(subparse... | AnalogJ/lexicon | lexicon/providers/namesilo.py | Python | mit | 5,524 |
"""
==============================
tests.test_markdown_extensions
==============================
Test proper work of various Markdown extensions.
"""
import sys
import unittest
from flask import Flask
from flask_flatpages import FlatPages
from markdown.extensions.toc import TocExtension
class TestMarkdownExtensio... | johnmee/Flask-FlatPages | tests/test_markdown_extensions.py | Python | bsd-3-clause | 3,895 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from playhouse.migrate import migrate
from peewee import TextField
logger = logging.getLogger('data')
def forward(migrator):
migrate(
migrator.add_column('task', 'mode', TextField(default='uninitialize... | andrewhead/Package-Qualifiers | migrate/0002_add_column_task_mode.py | Python | mit | 386 |
# Next step is to add filename processed to text summary
import tensorflow as tf
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.sparse import csr_matrix
from collections import Counter
import collections
import random
from six.moves import urllib
from six.moves import xrange # ... | jguhlin/nn-replicon-identification | replicon_identification_cnn.py | Python | epl-1.0 | 17,393 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib, json, os, os.path, shutil
class KVStoreLocal (object):
def __init__ (self, path = u"./"):
self._path = path
def __del__ (self):
pass
def set_binary (self, key, value):
try:
with open (self._get_key (key), "wb") as s:
s.write (value)
exc... | c86j224s/memorize | kvstorelocal.py | Python | apache-2.0 | 1,438 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, print_function
import itertools
import os
import site
import sys
import uuid
from pkg_resources import (
DistributionNotFound,
Environment... | kwlzn/pex | pex/environment.py | Python | apache-2.0 | 9,207 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# moehime / saimoe / data source package
#
# Copyright (C) 2012 Wang Xuerui <idontknw.wang@gmail.com>
#
# This file is part of moehime.
#
# moehime is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published... | xen0n/moehime | moehime/saimoe/datasource/__init__.py | Python | agpl-3.0 | 3,128 |
from pyspark import SparkContext
from pyspark import RDD
from pyspark.sql import SparkSession
from pyspark.sql import SQLContext
from pyspark.sql import HiveContext
from pyspark.sql.functions import *
from pyspark.sql.types import *
from pyspark.ml.feature import *
from pyspark.ml.linalg import DenseVector
from sklearn... | darewis/SubredditRecommend | validate.py | Python | gpl-3.0 | 4,870 |
# coding: utf-8
from main import create_tables, define_do
import sys
from lib.login import soupinfo
from Queue import Queue
from lib.db_cancel import id_cancel
from lib.db_info import id_info
from lib.db_news import id_news
import lib.settings
from logging import StreamHandler, DEBUG
import argparse
def main():
q... | pddg/Qkou_kit | __main__.py | Python | mit | 3,421 |
from __future__ import absolute_import
import sys
from lib2to3.main import main
if __name__ == '__main__':
sys.exit(main("fixes"))
def ten2eleven(*files):
"""Convert MDAnalysis 0.10.0 scripts to 0.11.0
Usage:
ten2eleven('myscript.py')
"""
main('MDAnalysis.migration.fixes', ['-w'] + list(fi... | kain88-de/mdanalysis | package/MDAnalysis/migration/ten2eleven.py | Python | gpl-2.0 | 326 |
#!/usr/bin/python
# script makes a change log txt file from git logs
# usage: makeChangelog.py > CHANGELOG.txt
import subprocess
atags = subprocess.getoutput('git tag -n')
atags = atags.split('\n')
tags = subprocess.getoutput('git tag -l')
tags = tags.split('\n')
# for t in range(0, len(tags)-1):
for t in range(len(... | tochikuji/pyPyrTools | pyrtools/makeChangelog.py | Python | mit | 828 |
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 11 - wsgi_app.py
# A simple web application built directly against the low-level WSGI spec.
import cgi, base64
from wsgiref.simple_server import make_server
def page(content, *args):
yield b'<html><head><title>wsgi_app.py</title></head><b... | jac2130/BayesGame | foundations-of-python-network-programming/python3/11/wsgi_app.py | Python | mit | 2,010 |
#!/usr/bin/python
# android-build.py
# Build android
import sys
import os, os.path
import shutil
from optparse import OptionParser
JS_SAMPLES = ['js-tests', 'js-moonwarriors']
def get_num_of_cpu():
''' The build process can be accelerated by running multiple concurrent job processes using the -j-option.
'''
... | jianglong0156/cocos2d-js | build/android-build.py | Python | mit | 8,583 |
# 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 the... | openstack/senlin | senlin/conf/zaqar.py | Python | apache-2.0 | 1,131 |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompa... | boto/botoflow | botoflow/context/decision_context.py | Python | apache-2.0 | 2,472 |
#
# Copyright (c) SAS Institute 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 w... | sassoftware/mint | mint/django_rest/rbuilder/discovery/manager.py | Python | apache-2.0 | 2,197 |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Functional tests for ``flocker.node.agents.ebs`` using an EC2 cluster.
"""
from uuid import uuid4
from bitmath import Byte
from boto.exception import EC2ResponseError
from twisted.trial.unittest import SkipTest
from eliot.testing import LoggedMessag... | LaynePeng/flocker | flocker/node/agents/functional/test_ebs.py | Python | apache-2.0 | 6,147 |
# coding=utf8
import os
import re
import csv
#os.environ['DJANGO_SETTINGS_MODULE'] = 'itg.settings' # apps aren't loaded yet
# import django # app_label error
# from django.conf import settings
# if not settings.configured:
# settings.configure()
# django.setup()
from .main.models import Track
# from django.a... | msheldyakov/itg-msk-3 | special_random/k_utils.py | Python | mit | 6,326 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | peeyush-tm/check_mk | web/plugins/wato/globals_notification.py | Python | gpl-2.0 | 13,074 |
import argparse
import boto
import time
import boto.ec2 as ec2
import instances
def parse_args(connection):
default_types = ['t2.micro', 't2.small', 't2.medium']
available_zones = [z.name for z in connection.get_all_zones()]
default_zones = available_zones
available_types = \
['t2.micro', 't2.s... | dmurvihill/acpa2015 | src/cartography.py | Python | unlicense | 1,756 |
# microbit.py 19/03/2017 D.J.Whale
#
# scaffolding file to aid testing of SDCard interface
# Use this for local simulation
from . import sdcard
# Use this for remote access via a device
##import auto_serial # auto connects to first found device
#----- PIN ----------------------------------------------------------... | whaleygeek/mb_sdcard | src/microbit/microbit.py | Python | mit | 7,370 |
# pyenchant
#
# Copyright (C) 2004-2009, Ryan Kelly
#
# 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.
#
# This ... | moloch--/PACKlib | enchant/tests.py | Python | bsd-3-clause | 23,083 |
#!/usr/bin/python
#
# Author: Rajesh Sinha, Karan Narain
# The base class for Twitter and GPlus Objects
#
import logging
import sys
from bs4 import BeautifulSoup
import urllib2
import re
## Some Important constants
_parser = "lxml" ## remember to pip install lxml or else use another parser
_loggingLevel = loggin... | sinharrajesh/dbtools | google-plus-analysis/SocialNW.py | Python | apache-2.0 | 4,807 |
from .common import Test
class TestEndpoint(Test):
def testing_wrong_endpoints(self):
response = self.app.get('/api/', expect_errors=True)
self.assertEqual(404, response.status_int)
response = self.app.get('/api/wrongurl', expect_errors=True)
self.assertEqual(404, response.status... | felipevolpone/onhands | ray-core/tests/test_endpoint.py | Python | mit | 1,326 |
# -*- coding: utf-8 -*-
# Scrapy settings for HomeAnalyzer project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/l... | liaocyintl/HomeAnalyzer | HomeAnalyzer/settings.py | Python | mit | 3,361 |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | arenadata/ambari | ambari-server/src/main/resources/stacks/BigInsights/4.0/services/KAFKA/package/scripts/kafka_broker.py | Python | apache-2.0 | 4,270 |
# -*- coding: utf-8 -*-
#! /usr/bin/python
# This module contains all the variables, lists, load and save
# the settings
#
# Bertrand Verdu 08/08
# import MySQLdb
from pyanocktail.dbUtils import initdb
import os
import json
class mainConfig:
notes = []
pumps = []
pumpsdb = []
recipesdb = []
c... | bverdu/Pyanocktail | pyanocktail/config.py | Python | lgpl-2.1 | 9,285 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.