code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import re
import logging
import time
import uuid
import os
import tempfile
import json
import base64
from textwrap import dedent
from threading import Thread
from datetime import datetime
from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error
import yaml
from botocore.exceptions i... | amoskong/scylla-cluster-tests | sdcm/cluster_aws.py | Python | agpl-3.0 | 47,032 |
# Utilities for printing ASN.1 values
def bits_to_hex(bit_array, delimiter=":"):
"""Convert a bit array to a prettily formated hex string. If the array
length is not a multiple of 8, it is padded with 0-bits from the left.
For example, [1,0,0,1,1,0,1,0,0,1,0] becomes 04:d2.
Args:
bit_array: th... | balena/python-smime | smime/print_util.py | Python | apache-2.0 | 3,175 |
"""
Model class for MyTardis API v1's InstrumentResource.
See: https://github.com/mytardis/mytardis/blob/3.7/tardis/tardis_portal/api.py
"""
from __future__ import print_function
import json
import logging
import requests
from mytardisclient.conf import config
from .facility import Facility
from .resultset import Re... | wettenhj/mytardisclient | mytardisclient/models/instrument.py | Python | gpl-3.0 | 4,860 |
def fu<caret>nc(b):
pass
| siosio/intellij-community | python/testData/refactoring/changeSignature/newParameterWithSignatureDefaultBeforeExistingWithoutSignatureDefault.py | Python | apache-2.0 | 29 |
import abc
__author__ = 'paoolo'
class Listener(object):
@abc.abstractmethod
def handle(self, response):
pass | project-capo/amber-python-clients | src/amberclient/common/listener.py | Python | mit | 128 |
import pandas as pd
from link import lnk
import IPython.core.display as d
import os
import sys
def df_to_json(df, columns=False):
"""
Returns columns in a Pandas dataframe as a JSON object
with the following structure:
{
"col_name":[val1,val2,val3],
"col_name2":[val1,v... | babraham123/script-runner | utility_functions.py | Python | mit | 9,325 |
class ProfileAgent(object):
""" A class that communicates to a profiler which assembler code belongs to
which functions. """
def startup(self):
pass
def shutdown(self):
pass
def native_code_written(self, name, address, size):
pass
| oblique-labs/pyVM | rpython/jit/backend/x86/profagent.py | Python | mit | 278 |
from tests import mock
from tests import unittest
from botocore.history import HistoryRecorder
from botocore.history import BaseHistoryHandler
from botocore.history import get_global_history_recorder
class TerribleError(Exception):
pass
class ExceptionThrowingHandler(BaseHistoryHandler):
def emit(self, eve... | boto/botocore | tests/unit/test_history.py | Python | apache-2.0 | 3,187 |
from django import template
register = template.Library()
@register.assignment_tag
def get_new_notifications_count(user):
"""Usually used to display an unread notifications counter"""
from notifier.models import Notification
return user.notifications.exclude(noti_type=Notification.EMAIL_NOTI).filter(dis... | Nomadblue/django-nomad-notifier | notifier/templatetags/notifier_tags.py | Python | bsd-3-clause | 342 |
from __future__ import absolute_import, division, print_function
import sys
import platform
import os
import _pytest._code
from _pytest.debugging import SUPPORTS_BREAKPOINT_BUILTIN
import pytest
_ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "")
def runpdb_and_get_report(testdir, source):
p = t... | ddboline/pytest | testing/test_pdb.py | Python | mit | 23,373 |
from django.db import models
class Club(models.Model):
"""
동아리 정보
"""
class Meta:
verbose_name = '동아리 정보'
verbose_name_plural = '동아리 정보(들)'
def __str__(self):
return str(self.name)
name = models.CharField(
max_length=63,
verbose_name='동아리 이름',
)
... | hangpark/kaistusc | apps/ot/models/club.py | Python | bsd-2-clause | 1,725 |
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from navigation.api import register_top_menu
from navigation.api import register_links
from project_setup.api import register_setup
from project_tools.api import register_tool
from .conf.se... | rosarior/mayan | apps/main/__init__.py | Python | gpl-3.0 | 2,420 |
# -*- coding: utf-8 -*-
from .schema import Schema, SchemaOpts
__version__ = '0.7.0'
__author__ = 'Steven Loria'
__license__ = 'MIT'
__all__ = (
'Schema',
'SchemaOpts',
)
| Tim-Erwin/marshmallow-jsonapi | marshmallow_jsonapi/__init__.py | Python | mit | 181 |
import numpy as np
import matplotlib.pyplot as plt
import random
#x = [1,2,3,4]
#y = [1,2,1,1]
random.seed(0)
x = np.array([0.0, 10.0, 20.0, 30.0, 40.0, 50.0])
y = np.array([0.0, 0.8, 0.9, 0.1, -0.8, -1.0])
z = np.polyfit(x, y, 3)
p = np.poly1d(z)
print "coeffs:", z
print "P3: ", p
print "P(0.5)", p(5)
for j in ... | squeakus/copresence | debug/polysim2.py | Python | gpl-2.0 | 830 |
import json
from ._BaseModel import BaseModel
from .DiffOrderBook import DiffOrderBook
from .Order import Order
from .OrderBook import OrderBook
from .Trade import Trade
class Stream(BaseModel):
def __init__(self, timestamp, datetime, payload):
self._timestamp = timestamp
self._datetime = dateti... | oxsoftdev/bitstampws | bitstampws/models/Stream.py | Python | mit | 1,556 |
# validate.py
# A Validator object
# Copyright (C) 2005-2014:
# (name) : (email)
# Michael Foord: fuzzyman AT voidspace DOT org DOT uk
# Mark Andrews: mark AT la-la DOT com
# Nicola Larosa: nico AT tekNico DOT net
# Rob Dennis: rdennis AT gmail DOT com
# Eli Courtwright: eli AT courtwright DOT org
# This software is l... | ruibarreira/linuxtrail | usr/lib/python2.7/dist-packages/validate.py | Python | gpl-3.0 | 47,237 |
# (C) British Crown Copyright 2013 - 2018, 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... | duncanwp/iris | lib/iris/tests/unit/cube/test_Cube.py | Python | lgpl-3.0 | 73,611 |
from rest_framework import serializers
# Serializer will look at models and convert them to JSON for us
from .models import List, Card #our models
# Have to load CardSerializer before List for order of operations
class CardSerializer(serializers.ModelSerializer):
# Model we are representing is Card
class Meta... | jantaylor/djangular-scrum | scrumboard/serializers.py | Python | mit | 663 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# BEGIN PYTHON 2/3 COMPATIBILITY BOILERPLATE
from __future__ import absolute_import
from __future__ import with_statement
from __future__ import division
from __future__ import nested_scopes
from __future__ import generators
from __future__ import unicode_literals
from __future... | michaelerule/neurotools | gpu/cu/function.py | Python | gpl-3.0 | 10,277 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v10/services/types/campaign_bid_modifier_service.py | Python | apache-2.0 | 6,664 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleads/google-ads-python | google/ads/googleads/v8/services/services/conversion_upload_service/client.py | Python | apache-2.0 | 25,206 |
# 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 ... | rjschwei/azure-sdk-for-python | azure-batch/azure/batch/models/task_scheduling_error.py | Python | mit | 1,889 |
# 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 t... | sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/keystoneclient/auth/identity/__init__.py | Python | mit | 1,089 |
import os
import sys
import urllib
import time
import logging
import pytest
import mock
# Config
if sys.platform == "win32":
PHANTOMJS_PATH = "tools/phantomjs/bin/phantomjs.exe"
else:
PHANTOMJS_PATH = "phantomjs"
SITE_URL = "http://127.0.0.1:43110"
# Imports relative to src dir
sys.path.append(
os.path.a... | ak-67/ZeroNet | src/Test/conftest.py | Python | gpl-2.0 | 3,844 |
# -*- coding: utf-8 -*-
ADMIN_MAPPING = {
'admin_user_suspend': {
'resource': 'admin/users/{id}/suspend',
'docs': ('http://docs.discourse.org/#tag/'
'Admin%2Fpaths%2F~1admin~1users~1%7Bid%7D~1suspend%2Fput'),
'methods': ['PUT'],
},
'admin_user_unsuspend': {
... | 0xc0ffeec0de/tapioca-discourse | tapioca_discourse/resource_mapping/admin.py | Python | mit | 3,741 |
from couchdeploy import coudeploy
| torque59/nosqlpot | couchpot/__init__.py | Python | gpl-2.0 | 34 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | hclhkbu/dlbench | tools/tensorflow/rnn/lstm/lstm.py | Python | mit | 12,444 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import sys
import unittest
import glob
import requests
from mock import Mock
from mock import patch
from mock import ANY
from sanji.connection.mockup import Mockup
from sanji.message import Message
try:
sys.path.append(os.path.dirname(os.path.realpath(__file_... | Sanji-IO/sanji-status | tests/test_index.py | Python | gpl-2.0 | 6,649 |
from .workout import Workout
from .duration import Time
from .duration import Distance | claha/suunto | suunto/__init__.py | Python | mit | 86 |
from django.core.files.base import File
from django.db.models.fields.files import (
FieldFile,
ImageFieldFile,
ImageFileDescriptor
)
from .mixins import VersatileImageMixIn
class VersatileImageFieldFile(VersatileImageMixIn, ImageFieldFile):
def __getstate__(self):
# VersatileImageFieldFile n... | WGBH/django-versatileimagefield | versatileimagefield/files.py | Python | mit | 4,601 |
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2014, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####################################... | krull/docker-zenoss4 | init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.Microsoft.Windows-2.6.9.egg/ZenPacks/zenoss/Microsoft/Windows/progresslog.py | Python | gpl-3.0 | 2,355 |
"""Generic linux daemon base class for python 3.x."""
import sys, os, time, atexit, signal
class Daemon:
"""A generic daemon class.
Usage: subclass the daemon class and override the run() method."""
def __init__(self, pidfile): self.pidfile = pidfile
def daemonize(self):
"""Deamonize class. UNIX double fork... | mmalter/eudaimonia | src/eudaimon.py | Python | gpl-3.0 | 2,659 |
# Copyright 2022 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | google/pigweed | pw_console/py/pw_console/quit_dialog.py | Python | apache-2.0 | 5,489 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "corpus_browser.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| myaser/DAPOS_corpus_browser | corpus_browser/manage.py | Python | mit | 257 |
import time
name = input("Enter your name: ")
age = input("Enter your age: ")
repeat = input("How many times would you like to print this message? ")
current_year = time.localtime().tm_year
born_year = current_year - int(age)
for count in range(int(repeat)):
print("\nPrinting message #%d:" % int(count+1), "\tDe... | stackingfunctions/practicepython | src/01-character_input.py | Python | mit | 388 |
import pandas
import numpy as np
from statsmodels.tools import data
def test_missing_data_pandas():
"""
Fixes GH: #144
"""
X = np.random.random((10,5))
X[1,2] = np.nan
df = pandas.DataFrame(X)
vals, cnames, rnames = data.interpret_data(df)
np.testing.assert_equal(rnames.tolist(), [0,2,... | hlin117/statsmodels | statsmodels/tools/tests/test_data.py | Python | bsd-3-clause | 1,758 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#********************************************************************
# ZYNTHIAN PROJECT: update_envars.py
#
# Update $ZYNTHIAN_CONFIG_DIR/zynthian_envars.sh with the
# file given as first argument
#
# Copyright (C) 2015-2020 Fernando Moyano <jofemodo@zynthian.org>
#
#****... | zynthian/zynthian-sys | sbin/update_envars.py | Python | gpl-3.0 | 2,536 |
import types
import signal
from PyQt4 import QtGui
from PyQt4 import QtCore
from qt4_gui import _GUI, _PropertiesDialog, _BasicNodeActions
import layouts
from ete_dev import Tree, PhyloTree, ClusterTree
from main import save
from qt4_render import _TreeScene, render, get_tree_img_map, init_tree_style
__all__ = ["s... | khughitt/ete | ete_dev/treeview/drawer.py | Python | gpl-3.0 | 2,766 |
# -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | immanetize/nikola | nikola/plugins/task/sources.py | Python | mit | 3,426 |
VERSION = (0, 1, 3)
__version__ = VERSION
__versionstr__ = '.'.join(map(str, VERSION)) | arktos65/elasticsearch-tools | lib/__init__.py | Python | apache-2.0 | 86 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import os
import os.path
import pathlib
import platform
import unittest
from .lib.testcase import IntegrationTestCase
if plat... | facebookexperimental/eden | eden/integration/linux_cgroup_test.py | Python | gpl-2.0 | 2,902 |
from base import Base
import nodes | Derfies/doodads | dynamicInheritance/game/__init__.py | Python | mit | 34 |
# Copyright 2020 The Matrix.org Foundation C.I.C.
#
# 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 a... | matrix-org/synapse | synapse/config/redis.py | Python | apache-2.0 | 1,857 |
#!/usr/bin/env python
import sys
import rospy
from geometry_msgs.msg import Point, Pose
class left_data:
"""Pose data for left arm"""
def __init__(self):
self.targetPose0 = Pose()
"""Pose 0 left arm"""
self.targetPose1 = Pose()
"""Pose 1 left arm"""
self.targetPose2 = Pose()
"""Pose 2 left arm"""
sel... | enriquecoronadozu/baxter_pointpy | src/point_data.py | Python | gpl-2.0 | 3,046 |
# (C) British Crown Copyright 2011 - 2012, Met Office
#
# This file is part of metOcean-mapping.
#
# metOcean-mapping 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 Licens... | metarelate/metOcean-mapping | lib/editor/app/forms.py | Python | gpl-3.0 | 20,915 |
import superimport
import numpy as np
import matplotlib.pyplot as plt
import pyprobml_utils as pml
err = np.linspace(-3.0, 3.0, 60)
L1 = abs(err);
L2 = err**2;
delta = 1.5;
ind = abs(err) <= delta;
huber = np.multiply(0.5*ind, (err**2)) + np.multiply((1-ind) , (delta*(abs(err)-delta/2)))
vapnik = np.multiply(ind, 0)... | probml/pyprobml | scripts/huberLossPlot.py | Python | mit | 583 |
from redis.connection import ConnectionPool, UnixDomainSocketConnection
try:
from redis.connection import SSLConnection
except ImportError:
SSLConnection = None
from threading import Lock
from rb.router import PartitionRouter
from rb.clients import RoutingClient, LocalClient
class HostInfo(object):
def... | Stranger6667/rb | rb/cluster.py | Python | apache-2.0 | 10,521 |
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
views = UnwrapElement(IN[0])
booleans = list()
for view in views:
if str(view.ViewType) == 'Schedule':
booleans.append(True)
else:
booleans.append(False)
OUT = booleans | andydandy74/ClockworkForDynamo | nodes/0.7.x/python/View.TypeIsSchedule.py | Python | mit | 250 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 12 11:32:41 2017
@author: Ludi Cao
"""
import time
import datetime
import csv
from Adafruit_BME280 import *
import os
import numpy as np
import dateutil
from matplotlib.dates import DateFormatter
import matplotlib.pyplot as plt
from collections import deque
class weather... | cllamb0/dosenet-raspberrypi | weather_DAQ.py | Python | mit | 10,219 |
import requests
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
class HipChatIsUpPlugin(WillPlugin):
@periodic(second='36')
def hipchat_is_up(self):
try:
r = requests.get("https://status.hipch... | skoczen/will | will/plugins/devops/hipchat_is_up.py | Python | mit | 859 |
from django.db import models
from django.utils import timezone
class Note(models.Model):
author = models.ForeignKey('auth.User')
title = models.CharField(max_length=200)
text = models.TextField()
created_date = models.DateTimeField(
default=timezone.now)
published_date = models.DateTime... | kcchaitanya/Notes_Django | notes/models.py | Python | mit | 501 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp import api, fields, models, _
import openerp.addons.decimal_precision as dp
from openerp.exceptions import UserError
class SaleAdvancePaymentInv(models.TransientModel):
_name = "sale.advance.payment.inv"
_desc... | vileopratama/vitech | src/addons/sale/wizard/sale_make_invoice_advance.py | Python | mit | 7,554 |
data = [ i for i in range(10**12)] | heticor915/ProgrammingContest | CodeForces/318_A/solve.py | Python | lgpl-3.0 | 34 |
# # install postgres
# brew install postgres
# # start server
# pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# after running this you can query by psql -d acs
import subprocess
import sys
def create_db(db):
cmd = "CREATE DATABASE " + db
# needs to run from base db postgres
run_c... | jfeser/ImputeDB | acs/make_acs_db.py | Python | mit | 1,275 |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/entry/graphic_generator.py | Python | apache-2.0 | 14,662 |
import nbformat
from nbconvert.preprocessors import CellExecutionError
from nbconvert.preprocessors import ExecutePreprocessor
from glob import glob
notebook_filenames_l = glob("notebooks/*.ipynb")
for notebook_filename in notebook_filenames_l:
with open(notebook_filename) as f:
print("Executing notebook... | tboch/mocpy | test_notebooks.py | Python | gpl-3.0 | 777 |
import time
t1 = time.time()
# use array to represent numbers backwards
def toArray(num):
a = []
while num >0:
a.append(num%10)
num = num //10
return a
def addReverse(x):
result = []
for i in range(0,len(x)):
result.append(x[i]+x[len(x)-1-i])
for i in range(0,len(resu... | Adamssss/projectEuler | Problem 001-150 Python/pb055.py | Python | mit | 932 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | sputnick-dev/weboob | weboob/tools/application/formatters/csv.py | Python | agpl-3.0 | 1,335 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ConfigurationListResponse(object):
"""
NOTE: This ... | kinow-io/kinow-python-sdk | kinow_client/models/configuration_list_response.py | Python | apache-2.0 | 3,544 |
#!/usr/local/bin/python
#demultiplex.py
#Class and function definitions providing functionality in the mubiomics
#package.
# Copyright (C) <2012> <Benjamin C. Smith>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | benjsmith/mubiomics | MPSDemultiplexer/demultiplex.py | Python | gpl-3.0 | 11,452 |
# ------------------------------------------------------------------------------
# This file is part of PyTango (http://pytango.rtfd.io)
#
# Copyright 2006-2012 CELLS / ALBA Synchrotron, Bellaterra, Spain
# Copyright 2013-2014 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of ... | tango-cs/PyTango | setup.py | Python | lgpl-3.0 | 18,899 |
from sm.so.service_orchestrator import LOG
from novaclient import client
from emm_exceptions.NotFoundException import NotFoundException
from model.Entities import Key, Flavor, Image, Quotas
__author__ = 'lto'
class Client:
def __init__(self, conf=None):
if not conf:
from util.SysUtil impor... | MobileCloudNetworking/maas | bundle/clients/nova.py | Python | apache-2.0 | 3,217 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2011 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... | tp81/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/controller/__init__.py | Python | gpl-2.0 | 2,099 |
# 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 t... | ctrlaltdel/neutrinator | vendor/openstack/identity/version.py | Python | gpl-3.0 | 1,236 |
# Time-stamp: <2019-09-25 10:04:48 taoliu>
"""Description: Fine-tuning script to call broad peaks from a single
bedGraph track for scores.
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file LICENSE included with
the distribution).
"""
# ------------... | taoliu/MACS | MACS2/bdgbroadcall_cmd.py | Python | bsd-3-clause | 2,141 |
#!/usr/bin/python
import sys, os, operator, smtplib, re
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_email(addr, subject, msg_body):
email_subject = subject
from_addr="confer@csail.mit.edu"
to_addr = [addr, 'confer@csail.mit.edu']
msg = MIMEMultipart()
ms... | anantb/confer | scripts/cscw2014/send_email.py | Python | mit | 1,516 |
"""
kombu.transport.filesystem
==========================
Transport using the file system as the message store.
"""
from __future__ import absolute_import
from Queue import Empty
from anyjson import loads, dumps
import os
import shutil
import time
import uuid
import tempfile
from . import virtual
from kombu.excep... | mozilla/firefox-flicks | vendor-local/lib/python/kombu/transport/filesystem.py | Python | bsd-3-clause | 5,565 |
# -*- coding: utf-8 -*-
import codecs
from distutils.core import setup
version = __import__('osmapi').__version__
try:
import pypandoc
from unidecode import unidecode
description = codecs.open('README.md', encoding='utf-8').read()
description = unidecode(description)
description = pypandoc.conver... | austinhartzheim/osmapi | setup.py | Python | gpl-3.0 | 1,507 |
# ------------------------------------------------------------------------------
# Name: __init__
# Purpose: Package information for h5cube
#
# Author: Brian Skinn
# bskinn@alum.mit.edu
#
# Created: 22 Aug 2016
# Copyright: (c) Brian Skinn 2016
# License: The MIT License; see "L... | bskinn/h5cube | h5cube/__init__.py | Python | mit | 652 |
from pymt import *
from pyglet.gl import *
class AlphaWindow(MTWidget):
def __init__(self, **kwargs):
super(AlphaWindow, self).__init__(**kwargs)
self.tsize = (64, 64)
self.fbo1 = Fbo(size=self.tsize)
self.fbo2 = Fbo(size=self.tsize)
self.fbo3 = Fbo(size=self.tsize)
... | nuigroup/nuipaint | tests/alphalayer-test.py | Python | gpl-3.0 | 2,967 |
"""
This inline scripts makes it possible to use mitmproxy in scenarios where IP spoofing has been used to redirect
connections to mitmproxy. The way this works is that we rely on either the TLS Server Name Indication (SNI) or the
Host header of the HTTP request.
Of course, this is not foolproof - if an HTTPS connectio... | noikiy/mitmproxy | examples/dns_spoofing.py | Python | mit | 1,652 |
from django.apps import AppConfig
class ListsConfig(AppConfig):
name = "lists"
| syrusakbary/snapshottest | examples/django_project/lists/apps.py | Python | mit | 85 |
#
# Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | mkuron/espresso | testsuite/python/galilei.py | Python | gpl-3.0 | 2,661 |
from jmessage import users
from jmessage import common
from conf import *
import time
import json
jmessage=common.JMessage(app_key,master_secret)
groups=jmessage.create_groups()
response=groups.get_groups_list("1","2")
time.sleep(2)
print (response.content) | jpush/jmessage-api-python-client | example/groups/get_groups_list.py | Python | mit | 260 |
import os
import unittest
from distutils.version import StrictVersion
from walrus import Database
HOST = os.environ.get('WALRUS_REDIS_HOST') or '127.0.0.1'
PORT = os.environ.get('WALRUS_REDIS_PORT') or 6379
db = Database(host=HOST, port=PORT, db=15)
REDIS_VERSION = None
def requires_version(min_version):
de... | coleifer/walrus | walrus/tests/base.py | Python | mit | 1,551 |
from model_utils import Choices
STATUS = Choices('active', 'inactive', 'deleted')
DEFAULT_STATUS = Choices('active', 'pending')
| nagyistoce/geokey | geokey/categories/base.py | Python | apache-2.0 | 129 |
class AppConfHelper(object):
def __new__(cls):
if not hasattr(cls, 'instance'):
cls.instance = super(AppConfHelper, cls).__new__(cls)
cls.instance._appconf = None
return cls.instance
def initialize(self, config):
self._appconf = config
def find_replacement(s... | aspyatkin/assetoolz | assetoolz/appconf.py | Python | mit | 669 |
# -*- coding: utf-8 -*-
#
# mini-dinstall-ng documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 3 18:06:14 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 fi... | coffeemakr/mini-dinstall-ng | doc/conf.py | Python | gpl-3.0 | 8,442 |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | QISKit/qiskit-sdk-py | qiskit/result/postprocess.py | Python | apache-2.0 | 6,761 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This a distutils script for creating distribution archives.
#
# Copyright (C) 2010 Kamil Páral <kamil.paral /at/ gmail /dot/ com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lice... | kparal/jabber-roster | setup.py | Python | agpl-3.0 | 2,183 |
# -*- encoding: utf-8 -*-
# Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
import sys
try:
from ast import PyCF_ONLY_AST
except ImportError:
PyCF_ONLY_AST = 1024
from setuptools import setup
def get_version():
retu... | miing/mci_migo_packages_django-preflight | setup.py | Python | agpl-3.0 | 1,975 |
'''
Created on Oct 30, 2015
@author: kashefy
'''
from nose.tools import assert_false, assert_true, assert_is_instance, \
assert_equal, assert_greater, assert_in, assert_list_equal
import os
import tempfile
import shutil
import sys
import nideep.iow.file_system_utils as fs
from nideep.eval.log_utils import is_caffe... | kashefy/caffe_sandbox | nideep/iow/test_file_system_utils.py | Python | bsd-2-clause | 3,184 |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import prelu
fX = theano.config.floatX
def test_prelu_node_serialization():
tn.check_serialization(prelu.PReLUNode("a"))
def test_prelu_node():
network ... | diogo149/treeano | treeano/sandbox/nodes/tests/prelu_test.py | Python | apache-2.0 | 666 |
'''Script used to test bucketlist response and request. '''
from rest_framework.authtoken.models import Token
from rest_framework.test import APIClient
from django.core.urlresolvers import reverse_lazy
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth.models import ... | andela-sjames/django-bucketlist-application | bucketlistapp/bucketlistapi/tests/test_bucketlist.py | Python | gpl-3.0 | 2,836 |
#
# This file is a part of KNOSSOS.
#
# (C) Copyright 2007-2011
# Max-Planck-Gesellschaft zur Foerderung der Wissenschaften e.V.
#
# KNOSSOS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 of
# the License as published by the Free So... | thorbenk/knossos-svn | tools/kconfig.py | Python | gpl-2.0 | 9,251 |
import time
import os
from selenium import webdriver
from selenium.common import exceptions
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("app-path=" + os.path.dirname(os.path.abspath(__file__)))
chrome_options.add_argument("ABC")
driver = webdriver.Chrom... | pdx1989/nw.js | test/remoting/nw-custom/rc4-lowercase-cmd-param(win)/test.py | Python | mit | 550 |
from datetime import datetime
from django.conf import settings
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.module_loading import import_string
import boto
from boto.s3.connection import OrdinaryCallingFormat
from ce... | fxa90id/mozillians | mozillians/common/mixins.py | Python | bsd-3-clause | 3,443 |
import os
import yaml
from twisted.internet.defer import inlineCallbacks
from juju.environment import environment
from juju.environment.config import EnvironmentsConfig, SAMPLE_CONFIG
from juju.environment.environment import Environment
from juju.environment.errors import EnvironmentsConfigError
from juju.errors impo... | anbangr/trusted-juju | juju/environment/tests/test_config.py | Python | agpl-3.0 | 28,757 |
# -*- coding: utf-8 -*-
#
# pytity documentation build configuration file, created by
# sphinx-quickstart on Sat Jan 24 22:22:46 2015.
#
# 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.
#
# Al... | marienfressinaud/pytity | doc/conf.py | Python | mit | 8,227 |
# Copyright 2017 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 ... | AllanYangZhou/oppia | core/storage/question/gae_models_test.py | Python | apache-2.0 | 2,014 |
# -*- coding: utf-8 -*-
"""
pages.py
~~~~~~
:copyright: (c) 2014 by @zizzamia
:license: BSD (See LICENSE for details)
"""
from flask import Blueprint, request, g
# Imports inside Bombolone
import bombolone.core.pages
from bombolone.core.utils import jsonify, set_message
from bombolone.core.pages import Pages
from bo... | Opentaste/bombolone | bombolone/api/pages.py | Python | bsd-3-clause | 1,914 |
../../../../../../share/pyshared/ubuntuone-storage-protocol/ubuntuone/storageprotocol/delta.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/ubuntuone/storageprotocol/delta.py | Python | gpl-3.0 | 94 |
# Copyright (c) 2015 Uber Technologies, Inc.
#
# 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
# to use, copy, modify, merge, publ... | ianmabie/uberpy | venv/lib/python2.7/site-packages/tests/test_session.py | Python | mit | 8,880 |
from src.util import *
import os
from nose.tools import *
filename = "basic"
def removeFiles():
os.remove(filename)
@with_setup(teardown = removeFiles)
def testBasicInstaParseFile():
simpleFile = InstaParseFile(filename)
simpleFile.write("abc")
simpleFile.save()
simpleFile.writeLine("def")
s... | ImpGuard/instaparse | tests/util_test.py | Python | mit | 1,973 |
import unittest
from golem.network.p2p.node import Node
def is_ip_address(address):
"""
Check if @address is correct IP address
:param address: Address to be checked
:return: True if is correct, false otherwise
"""
from ipaddress import ip_address, AddressValueError
try:
# will rai... | Radagast-red/golem | tests/golem/network/p2p/test_node.py | Python | gpl-3.0 | 1,163 |
# Copyright 2010 VPAC
# Copyright 2014-2021 Marcus Furlong <furlongm@gmail.com>
#
# This file is part of Patchman.
#
# Patchman 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, ... | furlongm/patchman | util/filterspecs.py | Python | gpl-3.0 | 3,552 |
# Implementation of RAKE - Rapid Automtic Keyword Exraction algorithm
# as described in:
# Rose, S., D. Engel, N. Cramer, and W. Cowley (2010).
# Automatic keyword extraction from indi-vidual documents.
# In M. W. Berry and J. Kogan (Eds.), Text Mining: Applications and Theory.unknown: John Wiley and Sons, Ltd.
#
# NOT... | chrisfromthelc/python-rake | rake.py | Python | mit | 8,423 |
from concurrent.futures import ThreadPoolExecutor
class SingletonThreadPoolExecutor(ThreadPoolExecutor):
"""
该类不要直接实例化
"""
def __new__(cls, max_workers=None, thread_name_prefix=None):
if cls is SingletonThreadPoolExecutor:
raise NotImplementedError
if getattr(cls, '_object... | skyoo/jumpserver | apps/common/thread_pools.py | Python | gpl-2.0 | 538 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Union.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | myarjunar/QGIS | python/plugins/processing/algs/qgis/Union.py | Python | gpl-2.0 | 11,085 |
"""
========================
Random Number Generation
========================
==================== =========================================================
Utility functions
==============================================================================
random Uniformly distributed values of a g... | beiko-lab/gengis | bin/Lib/site-packages/numpy/random/__init__.py | Python | gpl-3.0 | 5,234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.