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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Blockstore
~~~~~
copyright: (c) 2014 by Halfmoon Labs, Inc.
copyright: (c) 2015 by Blockstack.org
This file is part of Blockstore
Blockstore is free software: you can redistribute it and/or modify
it under the terms of the GNU Gener... | john-light/blockstore | blockstore/blockstored.py | Python | gpl-3.0 | 32,472 |
# -*- coding: utf-8 -*-
"""This file contains the analysis plugin manager class."""
from __future__ import unicode_literals
from plaso.analysis import definitions
class AnalysisPluginManager(object):
"""Analysis plugin manager."""
_plugin_classes = {}
_PLUGIN_TYPE_STRINGS = {
definitions.PLUGIN_TYPE_A... | rgayon/plaso | plaso/analysis/manager.py | Python | apache-2.0 | 4,070 |
#!/usr/bin/env python
# -*- coding: utf-8, utf-16 -*-
# ^ The above line is a hack for python2 with its poor unicode implementation to even support compiling this test.
# So long as the utf-16 strings are also utf-u compatible (albeit nonsense), it will work with python2.
#
# In this test we set the defaultIREncodi... | kata198/indexedredis | tests/UnitTests/test_IRUnicodeField.py | Python | lgpl-2.1 | 12,858 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | kustodian/ansible | lib/ansible/modules/network/fortios/fortios_wireless_controller_ap_status.py | Python | gpl-3.0 | 10,160 |
'''
Integration Test for creating KVM VM in MN HA mode with one mn host, which MN-VM is running on, network shutdown and recovery.
@author: Mirabel
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackw... | zstackorg/zstack-woodpecker | integrationtest/vm/mn_ha/test_one_mn_host_network_down_create_vm.py | Python | apache-2.0 | 3,288 |
#!/usr/bin/env python
# coding: utf8
from bottle import route, run, request
import json
import requests
plug_host = plug_port = None
@route('/register', method='POST')
def reg():
plug_data = request.json
print "Registered: %s at %s:%s" % (plug_data['plug'], plug_data['host'], plug_data['port'])
global pl... | talpah/cortana | plugins/hellopy/cortana.py | Python | mit | 1,076 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This is a docstring"""
WEEKS = (((19 % 10) + 100) + (2 ** 8)) / 7
print WEEKS
| eliz79/is210-week-03-warmup | task_02.py | Python | mpl-2.0 | 129 |
# coding=utf-8
# Copyright 2022 The Meta-Dataset 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 ... | google-research/meta-dataset | meta_dataset/learners/experimental/optimization_learners_test.py | Python | apache-2.0 | 4,094 |
# ENVISIoN
#
# Copyright (c) 2018 Jesper Ericsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list o... | rartino/ENVISIoN | demo/PCF.py | Python | bsd-2-clause | 2,129 |
from dask.local import get_sync
from dask.threaded import get as get_threaded
from dask.callbacks import Callback
from dask.utils_test import add
def test_start_callback():
flag = [False]
class MyCallback(Callback):
def _start(self, dsk):
flag[0] = True
with MyCallback():
get... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/dask/tests/test_callbacks.py | Python | gpl-3.0 | 2,569 |
# 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 th... | hammerlab/pyensembl | pyensembl/ensembl_release.py | Python | apache-2.0 | 5,224 |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Create a blockchain cache.
Creating a cache of the blockchain speeds up test execution when running
mu... | particl/particl-core | test/functional/create_cache.py | Python | mit | 793 |
from coalib.bearlib.abstractions.Linter import linter
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from dependency_management.requirements.PipRequirement import PipRequirement
@linter(executable='dennis-cmd',
output_format='regex',
output_regex=r'(?P<message>(?P<severity>[EW])[0-9]{3}: .... | horczech/coala-bears | bears/gettext/DennisBear.py | Python | agpl-3.0 | 1,583 |
from redis import DataError
from redis.exceptions import ResponseError
from .exceptions import VersionMismatchException
from .query_result import QueryResult
class GraphCommands:
"""RedisGraph Commands"""
def commit(self):
"""
Create entire graph.
For more information see `CREATE <ht... | alisaifee/redis-py | redis/commands/graph/commands.py | Python | mit | 6,937 |
#!Measurement
# all of this is configuration info that can be used in the script.
# you refer to these values using mx.<group>.<attribute>
# e.g
# mx.baseline.counts is 180
# mx.multicollect.detector is H1
'''
baseline:
after: true
before: false
counts: 180
detector: H1
mass: 34.2
settling_time: 15
d... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/basic.py | Python | apache-2.0 | 2,487 |
import os
import shutil
import sys
import glob
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version = 'x.y.z'
if os.path.exists('VERSION'):
version = open('VERSION').read().strip()
setup(
name='saffrontree',
version=vers... | andrewjpage/saffrontree | setup.py | Python | gpl-3.0 | 1,270 |
from setuptools import setup
setup(
name = 'md2remark',
py_modules = ['md2remark_runner'],
packages = ['md2remark', 'md2remark.resources', 'md2remark.resources.templates'],
package_data = {'md2remark.resources.templates': ['*.mustache']},
install_requires = ['pystache==0.5.4'],
version = '0.1.0',
descri... | patrickayoup/md2remark | setup.py | Python | mit | 1,102 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'OrderTransaction.currency'
db.add_column('datacash_ordertra... | django-oscar/django-oscar-datacash | datacash/migrations/0004_auto__add_field_ordertransaction_currency.py | Python | bsd-3-clause | 3,342 |
"""
EM Routines
"""
| Patrick-Cole/pygmi | pygmi/em/__init__.py | Python | gpl-3.0 | 21 |
import random
import sys
import __builtin__
from externals.moduleman.plugin import moduleman_plugin
from framework.core.myexception import FuzzException
from framework.fuzzer.base import wfuzz_iterator
from framework.plugins.api import search_bing
@wfuzz_iterator
@moduleman_plugin("count", "next", "__iter__")
class i... | Bladefidz/wfuzz | plugins/payloads.py | Python | gpl-2.0 | 10,373 |
# Copyright (C) 2006, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <[email protected]>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
# pylint: disable=wrong-import-order,ungrouped-imports
import gi
from gi.repository import Gdk
from gi.reposi... | crobinso/virt-manager | virtManager/details/serialcon.py | Python | gpl-2.0 | 11,857 |
# -*- coding: utf-8 -*-
## This file is part of Gertrude.
##
## Gertrude 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 vers... | studio1247/gertrude | history.py | Python | gpl-3.0 | 2,500 |
from django.test import SimpleTestCase, TestCase
from corehq.util.es.elasticsearch import ConnectionError
from eulxml.xpath import parse as parse_xpath
from casexml.apps.case.mock import CaseFactory, CaseIndex, CaseStructure
from pillowtop.es_utils import initialize_index_and_mapping
from corehq.apps.case_search.fil... | dimagi/commcare-hq | corehq/apps/case_search/tests/test_filter_dsl.py | Python | bsd-3-clause | 21,077 |
from setuptools import setup, find_packages
setup(
name = "afed_donations",
version = "1.0",
url = 'http://github.com/steveandroulakis/afed_donations',
license = 'BSD',
description = "Tool for viewing donations to Australian political parties",
author = 'Steve Androulakis',
packages = find_... | steveandroulakis/afed_donations | setup.py | Python | apache-2.0 | 454 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from nose.tools import eq_
from .utils import TestCase
from issue2branch.issue import Issue
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class TextTests(TestCase):
de... | pignacio/issue2branch | test/test_issue.py | Python | gpl-3.0 | 1,979 |
"""
Sampling along tracks
---------------------
The :func:`pygmt.grdtrack` function samples a raster grid's value along specified
points. We will need to input a 2D raster to ``grid`` which can be an
:class:`xarray.DataArray`. The argument passed to the ``points`` parameter can be a
:class:`pandas.DataFrame` table whe... | GenericMappingTools/gmt-python | examples/gallery/images/track_sampling.py | Python | bsd-3-clause | 1,614 |
# 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... | apache/incubator-superset | superset/queries/saved_queries/dao.py | Python | apache-2.0 | 1,792 |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio 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) an... | dset0x/inspire-next | inspire/base/fixtures/bibauthorid.py | Python | gpl-2.0 | 1,571 |
import os, sys, fileinput, re
if sys.argv[1] == None or os.path.exists(sys.argv[1])==False:
print "Usage: %s file_to_analyze" % sys.argv[0]
sys.exit()
class portRec:
srcIP=0
srcPort=0
dstPort=0
timeRecv=0
order=0
timeSent=0
intPort=0
def __init__(self):
pass
... | ph4r05/NATSimTools | portNums.py | Python | apache-2.0 | 3,271 |
"""
ldapobject.py - wraps class _ldap.LDAPObject
See http://www.python-ldap.org/ for details.
\$Id: ldapobject.py,v 1.109 2010/06/03 12:26:39 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
- LDAPObject class should be exactly the same like _ldap.LDAPObject
Usage:
Directly im... | vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/python-ldap-2.3.13/Lib/ldap/ldapobject.py | Python | gpl-2.0 | 32,219 |
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | helenst/django | django/conf/project_template/project_name/settings.py | Python | bsd-3-clause | 2,281 |
from __future__ import division
import copy
import numpy
from pycbc.tmpltbank.coord_utils import get_cov_params
def get_physical_covaried_masses(xis, bestMasses, bestXis, req_match,
massRangeParams, metricParams, fUpper,
giveUpThresh = 5000):
"""
... | hagabbar/pycbc_copy | pycbc/tmpltbank/brute_force_methods.py | Python | gpl-3.0 | 23,536 |
SPECS = {
"org.freedesktop.DBus.ObjectManager": """
<interface name="org.freedesktop.DBus.ObjectManager">
<method name="GetManagedObjects">
<arg name="objpath_interfaces_and_properties" type="a{oa{sa{sv}}}" direction="out" />
</method>
</interface>
""",
"org.storage.stratis3.Manager.r1": """
<in... | stratis-storage/stratisd | tests/client-dbus/src/stratisd_client_dbus/_introspect.py | Python | mpl-2.0 | 10,523 |
from ..core.bunk_user import BunkUser
"""
Metadata class for easy embeds when a duel has completed
"""
class DuelResult:
def __init__(self, chal: BunkUser, opnt: BunkUser, winner: BunkUser, loser: BunkUser):
self.challenger: BunkUser = chal
self.opponent: BunkUser = opnt
self.winner: BunkUs... | fugwenna/bunkbot | src/rpg/duel_result.py | Python | mit | 623 |
# -*- coding: 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/.
import os
import cli_common.taskcluster
import uplift_backend.config
secrets = cli_common.task... | lundjordan/services | src/uplift/backend/uplift_backend/secrets.py | Python | mpl-2.0 | 599 |
from models import User
# select user.id from user where (user.id > '1' and (user.name = 'jack' or user.email = '[email protected]'))
User.where(
(User.id > 1) & ((User.name == 'jack') | (User.email == '[email protected]'))
).select(User.id)
| hit9/skylark | snippets/expressions_with_priority.py | Python | bsd-2-clause | 235 |
#!/usr/bin/env python3
import json
import random
import redis
import time
from threading import Thread
# Replaces with your configuration information
redis_host = "0.0.0.0"
redis_port = 6379
redis_password = ""
def subscriber(name, channels):
"""Processes simulated event message from a Redis Channel"""
# A... | healthbridgeltd/zava-cop | redis/subscribe.py | Python | unlicense | 1,640 |
# Copyright 2017 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 agreed ... | craigcitro/pydatalab | solutionbox/structured_data/test_mltoolbox/test_datalab_e2e.py | Python | apache-2.0 | 7,533 |
from nsga2 import MultiObjectiveGA
""" added by JPQ """
from constnsga2 import ConstMultiObjectiveGA
# --- | fxsjy/pybrain | pybrain/optimization/populationbased/multiobjective/__init__.py | Python | bsd-3-clause | 106 |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.container_v1.proto import cluster_service_pb2 as google_dot_cloud_dot_container__v1_dot_proto_dot_cluster__service__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class ClusterManagerS... | tseaver/gcloud-python | container/google/cloud/container_v1/proto/cluster_service_pb2_grpc.py | Python | apache-2.0 | 32,660 |
#!/usr/bin/env python
"""
Small and dumb HTTP server for use in tests.
"""
from optparse import OptionParser
import BaseHTTPServer, SimpleHTTPServer, signal, sys
from mercurial import cmdutil
class simplehttpservice(object):
def __init__(self, host, port):
self.address = (host, port)
def init(self):... | hekra01/mercurial | tests/dumbhttp.py | Python | gpl-2.0 | 1,676 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Extract and analyze the mobility Mesos using Apache Spark.
import sys, os
import numpy as np
from xoxo.bsmap import BaseStationMap
from xoxo.permov import movement_reader
from xoxo.utils import radius_of_gyration
__author__ = 'Xiaming Chen'
__email__ = 'chen@xiaming.... | caesar0301/paper-flowmap-code | src/046.rg_dt.py | Python | gpl-3.0 | 5,812 |
from collections import *
from config import main
import heapq
class UserPreference:
def __init__(self):
self.results = []
self.list1 = []
self.list2 = []
self.list3 = []
self.list4 = []
self.categories = []
self.sold_average = []
self.bought_averag... | adarshdec23/Market | core/preference/main.py | Python | apache-2.0 | 3,319 |
# -*- encoding: utf-8 -*-
###############################################################################
# #
# product_prices_on_variant for OpenERP #
# Copyright (C) 2011 Akretion Benoît GUILLOT <b... | cgstudiomap/cgstudiomap | main/parts/product-attribute/product_prices_on_variant/product.py | Python | agpl-3.0 | 2,481 |
import json
from c2corg_api.models.user import User
from c2corg_api.models.user_profile import UserProfile, ArchiveUserProfile, \
USERPROFILE_TYPE
from c2corg_api.scripts.es.sync import sync_es
from c2corg_api.search import elasticsearch_config
from c2corg_api.search.mappings.user_mapping import SearchUser
from c2... | c2corg/v6_api | c2corg_api/tests/views/test_user_profile.py | Python | agpl-3.0 | 15,302 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, [email protected]
# Gerhard Lausser, [email protected]
# Gregory Starck, [email protected]
# Hartmut Goebel, [email protected]
#
# This file is part of Shinken.
#
# Shinken is free software: you c... | h4wkmoon/shinken | shinken/stats.py | Python | agpl-3.0 | 4,624 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-01 01:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v2', '0006_remove_event_is_valid'),
]
operations = [
migrations.AlterFi... | AstroMatt/esa-time-perception | backend/api_v2/migrations/0007_auto_20170101_0101.py | Python | mit | 3,986 |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from atomic_reactor.constants import PLUGIN_KOJI_TAG_BUILD_KEY
from atomic_reactor.koji_util import ... | jarodwilson/atomic-reactor | atomic_reactor/plugins/exit_koji_tag_build.py | Python | bsd-3-clause | 3,493 |
'''
Created on 08.02.2016.
@author: Lazar
'''
from textx.exceptions import TextXSemanticError
def data_show_processor(data_show_object):
data_show_kwd = ['table', 'list', 'thumbnail']
for type in data_show_kwd:
if type is data_show_object.type.name:
return True
else:
raise Text... | theshammy/GenAn | src/concepts/data_show.py | Python | mit | 839 |
import cacher
import checker
import logger
import mailer
import updater | christianrenier/dynamic-dns-updater | utils/__init__.py | Python | mit | 71 |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from oai.models import *
from djcelery.models import TaskMeta
class OaiErrorInline(admin.TabularInline):
model = OaiError
extra = 0
class OaiSourceAdmin(admin.ModelAdmin):
inlines = [OaiErrorInline]
class ... | dcosentino/edx-platform | lms/djangoapps/oai/admin.py | Python | agpl-3.0 | 630 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from graph.views import WebsiteListView
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'news_graph.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
... | Soaring-Outliers/news_graph | news_graph/urls.py | Python | mit | 522 |
from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
TableToPoints1 = TableToPoints()
TableToPoints1.XColumn = 'x0'
TableToPoints1.YColumn = 'x1'
TableToPoints1.a2DPoints = 1
# SpreadSheetView1 = GetRenderView()
# DataRepresentation2 = Show()
# DataRepresentation2.FieldAssociation = 'Point... | davidshepherd7/oomph-lib-micromagnetics | etc/paraview_helpers/csv2points.py | Python | gpl-2.0 | 2,020 |
import csv
import xlrd
from django.core.management.base import BaseCommand
from corehq.apps.accounting.models import Currency
from corehq.apps.smsbillables.utils import log_smsbillables_info
from corehq.messaging.smsbackends.twilio.models import SQLTwilioBackend
from corehq.apps.sms.models import OUTGOING
from corehq... | qedsoftware/commcare-hq | corehq/apps/smsbillables/management/commands/bootstrap_twilio_gateway.py | Python | bsd-3-clause | 5,306 |
#!/usr/bin/python -tt
# 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/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | sanaldavis/Google-Python-Exercies | basic/mimic.py | Python | apache-2.0 | 2,511 |
from django.http import HttpResponse
from anyjson import serialize
def multiply(request):
x = int(request.GET["x"])
y = int(request.GET["y"])
retval = x * y
response = {"status": "success", "retval": retval}
return HttpResponse(serialize(response), mimetype="application/json")
| mzdaniel/oh-mainline | vendor/packages/celery/examples/httpexample/views.py | Python | agpl-3.0 | 302 |
from xml.etree.ElementTree import Element, SubElement, Comment
from xml.etree import ElementTree
from xml.dom import minidom
import datetime
import time
import re
import os
from git import *
from generatePoaXml import *
from xml_generation import *
from parsePoaXml import *
import settings
"""
"""
class pubMedPoaXML... | gnott/elife-poa-xml-generation | generatePubMedXml.py | Python | mit | 22,473 |
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core 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 versio... | ethanaward/mycroft-core | mycroft/skills/cerberus_config/__init__.py | Python | gpl-3.0 | 1,712 |
from turtle import *
##############
###############
penup()
goto(325,325)
pendown()
goto(325,-325)
goto(-325,-325)
goto(-325,325)
goto(325,325)
for i in range(5):
right(90)
forward(65)
right(90)
forward(650)
left(90)
forward(65)
left(90)
forward(650)
right(180)
for i in range(5):
forward(65)
right(90)... | lizerd123/github | grid.py | Python | mit | 1,130 |
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/encodings/cp860.py | Python | gpl-3.0 | 34,681 |
from . import hr_salesman_commission
| MarcosCommunity/odoo | comunity_modules/hr_salesman_commission/__init__.py | Python | agpl-3.0 | 37 |
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtai... | timorieber/wagtail-openshift-quickstart | wsgi/wagtail-openshift-quickstart/wagtail-openshift-quickstart/urls.py | Python | isc | 1,011 |
"""
Script to process pytest warnings output by pytest-json-report plugin and output it as a html
"""
import argparse
import io
import itertools
import json
import os
import re
from collections import Counter
from write_to_html import (
HtmlOutlineWriter,
) # noqa pylint: disable=import-error,useless-suppression... | msegado/edx-platform | openedx/core/process_warnings.py | Python | agpl-3.0 | 9,900 |
import requests.exceptions
class ConsulClientRequestException(Exception):
"Exception while making a request to Consul"
class ConsulClient(object):
def __init__(self, http, consul_url, output):
self._http = http
self._base_url = consul_url
self._output = output
def get_active_end... | reactiveops/consul8s | consul8s/consul_client.py | Python | apache-2.0 | 4,540 |
# Local project imports
from core import app
from core.models import User
import helpers as util
# Standard python imports
import json
# Third party imports
from flask import render_template, jsonify, request
# Application homepage
@app.route('/index')
@app.route("/")
def index():
return render_template("index.h... | pesos/ngo-portal | src/core/views.py | Python | mit | 1,570 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import sys
from optparse import OptionParser, make_option as Option
from pprint import pformat
from textwrap import wrap
from anyjson import deserialize
from celery import __version__
from celery.app import app_or_d... | softak/webfaction_demo | vendor-local/lib/python/celery/bin/celeryctl.py | Python | bsd-3-clause | 11,986 |
import sys
from types import Node
from parser import parse
from walk import bfs
from builder import build
| wmgaca/deusexmachina | lib/__init__.py | Python | mit | 107 |
from epsilon import *
class Veblen(Epsilon):
def __init__(self,veblinForm):
assert(isinstance(veblinForm,(list,tuple)))
for p in veblinForm:
assert(isinstance(p,(Ordinal,int,long)))
for i in range(len(veblinForm)):
if(isinstance(veblinForm[i],(int,long))):
... | drocta/py-Ordinals | veblen.py | Python | lgpl-2.1 | 2,673 |
from __future__ import unicode_literals
import logging
import weakref
import spotify
import spotify.connection
import spotify.player
import spotify.social
from spotify import ffi, lib, serialized, utils
__all__ = ['Session', 'SessionEvent']
logger = logging.getLogger(__name__)
class Session(utils.EventEmitter):
... | mopidy/pyspotify | spotify/session.py | Python | apache-2.0 | 40,801 |
import numpy as np
A = np.matrix('1 2; 3 4')
B = np.matrix([[5, 6],
[7, 8]])
print(A * B)
| pdbartlett/misc-stuff | python/islp/01intro.py | Python | apache-2.0 | 106 |
from core.vectors import ModuleExec
from core.module import Module, Status
from core import modules
from core import messages
from core.loggers import log
from distutils import spawn
from mako import template
import tempfile
import subprocess
import atexit
class Mount(Module):
"""Mount remote filesystem using HTT... | dtrip/weevely3 | modules/file/mount.py | Python | gpl-3.0 | 3,403 |
#!/usr/bin/env python
# coding: utf-8
## Checks bash env for Debug and Testing Settings for globals()
from os import environ
globals()['PRD_ENV'] = 0 # 1=True, 0=False
if environ.get('PYDEBUG'): import pdb; pdb.set_trace()
# if environ.get('DEBUG'): globals()['DEBUG'] = 1
if environ.get('PRD_ENV'): globals()['PRD_ENV... | relic7/prodimages | mozu/base_config.py | Python | mit | 4,826 |
# This file is part of the bapsflib package, a Python toolkit for the
# BaPSF group at UCLA.
#
# http://plasma.physics.ucla.edu/
#
# Copyright 2017-2018 Erik T. Everson and contributors
#
# License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full
# license terms and contributor agreement.
#
"""Module for t... | rocco8773/bapsflib | bapsflib/_hdf/maps/controls/templates.py | Python | bsd-3-clause | 17,703 |
#!/usr/bin/env python
# 8 band Audio equaliser from wav file
# import alsaaudio as aa
# import smbus
from struct import unpack
import numpy as np
import wave
from time import sleep
import sys
ADDR = 0x20 #The I2C address of MCP23017
DIRA = 0x00 #PortA I/O direction, by pin. 0=output, 1=input
DIR... | mprinc/FeelTheSound | src/PoC/fft.py | Python | cc0-1.0 | 4,053 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import *
from karesansui.lib.utils import *
def assert_regexp_matches(text, regexp):
import re
if isinstance(regexp, basestring):
regexp = re.compile(regexp)
if not regexp.search(text):
message = '''Regexp didn't match: %r not ... | karesansui/karesansui | karesansui/tests/nose/test_list.py | Python | mit | 2,172 |
"""Tests for util.db module."""
import threading
import time
import unittest
from io import StringIO
import ddt
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.management import call_command
from django.db import IntegrityError, connection
from django.... | EDUlib/edx-platform | common/djangoapps/util/tests/test_db.py | Python | agpl-3.0 | 8,081 |
# -*- coding: utf-8 -*-
"""
pygments.filters
~~~~~~~~~~~~~~~~
Module containing filter lookup functions and default
filters.
:copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
try:
set
except NameError:
from sets import Set as... | KeyIngredient/gaepaste | pygments/filters/__init__.py | Python | lgpl-3.0 | 9,514 |
""" Stores a scrip in an HDF5 file. Assumes the data exists locally."""
# This is more of a test scrip where we want to explore all ideas.
import pandas as pd
from corp_actions_nse import get_corp_action_csv
csv_filename = '500209.csv'
COL_NAMES = ["Date", "Open Price", "High Price", "Low Price", "Close Price", "N... | gabhijit/tickdownload | scrip_to_hd5.py | Python | mit | 1,435 |
"""Fake module to test tests."""
def test_proc(x):
"""Fake procedure to test doctests.
>>> test_proc(42)
43
"""
return x
if __name__ == "__main__":
import doctest
doctest.testmod(raise_on_error=True)
| Grahack/test-travis | mytestmodule.py | Python | gpl-2.0 | 232 |
#!/usr/bin/env python
'''Testing a sprite.
The ball should bounce off the sides of the window. You may resize the
window.
This test should just run without failing.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import os
import unittest
from pyglet.gl import glClear
import pyglet.window
import pygl... | nicememory/pie | pyglet/contrib/currently-broken/scene2d/tests/scene2d/SPRITE_OVERLAP.py | Python | apache-2.0 | 2,070 |
import json
content = ""
with open('annotated.json', 'r') as content_file:
content = content_file.read()
content = json.loads(content)
content = sorted(content, key = lambda x: x["name"])
for ing in content:
if("measurement" in ing.keys()):
continue
print(ing["name"])
meas = input("1 - ml, 2 - g, 3 - ... | blacksph3re/alastair2 | crawl/annotate.py | Python | apache-2.0 | 780 |
# -*- coding: utf-8 -*-
"""
pyfdarc.py
This file contains layout definitions for Qt and matplotlib widgets
A dark and a light theme can be selected via a constant but this more a demonstration
on how to set things than a finished layout yet.
See
http://stackoverflow.com/questions/13034496/using-global-variables-betwe... | honahursey/pyFDA | pyfda/pyfda_rc.py | Python | apache-2.0 | 7,522 |
# -*- coding: utf-8 -*-
#
# Import script for .csv files.
# Note: manifest a strong printaholism.
#
import sys, os, csv, re
from optparse import OptionParser
# get path of the django project
path = ("/").join( sys.path[0].split("/")[:-1] )
ppath = ("/").join( sys.path[0].split("/")[:-2] )
if path not in sys.pat... | medialab/reanalyse | reanalyseapp/update.py | Python | lgpl-3.0 | 11,321 |
import re
import os
import cmd
import sys
import common
from getpass import getpass
from kp import KeePassError, get_password
from configmanager import ConfigManager, ConfigManagerError
common.init()
class ParseArgsException(Exception):
def __init__(self, msg):
self.msg = msg
class ModuleCore(cmd.Cmd):
def __... | nokia-wroclaw/innovativeproject-dbshepherd | mod_core.py | Python | mit | 8,041 |
import logging
from banal import ensure_list
from countrytagger import tag_place
log = logging.getLogger(__name__)
def location_country(location):
code, score, country = tag_place(location)
return ensure_list(country)
| alephdata/ingestors | ingestors/analysis/country.py | Python | mit | 230 |
#!/usr/bin/env python
from zenjsonclient import router, ZenJsonClientError
from sets import Set
from time import sleep
############ BASH BINDINGS DECLARATION ############
def bash_getDevices():
import os
import json
os.system("./zenoss_getDevices.sh")
f = open("tmpfile.txt")
data = f.read()
d... | thomasvincent/utilities | Standalone_Scripts/softlayer_iphostloc_puller/old_src/zenoss_injector.py | Python | apache-2.0 | 6,959 |
#coding: utf-8
import re
import logging
from urlparse import urljoin
from collections import defaultdict
from itertools import chain
from math import sqrt
from bs4 import BeautifulSoup as BS, Tag, NavigableString
from null import Null
from .utils import tokenize, string_inclusion_ratio
from .webimage import WebImage
... | polyrabbit/hacker-news-digest | page_content_extractor/html.py | Python | lgpl-3.0 | 14,547 |
#! /usr/bin/env python
#
# Author: Damian Eads
# Date: April 17, 2008
#
# Copyright (C) 2008 Damian Eads
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copy... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/scipy/spatial/tests/test_distance.py | Python | gpl-2.0 | 56,820 |
"""Projects module widgets."""
from __future__ import unicode_literals
WIDGETS = {'widget_tasks_assigned_to_me': {'title': 'Tasks Assigned To Me',
'size': "95%"}}
def get_widgets(request):
"""Return a set of all available widgets."""
return WIDGETS
| tovmeod/anaf | anaf/projects/widgets.py | Python | bsd-3-clause | 304 |
# -*- coding: utf-8 -*-
# Scrapy settings for cluj_info project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
#
BOT_NAME = 'cluj_info'
SPIDER_MODULES = ['cluj_info.spiders'... | atorok/tripadvisor_reviews_cluj | scrapy_phantomjs/cluj_info/settings.py | Python | apache-2.0 | 498 |
# Copyright (c) 2016 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | satish-avninetworks/murano | murano/tests/unit/cmd/test_engine_workers.py | Python | apache-2.0 | 2,110 |
#
# 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... | apache/incubator-airflow | airflow/providers/amazon/aws/transfers/ftp_to_s3.py | Python | apache-2.0 | 6,354 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | sosreport/sos | tests/cleaner_tests/full_report_run.py | Python | gpl-2.0 | 3,341 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-21 12:58
from __future__ import unicode_literals
from django.db import migrations, models
import base.models.enums.duration_unit
class Migration(migrations.Migration):
dependencies = [
('base', '0160_auto_20170926_0828'),
]
operat... | uclouvain/OSIS-Louvain | base/migrations/0161_new_fields_educationgroupyear.py | Python | agpl-3.0 | 1,465 |
from pandac.PandaModules import VBase3, BitMask32
GameTime = 60
NumBarrels = 4
BarrelStartingPositions = (
VBase3(4.3, 4, 0),
VBase3(4.3, -4, 0),
VBase3(-4.3, 4, 0),
VBase3(-4.3, -4, 0)
)
ToonStartingPositions = (
VBase3(0, 16, 0),
VBase3(0, -16, 0),
VBase3(-16, 0, 0),
VBase3(16, 0, 0)
)
CogStartingPositions =... | silly-wacky-3-town-toon/SOURCE-COD | toontown/minigame/CogThiefGameGlobals.py | Python | apache-2.0 | 2,523 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class LibraryConfig(AppConfig):
name = 'library'
| harikvpy/django-popupcrud | demo/library/apps.py | Python | bsd-3-clause | 154 |
from pyticketswitch.mixins import JSONMixin
class Media(JSONMixin, object):
"""Describes some event media asset
Attributes:
caption (str): caption in plain text describing the asset.
caption_html (str): caption as html describing the asset.
name (str): name of the asset.
url (... | ingresso-group/pyticketswitch | pyticketswitch/media.py | Python | mit | 1,930 |
# -*- coding: utf-8 -*-
import click
@click.command(
context_settings={
"ignore_unknown_options": True,
"allow_extra_args": True
},
add_help_option=False
)
@click.pass_context
def serve(ctx):
"""
# start app from current dir
"""
from .. import runner
runner.serve()
i... | MrKiven/REST_ARCH | rest_arch/skt/cmds/serve.py | Python | mit | 386 |
../../../../../../share/pyshared/twisted/web/test/test_static.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/web/test/test_static.py | Python | gpl-3.0 | 64 |
# Constructs diff between graphs.
# Return best match between them and its score.
# Algorithm is naive.
# g1_or, g2_or - dict of lists (graph)
def diff_construct(g1_or, g2_or):
g1, g2 = split_graph_by_labels(g1_or), split_graph_by_labels(g2_or)
extend_graphs(g1, g2)
g1, g2 = add_zero_nodes(g1, g2)
# min score.
# ... | alexander-bzikadze/graph_diff | src_depricated/diff_construct.py | Python | apache-2.0 | 4,468 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.