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 |
|---|---|---|---|---|---|
from __future__ import absolute_import
import six
from exam import fixture
from sentry.testutils import APITestCase, UserReportEnvironmentTestCase
from sentry.models import EventUser, Environment, GroupStatus, UserReport
from sentry.event_manager import EventManager
class ProjectUserReportListTest(APITestCase):
... | ifduyue/sentry | tests/sentry/api/endpoints/test_project_user_reports.py | Python | bsd-3-clause | 11,576 |
from __future__ import absolute_import
import sys
import time
import ctypes
import threading
import six
from six.moves import range
# Based on http://code.activestate.com/recipes/483752/
class TimeoutExpired(Exception):
'''Exception raised when a function times out.'''
def __str__(self):
return 'Func... | atomic-labs/zulip | zerver/lib/timeout.py | Python | apache-2.0 | 3,090 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
################################################################################
#
# benchmark.py
#
# A simple benchmarking tool for the various xsearch language versions
#
################################################################################
import subprocess
i... | clarkcb/xsearch | scripts/benchmark.py | Python | mit | 22,644 |
# -*- coding: utf-8 -*-
#
# This file is part of the Shiboken Python Bindings Generator project.
#
# Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
#
# Contact: PySide team <contact@pyside.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Le... | codewarrior0/Shiboken | tests/py3kcompat.py | Python | gpl-2.0 | 1,372 |
##
# .bin.pg_python - Python console with a connection.
##
"""
Python command with a PG-API connection(``db``).
"""
import os
import sys
import re
import code
import optparse
import contextlib
from .. import clientparameters
from ..python import command as pycmd
from .. import project
from ..driver import default as p... | zappyk-github/zappyk-python | lib/lib_external/postgresql/bin/pg_python.py | Python | gpl-2.0 | 3,516 |
import hashlib
import datetime
import random
import logging
from rest_framework import serializers
from notes.apps.account.models import User, UserProfile
logger = logging.getLogger(__name__)
class Account(serializers.ModelSerializer):
password = serializers.CharField(write_only=True, required=False)
confi... | NTsystems/NoTes-API | notes/apps/account/resources.py | Python | mit | 1,699 |
from django.shortcuts import render, redirect
def home(request):
page_title = 'Randora Home'
user = request.user
context = {
"page_title": page_title,
"user": user,
}
return render(request, 'main_home.html', context)
def about(request):
page_title = 'About Randora'
user = request.user
conte... | Cabal-Syndicate/WebDev | src/main/views.py | Python | cc0-1.0 | 432 |
# coding=utf-8
"""
The NetworkCollector class collects metrics on network interface usage
using /proc/net/dev.
#### Dependencies
* /proc/net/dev
"""
import diamond.collector
from diamond.collector import str_to_bool
import diamond.convertor
import os
import re
try:
import psutil
except ImportError:
psuti... | dcsquared13/Diamond | src/collectors/network/network.py | Python | mit | 4,536 |
# standard
import datetime
def now():
return int(datetime.datetime.now().strftime("%s"))
def load(timestamp):
return datetime.datetime.fromtimestamp(timestamp)
| MattCCS/PyVault | pyvault/crypto/datetime_utils.py | Python | mit | 173 |
BOT_TOKEN = ""
PUBG_STATS_TOKEN = ""
BATTLENET_KEY = ""
| Rauxz/discord-stats-bot | secrets.py | Python | mit | 56 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
import re
from thumbor.filters.drop_shadow import Filter
def test_... | 2947721120/thumbor | old_tests/test_drop_shadow_filter.py | Python | mit | 652 |
import re
XASSET_LOCATION_TAG = 'c4x'
XASSET_SRCREF_PREFIX = 'xasset:'
XASSET_THUMBNAIL_TAIL_NAME = '.jpg'
import os
import logging
import StringIO
from urlparse import urlparse, urlunparse, parse_qsl
from urllib import urlencode
from opaque_keys.edx.locations import AssetLocation, SlashSeparatedCourseKey
from .djan... | geekaia/edx-platform | common/lib/xmodule/xmodule/contentstore/content.py | Python | agpl-3.0 | 10,427 |
import hmac
import re
from collections import OrderedDict
from hashlib import sha256
from config import Config
sha_string = hmac.new(
bytearray(Config.SECRET_KEY, "utf-8"),
bytearray(Config.OTHER_SECRET_KEY, "utf-8"),
sha256
).hexdigest()
ids = {
"my": 200466757,
"ks": 71591548
}
webhook_host = ... | EeOneDown/spbu4u | app/constants.py | Python | apache-2.0 | 17,789 |
# Job tasks sent from web client
# Copyright 2015 by Fred Moolekamp
# License: BSD 3-clause
"""
While each toy may contain a large number of functions, only the functions located in the
``tasks.py`` file will be callable from the job queue.
"""
from __future__ import print_function, division
import importlib
import os... | fred3m/toyz | toyz/web/tasks.py | Python | bsd-3-clause | 30,883 |
from AccessControl import getSecurityManager
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t, dicts_to_dict
from bika.lims.browser.bika_listing import BikaListingView
from bika.lims.browser.sample import SamplePartitionsView
from bika.lims.content.analysisrequest import schema as AnalysisReq... | DeBortoliWines/Bika-LIMS | bika/lims/browser/analysisrequest/manage_analyses.py | Python | agpl-3.0 | 10,116 |
# flake8: noqa
"""
Contains SQLAlchemy database models and colander validation schemata.
"""
from ichnaea.models.base import _Model
# import all models, to make sure they are all registered
from ichnaea.models.constants import Radio
from ichnaea.models.constants import ReportSource
from ichnaea.models.api import ApiK... | mozilla/ichnaea | ichnaea/models/__init__.py | Python | apache-2.0 | 987 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCodec
from hazelcast.protocol.builtin import DataCodec
from hazelcas... | hazelcast/hazelcast-python-client | hazelcast/protocol/codec/transactional_map_values_with_predicate_codec.py | Python | apache-2.0 | 1,175 |
#!/usr/bin/python -d
# -*- coding:utf8 -*-
###########################################################################
# Copyright (C) 2005-2009 Håvard Gulldahl
# <havard@lurtgjort.no>
#
# Lisens: GPL2
#
# $Id$
###########################################################################
import os.path, glob, s... | kkoksvik/finfaktura | finfaktura/ekstra.py | Python | gpl-2.0 | 983 |
# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | catapult-project/catapult | third_party/gsutil/gslib/vendored/oauth2client/scripts/run_gce_system_tests.py | Python | bsd-3-clause | 2,001 |
import sqlite3
import re
from .champion_info import champion_id_from_name,champion_name_from_id, convert_champion_alias, AliasException
regionsDict = {"NA_LCS":"NA", "EU_LCS":"EU", "LCK":"LCK", "LPL":"LPL",
"LMS":"LMS", "International":"INTL", "NA_ACA": "NA_ACA", "KR_CHAL":"KR_CHAL", "LDL":"LDL"}
inter... | lightd22/smartDraft | src/data/database_ops.py | Python | apache-2.0 | 15,164 |
# Copyright 2012 OpenStack Foundation
#
# 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... | atheendra/access_keys | keystone/common/dependency.py | Python | apache-2.0 | 10,606 |
import sys
from accurate_bg_check.order import Order
from .client_example import client
payload = {
'candidateId': '', # use id which is return by candidate resource
'packageType': 'PKG_STANDARD',
'workflow': 'EXPRESS',
'jobLocation': {
'city': 'Burbank',
"region": "CA",
"coun... | kaushal235/accurate_bg_check | example/order_example.py | Python | mit | 899 |
"""
Handler for getting rates from a single rss url and its helper funcitons.
"""
from decimal import Decimal
import feedparser
def _get_feed_entries(url):
"""
Download whole feed from a given url and extract the part where the
relevant informations is stored - entries.
:param url: full url to a sin... | bartekbrak/gwaith | gwaith/rates.py | Python | mit | 1,262 |
from django.test import TestCase
from .models import VerifyEmail
from faker import Faker
# Create randomized test data.
# See http://fake-factory.readthedocs.org/en/latest/ for details.
fake = Faker()
class VerifyEmailTestCase(TestCase):
def test_create(self):
email = fake.email()
token = VerifyE... | favoritemedium/sso-prototype | sso/tests.py | Python | mit | 3,140 |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
import re
USE_TWOPHASE = False
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context... | jessekl/flixr | venv/lib/python2.7/site-packages/alembic/templates/multidb/env.py | Python | mit | 4,096 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-17 05:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0005_auto_20170116_1647'),
]
operations = [
migrations.AddField(
... | y73isc00l/WishGift | myproject/polls/migrations/0006_personuser_passwd.py | Python | apache-2.0 | 462 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... | huggingface/transformers | tests/unispeech_sat/test_modeling_unispeech_sat.py | Python | apache-2.0 | 36,941 |
"""
Deuce Client: Errors
"""
class DeuceClientExceptions(Exception):
"""Generic Deuce Client Exception
"""
pass
class InvalidProject(DeuceClientExceptions):
"""Deuce Client Project-ID Exceptions
"""
pass
class InvalidVault(DeuceClientExceptions):
"""Deuce Client Vault Exceptions
""... | rackerlabs/deuce-client | deuceclient/common/errors.py | Python | apache-2.0 | 1,924 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | fiete201/qutebrowser | qutebrowser/browser/webkit/webkittab.py | Python | gpl-3.0 | 37,070 |
import re
from django.conf import settings
from django.utils import translation
import requests
from requests.exceptions import RequestException
import olympia.core.logger
from olympia.amo.celery import task
from olympia.amo.decorators import use_primary_db
from olympia.files.models import (
File, WebextPermis... | aviarypl/mozilla-l10n-addons-server | src/olympia/files/tasks.py | Python | bsd-3-clause | 4,154 |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | tgarc/pyOCD | pyOCD/pyDAPAccess/dap_access_api.py | Python | apache-2.0 | 5,018 |
#!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from builtins import input
from http.server import HTTPServer, SimpleHTTPRequestHandler
from netaddr import IPNetwork
from os import chdir
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from random... | arslanabbasi/bcc | examples/tunnel_monitor/main.py | Python | apache-2.0 | 3,423 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Alexander Bulimov <lazywolf0@gmail.com>
# based on lvol module by Jeroen Hoekx <jeroen.hoekx@dsquare.be>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | smashwilson/ansible-modules-extras | system/lvg.py | Python | gpl-3.0 | 9,417 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google-research/google-research | graph_embedding/dmon/param_dgi.py | Python | apache-2.0 | 6,071 |
# Copyright (c) 2010 Python Software Foundation. All Rights Reserved.
# Adapted from Python's Lib/test/test_strtod.py (by Mark Dickinson)
# Tests for the correctly-rounded string -> float conversions
# introduced in Python 2.7 and 3.1.
import random
TEST_SIZE = 2
def test_short_halfway_cases():
# exact halfway... | valven/cdecimal | python/randfloat.py | Python | bsd-2-clause | 9,731 |
#!/usr/bin/env python
## @file kernelinfo_parse.py
# @brief Script for retrieving the last kernelinfo block from dmesg.
# The printout format is suitable for appending to a kernelinfo.conf file.
#
# @copyright This work is licensed under the terms of the GNU GPL, version 2.
# See the COPYING file... | KernelAnalysisPlatform/kvalgrind | qemu/panda_plugins/osi_linux/utils/kernelinfo/kernelinfo_parse.py | Python | gpl-3.0 | 2,092 |
import errno
import hashlib
import sqlalchemy as sa
from weasyl.define import connect, meta
from weasyl import orm
def batch_media_items(db):
q = (db.query(orm.MediaItem)
.with_polymorphic(orm.DiskMediaItem)
.filter(orm.MediaItem.sha256 == None))
(max_id,), = db.execute(sa.select([sa.func.... | dzamie/weasyl | weasyl/migration/fill_sha256.py | Python | apache-2.0 | 1,330 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are per... | pansapiens/mytardis | tardis/tardis_portal/tests/test_models.py | Python | bsd-3-clause | 15,003 |
'''
Mouse provider implementation
=============================
On linux systems, the mouse provider can be annoying when used with another
multitouch provider (hidinput or mtdev). The Mouse can conflict with them: a
single touch can generate one event from the mouse provider and another
from the multitouch provider.
... | Cheaterman/kivy | kivy/input/providers/mouse.py | Python | mit | 11,016 |
from TileCache.Service import Service, wsgiHandler
from optparse import OptionParser
def run(service, port=8080, threading=False, config=None):
def app(environ, start_response):
return wsgiHandler(environ, start_response, service)
from wsgiref import simple_server
if threading:
from Socket... | rjw57/foldbeam | data/tilecache_http_server.py | Python | apache-2.0 | 1,832 |
#!/usr/bin/python
# -*- coding: ascii -*-
import pychecker.checker
import time
import serial
def serialConnect():
serlocations=['/dev/ttyACM', '/dev/ttyACM0', '/dev/ttyACM0', '/dev/ttyACM1', '/dev/ttyACM2', '/dev/ttyACM3', '/dev/ttyACM4', '/dev/ttyACM5', '/dev/ttyUSB0', '/dev/ttyUSB1', '/dev/ttyUSB2', '/dev/ttyUSB3... | kbdick/RecycleTracker | recyclecollector/scrap/pythontesting_bench.py | Python | gpl-3.0 | 1,988 |
# Authors:
# Pedro Jose Pereira Vieito <pvieito@gmail.com> (Twitter: @pvieito)
#
# URL: https://github.com/mr-orange/Sick-Beard
#
# This file is part of Sick Beard.
#
# Sick Beard 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 S... | Branlala/docker-sickbeardfr | sickbeard/sickbeard/clients/download_station.py | Python | mit | 3,047 |
from util import byte_bit_util
from util.boyer_moore_search import BoyerMoore, boyer_moore
from protoSBN1 import protoSBN1_constants
from protoSBN1.protoSBN1_operand import ProtoSBN1Operand
__author__ = 'Yifei'
class ProtoSBN1(object):
"""ProtoSBN1 class"""
def __init__(self):
self.__rx_index = 0
... | BHFaction/SanBot | src/pySanbot/protoSBN1/protoSBN1.py | Python | mit | 6,818 |
from django.contrib import admin
from django.utils.html import format_html
from .models import Post
class Post_ParserAdmin(admin.ModelAdmin):
def post_link_url(self, obj):
return format_html("<a href='{url}'>{url}</a>", url=obj.post_link)
list_display = ('post_id', 'post_link_url', 'post_date', 'post_active', '... | ngardamala/vk_parser | post_parser/admin.py | Python | gpl-3.0 | 537 |
# pylint: disable=missing-docstring, import-error, invalid-name
# pylint: disable=too-few-public-methods, disallowed-name, no-member, useless-object-inheritance
import uuid
# Note this import doesn't actually exist
import foo
from .a import x
class Y(object):
x = x[0]
def test(default=None):
return defau... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/u/unused/unused_import_assigned_to.py | Python | mit | 425 |
"""The base command."""
from datetime import datetime
from json import dumps
from watches.util import ESClientProducer
class Base(object):
"""A base command."""
TEXT_PLAIN = 'plain/text'
JSON_APPLICATION = 'application/json'
TRANSFORM_PARAM = '--transform'
TIMESTAMP_PARAM = '--timestamp'
... | ViaQ/watches-cli | watches/commands/base.py | Python | apache-2.0 | 7,002 |
"""empty message
Revision ID: 75ec5950e6a0
Revises: 51f5ccfba190
Create Date: 2016-07-21 18:03:35.235400
"""
# revision identifiers, used by Alembic.
revision = '75ec5950e6a0'
down_revision = '51f5ccfba190'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | davismathew/netautgui | migrations/versions/75ec5950e6a0_.py | Python | mit | 4,280 |
import galaxy.model
from galaxy.model.orm import *
from galaxy.model.mapping import context as sa_session
from base.twilltestcase import TwillTestCase
class UploadData( TwillTestCase ):
def test_0005_upload_file( self ):
"""Test uploading 1.bed, NOT setting the file format"""
self.logout()
... | volpino/Yeps-EURAC | test/functional/test_get_data.py | Python | mit | 40,798 |
#!/usr/bin/env python3
# Copyright 2017 Kristopher Heijari
#
# This file is part of vim-liq.
#
# vim-liq 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) a... | kristopher-h/vim-lsp | tools/create_release.py | Python | gpl-3.0 | 2,131 |
"""
Django module container for classes and operations related to the "Course Module" content type
"""
import json
import logging
from cStringIO import StringIO
from datetime import datetime, timedelta
import dateutil.parser
from django.conf import settings
import requests
from lazy import lazy
from lxml import etree... | philanthropy-u/edx-platform | common/lib/xmodule/xmodule/course_module.py | Python | agpl-3.0 | 62,391 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2009 Blazingamer <n_hydo... | cherbib/fofix | src/Rockmeter.py | Python | gpl-2.0 | 17,913 |
# Copyright (C) 2010 University of California, Santa Cruz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This pro... | SoftwareIntrospectionLab/MininGit | pycvsanaly2/extensions/HunkBlame.py | Python | gpl-2.0 | 17,847 |
# Copyright 2014 Alcatel-Lucent USA Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | shakamunyi/neutron-vrrp | neutron/plugins/nuage/extensions/nuage_subnet.py | Python | apache-2.0 | 1,834 |
from Components.ActionMap import ActionMap
from Components.config import getConfigListEntry, config, ConfigSubsection, ConfigText, ConfigSelection, ConfigInteger, ConfigClock, NoSave
from Components.ConfigList import ConfigListScreen
from Components.Console import Console
from Components.Label import Label
from Compone... | Openeight/enigma2 | lib/python/Screens/CronTimer.py | Python | gpl-2.0 | 16,169 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
def dbtx_calc(fractE, fractC, Lw, Lbe, Lbc):
"""
A Python translation of a Matlab script to calculate electron transmission
probability for a GaAs/AlGaAs Resonant-Tunneling Diode.
Parameters:
-----------
fractE :... | elvd/phd_helper | dbrttx.py | Python | mit | 3,868 |
#!/usr/bin/env python
import MySQLdb
import optparse
# Get options
opt = optparse.OptionParser()
opt.add_option("-a", "--actor", action="store", help="denotes the lastname/surname of the actor for search - only ONE of actor or film can be used at a time", dest="actor")
opt.add_option("-f", "--film", action="s... | simontakite/sysadmin | pythonscripts/pythonmysql/0189_05_Code/project-ch5.py | Python | gpl-2.0 | 8,011 |
# engine.gamestate
class GameState:
def set(self):
return True
def unset(self):
return True
| CST205-Midterm/Game | engine/gamestate.py | Python | mit | 100 |
VARNISH_SERVERS = ['http://127.0.0.1:8080']
ENABLE_VARNISH = True
ENABLE_ESI = False
| brandonPurvis/osf.io | api/base/settings/local-dist.py | Python | apache-2.0 | 85 |
# -*- coding: utf-8 -*-
import requests
import json
import logging
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
class PublicAPI:
def __init__(self, production=True, version="v1", timeout=20):
self.__host = production and "https://api.korbit.co.kr/%s/" % v... | HoonJin/korbit-python | korbit/public_api.py | Python | mit | 2,611 |
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.
from zengine.views.base import BaseView
from zengine import forms
from zengine.forms import fields
from zengine.models import TaskInvitation
from pyoko.lib.utils import get_objec... | zetaops/zengine | zengine/views/task_manager_actions.py | Python | gpl-3.0 | 7,298 |
"""The data models for the Credits submodule of the URY website.
These data models are implemented using SQLAlchemy and contain no
website-specific code, and are theoretically transplantable into any Python
project.
Most notably missing from these models is any semblance of a "get URL" function
as this is defined at ... | UniversityRadioYork/lass-pyramid | credits/models.py | Python | bsd-2-clause | 3,561 |
"""CLI argument parsing related tests."""
import argparse
import json
import pytest
from requests.exceptions import InvalidSchema
import httpie.cli.argparser
from .fixtures import (
FILE_CONTENT, FILE_PATH, FILE_PATH_ARG, JSON_FILE_CONTENT,
JSON_FILE_PATH_ARG,
)
from httpie.status import ExitStatus
from httpi... | jkbrzt/httpie | tests/test_cli.py | Python | bsd-3-clause | 13,183 |
#!/usr/bin/env python26
#Description: Constants definitions
# Copyright 2013 Zynga Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | zbase/zbase-backup-tools | src/consts.py | Python | apache-2.0 | 3,516 |
# *-* coding=utf-8 *-*
from django import template
from django.conf import settings
from django.core import urlresolvers
from dynaform import forms as dynaforms
DYNAFORM_SESSION_KEY = getattr(settings, 'DYNAFORM_SESSION_KEY', 'DYNAFORM')
DYNAFORM_SUCCESS_REDIRECT_URL = getattr(settings, 'DYNAFORM_SUCCESS_REDIRECT_URL... | ninjaotoko/dynaform | dynaform/templatetags/dynaform_tags.py | Python | bsd-3-clause | 3,293 |
####################################################################################################
#
# GroupedPurchaseOrder - A Django Application.
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | FabriceSalvaire/grouped-purchase-order | GroupedPurchaseOrder/views/angular.py | Python | agpl-3.0 | 1,651 |
# ID-Fits
# Copyright (c) 2015 Institut National de l'Audiovisuel, INA, All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at... | ina-foss/ID-Fits | lib/utils/__init__.py | Python | lgpl-3.0 | 712 |
"""
This module helps to create dictionary of channel name and it's code
on burpp.com
"""
import pickle
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
import lxml.html
def create_list(toFile=True, filename='list', categorize=False):
"""
creates a simple colon se... | DhruvPatel01/indian-tv-schedule-api | channel_list_parser.py | Python | mit | 2,309 |
from typing import Any, Callable, Optional
from reactivex import Observable, abc, typing
from reactivex.disposable import Disposable
def from_callback_(
func: Callable[..., Callable[..., None]],
mapper: Optional[typing.Mapper[Any, Any]] = None,
) -> Callable[[], Observable[Any]]:
"""Converts a callback f... | ReactiveX/RxPY | reactivex/observable/fromcallback.py | Python | mit | 1,851 |
"""Add id column to certificate_notification_associations.
Revision ID: ce547319f7be
Revises: 5bc47fa7cac4
Create Date: 2018-02-23 11:00:02.150561
"""
# revision identifiers, used by Alembic.
revision = "ce547319f7be"
down_revision = "5bc47fa7cac4"
import sqlalchemy as sa
from alembic import op
from flask_sqlalche... | Netflix/lemur | lemur/migrations/versions/ce547319f7be_.py | Python | apache-2.0 | 708 |
# Copyright (c) 2016, Mike Smith
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import GPy
import numpy as np
import sys #so I can print dots
import time
import os
from joblib import Parallel, delayed
def get_log_likelihood(inputs,data,clust):
"""Get the LL of a combined set of clusters, ignoring time... | mikecroucher/GPy | GPy/util/cluster_with_offset.py | Python | bsd-3-clause | 9,193 |
from twisted.internet import reactor
from twisted.web import http
class MyRequestHandler(http.Request):
resources = {
'/': '<h1>Home</h1>Home page',
'/about': '<h1>About</h1>All about me',
}
def process(self):
self.setHeader('Content-Type', 'text/html')
if self.reso... | paoletto/mediastreamer | mediastreamer.py | Python | gpl-3.0 | 816 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-28 20:31
from __future__ import unicode_literals
import django.contrib.sites.managers
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | stosdev/registero | news/migrations/0001_initial.py | Python | gpl-3.0 | 1,353 |
import logging
import datetime
import pytz
from pyramid.httpexceptions import HTTPBadRequest, HTTPTooManyRequests
from c2corg_api.emails.email_service import get_email_service
from c2corg_api.views import http_error_handler
from c2corg_api.models import DBSession
from c2corg_api.models.user import User
from smtplib im... | c2corg/v6_api | c2corg_api/tweens/rate_limiting.py | Python | agpl-3.0 | 3,283 |
from bisect import bisect_left, bisect_right
# from https://raw.githubusercontent.com/ActiveState/code/3b27230f418b714bc9a0f897cb8ea189c3515e99/recipes/Python/577197_SortedCollection/recipe-577197.py
class SortedCollection(object):
'''Sequence sorted by a key function.
SortedCollection() is much easier to wo... | statgen/encore | encore/sorted_collection.py | Python | agpl-3.0 | 6,876 |
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | GoogleCloudPlatform/professional-services | tools/ml-auto-eda/ml_eda/preprocessing/analysis_query/query_templates.py | Python | apache-2.0 | 5,308 |
#!/usr/bin/env python
# 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, softwar... | noironetworks/horizon | manage.py | Python | apache-2.0 | 830 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-container | samples/generated_samples/container_v1beta1_generated_cluster_manager_get_server_config_sync.py | Python | apache-2.0 | 1,533 |
import csv
import sys
from django.core.management.base import BaseCommand
from postix.core.models import Record
class Command(BaseCommand):
help = 'Export generated records as csv.'
def handle(self, *args, **kwargs):
keys = [('date', 'Datum'), ('time', 'Uhrzeit'), ('direction', 'Richtung'), ('amoun... | c3cashdesk/c6sh | src/postix/core/management/commands/export_records.py | Python | agpl-3.0 | 686 |
###
# Copyright (c) 2010, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | kg-bot/SupyBot | plugins/WebStats/__init__.py | Python | gpl-3.0 | 2,879 |
from TravelingTony.TestCase import TestCase
from TravelingTony.Constants import TT_Constants
from TravelingTony.pages.ShareOnTwitterPage import ShareOnTwitterPage
import unittest
import time
class ShareOnTwitterTest(TestCase, unittest.TestCase):
def setUp(self):
super(... | gagoncal/Selenium | Exercise/Mine/UI MAPS/Exercise/TravelingTony/tests/ShareOnTwitterTest.py | Python | lgpl-2.1 | 834 |
# -*- coding: utf-8 -*-
# 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, softw... | enykeev/lazyengine | lazyengine/tests/test_lazyengine.py | Python | apache-2.0 | 4,199 |
# -*- coding: utf-8 -*-
"""
@author: Chenglong Chen <c.chenglong@gmail.com>
@brief: feature combiner
"""
import os
import sys
import imp
from optparse import OptionParser
import scipy
import pandas as pd
import numpy as np
import config
from config import TRAIN_SIZE
from utils import logging_utils, time_utils, pkl_... | ChenglongChen/Kaggle_HomeDepot | Code/Chenglong/feature_combiner.py | Python | mit | 20,725 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 L Fiaschi, T Kroeger, M Nullmaier C Sommer, C Straehle, U Koethe, FA Hamprecht.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditi... | ilastik/ilastik-0.5 | scripts/pretty-class-headers.py | Python | bsd-2-clause | 3,186 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Subset take an integer k and a sequence of N objects as input,
# and subset return exactly k of N objects uniformly at random.
# The probability of returning a particular object is k / N.
class subset:
# initialize a subset class with iterable object representing
... | songsuoyuan/Algorithms-Part-1-Python | subsets.py | Python | mit | 395 |
# Copyright 2015 Artur Chakhvadze <nopadon@yandex.ru>.
# Copyright 2014-2015 Dmitry Voronin <dimka665@gmail.com>.
# All Rights Reserved.
"""Basic VK API wrapper."""
__author__ = 'Artur Chakhvadze (norpadon@yandex.ru)'
import time
from collections import deque
from datetime import datetime, timedelta
from tornado im... | Norpadon/vk_async | vk_async/application.py | Python | mit | 9,229 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | jenaiz/Crawly | searcher-front-end/main.py | Python | mit | 4,601 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | google/clif | clif/testing/python/template_alias_test.py | Python | apache-2.0 | 1,298 |
# -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | apache/incubator-systemml | src/main/python/systemds/operator/algorithm/builtin/img_shear.py | Python | apache-2.0 | 1,962 |
__author__ = 'elip'
raise Exception('Bad Script!') | yaronp68/cloudify-python-plugin | python_script_executor/tests/resources/bad.py | Python | apache-2.0 | 51 |
def <caret>foo(*a)
if a
pass | idea4bsd/idea4bsd | python/testData/codeInsight/smartEnter/func.py | Python | apache-2.0 | 40 |
from .main import TorrentDay
def start():
return TorrentDay()
config = [{
'name': 'torrentday',
'groups': [
{
'tab': 'searcher',
'subtab': 'providers',
'list': 'torrent_providers',
'name': 'TorrentDay',
'description': 'See <a href="http:/... | coolbombom/CouchPotatoServer | couchpotato/core/providers/torrent/torrentday/__init__.py | Python | gpl-3.0 | 1,181 |
from local_settings import BASE_URL
import datetime
import json
import redis
import requests
import requests.exceptions
class TeaReaderConsumer(object):
def __init__(self):
self.redis = redis.StrictRedis()
def run(self):
pubsub = self.redis.pubsub(ignore_subscribe_messages=True)
pubs... | ojarva/home-info-display | tea_reader_consumer/run.py | Python | bsd-3-clause | 1,217 |
import question_template
game_type = 'input_output'
source_language = 'C'
parameter_list = [
['$x1','int'],['$x2','int'],['$x3','int'],['$y0','int'],
]
tuple_list = [
['search_',
[1,0,0,None],
[1,0,2,None],
[1,0,5,None],
[1,2,0,None],
[1,2,1,None],
[1,2,3,None],
[1,4,0,None],
[1,4,1,None],
[5,0,0... | stryder199/RyarkAssignments | Assignment2/ttt/archive/arrays/search.py | Python | mit | 1,168 |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
#
# 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 ... | AVSystem/Anjay | tests/integration/suites/default/queue_mode.py | Python | apache-2.0 | 3,449 |
# Copyright 2016 Hackers' Club, University Of Peradeniya
# Author : Tharinda Ehelepola, E/11/105
#
# 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... | HackersUOP/project-iMAS | run_server_app.py | Python | apache-2.0 | 736 |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 5 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
from contextlib import ... | sharad/calibre | src/calibre/gui2/store/stores/amazon_fr_plugin.py | Python | gpl-3.0 | 6,668 |
# -*- coding: utf-8 -*-
from flask import render_template, redirect, url_for, request, current_app, \
flash
from flask.ext.login import login_required
from app.main.forms import DeleteForm, TestPaperConstraintForm, \
TestPaperReplaceForm, TestPaperNameForm
from app import db
from app.main import main
fr... | ts25504/item-bank | app/main/test_paper_views.py | Python | gpl-2.0 | 11,676 |
# Copyright (C) 2005 Saul J B
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the h... | scommab/pytrips | style.py | Python | gpl-2.0 | 4,537 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | r-pufky/docs | sphinx/conf.py | Python | gpl-2.0 | 3,567 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lengtharea.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**************... | AsgerPetersen/QGIS | python/plugins/processing/algs/taudem/lengtharea.py | Python | gpl-2.0 | 3,956 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.