code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from flask.blueprints import Blueprint
import logging
from flask_login import login_required, current_user
from waitlist.ts3.connection import send_poke
from flask import jsonify
bp = Blueprint('api_ts3', __name__)
logger = logging.getLogger(__name__)
@bp.route("/test_poke")
@login_required
def test_poke():
send... | SpeedProg/eve-inc-waitlist | waitlist/blueprints/api/teamspeak.py | Python | mit | 473 |
from util import hash256, hash_pks
from copy import deepcopy
class AggregationInfo:
"""
AggregationInfo represents information of how a tree of aggregate
signatures was created. Different tress will result in different
signatures, due to exponentiations required for security.
An AggregationInfo i... | zcoinofficial/zcoin | src/bls-signatures/python-impl/aggregation_info.py | Python | mit | 6,831 |
import csv
import logging
import ntpath
import re
import sys
from uuid import UUID
from django.conf import settings
from django.contrib.auth.hashers import make_password
from django.core.exceptions import ValidationError
from django.core.management.base import CommandError
from django.utils import translation
from dja... | indirectlylit/kolibri | kolibri/core/auth/management/commands/bulkimportusers.py | Python | mit | 35,248 |
import matplotlib, os, errno
# IF WE ARE ON SERVER WITH NO DISPLAY, then we use Agg:
#print matplotlib.get_backend()
if not('DISPLAY' in os.environ):
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
def visualize_history(hi, show=True, save=False, save_path='', show_also='', custom_title=N... | previtus/MGR-Project-Code | Downloader/VisualizeHistory.py | Python | mit | 7,469 |
# from django.contrib import admin
# from libraryapp.models import Author, Book, Interest, History, GoogleUser, \
# Category, Ratings, Quote
| andela-sjames/Django-ReactJS-Library-App | reactlibapp/libraryapp/admin.py | Python | mit | 145 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import User
class UserDetailView(Login... | bilgorajskim/soman | server/soman/users/views.py | Python | mit | 1,466 |
from django.db import models
from django.contrib.auth.models import User
from video.models import Video
# Create your models here.
class Comment(models.Model):
author = models.ForeignKey(User)
video = models.ForeignKey(Video)
content = models.TextField()
time = models.DateTimeField(auto_now=True, auto_... | lumig242/Video-Share-System | comments/models.py | Python | mit | 335 |
'''
Created on 16 Sep 2016
@author: rizarse
'''
import jks, textwrap, base64
from os.path import expanduser
import os.path
import atexit
import shutil
from os import makedirs
class JksHandler(object):
def __init__(self, params):
pass
@staticmethod
def writePkAndCerts(ks, token):
... | magistral-io/MagistralPython | src/magistral/client/util/JksHandler.py | Python | mit | 3,975 |
"""
homeassistant.components.sensor.netatmo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NetAtmo Weather Service service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.netatmo/
"""
import logging
from datetime import timedelta
from homeassistant.comp... | nnic/home-assistant | homeassistant/components/sensor/netatmo.py | Python | mit | 5,202 |
__author__ = 'mwagner'
from PyQt4.Qt import Qt
from PyQt4.QtGui import QDialog, QIcon
from ..view.Ui_VertexDialog import Ui_VertexDialog
from ..model.VertexToolsError import *
class VertexDialog(QDialog, Ui_VertexDialog):
def __init__(self, plugin, parent=None):
super(VertexDialog, self).__init__(pare... | allspatial/vertex-tools | controller/VertexDialog.py | Python | mit | 550 |
'''
ÏÂÀý չʾÁË traceback Ä£¿éÔÊÐíÄãÔÚ³ÌÐòÀï´òÓ¡Òì³£µÄ¸ú×Ù·µ»Ø(Traceback)ÐÅÏ¢, ÀàËÆÎ´²¶»ñÒ쳣ʱ½âÊÍÆ÷Ëù×öµÄ.
'''
# ×¢Òâ! µ¼Èë traceback »áÇåÀíµôÒ쳣״̬, ËùÒÔ
# ×îºÃ±ðÔÚÒì³£´¦Àí´úÂëÖе¼Èë¸ÃÄ£¿é
import traceback
try:
raise SyntaxError, "example"
except:
traceback.print_exc() | iamweilee/pylearn | traceback-example-1.py | Python | mit | 285 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_route_filters_operations.py | Python | mit | 27,222 |
from office365.directory.identities.identity_set import IdentitySet
from office365.entity import Entity
class CallRecord(Entity):
"""Represents a single peer-to-peer call or a group call between multiple participants,
sometimes referred to as an online meeting."""
@property
def join_web_url(self):
... | vgrem/Office365-REST-Python-Client | office365/communications/callrecords/call_record.py | Python | mit | 630 |
#Copyright 2008, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
#LIMITED... | ahoarau/m3meka | python/scripts/m3qa/calibrate_head_s2r2.py | Python | mit | 4,572 |
year = 2015
print(year)
| codermoji-contrib/python | start/Intro to variables/002/setvar2.py | Python | mit | 24 |
from lintreview.review import Problems
from lintreview.review import Comment
from lintreview.tools.shellcheck import Shellcheck
from lintreview.utils import in_path
from unittest import TestCase
from unittest import skipIf
from nose.tools import eq_
shellcheck_missing = not(in_path('shellCheck'))
class Testshellchec... | adrianmoisey/lint-review | tests/tools/test_shellcheck.py | Python | mit | 2,600 |
import sys
sys.path.append('../')
import Graffity
import numpy
import PlotTools
import glob
import astropy.io.fits as pyfits
from scipy import optimize
from os import walk
from os.path import join
def fitGaussian(x, y):
errfunc = lambda p, x, y: numpy.abs(p[0]*numpy.exp(-(x**2.0)/(2*p[1]**2.0)) - y)
coeffs = [... | soylentdeen/Graffity | src/BCI/IRS16NM.py | Python | mit | 4,007 |
"""Initial Structure (Creating test and page tables)
Revision ID: 6aab1ac34c3
Revises: None
Create Date: 2015-07-19 12:58:04.968533
"""
# revision identifiers, used by Alembic.
revision = '6aab1ac34c3'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generat... | mrname/haralyzer-api | migrations/versions/6aab1ac34c3_.py | Python | mit | 2,147 |
# 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 ... | Azure/azure-sdk-for-python | sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_application_info_py3.py | Python | mit | 917 |
# -*- coding: utf-8 -*-
from httoop.status.types import StatusException
from httoop.uri import URI
class RedirectStatus(StatusException):
u"""REDIRECTIONS = 3xx
A redirection to other URI(s) which are set in the Location-header.
"""
location = None
def __init__(self, location, *args, **kwargs):
if not isin... | spaceone/httoop | httoop/status/redirect.py | Python | mit | 3,015 |
from typing import Sequence
from numbers import Number
from tabulate import tabulate
class Matrix(Sequence):
def __init__(self, matrix: Sequence[Sequence[float]]):
assert (isinstance(matrix, Sequence) and
isinstance(matrix, Sequence)), "Wrong data"
self.__matrix = [[float(x) for x ... | FeodorM/Computer-Graphics | util/matrix.py | Python | mit | 2,886 |
#encoding: utf8
class MemoryStorage(object):
"""
Simple(dummy) in-memory storage
In production better to use some database. Written to describe the api and testing
"""
def __init__(self, config):
# configuration of channels and services provided by application
self.config = config
... | Sulverus/aqueduct | aqueduct/storages/basic.py | Python | mit | 4,409 |
########################################
# Automatically generated, do not edit.
########################################
from pyvisdk.thirdparty import Enum
PerfFormat = Enum(
'csv',
'normal',
)
| xuru/pyvisdk | pyvisdk/enums/perf_format.py | Python | mit | 209 |
from app import db
import datetime
from geoalchemy2 import Geometry
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy import Column
import sqlalchemy
from slugify import slugify
from flask.ext.login import UserMixin
class User(UserMixin, db.Model):
__tablen... | hardworkingcoder/dw_experiments | models.py | Python | mit | 1,081 |
from flask import Flask, render_template, send_from_directory, request
from settings import getDatabaseString
import os
import time
import psycopg2
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = 'uploads'
def genFilename(s):
arr_s = s.split('.')
t = time.strftime("%d-%m-%Yh%Hm%Ms%S", time.localtime())
... | DreamN/Pic-storage | app.py | Python | mit | 1,843 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py | Python | mit | 22,205 |
# -*- coding: utf-8 -*-
# Copyright © 2011 Varyant, LLC
import re
from wsgiref.util import request_uri
from wack.http.errors import HttpMethodNotAllowed, HttpNotFound
from wack.http.request import Request
from wack.http.response import Response
class Controllers(object):
"""
WSGI application that maps URLs ... | jlconnor/wsgistack | wack/controllers.py | Python | mit | 3,103 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... | tzpBingo/github-trending | codespace/python/tencentcloud/tms/v20201229/tms_client.py | Python | mit | 3,829 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/peering/azure-mgmt-peering/azure/mgmt/peering/aio/operations/_peering_service_prefixes_operations.py | Python | mit | 11,684 |
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
map_item = client.sync \
... | teoreteetik/api-snippets | sync/rest/maps/retrieve-map-item/retrieve-map-item.6.x.py | Python | mit | 471 |
#!/usr/bin/env python2
"""
Note: This does not sort the output.
For sorting simply run:
$ sort md5sums.txt > md5sums_sorted.txt
"""
import sys
import glob
import csv
import hashlib
from multiprocessing import Pool
def md5_file(filename):
with open(filename) as f:
return (hashlib.md5(f.rea... | jpypi/dup-image-search | md5/calculate_md5_hashes.py | Python | mit | 1,021 |
# Python - 3.6.0
Test.expect(find_multiples(5, 25) == [5, 10, 15, 20, 25], f'{str(find_multiples(5, 25))} should equal [5, 10, 15, 20, 25]')
Test.expect(find_multiples(1, 2) == [1, 2], f'{str(find_multiples(1, 2))} should equal [1, 2]')
| RevansChen/online-judge | Codewars/8kyu/find-multiples-of-a-number/Python/test.py | Python | mit | 238 |
#!usr/bin/python
'''
Get satellite data according to input file.
'''
from random import shuffle,random
import os,json
from utils.mapbox_static import MapboxStatic
from utils.coordinate_converter import CoordConvert
from modules.getFeatures import latLon,getBBox
from libs.foldernames import satDataFolder,testDataFolder
... | worldbank/cv4ag | modules/get_satellite.py | Python | mit | 4,605 |
#!/usr/bin/python3
import numpy as np
import cv2
from collections import deque
from obstacle_detector.distance_calculator import spline_dist
from obstacle_detector.perspective import inv_persp_new
from obstacle_detector.perspective import regress_perspecive
from obstacle_detector.depth_mapper import calculate_depth... | Sid1057/obstacle_detector | depth_test.py | Python | mit | 3,465 |
# A WavPack reader/tagger
#
# Copyright 2006 Joe Wreschnig <piman@sacredchao.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# $Id: wavpack.py 4153 2007-08-05 07:07:49Z piman ... | JustinTulloss/harmonize.fm | libs.py/mutagen/wavpack.py | Python | mit | 1,810 |
import sys
from traceback import format_exception
import colorama
def color(color_, settings):
"""Utility for ability to disabling colored output."""
if settings.no_colors:
return ''
else:
return color_
def exception(title, exc_info, settings):
sys.stderr.write(
u'{warn}[WARN... | JianfengYao/thefuck | thefuck/logs.py | Python | mit | 1,661 |
#!/usr/bin/python
"""
Object
"""
import sys
from copy import copy as _copy
from collections import defaultdict
from .errors import ConfigurationError, ExecutionError, \
InvalidParameterDatatype
from .debugging import bacpypes_debugging, ModuleLogger
from .primitivedata import Atomic, BitString, Boolean, Charact... | JoelBender/bacpypes | py34/bacpypes/object.py | Python | mit | 139,323 |
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
import miscClin
import tsvIO
import sys
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
remapDict = {}
DAYS_PER_YEAR = 365.2425
# ----------------------------------------------------------------------... | cancerregulome/gidget | commands/feature_matrix_construction/main/cleanClinTSV.py | Python | mit | 98,495 |
from __future__ import (absolute_import, print_function, division)
import itertools
import time
import hyperframe.frame
from hpack.hpack import Encoder, Decoder
from netlib import utils
from netlib.http import url
import netlib.http.headers
import netlib.http.response
import netlib.http.request
from netlib.http.http2... | tdickers/mitmproxy | netlib/http/http2/connections.py | Python | mit | 14,926 |
from discord import Embed
from bot import Command, categories
class GuildList(Command):
def __init__(self, bot):
super().__init__(bot)
self.name = 'guildlist'
self.aliases = ['guilds']
self.category = categories.SETTINGS
self.bot_owner_only = True
async def handle(sel... | jvicu2001/alexis-bot | bot/modules/guildlist.py | Python | mit | 1,174 |
# -*- coding: utf-8 -*-
import cgi
import logging
import os
import uuid
from collections import namedtuple
import requests
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.runtime.client_request import ClientRequest
from office365.runtime.utilities.http_method import Htt... | Unifield/ufload | ufload/webdav.py | Python | mit | 8,486 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import contents.models
class Migration(migrations.Migration):
dependencies = [
('contents', '0017_auto_20170329_1504'),
]
operations = [
migrations.AlterField(
model_name... | andersonjonathan/Navitas | navitas/contents/migrations/0018_auto_20170329_1549.py | Python | mit | 483 |
"""
WSGI config for jt_portfolio project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | ilikesounds/jt_portfolio | jt_portfolio/wsgi.py | Python | mit | 582 |
from tempfile import TemporaryFile
import pytest
from imgpy import Img
@pytest.mark.parametrize('image', ({
'sub': 'anima/bordered.gif',
'convert': 'L',
'mode': 'P'
}, {
'sub': 'anima/clear.gif',
'convert': 'L',
'mode': 'P'
}, {
'sub': 'fixed/bordered.jpg',
'convert': 'L',
'mode'... | embali/imgpy | tests/test_convert.py | Python | mit | 746 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_08_01/operations/_application_gateways_operations.py | Python | mit | 73,707 |
#!/usr/bin/env python3
import unittest
from tests import testfunctions
from dftintegrate.fourier import vaspdata
class TestExtractingVASPDataToDatFiles(unittest.TestCase,
testfunctions.TestFunctions):
def setUp(self):
print('Testing extracting VASP data to .dat fi... | mmb90/dftintegrate | tests/fourier/extractvaspdata/test_extractvaspdata.py | Python | mit | 1,597 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_06_01/aio/operations/_available_endpoint_services_operations.py | Python | mit | 5,328 |
def capitalize(string):
for s in string.split(" "):
string = string.replace(s, s.capitalize())
return string
if __name__ == '__main__':
string = input()
capitalized_string = capitalize(string)
print(capitalized_string)
| MrinmoiHossain/HackerRank | Python/Strings/Capitalize!.py | Python | mit | 259 |
# -*- coding: utf-8 -*-
# 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, publish,
# distribute, sub... | ngageoint/gamification-server | gamification/core/models.py | Python | mit | 7,022 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
# (r'^statinfo/$', 'appname.views.stat_info'),
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', 'django.contrib... | laxmikantG/mypublisher | mypublisher/urls.py | Python | mit | 629 |
#!/usr/bin/env python
# encoding: utf-8
"""
__init__.py
The MIT License (MIT)
Copyright (c) 2013 Matt Ryan
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 ... | mattvryan/audiofile | afmq/__init__.py | Python | mit | 3,351 |
import pytest # noqa
import python_jsonschema_objects as pjo
def test_regression_156(markdown_examples):
builder = pjo.ObjectBuilder(
markdown_examples["MultipleObjects"], resolved=markdown_examples
)
classes = builder.build_classes(named_only=True)
er = classes.ErrorResponse(message="Danger... | cwacek/python-jsonschema-objects | test/test_regression_156.py | Python | mit | 1,032 |
"""
virtstrap.project
-----------------
This module contains all the abstractions for dealing with a Project.
Using this object simplifies creating commands that are used to manage
the project.
"""
import os
import sys
from virtstrap import constants
from virtstrap.config import VirtstrapConfig
from virtstrap.utils i... | ravenac95/virtstrap | virtstrap-core/virtstrap/project.py | Python | mit | 3,644 |
"""Module containing kernel related classes"""
__author__ = 'wittawat'
from abc import ABCMeta, abstractmethod
import numpy as np
import scipy.signal as sig
class Kernel(object):
"""Abstract class for kernels"""
__metaclass__ = ABCMeta
@abstractmethod
def eval(self, X1, X2):
"""Evalute the k... | wittawatj/fsic-test | fsic/kernel.py | Python | mit | 3,695 |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HSS2_then_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HSS2_then_IsolatedLHS.
"""
# Flag this instance ... | levilucio/SyVOLT | UMLRT2Kiltera_MM/Properties/from_thesis/HSS2_then_IsolatedLHS.py | Python | mit | 2,488 |
#!/usr/bin/env python
import sys, re
output = open(sys.argv[1])
output = output.read()
output = re.split('thisisalinebreak =',output)
f = open(sys.argv[2])
i = 1
matlab = False
for line in f:
if line == "<?ml\n":
matlab = True
j = 0
for oline in output[i].split('\n'):
if (j > 2... | newhouseb/MatTex | mattex.py | Python | mit | 582 |
#
# Copyright (c) 2017-2021 w-gao
#
import argparse
import logging
import struct
import sys
import socket
from contextlib import contextmanager
from random import randint
from typing import Generator
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.WARNING)
# constants
MC_QUERY_MAGIC = b'\xFE\... | w-gao/py-mcpe-query | src/mcquery/query.py | Python | mit | 5,863 |
# -*- coding: utf-8 -*-
from converters.circle import circle
from converters.currency import currency
from converters.electric import electric
from converters.force import force
from converters.pressure import pressure
from converters.speed import speed
from converters.temperature import temperature
class UnitsManage... | mattgd/UnitConverter | units/__init__.py | Python | mit | 1,001 |
""" Various global variables """
import os
PROG_NAME = "gBuilder"
PROG_VERSION = "2.0.0"
environ = {"os":"Windows",
"path":os.environ["GINI_HOME"]+"/",
"remotepath":"./",
"images":os.environ["GINI_HOME"]+"/share/gbuilder/images/",
"config":os.environ["GINI_HOME"]+"/etc/",
... | sciyoshi/gini | frontend/src/gbuilder/Core/globals.py | Python | mit | 1,542 |
# vim:ts=4:sts=4:sw=4:expandtab
from satori.client.common import want_import
want_import(globals(), '*')
from satori.web.utils.decorators import contest_view
from django import forms
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse... | zielmicha/satori | satori.web/satori/web/views/contest/extends.py | Python | mit | 4,539 |
"""create_table
Revision ID: 42f4a0f4afd9
Revises: None
Create Date: 2014-11-15 16:53:22.716676
"""
# revision identifiers, used by Alembic.
revision = '42f4a0f4afd9'
down_revision = None
from alembic import op
import sqlalchemy as sa
#from guokr.platform.sqlalchemy.types import JSONType
def upgrade():
op.crea... | qisanstudio/qsapp-score | src/score/migration/versions/42f4a0f4afd9_create_table.py | Python | mit | 3,217 |
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
import argparse
import os
import re
import subprocess
import sys
import traceback
import json
def main():
parser = argparse.ArgumentParser(description='Test discovery for Zabbix',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argumen... | RemiZOffAlex/specialistoff.net | Zabbix/scripts/test.py | Python | mit | 1,067 |
from sqlalchemy.testing import eq_, assert_raises, assert_raises_message
from sqlalchemy import testing
from sqlalchemy.testing import engines
from sqlalchemy.testing.schema import Table, Column
from test.orm import _fixtures
from sqlalchemy import exc
from sqlalchemy.testing import fixtures
from sqlalchemy import Inte... | michaelBenin/sqlalchemy | test/orm/test_unitofworkv2.py | Python | mit | 55,891 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/automanage/azure-mgmt-automanage/azure/mgmt/automanage/operations/_configuration_profile_preferences_operations.py | Python | mit | 22,341 |
import re
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from plumbum.commands import CommandNotFound, ConcreteCommand, shquote
from plumbum.lib import ProcInfo
from plumbum.machines.base import BaseMachine
from plumbum.machines.env import BaseEnv
from plumbum.machines.local import Local... | tomerfiliba/plumbum | plumbum/machines/remote.py | Python | mit | 16,021 |
#!/usr/bin/env python2
import os, shutil, glob
from functools import wraps
def print_warning(message, *args, **kwargs):
from . import colortext
if args or kwargs: message = message.format(*args, **kwargs)
colortext.write(message + '\n', color='red')
def print_error_and_die(message, *args, **kwargs):
... | Kortemme-Lab/klab | klab/scripting.py | Python | mit | 2,249 |
# coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import json
china = json.loads(open('china.json', 'r').read()) # slow
new_provs = []
new_citys = []
for prov in china['children']:
new_provs.append(prov['name'])
for city in prov['children']:
if city['name'] not in [u'市辖区', u'县',... | phyng/phyip | geodata/provinces_script.py | Python | mit | 637 |
# AUTHOR: Kale Miller
# DESCRIPTION: Contains the core classes for the program.
# 50726f6772616d6d696e6720697320627265616b696e67206f66206f6e652062696720696d706f737369626c65207461736b20696e746f20736576
# 6572616c207665727920736d616c6c20706f737369626c65207461736b732e
# DEVELOPMENT LOG:
# 05/12/16: Initialized... | kmiller96/Shipping-Containers-Software | lib/containers.py | Python | mit | 14,805 |
"""
Test for the bandicoot.helper.group module.
"""
import bandicoot as bc
from bandicoot.core import Record, Position
import unittest
import datetime
from bandicoot.tests.generate_user import random_burst
from bandicoot.helper.group import group_records
from bandicoot.helper.tools import std, mean
from datetime impor... | econandrew/bandicoot | bandicoot/tests/test_group.py | Python | mit | 7,063 |
"""tcprocd client."""
from __future__ import unicode_literals, print_function, absolute_import
from tcprocd.protocol import Protocol
import socket
import select
import sys
if sys.version_info[0] < 3:
str_types = (str, unicode) # noqa
else:
str_types = (str, bytes) # noqa
class SocketShell(object):
"""... | knoppo/tcprocd | tcprocd/client.py | Python | mit | 7,172 |
major = 0
minor = 37
patch = 0
| vovanbo/aiohttp_json_api | punch_version.py | Python | mit | 31 |
"""
Custom management command to rebuild thumbnail images
- May be required after importing a new dataset, for example
"""
import os
import logging
from PIL import UnidentifiedImageError
from django.core.management.base import BaseCommand
from django.conf import settings
from django.db.utils import OperationalError... | SchrodingersGat/InvenTree | InvenTree/InvenTree/management/commands/rebuild_thumbnails.py | Python | mit | 1,950 |
#!/usr/bin/python
#
# linearize.py: Construct a linear, no-fork, best version of the blockchain.
#
#
# Copyright (c) 2013 The Umaro developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
import... | randayh/umaro | contrib/misc/linearize.py | Python | mit | 3,196 |
# This package will contain the spiders of your Scrapy project
#
# Please refer to the documentation for information on how to create and manage
# your spiders.
import json
from urllib import urlencode
from scrapy import log
from scrapy.http import Request
from scrapy.selector import Selector
from scrapy.contrib.load... | Answeror/torabot | torabot/mods/bilibili/spy/bilibili/spiders/__init__.py | Python | mit | 6,671 |
from django.contrib import admin
from books.models import *
# Register your models here.
# Register your models here.
class BookInfoAdmin(admin.ModelAdmin):
list_display=('title','isbn','price')
class GoodInfoAdmin(admin.ModelAdmin):
list_display=('seller','book','price')
admin.site.register(UserInfo)
admin.sit... | zearom32/SmartBooks | books/admin.py | Python | mit | 402 |
#!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Test RPCs related to blockchainstate.
Test the following RPCs:
- getblockchaininfo
- gettxouts... | syscoin/syscoin2 | test/functional/rpc_blockchain.py | Python | mit | 14,422 |
# Resources
from lob.resource import (
Address,
BankAccount,
BillingGroup,
BulkUSVerification,
BulkIntlVerification,
Card,
CardOrder,
Check,
Letter,
Postcard,
SelfMailer,
USAutocompletion,
USReverseGeocodeLookup,
USVerification,
USZipLookup,
IntlVerificati... | lob/lob-python | lob/__init__.py | Python | mit | 410 |
import datetime
from xml.etree import ElementTree
try:
from urllib.parse import urlparse, parse_qs
except ImportError:
# Python 2
from urlparse import urlparse, parse_qs
import html5lib
import requests
from .models import (
Category, SearchSortKey, SearchOrderKey, SearchResultPage, TorrentPage,
To... | kennydo/nyaalib | nyaalib/__init__.py | Python | mit | 8,198 |
import csv
def model_name(table_name):
if table_name in [
'vtm',
'vpi',
'vmp',
'vmpp',
'amp',
'ampp',
'gtin',
]:
return table_name.upper()
else:
return ''.join(tok.title() for tok in table_name.split('_'))
def quote(s):
assert '... | annapowellsmith/openpresc | openprescribing/dmd2/gen_models/gen_models.py | Python | mit | 1,981 |
#!/usr/bin/env python
import csv
import json
import requests
def main():
# We'll use a local version of this file from now on to save on
# bandwith.
with open('bills.json', 'r') as f:
data = json.load(f)
objects = data['objects']
# Create a csv file to output
with open('b... | tommeagher/pycar14 | project4/step_3_complete.py | Python | mit | 1,081 |
# box
# Copyright 2013-2014 Dipen Patel
# See LICENSE for details.
STATUSCODES = {
200 : "success",
201 : "created",
202 : "accepted",
204 : "no_content",
302 : "redirect",
304 : "not_modified",
400 : "bad_request",
... | dipen30/boxapi | box/error.py | Python | mit | 982 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import unittest
from pyowm.airpollutionapi30 import airpollution_client, airpollution_manager, coindex, so2index, ozone, no2index, airstatus
from pyowm.config import DEFAULT_CONFIG
from pyowm.constants import AIRPOLLUTION_API_VERSION
from pyowm.utils import tim... | csparpa/pyowm | tests/unit/airpollutionapi30/test_airpollution_manager.py | Python | mit | 15,769 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import clusters
blognames,words,data=clusters.readfile( './../data/feed_list.csv' )
for k in range( 1, 10 ) :
kclust = None
kclust = clusters.kcluster(data, blognames, clusters.pearson, k)
for k_id in range( len( kclust ) ):
print [blognames[r] for r in kclust[k_id... | oreno4645/clustering | clusters/kcluster_do.py | Python | mit | 323 |
import logging
import rlp
from utils import big_endian_to_int as idec
from utils import int_to_big_endian4 as ienc4
from utils import int_to_big_endian as ienc
from utils import recursive_int_to_big_endian
import dispatch
import sys
import signals
logger = logging.getLogger(__name__)
def lrlp_decode(data):
"alwa... | elkingtowa/azove | azove/packet.py | Python | mit | 9,338 |
from RPi import GPIO as gpio
from robotics.actors.redbot_motor_actor import RedbotMotorActor
from robotics.interfaces.spi.mcp3008_spi_interface import MCP3008SpiInterface
from robotics.robots.aizek_robot import AizekRobot
from robotics.sensors.redbot_wheel_encoder_sensor import RedbotWheelEncoderSensor
from robotics.s... | asydorchuk/robotics | python/robotics/robots/factory.py | Python | mit | 1,253 |
#!/usr/bin/env python
"""Simple tools to query github.com and gather stats about issues.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function
import json
import ... | yavalvas/yav_com | build/matplotlib/tools/github_stats.py | Python | mit | 6,681 |
import termcolor
import sys
class StrUtils:
def __init__(self):
pass
@staticmethod
def print_log_row(op_code, url, status_code, documented_reason, body, curlcommand):
if type(curlcommand) == str:
curlstr = curlcommand
else:
curlstr = curlcommand.get()
... | Teebytes/TnT-Fuzzer | tntfuzzer/utils/strutils.py | Python | mit | 1,142 |
import unittest
from probe import SearchApi, CompanyApi
class TestProbeAPI(unittest.TestCase):
def test_search_company_loanzen(self):
api = SearchApi()
companies = api.companies_get('1.1', filters='{"nameStartsWith": "loanzen"}')
#print type(companies.data), companies.data.companies
... | loanzen/probe-py | probe/tests.py | Python | mit | 1,727 |
import pytest
from path import Path
import yaml
from uuid import uuid4
from formica import cli
from tests.unit.constants import (REGION, PROFILE, STACK,
CHANGE_SET_PARAMETERS, CHANGE_SET_STACK_TAGS,
FULL_CONFIG_FILE, CHANGE_SET_CAPABILITIES,
... | flomotlik/formica | tests/unit/test_config_file.py | Python | mit | 4,899 |
"""
Helper module for Python version 2.6 and below
- Ordered dictionaries
- Encoding/decoding urls
- Unicode
- Exception handling (except Exception, e)
"""
import base64
from urllib import unquote, quote
try:
from ordereddict import OrderedDict
except:
pass
def modulename():
return 'Helper module for Pyt... | martomo/SublimeTextXdebug | xdebug/helper/helper_26.py | Python | mit | 1,428 |
#!/usr/bin/python
"""
Google AJAX Search Module
http://code.google.com/apis/ajaxsearch/documentation/reference.html
Needs Python 2.6 or later
"""
try:
import json
except ImportError as e:
import simplejson as json
except ImportError as e:
print(e)
exit()
import sys
import urllib.request, urllib.parse, ... | jmdana/py3google | pygoogle.py | Python | mit | 9,074 |
import PyQt5 # this force pyqtgraph to deal with Qt5
# For matplotlib to Qt5 :
# * this avoid tinker problem when not installed
# * work better with GUI
# * trigger a warning on notebook
import matplotlib
import warnings
with warnings.catch_warnings():
try: ... | tridesclous/tridesclous | tridesclous/gui/__init__.py | Python | mit | 2,001 |
from pysimplesoap.client import SoapClient
def inspect(wsdl_url):
client = SoapClient(wsdl=wsdl_url,trace=False)
print("Target Namespace", client.namespace)
for service in list(client.services.values()):
for port in list(service['ports'].values()):
print(port['location'])
fo... | xflows/clowdflows-backend | services/tests.py | Python | mit | 685 |
from PyQt4.QtCore import *
from PyQt4 import QtGui
class RadioManagement ():
def __init__ (self, radioCol, gridLayout):
self.radioGroup = QtGui.QButtonGroup() # To store radio buttons.
self.radioCol = radioCol
self.gridLayout = gridLayout
def initDelAndMovButtons (self, vLayout):
# Add hbox for edit button... | electronics45/pyapplaunch | pyapplaunch/RadioManagement.py | Python | mit | 6,893 |
# coding=utf8
from types import MethodType
def implant_method(obj, func, func_name):
base_class = obj.__class__
event = MethodType(func, obj, base_class)
setattr(obj, func_name, event)
if __name__ == "__main__":
pass
| cineuse/CNCGToolKit | cgtkLibs/cgtk_py/implant_method.py | Python | mit | 238 |
import sys
import os.path
import lzma
import time
import os
import subprocess
if "APPVEYOR_REPO_TAG" not in os.environ or os.environ["APPVEYOR_REPO_TAG"] != "true":
print("Not uploading symbols since build is not tagged")
sys.exit()
symbol_filename = sys.argv[1]
with open(symbol_filename, "rt") as fh:
f... | GrognardsFromHell/TemplePlus | deploy_symbols_s3.py | Python | mit | 1,455 |
# Unit3 - Lessons 3 and 4 folder
| flygeneticist/Thinkful-Data-Science-Examples | Unit2/Lesson3-4/__init__.py | Python | mit | 33 |
import os
import pickle
from parsers_backend import get_tree
from directories import dirs
def get_cached_sentence_image(argv, output_path, img_path):
"""Returns if the image is already generated or not, and avoids generating if yes.
Args:
argv: The command line arguments.
output_path: The pa... | aoldoni/tetre | lib/parsers_cache.py | Python | mit | 1,577 |
import os, sys, argparse
from os import listdir
from os.path import isfile, join
from os import walk
from dd_client import DD
from annoy import AnnoyIndex
import shelve
import cv2
parser = argparse.ArgumentParser()
parser.add_argument("--index",help="repository of images to be indexed")
parser.add_argument("--index-ba... | roscopecoltran/scraper | shared/docker/templates/deepdetect/demo/imgsearch/imgsearch.py | Python | mit | 3,645 |
import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.di... | Amande-WP5/formalarg | setup.py | Python | mit | 1,036 |