text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env/python
"""
make_enum.py -- make enumerations for positions
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2015 (c) Michael Conlon"
__license__ = "BSD 3-Clause license"
__version__ = "0.1.1"
from datetime import datetime
from vivopump import get_parms, create_enum
def main():
""... | atloiaco/vivo-pump | examples/positions/make_enum.py | Python | bsd-3-clause | 1,483 | 0.001349 |
#! /usr/bin/python
from model import *
# Utils ----------------------------------------------------------------------
def load_file(path):
return scipy.sparse.csr_matrix(cPickle.load(open(path)),
dtype=theano.config.floatX)
def compute_prauc(pred, lab):
pred = np.asarray(pred)
lab = np.asar... | while519/SME | Tensor_exp.py | Python | bsd-3-clause | 11,310 | 0.002918 |
# Copyright (c) 2014 Mirantis, 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... | chenyujie/hybrid-murano | murano/packages/load_utils.py | Python | apache-2.0 | 3,350 | 0 |
# -*- test-case-name: twisted.test.test_amp -*-
# Copyright 2005 Divmod, Inc. See LICENSE file for details
"""
This module implements AMP, the Asynchronous Messaging Protocol.
AMP is a protocol for sending multiple asynchronous request/response pairs over
the same connection. Requests and responses are both collect... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/protocols/amp.py | Python | bsd-3-clause | 60,989 | 0.002246 |
#
# (c) 2015, Peter Sprygada <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licens... | tsdmgz/ansible | lib/ansible/utils/module_docs_fragments/dellos9.py | Python | gpl-3.0 | 2,591 | 0.003088 |
#!/usr/bin/env python
import pysolr
import os.path
import sqlite3
import sys
import json
import Geohash
import re
import geojson
import shapely.wkt
from shapely.geometry import Polygon
from shapely.geometry import LineString
solr = pysolr.Solr('http://localhost:9999/solr/buildings')
solr.delete(q='*:*')
dbconn = sq... | straup/buildingequalsyes | bin/sqlite2solr.py | Python | bsd-2-clause | 3,932 | 0.006358 |
# vi: ts=4 expandtab syntax=python
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it an... | pwyliu/cloud-init-0.6.3 | cloudinit/CloudConfig/cc_rsyslog.py | Python | gpl-3.0 | 3,237 | 0.000618 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ${FILENAME}
#
# Copyright 2015 Anupam Mitra <anupam.mitra@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... | anupam-mitra/PySpikeSort | spikesort/features/spectral.py | Python | gpl-3.0 | 1,567 | 0.008296 |
import pytest
from django.urls import reverse
from adhocracy4.modules.models import Module
from adhocracy4.test.helpers import redirect_target
@pytest.mark.django_db
def test_module_delete_perms(client, phase, user, user2):
module = phase.module
module_delete_url = reverse('a4dashboard:module-delete', kwarg... | liqd/a4-meinberlin | tests/dashboard/test_dashboard_views_module_delete.py | Python | agpl-3.0 | 3,903 | 0 |
# Copyright 2016 - 2018 Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only
from pkg_resources import resource_filename
import marv_node.testing
from marv_node.testing import make_dataset, run_nodes, temporary_directory
from marv_robotics.detail import connections_section as node
from marv_store import Store
class ... | ternaris/marv-robotics | code/marv/marv_node/testing/_robotics_tests/test_section_topics.py | Python | agpl-3.0 | 960 | 0.002083 |
# 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 agr... | tvansteenburgh/PerfKitBenchmarker | tests/sample_test.py | Python | apache-2.0 | 1,098 | 0.001821 |
#!/usr/bin/python
# LADITools - Linux Audio Desktop Integration Tools
# Copyright (C) 2011-2012 Alessio Treglia <quadrispro@ubuntu.com>
# Copyright (C) 2007-2010, Marc-Olivier Barre <marco@marcochapeau.org>
# Copyright (C) 2007-2009, Nedko Arnaudov <nedko@arnaudov.name>
#
# This program is free software: you can redist... | alessio/laditools | laditools/jack.py | Python | gpl-3.0 | 8,258 | 0.013684 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
""" supervisor event listenner for generic script launching
launches a script (passed as $1+) and communicates with supervisor """
import sys
import pathlib
import datetime
import subprocess
def to_supervisor(text):
# only event... | openzim/zimfarm | dispatcher/backend/supervisor-listener.py | Python | gpl-3.0 | 1,917 | 0.000522 |
# engine/interfaces.py
# Copyright (C) 2005-2014 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
"""Define core interfaces used by the engine system."""
from .. impor... | olivierdalang/stdm | third_party/sqlalchemy/engine/interfaces.py | Python | gpl-2.0 | 31,317 | 0.000032 |
#!/usr/bin/env python
import threading
import dns
from dnsdisttests import DNSDistTest
class TestTrailing(DNSDistTest):
# this test suite uses a different responder port
# because, contrary to the other ones, its
# responders allow trailing data and we don't want
# to mix things up.
_testServerPor... | grahamhayes/pdns | regression-tests.dnsdist/test_Trailing.py | Python | gpl-2.0 | 2,718 | 0.004047 |
#
# 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
# ... | Hybrid-Cloud/conveyor | conveyor/conveyorheat/engine/resources/aws/cfn/wait_condition_handle.py | Python | apache-2.0 | 2,385 | 0 |
"""
extend TiddlyWiki serialization to optionally use beta or
externalized releases and add the UniversalBackstage.
activated via "twrelease=beta" URL parameter or ServerSettings,
see build_config_var
"""
import logging
from tiddlyweb.util import read_utf8_file
from tiddlywebwiki.serialization import Serialization... | TiddlySpace/tiddlyspace | tiddlywebplugins/tiddlyspace/betaserialization.py | Python | bsd-3-clause | 3,007 | 0.000998 |
#-------------------------------------------------------------------------------
# Name: homework 6
# Author: kirbs
# Created: 11/9/2013
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import urllib
import numpy
# ###############################... | JMill/edX-Learning-From-Data-Solutions-jm | Homework_6/Python/hw6_by_kirbs.py | Python | apache-2.0 | 3,869 | 0.010856 |
# (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | kwilliams-mo/iris | lib/iris/tests/test_grib_save.py | Python | gpl-3.0 | 10,295 | 0.002817 |
""" This module loads all the classes from the VTK Charts library into
its namespace. This is an optional module."""
import os
if os.name == 'posix':
from libvtkChartsPython import *
else:
from vtkChartsPython import *
| jeffbaumes/jeffbaumes-vtk | Wrapping/Python/vtk/charts.py | Python | bsd-3-clause | 230 | 0 |
#! /usr/bin/python
f = open("birds.txt", "r")
data = f.read()
f.close()
lines = data.split("\n")
print("Wrong: The number of lines is", len(lines))
for l in lines:
if not l:
# Can also do this: if len(l) == 0
lines.remove(l)
print("Right: The number of lines is", len(lines))
| shantnu/PyEng | WordCount/count_lines_fixed.py | Python | mit | 299 | 0.003344 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
libs_python=["functions"]
libs_php=[]
#aqui va el nombre de las bases de datos
dbs=["main"]
#variable para paso de parametros
p={}
consola=True
host="localhost"
consola_port=9999 | ZerpaTechnology/AsenZor | apps/votSys2/admin/settings/config.py | Python | lgpl-3.0 | 220 | 0.045455 |
"""A basic implementation of a Neural Network
by following the tutorial by Andrew Trask
http://iamtrask.github.io/2015/07/12/basic-python-network/
"""
import numpy as np
# sigmoid function
def nonlin(x, deriv=False):
if deriv==True:
return x * (1-x)
return 1 / (1 + np.exp(-x))
# input dataset
x = np.... | alexandercrosson/ml | neural_network/basic.py | Python | mit | 1,043 | 0.004794 |
'''
Created on 24 Feb 2015
@author: Ronny Andersson (ronny@andersson.tk)
@copyright: (c) 2015 Ronny Andersson
@license: MIT
'''
# Standard library
import unittest
# Third party
import nose
# Internal
from zignal.music import scales
class Test_midi_scales(unittest.TestCase):
# Benson, DJ. (2006). Music: A Math... | ronnyandersson/zignal | zignal/tests/test_music_scales.py | Python | mit | 5,855 | 0.006319 |
flight_file=open("flight.txt","w")
flight_file.write("Hello")
text=flight_file.read()
flight_file.close()
flight_file.closed # Returns whether the file is closed or not. | pk-python/basics | basics/files.py | Python | mit | 169 | 0.029586 |
#!/usr/bin/env python
# Licensed to Rackspace under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Rackspace licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use thi... | tilogaat/blueflood | demo/ingest.py | Python | apache-2.0 | 3,541 | 0.001977 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-23 22:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('backups', '0001_initial'),
]
operations = [
migrations.RemoveField(
model... | Landver/netmon | apps/backups/migrations/0002_auto_20170424_0117.py | Python | mit | 737 | 0 |
"""Vizio SmartCast Device support."""
from datetime import timedelta
import logging
from typing import Any, Callable, Dict, List, Optional, Union
from pyvizio import VizioAsync
from pyvizio.api.apps import find_app_name
from pyvizio.const import APP_HOME, INPUT_APPS, NO_APP_RUNNING, UNKNOWN_APP
from homeassistant.com... | tboyce021/home-assistant | homeassistant/components/vizio/media_player.py | Python | apache-2.0 | 18,119 | 0.000883 |
# Django settings for firsty project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'N... | theicfire/djangofun | src/firsty/settings.py | Python | bsd-3-clause | 5,085 | 0.001573 |
#!/usr/bin/env python
PACKAGE = 'hanse_pipefollowing'
import roslib; roslib.load_manifest('hanse_pipefollowing')
import rospy
import dynamic_reconfigure.server
import math
import smach
import smach_ros
import numpy
from geometry_msgs.msg import PoseStamped, Point, Twist, Vector3
from hanse_msgs.msg import Object, sollS... | iti-luebeck/HANSE2012 | hanse_ros/hanse_pipefollowing/nodes/pipefollowing.py | Python | bsd-3-clause | 10,171 | 0.033133 |
index = 20
bets = 25
names = ("Plain", "Cheval H", "Cheval V", "Trans", "Trans S", "Carre", "Colonne", "Simple")
for bet in range(bets):
col = 40
# --------------------------------------- money
print("""
when %d =>
if bets_index > %d then
fb_a_addr <= std_logic_vector(to_unsigned(COLS*21 + COLS... | dries007/Basys3 | python/RouletteMaker.py | Python | mit | 1,814 | 0.001654 |
import pybossa.sched as sched
from pybossa.forms.forms import TaskSchedulerForm
from pybossa.core import project_repo
from flask.ext.plugins import Plugin
from functools import wraps
import random
__plugin__ = "RandomScheduler"
__version__ = "0.0.1"
SCHEDULER_NAME = 'random'
def get_random_task(project_id, user_id=... | PyBossa/random-scheduler | random_scheduler/__init__.py | Python | agpl-3.0 | 1,346 | 0.001486 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import base64
import mimetypes
import re
from contextlib import contextmanager
from urllib.parse import ur... | ThiefMaster/indico | indico/modules/events/static/util.py | Python | mit | 6,995 | 0.002001 |
import os
import unittest
from blivet import Blivet
from blivet import util
from blivet.size import Size
from blivet.flags import flags
@unittest.skipUnless(os.environ.get("JENKINS_HOME"), "jenkins only test")
@unittest.skipUnless(os.geteuid() == 0, "requires root access")
class ImageBackedTestCase(unittest.TestCase... | wgwoods/blivet | tests/imagebackedtestcase.py | Python | gpl-2.0 | 3,326 | 0.001203 |
from colordetection import *
topColors(992780587437103) | PTAug/fashion-analytics | fashion-analytics/image-processing/testcolor.py | Python | apache-2.0 | 56 | 0.017857 |
"""
URL patterns for the views included in ``django.contrib.auth``.
"""
from django.conf.urls import patterns, url
from registration_withemail.forms import EldonUserAuthenticationForm
urlpatterns = patterns('',
url(r'^login/$', 'django.contrib.auth.views.login',
{'template_name': 'registration/login.html', 'a... | kamagatos/django-registration-withemail | registration_withemail/auth_urls.py | Python | bsd-2-clause | 1,200 | 0.0075 |
# -*- coding: utf-8 -*-
import json
from concurrent.futures import ThreadPoolExecutor
from datetime import date, timedelta
import requests
import common
# ------------------------------------------------------------------------
def grab(url):
requests.packages.urllib3.disable_warnings()
# 请求头
headers ... | Cuile/Grab-the-National-Train-Timetable | grab.py | Python | mit | 7,660 | 0.002094 |
from expects.testing import failure
from expects import *
from enerdata.contracts.tariff import *
from datetime import datetime, timedelta
from enerdata.datetime.timezone import TIMEZONE
from mamba import before, context, description, it
with description('Create a period'):
with it('accepts "te"'):
Tariff... | gisce/enerdata | spec/contracts/tariff_spec.py | Python | mit | 226,020 | 0.007597 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatter"
_path_str = "scatter.hoverlabel"
_valid_props = {
"align",
"ali... | plotly/plotly.py | packages/python/plotly/plotly/graph_objs/scatter/_hoverlabel.py | Python | mit | 17,848 | 0.000952 |
from genc.regions import (
Region,
REGIONS,
)
try:
basestring
except NameError: # pragma: no cover
basestring = str
def _build_cache(name):
idx = Region._fields.index(name)
return dict([(reg[idx].upper(), reg) for reg in REGIONS
if reg[idx] is not None])
_alpha2 = _build_c... | hannosch/genc | genc/__init__.py | Python | apache-2.0 | 935 | 0 |
from django.contrib import admin
from django.contrib.contenttypes.generic import GenericStackedInline
from reversion.admin import VersionAdmin
from test_project.test_app.models import ChildModel, RelatedModel, GenericRelatedModel, ProxyModel
class RelatedModelInline(admin.StackedInline):
model = RelatedMo... | empty/django-reversion | test_project/test_app/admin.py | Python | bsd-3-clause | 780 | 0.017949 |
import time
import numpy as np
from numpy import log, exp
from scipy.sparse import triu, csr_matrix
from scipy.special import gammaln
from scipy.stats import norm, lognorm
from .NCRMmcmc import NGGPmcmc
from .GGPgraphmcmc import tpoissonrnd
def MixGGPgraphmcmc(G, modelparam, mcmcparam, typegraph, verbose=True):
... | arongdari/sparse-graph-prior | sgp/MixGGPgraphmcmc.py | Python | mit | 7,905 | 0.002657 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | tedder/ansible-modules-core | utilities/helper/_fireball.py | Python | gpl-3.0 | 1,209 | 0.000827 |
#
# Copyright (C) 2006, 2013 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (... | giuseppe/virt-manager | virtManager/about.py | Python | gpl-2.0 | 1,472 | 0 |
#!/usr/bin/python
#
# Copyright 2018 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 ag... | google/google-ctf | 2017/quals/2017-re-food/dex_to_bytes.py | Python | apache-2.0 | 705 | 0.001418 |
import pytest
import sys
from _pydevd_bundle.pydevd_constants import IS_JYTHON, IS_IRONPYTHON
from tests_python.debug_constants import TEST_CYTHON
from tests_python.debug_constants import PYDEVD_TEST_VM
import site
import os
from _pydev_bundle import pydev_log
def pytest_report_header(config):
print('PYDEVD_USE_C... | fabioz/Pydev | plugins/org.python.pydev.core/pysrc/conftest.py | Python | epl-1.0 | 12,827 | 0.002495 |
from __future__ import unicode_literals
import os
import sys
import threading
from contextlib import contextmanager
from django.contrib.sites.models import Site
from mezzanine.conf import settings
from mezzanine.core.request import current_request
from mezzanine.utils.conf import middlewares_or_subclasses_installed
... | wbtuomela/mezzanine | mezzanine/utils/sites.py | Python | bsd-2-clause | 4,584 | 0.000218 |
# Copyright 2017 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 acc... | artemsok/sockeye | test/unit/test_attention.py | Python | apache-2.0 | 18,317 | 0.005186 |
"""Helper for aiohttp webclient stuff."""
from __future__ import annotations
import asyncio
from contextlib import suppress
from ssl import SSLContext
import sys
from typing import Any, Awaitable, cast
import aiohttp
from aiohttp import web
from aiohttp.hdrs import CONTENT_TYPE, USER_AGENT
from aiohttp.web_exceptions... | adrienbrault/home-assistant | homeassistant/helpers/aiohttp_client.py | Python | apache-2.0 | 5,482 | 0.000547 |
from django.core.management.base import BaseCommand, CommandError
from django.db import IntegrityError
import olympia.core.logger
from olympia.access.models import Group, GroupUser
from olympia.users.models import UserProfile
class Command(BaseCommand):
help = 'Add a new user to a group.'
log = olympia.core... | harikishen/addons-server | src/olympia/zadmin/management/commands/addusertogroup.py | Python | bsd-3-clause | 1,528 | 0 |
# -*- coding: utf-8 -*-
#################################################################################################
import json
import logging
import hashlib
import socket
import time
from datetime import datetime
from distutils.version import LooseVersion
from credentials import Credentials
from http import H... | angelblue05/plugin.video.emby | libraries/emby/core/connection_manager.py | Python | gpl-3.0 | 28,487 | 0.002457 |
from config.settings import STREAM_COLLECTION
from bson.objectid import ObjectId
from radio_db.models import BaseModel
class Stream(BaseModel):
def __init__(self, db, data):
super().__init__(db, collection=STREAM_COLLECTION)
self.stream_ip = data.get('stream_ip')
self.name = data.get... | wolendranh/movie_radio | admin/models.py | Python | apache-2.0 | 415 | 0.00241 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from db.common import Base
from db.specific_event import SpecificEvent
from db.event import Event
from db.player import Player
from db.team import Team
class Takeaway(Base, SpecificEvent):
__tablename__ = 'takeaways'
__autoload__ = True
HUMAN_RE... | leaffan/pynhldb | db/takeaway.py | Python | mit | 991 | 0 |
"""
Django settings for figexample project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | arbiterofcool/fig-seed | template/fig-django/figexample/settings.py | Python | mit | 2,114 | 0 |
#!/usr/bin/env python
#PYTHON 3 only
# Sample Windows Startup check -- Mail alert
# SurvivalAlert v1.0
# By thxer.com
# N-pn.fr Community and Hexpresso CTF team
import os
import socket
import ctypes
import smtplib
#Global Variables
HOSTNAME = str(socket.gethostname())
IPLAN = str(socket.gethostbyname(socket.gethos... | Thx3r/survivalAlertWin | SurvivalAlertWin.py | Python | gpl-2.0 | 2,493 | 0.015243 |
from a10sdk.common.A10BaseClass import A10BaseClass
class Udp(A10BaseClass):
"""Class Description::
Set UDP STUN timeout.
Class udp supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param port_start: {"description": "Port... | amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_lsn_stun_timeout_udp.py | Python | apache-2.0 | 1,644 | 0.009732 |
# Copyright 2015 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 ... | yebrahim/pydatalab | google/datalab/bigquery/commands/_bigquery.py | Python | apache-2.0 | 49,966 | 0.011348 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# Copyright: (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# Copyright: (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# Copyright: (c) 2015, Evan Kaufman <evan@digitalflophouse.com>
# Copyright: (c) 2015, Luca... | Jorge-Rodriguez/ansible | lib/ansible/modules/system/cron.py | Python | gpl-3.0 | 24,897 | 0.002691 |
# -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MetadataOptionsPage(object):
def setupUi(self, MetadataOptionsPage):
MetadataOptionsPage.setObjectName("MetadataOptionsPage")
Metada... | phw/picard | picard/ui/ui_options_metadata.py | Python | gpl-2.0 | 9,138 | 0.003174 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | gkc1000/pyscf | pyscf/geomopt/__init__.py | Python | apache-2.0 | 977 | 0.002047 |
# type: ignore
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import copy
from requests import Response
from typing import Callable
INCIDENT_TYPE_NAME = "Azure DevOps"
OUTGOING_MIRRORED_FIELDS = {'status': 'The status of the pull request.',
'titl... | demisto/content | Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py | Python | mit | 59,271 | 0.002733 |
#!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | sunqm/pyscf | pyscf/eph/eph_fd.py | Python | apache-2.0 | 5,884 | 0.008158 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('search', '0003_auto_20150826_0632'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | brianwc/courtlistener | cl/visualizations/migrations/0001_initial.py | Python | agpl-3.0 | 3,649 | 0.005755 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import erpnext
import unittest
from frappe.utils import nowdate, add_days
from erpnext.tests.utils import create_test_contact_and_address
from erpnext.sto... | indictranstech/erpnext | erpnext/stock/doctype/delivery_trip/test_delivery_trip.py | Python | agpl-3.0 | 2,568 | 0.025312 |
from mock import patch, sentinel, call
from arctic.scripts.arctic_fsck import main
from ...util import run_as_main
import sys
import pytest
def test_main():
with patch('arctic.scripts.arctic_fsck.Arctic') as Arctic, \
patch('arctic.scripts.arctic_fsck.get_mongodb_uri') as get_mongodb_uri, \
pa... | Frankkkkk/arctic | tests/unit/scripts/test_arctic_fsck.py | Python | lgpl-2.1 | 2,098 | 0.006673 |
"""Add ReceiverRanking
Revision ID: 7f5b8f65a977
Revises: c53fdb39f5a5
Create Date: 2020-12-02 22:33:58.821112
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7f5b8f65a977'
down_revision = 'c53fdb39f5a5'
branch_labels = None
depends_on = None
def upgrade():
... | Meisterschueler/ogn-python | migrations/versions/7f5b8f65a977_add_receiverranking.py | Python | agpl-3.0 | 2,677 | 0.004483 |
#!/usr/bin/env python3
# encoding: utf-8
"""
userdata_script.py - control an aws instance from a sqs queue
Run this guy on startup as a userdata script and he will connect to
s3 to download code to a directory, and run commands in it that are
provided by an SQS queue, one job at a time per core
Processing as a string... | cdw/multifil | multifil/aws/userdata.py | Python | mit | 3,807 | 0.008406 |
import html
from .helpers import *
from .track import Track
from .album import Album
class Discography:
"""
Discography class of Campdown. This class takes in a URL and treats it as a
Bandcamp discography page. Takes over downloading of files as well as
fetching of general information which can be ... | catlinman/campdown | campdown/discography.py | Python | mit | 10,389 | 0.001636 |
"""
Demonstrates how to use the labjack.ljm.eReadAddresses (LJM_eReadAddresses)
function.
"""
from labjack import ljm
# Open first found LabJack
handle = ljm.open(ljm.constants.dtANY, ljm.constants.ctANY, "ANY")
#handle = ljm.openS("ANY", "ANY", "ANY")
info = ljm.getHandleInfo(handle)
print("Opened a LabJack with ... | LAMAC-IFUNAM/lafrioc-electronics-labjack | Python_LJM/Examples/eReadAddresses.py | Python | gpl-3.0 | 1,058 | 0.008507 |
#!/usr/bin/env python
# -*- coding: UTF8 -*-
#
# Provides access to portaudio.
# Copyright (C) 2010 Josiah Gordon <josiahg@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ve... | zepto/musio | musio/portaudio/__init__.py | Python | gpl-3.0 | 830 | 0.003614 |
from django.conf.urls import url
from cobra.core.application import Application
from cobra.core.loading import get_class
class AutoCheckDashboardApplication(Application):
name = None
index_view = get_class('dashboard.autocheck.views', 'IndexView')
def get_urls(self):
urls = [
url(r'... | lyoniionly/django-cobra | src/cobra/apps/dashboard/autocheck/app.py | Python | apache-2.0 | 480 | 0 |
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | oppia/oppia | core/controllers/resources_test.py | Python | apache-2.0 | 33,854 | 0.000148 |
# This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# 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 Soft... | listyque/TACTIC-Handler | thlib/side/ntlm/des_c.py | Python | epl-1.0 | 9,208 | 0.016725 |
import unittest
import MonitorManager
import RamByteMonitor
import Constants
import logging
import Utils
#TODO figure out proper logging practice.
logging.basicConfig(level=logging.INFO)
class TestMonitorManager(unittest.TestCase):
def setUp(self):
self.manager = MonitorManager.MonitorManager()
... | tadgh/Shizuka | src/test_client/test_MonitorManager.py | Python | mit | 2,845 | 0.004569 |
"""Order 17: show time with give time and current time.
"""
class ShowTimeWithCurrentAndGiven(object):
@staticmethod
def show(current_timestamp=0, given_timestamp=0):
if current_timestamp - given_timestamp < 0:
return ''
if current_timestamp - given_timestamp < 120:
... | flyingSprite/spinelle | task_inventory/order_1_to_30/order_17_show_time_with_current_and_given.py | Python | mit | 1,185 | 0 |
'''
Configures the path to pyatspi. Exposes all other package contents.
@author: Eitan Isaacson
@author: Peter Parente
@organization: IBM Corporation
@copyright: Copyright (c) 2006, 2007 IBM Corporation
@license: BSD
All rights reserved. This program and the accompanying materials are made
available under the terms ... | javihernandez/accerciser-mirror | src/lib/accerciser/__init__.py | Python | bsd-3-clause | 1,039 | 0.014437 |
#!/usr/bin/env python
#
# Computation of the rate-distortion function for source coding with side
# information at the decoder using the Blahut-Arimoto algorithm.
#
# Formulation similar to R.E. Blahut "Computation of Channel Capacity and
# Rate-Distortion Functions," IEEE Transactions on Information Theory, 18,
# no. ... | isloux/Shannon | python/rbawz2.py | Python | bsd-3-clause | 3,690 | 0.066667 |
import unittest
from mox import MoxTestBase, IsA, IgnoreArg
import gevent
from gevent.socket import create_connection
from gevent.ssl import SSLSocket
from slimta.edge.smtp import SmtpEdge, SmtpSession
from slimta.envelope import Envelope
from slimta.queue import QueueError
from slimta.smtp.reply import Reply
from sli... | slimta/python-slimta | test/test_slimta_edge_smtp.py | Python | mit | 5,342 | 0 |
from numpy import arange, dtype, int64, float64
from bolt import array, ones
from bolt.utils import allclose
def test_shape(sc):
x = arange(2*3).reshape((2, 3))
b = array(x, sc)
assert b.shape == x.shape
x = arange(2*3*4).reshape((2, 3, 4))
b = array(x, sc)
assert b.shape == x.shape
def test... | bolt-project/bolt | test/spark/test_spark_basic.py | Python | apache-2.0 | 4,090 | 0.003912 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('million', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='game',
options={'ver... | codefisher/web_games | million/migrations/0002_auto_20150622_0949.py | Python | mit | 2,654 | 0.00113 |
## Non-optimized:
#
# from sklearn import grid_search, datasets
# from sklearn.ensemble import RandomForestClassifier
# from sklearn.grid_search import GridSearchCV
#
#
# digits = datasets.load_digits()
# X, y = digits.data, digits.target
# param_grid = {"max_depth": [3, None],
# "max_features": [1, 3, 1... | samgoodgame/sf_crime | iterations/spark-sklearn/spark_sklearn_test.py | Python | mit | 1,383 | 0.004345 |
#coding=utf-8
import json
import logging
import os
from pylibui.core import App
from pylibui.controls import Window, Tab, OpenGLArea
import cap.cap_manager
from session import create_session
from term import TextAttribute, TextMode, reserve
import term.term_keyboard
from term.terminal_gui import TerminalGUI
from term... | stonewell/pymterm | pymterm/term_pylibui/main.py | Python | mit | 10,403 | 0.007402 |
# Copyright 2013 OpenStack Foundation
# Copyright 2015, 2018 IBM Corp.
#
# 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/lice... | openstack/nova | nova/virt/powervm/disk/localdisk.py | Python | apache-2.0 | 8,561 | 0.000117 |
########################################################################
#
# Copyright 2014 Johns Hopkins University
#
# 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... | idies/pyJHTDB | tests.py | Python | apache-2.0 | 1,897 | 0.01845 |
# Copyright 2022 The Magenta 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 ... | magenta/magenta | magenta/pipelines/lead_sheet_pipelines.py | Python | apache-2.0 | 7,193 | 0.003337 |
from django.contrib.sites.models import Site
from django.db.utils import IntegrityError
from django.test import TestCase
from django.template import Context, Template
from simpleblocks.models import SimpleBlock
def render_to_string(template, data):
t = Template(template)
c = Context(data)
return t.render... | alfredo/django-simpleblocks | src/simpleblocks/tests.py | Python | bsd-3-clause | 1,975 | 0.000506 |
import sys
import os.path
# Add /testing/ to PYTHONPATH:
this_file_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.normpath(os.path.join(this_file_dir, 'testing')))
| vishnu2kmohan/dcos-commons | __init__.py | Python | apache-2.0 | 191 | 0 |
"""
Library for autotest-remote usage.
"""
import sys
import os
import re
import traceback
import signal
import time
import logging
import getpass
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared.settings import settings
require_atfork = settings.get_value('... | bigzz/autotest | server/autoserv.py | Python | gpl-2.0 | 8,355 | 0.001317 |
import pdb
import random
import sys
import numpy as np
from sklearn.model_selection import train_test_split
def recursive_dirichlet(cluster_spec, num_cells,
dirichlet_parameter_cluster_size):
num_clusters = len(cluster_spec)
cluster_sizes = np.ones(num_clusters)
while min(cluste... | nicococo/scRNA | scRNA/simulation.py | Python | mit | 24,906 | 0.003132 |
#
# 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 us... | chamikaramj/incubator-beam | sdks/python/apache_beam/examples/snippets/snippets.py | Python | apache-2.0 | 40,001 | 0.0134 |
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import sys
test_suite = "tests"
tests_require = ["mongo-orchestration >= 0.2, < 0.4", "requests >= 2.5.1"]
if sys.version_info[:2] == (2, 6):
# Need unittest2 to... | LaoLiulaoliu/hzkgelastic2-doc-manager | setup.py | Python | apache-2.0 | 2,047 | 0.000489 |
import os
from qmpy import *
from django.test import TestCase
peak_locations = []
class MiedemaTestCase(TestCase):
def setUp(self):
read_elements()
def test_methods(self):
## test that it generally works
self.assertEqual(Miedema("FeNi").energy, -0.03)
self.assertEqual(Miedem... | wolverton-research-group/qmpy | qmpy/analysis/tests.py | Python | mit | 1,996 | 0.001503 |
"""
Redis check tests.
"""
import logging
import os
import unittest
import subprocess
import time
import pprint
import redis
from tests.common import load_check
from nose.plugins.skip import SkipTest
logger = logging.getLogger()
MAX_WAIT = 20
NOAUTH_PORT = 16379
AUTH_PORT = 26379
DEFAULT_PORT = 6379
MISSING_KEY_TOLER... | sapcc/monasca-agent | tests_to_fix/test_redis.py | Python | bsd-3-clause | 5,369 | 0.001863 |
from django.core.urlresolvers import reverse_lazy
from django.views.generic import View
from hopes.forms import StudentForm, SchoolForm, OneTimeForm, SpecificDateTimeForm
from hopes.models import Student, School, OneTime, SpecificDateTime
from vanilla import CreateView, DeleteView, ListView, UpdateView
class ListStu... | elcolie/fight | hopes/views.py | Python | mit | 2,543 | 0.002359 |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2016 CERN.
#
# B2Share is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | emanueldima/b2share | b2share/modules/files/cli.py | Python | gpl-2.0 | 3,385 | 0.001182 |
# -*- coding: utf-8 -*-
# generated from catkin/cmake/template/__init__.py.in
# keep symbol table as clean as possible by deleting all unnecessary symbols
from os import path as os_path
from sys import path as sys_path
from pkgutil import extend_path
__extended_path = "/home/pi/Documents/desenvolvimentoRos/src/tf2_r... | UnbDroid/robomagellan | Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/tf2_ros/__init__.py | Python | gpl-3.0 | 1,035 | 0.000966 |
# -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand
from django_datawatch.datawatch import Scheduler
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--force',
action='store_true',
dest='force',
defa... | RegioHelden/django-datawatch | django_datawatch/management/commands/datawatch_run_checks.py | Python | mit | 701 | 0.001427 |
from pupa.scrape import Jurisdiction, Organization
from .bills import MNBillScraper
from .committees import MNCommitteeScraper
from .people import MNPersonScraper
from .vote_events import MNVoteScraper
from .events import MNEventScraper
from .common import url_xpath
"""
Minnesota legislative data can be found at the O... | cliftonmcintosh/openstates | openstates/mn/__init__.py | Python | gpl-3.0 | 5,612 | 0.000713 |
def saveData(X, f_out, colfmt='%i'):
'''
Quick alias for saving data matricies. If X and f_out are tuples,
this function will save multiple matricies at once.
'''
import numpy as np
if isinstance(X, tuple):
assert(len(X) == len(f_out))
for idx,Z in enumerate(X):
... | mattdelhey/kaggle-galaxy | saveData.py | Python | mit | 440 | 0.004545 |
#!/usr/bin/env python3
#
#
#
# This file is part of librix-thinclient.
#
# librix-thinclient 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 ver... | andrevmatos/Librix-ThinClient | src/ui/export/ssh_export/__init__.py | Python | gpl-2.0 | 739 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.