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 |
|---|---|---|---|---|---|
import do
import setvar
import sys
import show
import getvalue
lines = 0
baseVariables = {
"URL":None,
"TMPCOOKIE":None,
"COOKIE":None,
"HTML":None,
"POSTDATA":None,
"USERAGENT":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0", ... | Danisan/HTTPLang | httplang/utils.py | Python | mit | 894 |
#!/usr/bin/python
import getopt
import sys
import pymqi, CMQC, CMQCFC
STATE_OK = 0
STATE_WARNING = 1
STATE_CRITICAL = 2
STATE_UNKNOWN = 3
def usage():
print """Usage: rbh_check_mq_channel_status -H <HostName> -g <QMGRName> -p <PortNumber> -a <ChannelName for connection> -t <ChannelName for test>"""
def show_hel... | klapper/nagios-plugins-mq | check_mq_channel.py | Python | mit | 5,483 |
from mock import MagicMock, mock_open, patch
from unittest import TestCase
from warnings import simplefilter
import pconf
from pconf.store.env import Env
TEST_ENV_BASE_VARS = {
"env__var": "result",
"env__var_2": "second_result",
}
TEST_ENV_MATCHED_VARS = {"matched_var": "match"}
TEST_ENV_WHITELIST_VARS = {"... | andrasmaroy/pconf | tests/test_env.py | Python | mit | 9,384 |
from biokbase.workspace.client import Workspace
import requests
import json
import sys
from time import time
from fix_workspace_info import fix_all_workspace_info
from pprint import pprint
kb_port = 9999
mini_ws_url = f"http://localhost:{kb_port}/services/ws"
mini_auth_url = f"http://localhost:{kb_port}/services/auth/... | pranjan77/narrative | src/scripts/test_data_uploader/populate_mini_ws.py | Python | mit | 6,648 |
# Ant-FS
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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... | ddboline/Garmin-Forerunner-610-Extractor_fork | ant/fs/test/commandpipe_test.py | Python | mit | 1,838 |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name='profile')
display_name = models.CharField(
max_length=200, verbo... | agfor/chipy.org | chipy_org/apps/profiles/models.py | Python | mit | 772 |
from __future__ import absolute_import
import random
from django.core.exceptions import ValidationError
from django.http.request import HttpRequest
from django.urls import reverse
from django.utils.text import slugify
from test_plus import TestCase
from ..context_processors import scoped
from ..models import Blog, ... | pinax/pinax-blog | pinax/blog/tests/tests.py | Python | mit | 6,575 |
import os
import sys
import argparse
import configparser
from utils.process import Process
# They are imported as all lowercase
# so it is case insensitive in the config file
from modules.tuebl import Tuebl as tuebl
from modules.itebooks import ItEbooks as itebooks
from modules.wallhaven import Wallhaven as wallhaven... | xtream1101/web-scraper | main.py | Python | mit | 1,737 |
# -*- coding: utf-8 -*-
"""Unit tests for gridmap classed"""
# ----------------------------------
# Bjørn Ådlandsvik <bjorn@imr.no>
# Institute of Marine Research
# ----------------------------------
import sys
from math import pi
import unittest
import numpy as np
sys.path = ['..'] + sys.path # import from develop... | bjornaa/gridmap | test/test_gridmap0.py | Python | mit | 4,541 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pyramid_sendgrid_webhooks
----------------------------------
Tests for `pyramid_sendgrid_webhooks` module.
"""
from __future__ import unicode_literals
import unittest
import pyramid_sendgrid_webhooks as psw
from pyramid_sendgrid_webhooks import events, errors
... | GoodRx/pyramid-sendgrid-webhooks | tests/test_pyramid_sendgrid_webhooks.py | Python | mit | 6,637 |
import sys
import threading
from netfilterqueue import NetfilterQueue
import dpkt
import socket
import config
logger = config.logger
class FlowControlQueue:
''' The class creates a NetfilterQueue that blocks/releases IP packets of
given types.
'''
def __init__(self, worker, queue_num=config.WorkerCo... | LeoLiangZhang/Picocenter | worker/netfilter.py | Python | mit | 4,059 |
#!/usr/bin/python2
# test.py
# nroberts 04/10/2017
# Instead of lighting up a bridge, we light up the terminal
from tennis_show import TennisShow
import current_bridge
from threading import Thread
import Queue
from colors import Colors
thread_continuing = True
class OutQueue:
def put(self, event):
print ... | alexoneill/15-love | game/test.py | Python | mit | 1,989 |
# Core Django imports
from django.contrib import admin
# Third party app imports
from reversion import VersionAdmin
# Local app imports
from mantises.models import Mantis, Breed, Molt
class MantisAdmin(VersionAdmin):
list_display = ('__str__',)
def save_model(self, request, obj, form, change):
obj.... | archen/mantistrack | mantistrack/mantises/admin.py | Python | mit | 831 |
#!/usr/bin/env python
# encoding: utf-8
"""
models.py
Created by Darcy Liu on 2012-03-03.
Copyright (c) 2012 Close To U. All rights reserved.
"""
from django.db import models
from django.contrib.auth.models import User
# class Setting(models.Model):
# sid = models.AutoField(primary_key=True)
# option = model... | darcyliu/storyboard | home/models.py | Python | mit | 2,582 |
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8')... | pdorrell/melody_scripter | setup.py | Python | mit | 3,795 |
# Copyright 2017-2019 Tom Eulenfeld, MIT license
"""Stack correlations"""
import numpy as np
import obspy
from obspy import UTCDateTime as UTC
from yam.util import _corr_id, _time2sec, IterTime
def stack(stream, length=None, move=None):
"""
Stack traces in stream by correlation id
:param stream: |Stream... | trichter/yam | yam/stack.py | Python | mit | 3,034 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DVSManagerDvsConfigTarget(vim, *args, **kwargs):
'''Configuration specification for a... | xuru/pyvisdk | pyvisdk/do/dvs_manager_dvs_config_target.py | Python | mit | 1,114 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import re
import os
import sys
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search(
... | fmartingr/iosfu | setup.py | Python | mit | 1,441 |
"""Support for ISY994 covers."""
from __future__ import annotations
from typing import Any
from pyisy.constants import ISY_VALUE_UNKNOWN
from homeassistant.components.cover import (
ATTR_POSITION,
DOMAIN as COVER,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
CoverEntity,
)
from homeassi... | rohitranjan1991/home-assistant | homeassistant/components/isy994/cover.py | Python | mit | 3,841 |
"""
@author: Nikhith !!
"""
from pycricbuzz import Cricbuzz
import json
import sys
""" Writing a CLI for Live score """
try:
cric_obj = Cricbuzz() # cric_obj contains object instance of Cricbuzz Class
matches = cric_obj.matches()
except:
print "Connection dobhindhi bey!"
sys.exit(0)
... | nikkitricky/nikbuzz | score.py | Python | mit | 5,706 |
# 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 ... | AutorestCI/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/grant_access_data.py | Python | mit | 1,336 |
import time
from bs4 import BeautifulSoup
import sys
if (sys.version_info > (3, 0)):
# Python 3 code in this block
import urllib.request as urllib2
else:
# Python 2 code in this block
import urllib2
import datetime, re, os
class NonNCEPModel:
'''''
Base Class for all Non-NCEP models.
'''''
def __init_... | cacraig/grib-inventory | gribinventory/models/NonNCEPModel.py | Python | mit | 1,819 |
import numpy as np
from scipy.special import sph_harm, lpmv
try:
from scipy.misc import factorial
except:
from scipy.special import factorial
def sh(l, m, theta, phi, field='real', normalization='quantum', condon_shortley=True):
if field == 'real':
return rsh(l, m, theta, phi, normalization, condo... | AMLab-Amsterdam/lie_learn | lie_learn/representations/SO3/spherical_harmonics.py | Python | mit | 13,535 |
import unittest
import two_fer
class Two_Fer_test(unittest.TestCase):
def test_empty(self):
self.assertEqual(two_fer.two_fer(), 'One for you, one for me.')
def test_eve(self):
self.assertEqual(two_fer.two_fer("Eve"), "One for Eve, one for me.")
def test_bob(self):
self.assertEqu... | mweb/python | exercises/two-fer/two_fer_test.py | Python | mit | 424 |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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 right... | croxis/SpaceDrive | spacedrive/renderpipeline/samples/download_samples.py | Python | mit | 1,629 |
#!/usr/bin/python
#
# Copyright 2014: wycomco GmbH (choules@wycomco.de)
# 2015: modifications by Tim Sutton
#
# 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... | FabianN/autopkg_recipies | AdobeReader/AdobeReaderUpdatesURLProvider.py | Python | mit | 5,706 |
from django import forms
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import ugettext_lazy as _
from .models import User
class UserCreationForm(forms.ModelForm):
password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput)
password2 = forms.Cha... | esistgut/django-content-toolkit | accounts/forms.py | Python | mit | 2,072 |
import os
import sys
class Widget(object):
"""
Widget is a User Interface (UI) component object. A widget
object claims a rectagular region of its content, is responsible
for all drawing within that region.
"""
def __init__(self, name, width=50, height=50):
self.name = name
sel... | ishikawa/modipyd | examples/widget/002/widget.py | Python | mit | 491 |
import click
import requests
@click.command()
@click.argument('url')
@click.option('--show-headers', '-H', is_flag=True, default=False)
@click.option('--show-status', '-S', is_flag=True, default=False)
@click.option('--quiet', '-Q', is_flag=True, default=False)
@click.option('--allow-redirects/--no-allow-redirects', d... | tylerdave/reqcli | reqcli/cli.py | Python | mit | 1,667 |
import os
import socket
import venusian
from botocore.exceptions import ClientError
from flowy.swf.client import SWFClient, IDENTITY_SIZE
from flowy.swf.decision import SWFActivityDecision
from flowy.swf.decision import SWFWorkflowDecision
from flowy.swf.history import SWFExecutionHistory
from flowy.utils import logg... | severb/flowy | flowy/swf/worker.py | Python | mit | 14,853 |
__author__ = 'had'
# The MIT License (MIT)
# Copyright (c) [2015] [Houtmann Hadrien]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the Aidez-moi), to deal
# in the Software without restriction, including without limitation the righ... | hadmagic/Aidez-moi | ticket/views/home.py | Python | mit | 2,583 |
from pivoteer import *
from pivotEngine import *
from pivotUtils import *
| BechtelCIRT/pivoteer | pivoteer/__init__.py | Python | mit | 74 |
from typing import List, Optional
from backend.common.consts.ranking_sort_orders import SORT_ORDER_INFO
from backend.common.models.event_details import EventDetails
from backend.common.models.event_ranking import EventRanking
from backend.common.models.event_team_status import WLTRecord
from backend.common.models.keys... | the-blue-alliance/the-blue-alliance | src/backend/common/helpers/rankings_helper.py | Python | mit | 1,985 |
## Copyright (c) 2003 Henk Punt
## 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,
#... | toymachine/venster | venster/windows.py | Python | mit | 23,583 |
#!/usr/bin/env python
import sys
import time
from timerasp import gmail
if __name__ == '__main__':
time.sleep(300)
gmail.send_email('notify.py: IP:{}'.format(' '.join(sys.argv[1:])),
'Notify was run and is telling you something')
| ajmendez/timerasp | bin/notify.py | Python | mit | 261 |
# -*- coding: utf-8 -*-
# Actualiza el valor de los hedge cue discontinuos como either..or
# están marcados ambos como B-SPECCUE, pero si aparecen en el mismo scope
# tengo que cambiar al segundo para que diga D-SPECCUE
# lo hago directamente en las tablas
# Uso: python update_discontinuous_hc.py working_dir
import ... | gmonce/bioscope | thesis/src/scripts/update_discontinuous_hc.py | Python | mit | 6,790 |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2018 by XESS Corporation / Hildo Guillardi Júnior
#
# 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 with... | xesscorp/KiCost | kicost/distributors/__init__.py | Python | mit | 3,347 |
import os
import logging
import boto3
import mimetypes
from datetime import datetime
from morphium.util import env, TAG_LATEST
log = logging.getLogger(__name__)
config = {}
class Archive(object):
"""A scraper archive on S3. This is called when a scraper has generated a
file which needs to be backed up to a ... | pudo/morphium | morphium/archive.py | Python | mit | 2,477 |
# Copyright (c) 2017 Nick Gashkov
#
# Distributed under MIT License. See LICENSE file for details.
class ValidationError(Exception):
def __init__(self, *args, **kwargs):
self.error_dict = kwargs.pop('error_dict')
super(ValidationError, self).__init__(*args, **kwargs)
| nickgashkov/virtualspace | virtualspace/utils/exceptions.py | Python | mit | 290 |
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2018, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (c) 2012 Omoto Kenji
# Copyright (c) 2011 Sam Stephenson
# Copyright (c) 2011 Josh Peek
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation... | rsalmaso/django-babeljs | babeljs/execjs/runtime.py | Python | mit | 8,806 |
import os
import asyncio
import logging
from functools import partial
from collections import deque
from lxml import etree
from . import stanzas
from .stanzas import Iq
from .parser import Parser
from .utils import signalEvent
from .utils import benchmark as timedWait
from . import getLogger
log = getLogger(__name_... | nicfit/vexmpp | vexmpp/stream.py | Python | mit | 11,877 |
# Generated by Django 1.10.1 on 2016-09-07 20:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("institutions", "0005_auto_20160907_1814")]
operations = [
migrations.AlterModelOptions(
name="email",
options={
"ordering... | watchdogpolska/feder | feder/institutions/migrations/0006_auto_20160907_2016.py | Python | mit | 828 |
import os
from tornado import gen
import tornado.web
class DocsHandler(tornado.web.RequestHandler):
@gen.coroutine
def get(self):
version = "{}://{}/docs/version/v1.yml".format(
self.request.protocol, self.request.host)
self.render("swagger/index.html", version=version)
class H... | vladiibine/trust-network | src/python/trust_network_backend/tnb/apps/core/views.py | Python | mit | 954 |
#!/usr/bin/env python
# coding: utf-8
from datetime import datetime
from distutils import spawn
import argparse
import json
import os
import platform
import shutil
import socket
import sys
import urllib
import urllib2
import main
from main import config
##############################################################... | lipis/life-line | run.py | Python | mit | 12,739 |
from shutit_module import ShutItModule
import base64
class openshift_airflow(ShutItModule):
def build(self, shutit):
shutit.send('cd /tmp/openshift_vm')
shutit.login(command='vagrant ssh')
shutit.login(command='sudo su -',password='vagrant',note='Become root (there is a problem logging in as admin with the vag... | ianmiell/shutit-openshift-vm | airflow.py | Python | mit | 4,398 |
import os
import shutil
import re
import zipfile
import xml.etree.ElementTree as ET
from tempfile import TemporaryDirectory
import psycopg2
conn = psycopg2.connect(
database='innoter', user='postgres', password='postgres', host='192.168.0.107', port='5432')
cursor = conn.cursor()
dst_dir = r"\\nas1\storage\DG_arc... | bazzile/imScrape | Scripts/v1/dev/auxiliary/move_imagery.py | Python | mit | 1,527 |
# parser2.py
# parses sentences from the CSV files
# J. Hassler Thurston
# RocHack Hackathon December 7, 2013
# Modified December 11, 2013
import nltk
from random import choice
cfg_file = 'upenn_grammar.cfg'
tbank_productions = []
nonterminals = []
rightside = []
def get_initial_rules():
global tbank_productions, n... | jthurst3/newspeeches | parser2.py | Python | mit | 1,487 |
#!/usr/bin/env python
import itertools
import time
import rospy
from std_msgs.msg import String
class QueueProc(object):
def __init__(self):
rospy.init_node('motor_queue_proc', anonymous=True)
self.state_change = rospy.Publisher('/motor/state_change', String, queue_size=10)
rospy.Subscriber("/mot... | OSURoboticsClub/Rover2015 | software/ros-packages/motor_controller/scripts/motor_queue_proc.py | Python | mit | 2,620 |
from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf=conf)
lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collec... | TalhaAsmal/Taming-Big-Data-Pyspark-Udemy | ratings-counter.py | Python | mit | 437 |
from .graph_exception import GraphException
from .quality import Quality
from .node_factory import NodeFactory
# noinspection PyProtectedMember
class GraphNode(object):
"""
Base class for nodes in the calculation graph.
See: http:#richard-shepherd.github.io/calculation_graph/GraphNode.html
"""
#... | richard-shepherd/calculation_graph | graph/graph_node.py | Python | mit | 13,788 |
# coding=UTF-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
#import tornado
from tornado import ioloop , web , httpserver , websocket , options
#import handler function
import handler
import os
#set server setti... | ken1277725/pythonweb-STT | server/server.py | Python | mit | 1,001 |
#!/bin/python3
import sys
x1, v1, x2, v2 = map(int, input().strip().split(' '))
willLand = (
v1 != v2
and (x1 - x2) % (v2 - v1) == 0
and (x1 - x2) // (v2 - v1) >= 0)
print(('NO', 'YES')[willLand])
| lilsweetcaligula/Online-Judges | hackerrank/algorithms/implementation/easy/kangaroo/py/solution.py | Python | mit | 215 |
import os
import textwrap
import glob
from os.path import join, curdir, pardir
import pytest
from pip.utils import rmtree
from tests.lib import pyversion
from tests.lib.local_repos import local_checkout
from tests.lib.path import Path
@pytest.mark.network
def test_without_setuptools(script):
script.run("pip",... | pjdelport/pip | tests/functional/test_install.py | Python | mit | 24,544 |
from django.db import models
from django.contrib.auth.models import User, Group
import uuid
import davvy
import davvy.exceptions
from lxml import etree
# Create your models here.
class Resource(models.Model):
def generate_uuid():
return str(uuid.uuid4())
user = models.ForeignKey(User)
groups = ... | unbit/davvy | davvy/models.py | Python | mit | 4,165 |
from django import forms
from Crate.models import Discussion
class ReportForm(forms.Form):
report = forms.CharField(label="Enter your report", max_length=500, widget=forms.Textarea)
class DiscussionForm(forms.ModelForm):
class Meta:
model = Discussion
fields = ['comment']
| KamLii/Databaes | Crate/forms.py | Python | mit | 302 |
from flask import Blueprint, render_template, redirect, url_for, current_app
monitoring_main = Blueprint('monitoring_main', __name__, # pylint: disable=invalid-name
template_folder='templates',
static_url_path='/static',
static_folde... | derekmoyes/opsy | opsy/plugins/monitoring/main.py | Python | mit | 1,477 |
'''
Created on 20/02/2009
@author: Chuidiang
Ejemplo de cliente de socket.
Establece conexion con el servidor, envia "hola", recibe y escribe la
respuesta, espera 2 segundos, envia "adios", recibe y escribe la respuesta
y cierrra la conexion
'''
import socket
#import time
if __name__ == '__main__':
# Se establece ... | oroxo/LPPDP | cliente.py | Python | mit | 1,465 |
# 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_11_01/operations/_express_route_circuit_connections_operations.py | Python | mit | 24,012 |
import subprocess as sp
import sys
goleft_bed = sys.argv[1]
bam = sys.argv[2]
for toks in (l.rstrip().split("\t") for l in open(goleft_bed)):
cmd = "samtools depth -a -Q 1 -r '%s:%d-%s' %s | awk '{s+=$3}END{if(NR==0){print 0}else{print s/%d}}'" % (toks[0], int(toks[1]) + 1, toks[2], bam, int(toks[2]) - int(toks[1... | brentp/goleft | depth/test/cmp.py | Python | mit | 562 |
from __future__ import division
import conformal_blocks.cbbundle as cbd
import cProfile, time, random
#First test
#----------
#
def experiment():
"""
Computes the rank and divisor of conformal block bundles with random weights.
:return: Null
"""
rank = 5
level = 3
num_points = 10
tries ... | mjschust/conformal-blocks | experiments/non_sym_m0n.py | Python | mit | 1,075 |
"""
The Tornado Framework
By Ali Pesaranghader
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
---
*** The Page Hinkley (PH) Method Implementation ***
Paper: Page, Ewan S. "Continuous inspection schemes."
Published in: Biometrika 41.1/2 (1954): 100-115... | alipsgh/tornado | drift_detection/page_hinkley.py | Python | mit | 2,052 |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-tvdb',
version='0.1',
packages=['tvdb'],
include_package_data=True,
... | maxsocl/django-tvdb | setup.py | Python | mit | 1,193 |
# -*- coding:utf-8 -*-
"""
用户消息相关的视图
"""
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.filters import SearchFilter
from account.serializers.message... | codelieche/codelieche.com | apps/account/views/message.py | Python | mit | 3,318 |
# coding: utf-8
"""
Talon.One API
The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #... | talon-one/talon_one.py | talon_one/models/session.py | Python | mit | 5,860 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/models/upgrade_policy_py3.py | Python | mit | 1,372 |
"""Unit tests of resource managers."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
from dlkit.abstract_osid.osid import errors
from dlkit.abstract_osid.type.objects import TypeList as abc_type_list
from dlkit.primordium.id.primitives import Id
fro... | mitsei/dlkit | tests/resource/test_managers.py | Python | mit | 26,397 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from flask import Blueprint, render_template, Markup, url_for
from flask_toolbox.models import Package
package_page = Blueprint('package_page', __name__,
template_folder='templates')
@package_page.route(... | lord63/flask_toolbox | flask_toolbox/views/package.py | Python | mit | 2,151 |
# 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/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_jobs_operations.py | Python | mit | 5,627 |
import os
import uuid
from django.db import models
from django.core.files.uploadedfile import UploadedFile
from django.forms.forms import pretty_name
from . import get_image_cropper
from . import tasks
from . import settings
from . import utils
from . import signals
from .managers import AssetManager
from .fields imp... | ff0000/scarlet | scarlet/assets/models.py | Python | mit | 7,186 |
from setuptools import setup
import minify.command
setup(name='cloaca',
version='0.1.0',
url='https://github.com/mhmurray/cloaca',
author='Michael Murray',
author_email='michaelhamburgmurray@gmail.com',
license='MIT',
packages=['cloaca'],
zip_safe=False,
... | mhmurray/cloaca | setup.py | Python | mit | 696 |
# -*- coding: utf-8 -*-
# pylint: disable-msg=W0104,E0602,W0613,R0201
"""
Abstract classes and utilities for template engines
"""
from hyde._compat import with_metaclass
from hyde.exceptions import HydeException
import abc
from commando.util import getLoggerWithNullHandler, load_python_object
DEFAULT_TEMPLATE = 'hyd... | hyde/hyde | hyde/template.py | Python | mit | 4,633 |
class Bot:
def setup(self, initial_data):
pass
def update(self, state, response):
pass
| RokKos/FRI_Programiranje | OUI/planet-lia/rokkos/core/bot.py | Python | mit | 112 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-04-09 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('georegion', '0001_initial_squashed_0004_auto_20180307_2026'... | stefanw/froide | froide/georegion/migrations/0002_auto_20180409_1007.py | Python | mit | 617 |
from base_screen import BaseScreen
import pygame
from ..graphic_utils import ListView,\
ScreenObjectsManager, TouchAndTextItem
from ..input import InputManager
from play_options import PlayOptions
mode_track_name = 0
mode_album_name = 1
mode_artist_name = 2
class SearchScreen(BaseScreen):
def __init__(se... | jravey7/Joe2Music | mopidy_touchscreen/screens/search_screen.py | Python | mit | 7,928 |
# cgc.py - Curriculum Graph Converter - Dana Toribio
import graphviz
import os
import re
import subprocess
import sys
re_courses = re.compile('\w+\s\d+\w*') # regex for courses
header = r'''from graphviz import Digraph
g = Digraph('studyplan', filename='studyplan.gv')
g.attr('graph', fontname='Helvetica')
g.attr('no... | danaoira/CurriculumGraphVisualizer | cgc.py | Python | mit | 5,047 |
""" A location-aware script to manage ringer volume """
__author__ = 'Marco Bonifacio <bonifacio.marco@gmail.com>'
__license__ = 'MIT License'
import android
import time
# Parameters
SSID = {'bonix-lan': 'casa',
'ZENIT SECURED WPA': 'lavoro'}
RINGER = {'casa': 5,
'lavoro': 2,
'sconosciuto... | mbonix/yapr | android/PyLocale.py | Python | mit | 2,023 |
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
class Category(models.Model):
"""
Django 要求模型必须继承 models.Model 类。
Category 只需要一个简单的分类名 name 就可以了。
CharField 指定了分类名 name 的数据类型,CharField 是字符型,
CharField 的 max_length 参数指定其最大长度,超过这个长度的分类名就不能被存入数据库... | ghostcode/django-blog | blogproject/blog/models.py | Python | mit | 3,967 |
#!/usr/bin/env python
import sys
import string
import subprocess
#----------------------------------------------------------------------
# Define some handy functions
#----------------------------------------------------------------------
def get_contents(file):
f = open(file,'r')
fc = f.readlines()
f.clo... | hermes47/QUACCS_2.0_Shython | py2/scan_dihedral.py | Python | mit | 6,460 |
# The default ``config.py``
# flake8: noqa
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_fil... | fredericklussier/ObservablePy | .vscode/.ropeproject/config.py | Python | mit | 4,037 |
# Given code
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
# Start
pos = 0.0
zero = 0.0
neg = 0.0
for i in arr:
if i == 0:
zero += 1
elif i > 0:
pos += 1
else:
neg += 1
print("%.6f" % (pos / n))
print("%.6f" % (neg / n))
print("%.6f" % (z... | Adriel-M/HackerRank | Learn/Algorithms/Warmup/Plus Minus/plusminus.py | Python | mit | 331 |
from setuptools import setup
setup(
name='behave-teamcity',
version="0.1.23",
packages=['behave_teamcity', ],
url='https://github.com/iljabauer/behave-teamcity',
download_url='https://github.com/iljabauer/behave-teamcity/releases/tag/0.1.23',
license='MIT',
author='Ilja Bauer',
author_e... | jronald01/behave-teamcity | setup.py | Python | mit | 861 |
from wrapper import parse_header, safe_parse_header, XCSVDialect
__all__ = ["parse_header", "safe_parse_header", "XCSVDialect"]
__version__ = "0.2.4"
| Alphadelta14/XCSV | xcsv/__init__.py | Python | mit | 152 |
import unittest
from Pluss import add
class TestAdd(unittest.TestCase):
def setUp(self):
pass
def test_numbers_5_7(self):
self.assertEqual(add(5,7), 12)
if __name__ == '__main__':
unittest.main() | github4321/IS-105_2016_Gruppe92 | uke03/Sebastian_Test_Pluss.py | Python | mit | 233 |
# Generated by Django 3.1.6 on 2022-01-26 20:48
import common.mixins
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.A... | sigmapi-gammaiota/sigmapi-web | sigmapiweb/apps/Scholarship/migrations/0006_course_coursesection.py | Python | mit | 2,984 |
# coding=utf-8
import os
from __init__ import *
import traceback, cStringIO, re
from flask import current_app
from werkzeug.datastructures import FileStorage
from server import user_server, article_server, status_server, form, \
account_server, news_server, resource_server
from server import general, honor_server
f... | Raynxxx/CUIT-ACM-Website | view/ajax.py | Python | mit | 35,176 |
from .views import DepartmentDetailView, Stats, FireDepartmentListView, SimilarDepartmentsListView, DepartmentUpdateGovernmentUnits
from django.contrib.auth.decorators import permission_required
from django.views.generic import TemplateView
from django.conf.urls import patterns, url
from django.views.decorators.cache i... | garnertb/firecares | firecares/firestation/urls.py | Python | mit | 2,033 |
'''
@author: davandev
'''
import logging
import os
import urllib
import datetime
import telnetlib
import paramiko
import davan.config.config_creator as configuration
import davan.util.constants as constants
import davan.util.helper_functions as helper
from davan.http.service.presence.AsusRouterDeviceS... | davandev/davanserver | davan/http/service/presence/AsusRouterPresenceService.py | Python | mit | 10,548 |
""":mod:`flask.ext.volatile.transaction` --- Key-level transactions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by Hong Minhee, StyleShare
:license: MIT License, see :file:`LICENSE` for more details.
"""
import time
from werkzeug.contrib.cache import BaseCache
__all__ = '... | StyleShare/flask-volatile | flask_volatile/transaction.py | Python | mit | 5,200 |
import numpy as np
import moderngl
from ported._example import Example
class Fractal(Example):
title = "Mandelbrot"
gl_version = (3, 3)
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.prog = self.ctx.program(
vertex_shader='''
#version 330
... | cprogrammer1994/ModernGL | examples/mandelbrot_set.py | Python | mit | 2,406 |
'''
Unit tests for mir_eval.onset
'''
import numpy as np
import json
import mir_eval
import glob
import warnings
import nose.tools
A_TOL = 1e-12
# Path to the fixture files
REF_GLOB = 'data/onset/ref*.txt'
EST_GLOB = 'data/onset/est*.txt'
SCORES_GLOB = 'data/onset/output*.json'
def __unit_test_onset_function(metri... | mrgloom/mir_eval | tests/test_onset.py | Python | mit | 2,721 |
import system
# Create the computer system and power it up.
sys = system.System()
sys.power_on()
| richgieg/RichEmu86 | main.py | Python | mit | 98 |
"""
Token class definition
"""
class Token(object):
"""Represents a token with type and value"""
def __init__(self, type, value):
self._type = type
self._value = value
@property
def type(self):
return self._type
@property
def value(self):
return self._value
| piller-imre/exprail-python | exprail/token.py | Python | mit | 319 |
#!/usr/bin/python
import sys
import subprocess
import os
import commands
CLIENT_CN = sys.argv[1]
SEP = '==========> '
OVPN_ROOT='/etc/openvpn/'
ERSA=OVPN_ROOT+'easy-rsa-release-2.x/easy-rsa/2.0/keys/'
IP_PLACEHOLDER = 'placeholder_ip'
TA_PLACEHOLDER = 'placeholder_ta'
CA_PLACEHOLDER = 'placeholder_ca'
CL_KEY_PLACEHO... | storytime/openvpn-server-utils | openvpn/conf_generator.py | Python | mit | 1,782 |
import os
from sqs import (make_SQS_connection, get_queue, queue_size, )
from cloudwatch import (make_CW_connection, update_metric, )
from threading import Timer
# Define AWS credentials
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
REGION = 'us-west-2'... | recombinators/autoscaling | checker.py | Python | mit | 2,410 |
"""length_of_subdivisionfirst
Revision ID: eb61567ea005
Revises: 66f71cf543a4
Create Date: 2018-05-15 22:24:27.212164
"""
from alembic import op
import sqlalchemy as sa
from docassemble.webapp.database import dbtableprefix
# revision identifiers, used by Alembic.
revision = 'eb61567ea005'
down_revision = '66f71cf54... | jhpyle/docassemble | docassemble_webapp/docassemble/webapp/alembic/versions/eb61567ea005_length_of_subdivisionfirst.py | Python | mit | 1,226 |
# -*- coding: utf-8 -*-
import urllib2
from BeautifulSoup import BeautifulSoup
# Download the HTML
request = urllib2.Request('http://www.uci.edu')
response = urllib2.urlopen(request)
print '\r\n\r\n'
# Verify that everything went ok.
# Error codes: 200 == good, 404, 500 == bad
print 'The error code is:', response.c... | codelucas/uci-web-extraction-workshop | basic.py | Python | mit | 1,190 |
# -*- coding: utf-8 -*-
from openerp import models,fields,api
import datetime
import time
class assistent_report1(models.TransientModel):
_name = "assistent.report1"
def date_debut_mois():
now = datetime.date.today() # Date du jour
date_debut_mois = datetime.da... | tonygalmiche/is_plastigray | wizard/assistent_report.py | Python | mit | 2,803 |
from django.apps import AppConfig
class NstoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'nsync_server.nstore'
| pizzapanther/Neutron-Sync | nsync_server/nstore/apps.py | Python | mit | 153 |
import wmi
import requests
import pythoncom
def get_iip():
""""""
f = requests.get("http://myip.dnsomatic.com")
iip = f.text
return iip
def get_lip():
""""""
c = wmi.WMI()
lip = ""
for interface in c.Win32_NetworkAdapterConfiguration(IPEnabled=1):
lip = interface.IPAddress[0... | msincenselee/vnpy | vnpy/gateway/tora/terminal_info.py | Python | mit | 1,108 |
class Config(dict):
def __init__ (self):
self['server'] = 'chat.freenode.com'
self['port'] = 6667
self['debug'] = False
self['verbose'] = False
self['web_host'] = '0.0.0.0'
self['web_port'] = 8080
def __getattr__(self, attr):
try:
return se... | citruspi/ReactIRC | ReactIRC/config.py | Python | mit | 643 |