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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
import fitsio
import sys
try:
filename = sys.argv[1]
except:
exit("ERROR: Please provide a filename")
#filename = 'ITL-3800C-145-Dev_fe55_bias_000_4698D_20170306174623.fits'
F = fitsio.FITS(filename)
for hdu in F:
header = hdu.read_header()
extnum = hdu.get_extnum()
e... | menanteau/HeaderService | etc/TestCamera/extract_header_templates.py | Python | gpl-3.0 | 583 |
def transform(dataset):
"""
For each tilt image, the method calculates its histogram
and then chooses the highest peak as the background level and subtracts it
from the image.
It does NOT set negative pixels to zero.
"""
import numpy as np
data = dataset.active_scalars # Get data as nu... | OpenChemistry/tomviz | tomviz/python/Subtract_TiltSer_Background_Auto.py | Python | bsd-3-clause | 712 |
# rotate-backups: Simple command line interface for backup rotation.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 20, 2016
# URL: https://github.com/xolox/python-rotate-backups
"""
Usage: rotate-backups-s3 [OPTIONS] DIRECTORY..
Easy rotation of backups in an AWS S3 bucket based. To use
this p... | tarzan0820/python-rotate-backups-s3 | rotate_backups_s3/cli.py | Python | mit | 7,062 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seguimiento.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| NavarraBiomed/seguimientoPacientes | manage.py | Python | gpl-2.0 | 254 |
import sys
from setuptools import setup
from setuptools.extension import Extension
#XXX gettid only works on Linux, don't bother else
if 'linux' in sys.platform:
exts = [Extension('mmstats._libgettid', sources=['mmstats/_libgettid.c'])]
else:
exts = []
requirements = ['Flask']
try:
import argparse
exce... | schmichael/mmstats | setup.py | Python | bsd-3-clause | 1,396 |
# -*- coding: utf-8 -*-
# This is an app-specific example router
#
# This simple router is used for setting languages from app/languages directory
# as a part of the application path: app/<lang>/controller/function
# Language from default.py or 'en' (if the file is not found) is used as
# a default_language
#
# ... | francielsilvestrini/soupport | routes.py | Python | lgpl-3.0 | 1,527 |
import os
import numpy as np
import soundfile as sf
import argparse
from commonfate import decompose
def export(input, input_file, output_path, samplerate):
if not os.path.exists(output_path):
os.makedirs(output_path)
basepath = os.path.join(
output_path, os.path.splitext(os.path.basename(inp... | aliutkus/commonfate | examples/cfm_decompose.py | Python | bsd-3-clause | 1,202 |
import os
filename = os.path.basename(__file__)
def main(request, response):
if request.method == 'POST':
return 302, [('Location', './%s?redirect' % filename)], ''
return [('Content-Type', 'text/plain')], request.request_path
| UK992/servo | tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigation-redirect-body.py | Python | mpl-2.0 | 246 |
# =============================================================================
# Federal University of Rio Grande do Sul (UFRGS)
# Connectionist Artificial Intelligence Laboratory (LIAC)
# Renato de Pontes Pereira - rppereira@inf.ufrgs.br
# =============================================================================
... | renatopp/liac-chess | chess/__init__.py | Python | mit | 3,617 |
# pylint: disable=redefined-builtin, wildcard-import
"""Intel Gen9 GPU specific declaration and schedules."""
from __future__ import absolute_import as _abs
from .conv2d import *
| Huyuwei/tvm | topi/python/topi/intel_graphics/__init__.py | Python | apache-2.0 | 180 |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | nebril/fuel-web | nailgun/nailgun/test/unit/test_task_helpers.py | Python | apache-2.0 | 8,615 |
# -*- coding: utf-8 -*-
__author__ = 'aramirez'
import classdb
import xlsxwriter
import datetime
from flask import session
def export_excel(data, date_start, date_end):
startDateReport = date_start.split(' ')
date = startDateReport[0].split('-')
startDateReport = date[2] +'/'+ date[1] +'/'+ date[0] +' '+... | cristian69/KernotekV3 | excel.py | Python | gpl-3.0 | 23,504 |
from common import *
class Node(object):
"""
Class representing a single node.
It is important to note that Nodes, in isolation, are
not bound to a single Graph (they are referenced in NodeTuples, which
compose NodeLists, which are associated with a Graph's NodeRegistry).
A node must have a name, and may option... | AlexArendsen/pylog | nodes.py | Python | gpl-2.0 | 8,666 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
#
# 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 you... | Forage/Gramps | gramps/gen/filters/rules/person/_ischildoffiltermatch.py | Python | gpl-2.0 | 2,540 |
# Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
try:
import pylab as pb
except:
pass
def univariate_plot(prior):
rvs = prior.rvs(1000)
pb.hist(rvs, 100, normed=True)
xmin, xmax = pb.xlim()
xx = np.linspace(xm... | gusmaogabriels/GPy | GPy/plotting/matplot_dep/priors_plots.py | Python | bsd-3-clause | 892 |
"""Utility classes for testing."""
from __future__ import absolute_import, division, print_function
# pylint: disable=too-few-public-methods,fixme
class MockHttpResponse(object):
"""Test Util: mocks response."""
# TODO Move this to helpers under tests directory
def __init__(self, content, status_code):
... | aayush26/pirant | pirant/utils.py | Python | mit | 430 |
import os
import yaml
from datamgr import Scheduler
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from variablelabel import VariableLabel
from thermometer import Thermometer
from manometer import Manometer
from led import Led
root_widget = FloatLayout... | victor-rene/MicroScada | archive/day_06/pageloader.py | Python | mit | 2,009 |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# from __future__ import annotations
from textwrap import dedent
from typing import Any, Mapping
import pytest
from pants.backend.docker.target_types import DockerImageSourceField, Dock... | pantsbuild/pants | src/python/pants/backend/docker/util_rules/dockerfile_test.py | Python | apache-2.0 | 5,265 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from PyQt5 import QtGui
from PyQt5 import QtCore
from PyQt5 import QtWidgets
if __name__ == '__main__':
from basedialog import BaseDialog
else:
from .basedialog import BaseDialog
class UrlinputDialog(BaseDialog):
def __init__(self, styleoptions, parent=... | dragondjf/CloudSetuper | setuper desktop app/gui/dialogs/urlinputdialog.py | Python | mit | 2,271 |
from __future__ import division
from sympy import I, Rational, Symbol, pi, sqrt
from sympy.geometry import Line, Point, Point2D, Point3D, Line3D, Plane
from sympy.geometry.entity import rotate, scale, translate
from sympy.matrices import Matrix
from sympy.utilities.iterables import subsets, permutations, cartes
from s... | antepsis/anteplahmacun | sympy/geometry/tests/test_point.py | Python | bsd-3-clause | 12,892 |
#school Computers Api V1.1
#Written in python by Mike Semple
import json
import bottle
from bottle import route, run, request, abort
from pymongo import Connection
connection = Connection('localhost', 27017)
db = connection.mydatabase
#This will be taken out for production
@route('/api/v1.1/14be4a968a6c807ba132ab6a... | mike-semple/python_api | api.py | Python | gpl-2.0 | 2,314 |
import os
import sys
import six
from conans.client.runner import ConanRunner
from conans.client.tools.oss import OSInfo, cross_building, get_cross_building_settings
from conans.client.tools.files import which
from conans.errors import ConanException, ConanInvalidSystemRequirements
from conans.util.env_reader import ge... | conan-io/conan | conans/client/tools/system_pm.py | Python | mit | 18,797 |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
class Template(models.Model):
def __str__(self):
return self.name
name = models.CharField(_("Template File Name"), max_length=250)
class BaseFor... | aldryn/aldryn-constantcontact | aldryn_constantcontact/models.py | Python | bsd-3-clause | 469 |
def Settings( **kwargs ):
return { 'ls': { 'java.rename.enabled' : False } }
| Valloric/ycmd | ycmd/tests/language_server/testdata/project/settings_extra_conf/.ycm_extra_conf.py | Python | gpl-3.0 | 81 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(seria... | cyberbikepunk/django_polls | polls/migrations/0001_initial.py | Python | apache-2.0 | 1,305 |
from collections import deque
from sys import stdout
import re
contextLines = 3
class DiffLines:
"""A single span of lines from a chunk of diff, used to store either the original
or the changed lines"""
def __init__(self, start, lines):
"""Note: end is inclusive"""
self.start = start
... | martinthomson/blame-bridge | blame_bridge/diffu.py | Python | mit | 8,505 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-14 01:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
... | seba3c/scamera | notifications/migrations/0002_auto_20161014_0113.py | Python | gpl-3.0 | 656 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
from xml.etree import ElementTree as et
from lib.core.common import getSafeExString
from lib.core.data import conf
from lib.core.data import paths
from lib.core.da... | glaudsonml/kurgan-ai | tools/sqlmap/lib/parse/payloads.py | Python | apache-2.0 | 3,167 |
# -*- 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-dataplex | samples/generated_samples/dataplex_v1_generated_dataplex_service_create_asset_async.py | Python | apache-2.0 | 1,690 |
import os
import re
import logging
import requests
from typing import Union
import xml.etree.ElementTree as ET
from functools import lru_cache
from indra.util import read_unicode_csv, UnicodeXMLTreeBuilder as UTB
logger = logging.getLogger(__name__)
hgnc_url = 'http://rest.genenames.org/fetch/'
def get_uniprot_id... | sorgerlab/belpy | indra/databases/hgnc_client.py | Python | mit | 12,982 |
import discord
async def removereaction(cmd, message, args):
if args:
lookup = args[0].lower()
interaction_item = cmd.db[cmd.db.db_cfg.database].Interactions.find_one({'ReactionID': lookup})
if interaction_item:
cmd.db[cmd.db.db_cfg.database].Interactions.delete_one(interaction... | AXAz0r/apex-sigma-core | sigma/modules/owner_controls/core/removereaction.py | Python | gpl-3.0 | 664 |
"""Tests for the key interactiveshell module, where the main ipython class is defined.
"""
#-----------------------------------------------------------------------------
# Module imports
#-----------------------------------------------------------------------------
# third party
import nose.tools as nt
# our own pack... | sserrot/champion_relationships | venv/Lib/site-packages/IPython/core/tests/test_iplib.py | Python | mit | 6,107 |
"""Tests for the datadog component."""
| fbradyirl/home-assistant | tests/components/datadog/__init__.py | Python | apache-2.0 | 39 |
#!/usr/bin/python
import hashlib
class Device():
def __init__(self, name='default_device_name'):
self.__name = name
self.__id = hashlib.md5(name).hexdigest()
self.__is_online = False
@property
def name(self):
return self.__name
@property
def id(self):
re... | guolinp/storage | device.py | Python | gpl-2.0 | 604 |
import unittest
import json
import time
import urllib2
from selenium import webdriver
class RestApiUiTest(unittest.TestCase):
def setUp(self):
#http://api.openweathermap.org/data/2.5/weather?q=Baltimre,us&APPID=70926ddfd37fdf454548b8db13695995
#define Api URL and API Key
self.ApiUrl = "http... | gagoncal/Selenium | 2016/Equal_Experts/Use_Cases/RestAPICheckUI/Rest_API_Check_UI.py | Python | lgpl-2.1 | 2,708 |
import ply.yacc as yacc
from lex import tokens
from ast import ConfigNode, AssNode, DeclNode, WatchNode, ValueNode, DerefNode
def p_config(p):
"""config : top_assignments watch_blocks
"""
print "Config"
p[0] = ConfigNode(top_assignments=p[1], watches=p[2])
def p_top_assignments(p):
"""top_as... | apg/canoe | canoe/config/parser.py | Python | gpl-3.0 | 2,708 |
# -*- coding: utf-8 -*-
# Copyright (C) 2016-2018 Stadt Karlsruhe (www.karlsruhe.de)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your opti... | stadt-karlsruhe/ckanext-extractor | setup.py | Python | agpl-3.0 | 5,131 |
"""
locally connected implimentation on the lip movement data.
Akm Ashiquzzaman
13101002@uap-bd.edu
Fall 2016
after 1 epoch , val_acc: 0.0926
"""
from __future__ import print_function, division
#random seed fixing for reproducibility
import numpy as np
np.random.seed(1337)
import time
#Data loading
X_train = np.... | zamanashiq3/code-DNN | dense_v1.py | Python | mit | 2,055 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author : Masahiro Ohmomo
# DCC : Maya
# Version : 2013 - Latest
# Recommend: 2013
#
# Description.
# In this script, you can toggle the isolate of objects .
# Run Select the object.
#
# Extra command to disable the isolate.
#
#
# Run command. -Defult
# impo... | momotarou-zamurai/kibidango | maya/python/viewport/view/toggle_isolate_object.py | Python | mit | 1,541 |
from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from src.module.deploy_utils import parse_war_path
from requests.utils import dict_from_cookiejar
from re import findall
from log import LOG
import utility
titles = [TINTERFACES.MAN]
def undeploy(fingerengine,... | 0x27/clusterd | src/platform/tomcat/undeployer.py | Python | mit | 3,359 |
import abc
import builtins
import collections
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import time
import unittest
from weakref import proxy
import contextlib
try:
import threading
except ImportError:
threading = None
import func... | yotchang4s/cafebabepy | src/main/python/test/test_functools.py | Python | bsd-3-clause | 77,293 |
__version__ = '0.10.2'
| freevoid/yawf | yawf/version.py | Python | mit | 23 |
# Copyright (C) 2017 Red Hat, Inc.
#
# fedmsg_meta_umb 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 2.1 of the License, or (at your option) any later version.
#
# fedmsg_meta_umb is ... | release-engineering/fedmsg_meta_umb | fedmsg_meta_umb/errata.py | Python | lgpl-2.1 | 7,313 |
class GingerAPIError(StandardError):
"""
Default Error of the API wrapper
"""
def __init__(self, status=None, type=None, value=None):
self.status = status or ''
self.type = type or ''
self.value = value or ''
def __repr__(self):
return '%s: %s %s\n%s' % (self.__cla... | congressus/ginger-api | GingerAPI/exceptions.py | Python | mit | 784 |
import os, sys
import numpy as np
from netCDF4 import Dataset
SRng = np.array([1267.5, 1272.5, 1285, 1295])
restartStateRng = ['warm']*SRng.shape[0]
#SRng = np.array([1272.5])
#restartStateRng = ['warm']
firstYear = 101
lastYear = 4000
yearsPerFile = 100
daysPerYear = 360
#indexChoice = 'globmst'
#indexChoice = 'np... | atantet/transferPlasim | runPlasim/postprocessor/indices/get_index_loop3.py | Python | gpl-2.0 | 948 |
"""Configuration for GeoNet NZ Quakes tests."""
import pytest
from homeassistant.components.geonetnz_quakes import (
CONF_MINIMUM_MAGNITUDE,
CONF_MMI,
DOMAIN,
)
from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_RADIUS,
CONF_SCAN_INTERVAL,
CONF_UNIT_SYSTEM,
)
from te... | nkgilley/home-assistant | tests/components/geonetnz_quakes/conftest.py | Python | apache-2.0 | 837 |
"""
Copyright 2015 Brocade Communications Systems, 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 t... | BRCDcomm/pynos | tests/versions/ver_6/ver_6_0_1/__init__.py | Python | apache-2.0 | 585 |
# -*- 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, software
... | KL-WLCR/incubator-airflow | airflow/contrib/hooks/__init__.py | Python | apache-2.0 | 1,945 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# plotpdf.py
#
# Copyright 2012 Greg <greg@greg-G53JW>
#
# 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 Founda... | gregreen/bayestar | scripts/plotpdf.py | Python | gpl-2.0 | 13,899 |
#-*- coding: utf-8 -*
import robot
r = robot.rmap()
r.lm('task5')
r.sleep = 0.05
def bowls():
while r.fr():
r.pt()
r.rt(1)
r.dn(1)
r.pt()
r.up(1)
r.rt(1)
r.pt()
r.rt(1)
#------- пишите код здесь -----
def task():
for i in range(2):
for k in range(0,2):
bowls()
whil... | IlinArkady/IlinArkady | practice4/task5.py | Python | gpl-3.0 | 1,503 |
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
'''
Bundle a context and its packages into a relocatable dir.
'''
from __future__ import print_function
import os
import os.path
import sys
def setup_parser(parser, completions=False):
group = parser.add_mutually_exclusive_group(... | instinct-vfx/rez | src/rez/cli/bundle.py | Python | apache-2.0 | 1,729 |
import random
import socket
import struct
from random import randint
def port_generator():
lim=1000
port_src_start = []
port_src_end = []
port_dst_start = []
port_dst_end = []
for i in range (0,lim):
m = random.randint(1, 200)
n = random.randint(1, 200)
i... | VRaviTheja/SDN-policy | flowgenerator/random_ports.py | Python | apache-2.0 | 1,532 |
"""
GraphLab Create offers several data structures for data analysis.
Concise descriptions of the data structures and their methods are contained in
the API documentation, along with a small number of simple examples. For more
detailed descriptions and examples, please see the `User Guide
<https://dato.com/learn/userg... | haijieg/SFrame | oss_src/unity/python/sframe/data_structures/__init__.py | Python | bsd-3-clause | 841 |
#!/usr/bin/env python3
# This file is part of WeWi.
#
# WeWi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# WeWi is distributed in... | interoceto/wewi | weather.py | Python | gpl-3.0 | 1,032 |
# © 2018 Forest and Biomass Romania SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class AccountGroup(models.Model):
_inherit = 'account.group'
group_child_ids = fields.One2many(
comodel_name='account.group',
inverse_name='parent_... | BT-astauder/account-financial-reporting | account_financial_report/models/account_group.py | Python | agpl-3.0 | 1,595 |
#!/usr/bin/env python
""" Small example that shows how to work with variable length arrays of
different types, UNICODE strings and general Python objects included. """
from numpy import *
from tables import *
import cPickle
# Open a new empty HDF5 file
fileh = openFile("vlarray2.h5", mode = "w")
# Get the root group... | cpcloud/PyTables | examples/vlarray2.py | Python | bsd-3-clause | 3,246 |
'''
Created by auto_sdk on 2014.11.04
'''
from top.api.base import RestApi
class WlbItemGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.item_id = None
def getapiname(self):
return 'taobao.wlb.item.get'
| colaftc/webtool | top/api/rest/WlbItemGetRequest.py | Python | mit | 291 |
# coding=utf-8
import django_sae
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
packages = [
'django_sae',
'django_sae.conf',
'django_sae.cache',
'django_sae.cache.tests',
'django_sae.contrib',
'django_sae.contrib.tasks',
'django_sae.contrib... | twz915/django-sae | setup.py | Python | apache-2.0 | 1,542 |
"""sympify -- convert objects SymPy internal format"""
from __future__ import print_function, division
from inspect import getmro
from .core import all_classes as sympy_classes
from .compatibility import iterable, string_types, range
from .evaluate import global_evaluate
class SympifyError(ValueError):
def __i... | Mitchkoens/sympy | sympy/core/sympify.py | Python | bsd-3-clause | 13,734 |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | roadmapper/ansible | lib/ansible/module_utils/network/exos/argspec/vlans/vlans.py | Python | gpl-3.0 | 1,503 |
"""
Make sure that ImportAll and ExecStmt can modify the locals
"""
import support
def f1():
from stat import *
v1 = ST_ATIME
assert v1 == 7
exec "foo=22"
v2 = foo
assert v2 == 22
f1()
| tunneln/CarnotKE | jyhton/out/production/jyhton/test267.py | Python | apache-2.0 | 213 |
# Copyright 2012 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 a... | Sigil-Ebook/sigil-gumbo | python/gumbo/html5lib_adapter.py | Python | apache-2.0 | 5,088 |
# coding=utf-8
from string import ascii_uppercase
import flask_featureflags
from app.main import main
from flask import render_template, request
from app.helpers.search_helpers import get_template_data
from app import data_api_client
import re
try:
from urlparse import urlparse, parse_qs
except ImportError:
fr... | mtekel/digitalmarketplace-buyer-frontend | app/main/suppliers.py | Python | mit | 2,705 |
# Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
from setuptools import setup, find_packages
from hbmqtt.version import get_version
setup(
name="hbmqtt",
version=get_version(),
description="MQTT client/broker using Python 3.4 asyncio library",
author="Nicolas J... | beerfactory/hbmqtt | setup.py | Python | mit | 2,366 |
from subprocess import Popen, PIPE
from uuid import uuid4
from functools import partial
from IPython.parallel import Client
from .exceptions import ComputeError
def system_call(cmd):
"""Call cmd and return (stdout, stderr, return_value).
cmd: can be either a string containing the command to be run, or a
... | RNAer/qiita | qiita_ware/context.py | Python | bsd-3-clause | 8,140 |
#!/Users/coursehero/Repos/slack-christmas-bot/christmasbot/bin/python2.7
# $Id: rst2xetex.py 7038 2011-05-19 09:12:02Z milde $
# Author: Guenter Milde
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing XeLaTeX source code.
"""
try:
import l... | Mechdriver/slack-christmas-bot | christmasbot/bin/rst2xetex.py | Python | mit | 840 |
from calendar import month_name
from collections import defaultdict
from django.http import Http404
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
from django import VERSION
from mezzanine.blog.models import BlogPos... | westinedu/similarinterest | mezzanine/blog/views.py | Python | bsd-3-clause | 5,271 |
# databaes setup
db_user = "catalog"
db_password = "udacity"
db_host = "localhost"
db_port = 5432
db_name = "item_catalog"
| recto/udacity_full_stack_web_developer | P5_Item_Catalog_Postgres/settings.py | Python | mit | 123 |
import re
import asyncio
import threading
from collections import defaultdict
def connector(bot, dispatcher, NICK, CHANNELS, PASSWORD=None):
@bot.on('client_connect')
async def connect(**kwargs):
bot.send('USER', user=NICK, realname=NICK)
if PASSWORD:
bot.send('PASS', password=PAS... | AiAeGames/DaniBot | dispatcher.py | Python | gpl-3.0 | 4,840 |
from typing import Dict
import pytest
from app.request_schemes.deployment_status_request_data import DeploymentStatusRequestData
pytestmark = pytest.mark.asyncio
@pytest.mark.usefixtures('unstub')
class TestDeploymentStatusRequestData:
@pytest.mark.parametrize("data", [
{'ref': ''},
{'repo': ''... | futuresimple/triggear | tests/request_schemes/test_deployment_status_request_data.py | Python | mit | 1,590 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, extract_email_id
from utilities.transaction_base import TransactionBase
import atom.data
import gda... | gangadhar-kadam/nassimapp | utilities/doctype/contact/contact.py | Python | agpl-3.0 | 7,267 |
# coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import uuid
import pytest
import functools
from devtools_testutils import recorded_by_proxy, set_bodiless_matcher
from azure.core.credentials import Azur... | Azure/azure-sdk-for-python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | Python | mit | 10,911 |
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from jobs.models import UserToolPermission
def GetToolPermission(user, tool):
try:
return UserToolPermission.objects.get(Tool=tool, User=user)
except:
raise PermissionDenied
def GetToolPermis... | RUBi-ZA/JMS | src/jobs/JMS/CRUD/ToolPermissions.py | Python | gpl-2.0 | 1,749 |
# -*- coding: utf-8 -*-
from . import test_convert
from . import test_env
| ddico/odoo | odoo/addons/test_convert/tests/__init__.py | Python | agpl-3.0 | 74 |
#License GPL v3
#Author Horst Knorr <gpgmailencrypt@gmx.de>
from .child import _gmechild
import threading
#########
#_mytimer
#########
class _mytimer(_gmechild):
"""
Timer class that can act either as a countdown timer or a periodic revolving
timer.
The class will return timer.is_running() == False in case the... | gpgmailencrypt/gpgmailencrypt | gmeutils/mytimer.py | Python | gpl-3.0 | 3,055 |
# Local status cache repository support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.org>
#
# 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... | udomsak/offlineimap | offlineimap/repository/LocalStatus.py | Python | gpl-2.0 | 3,856 |
_base_ = [
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
teacher_ckpt = 'https://download.openmmlab.com/mmdetection/v2.0/gfl/gfl_r101_fpn_mstrain_2x_coco/gfl_r101_fpn_mstrain_2x_coco_20200629_200126-dd12f847.pth' # noqa
model = dict(
type='Kn... | open-mmlab/mmdetection | configs/ld/ld_r18_gflv1_r101_fpn_coco_1x.py | Python | apache-2.0 | 2,120 |
"""Test deCONZ gateway."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.components.deconz import errors, gateway
from tests.common import mock_coro
import pydeconz
ENTRY_CONFIG = {
"host": "1.2.3.4",
"port": 80,
"api_ke... | jabesq/home-assistant | tests/components/deconz/test_gateway.py | Python | apache-2.0 | 7,242 |
""" Setup file.
"""
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
README = f.read()
requires = ['cornice', 'metlog-py', 'mozsvc', 'PasteScript', 'waitress', 'PyBrowserID', 'Requests', 'webtest']
setup(nam... | ncalexan/server-fxap | setup.py | Python | mpl-2.0 | 1,001 |
# Copyright 2013 vArmour Networks 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 req... | aaron-fz/neutron_full_sync | neutron/tests/unit/services/firewall/agents/varmour/test_varmour_router.py | Python | apache-2.0 | 11,913 |
import sys
sys.path.append("..")
import pygame
import core
import widgets
# Text field example.
WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 728
pygame.init()
pygame.font.init
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
clock = pygame.time.Clock()
FPS = 60
running = True
if __name__ == "__main__":
pane... | EricsonWillians/PyGameWidgets | examples/text_field.py | Python | gpl-3.0 | 787 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | power12317/weblate | weblate/accounts/views.py | Python | gpl-3.0 | 5,885 |
"""
Author: RedFantom
License: GNU GPLv3
Copyright (c) 2017-2018 RedFantom
"""
import os
from tkinter import TkVersion
from setuptools import setup
if TkVersion <= 8.5:
message = "This version of ttkthemes does not support Tk 8.5 and earlier. Please install a later version."
raise RuntimeError(message)
def ... | SAOImageDS9/SAOImageDS9 | ttkthemes/setup.py | Python | gpl-3.0 | 1,699 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, has_gravatar, cint
from frappe import _
from frappe.model.document import Document
from frappe.core.doctype... | saurabh6790/frappe | frappe/contacts/doctype/contact/contact.py | Python | mit | 9,141 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SearchToken'
db.create_table(
'sentry_searchtoken', (
(
... | jean/sentry | src/sentry/south_migrations/0038_auto__add_searchtoken__add_unique_searchtoken_document_field_token__ad.py | Python | bsd-3-clause | 24,705 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CertificateAuthority'
db.create_table('pki_certificateauthority', (
('id', sel... | dkerwin/django-pki | pki/migrations/0001_initial.py | Python | gpl-2.0 | 13,373 |
"""Test the test support."""
from __future__ import absolute_import
import filecmp
import re
from os.path import isdir, join
from tests.lib import SRC_DIR
def test_tmp_dir_exists_in_env(script):
"""
Test that $TMPDIR == env.temp_path and path exists and env.assert_no_temp()
passes (in fast env)
"""
... | techtonik/pip | tests/lib/test_lib.py | Python | mit | 1,893 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-6 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | kaday/rose | lib/python/rose/config_editor/data_helper.py | Python | gpl-3.0 | 22,359 |
#coding=utf-8
__author__ = 'answer-huang'
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import wx
from MyInfo import AboutMe
from AHDropTarget import AHDropTarget
import os
import subprocess
import sqlite3
class AHFrame(wx.Frame):
def __init__(self, parent, title):
wx.Frame.__init__(self,
... | sunnyvalue/dSYMTools | dSYM.py | Python | mit | 8,610 |
# -*- coding: ascii -*-
import sys, os, os.path
import unittest, doctest
try:
import cPickle as pickle
except ImportError:
import pickle
from datetime import datetime, time, timedelta, tzinfo
import warnings
if __name__ == '__main__':
# Only munge path if invoked as a script. Testrunners should have setup... | ehudmagal/robotqcapp | pytz/tests/test_tzinfo.py | Python | bsd-3-clause | 28,136 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "master_node.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| zzvv/shadowsocks_admin | master_node/manage.py | Python | gpl-2.0 | 254 |
# coding=utf-8
"""Tools to walk a path and collect test methods and functions."""
import ast
import collections
import fnmatch
import os
from betelgeuse.parser import parse_docstring
class TestFunction(object):
"""Wrapper for ``ast.FunctionDef`` which parse docstring information."""
def __init__(self, funct... | elyezer/betelgeuse | betelgeuse/collector.py | Python | gpl-3.0 | 5,662 |
"""
`National Climatic Data Center`_ `Global Historical Climate Network -
Daily`_ dataset
.. _National Climatic Data Center: http://www.ncdc.noaa.gov
.. _Global Historical Climate Network - Daily: http://www.ncdc.noaa.gov/oa/climate/ghcn-daily/
"""
from .core import (get_data, get_stations)
| cameronbracken/ulmo | ulmo/ncdc/ghcn_daily/__init__.py | Python | bsd-3-clause | 309 |
import function.webapi.chat
import function.webapi.joke
import function.webapi.maxim
import function.webapi.sm
import function.webapi.trick
import function.webapi.weather
import function.webapi.ip
import function.webapi.ping
import function.webapi.py3exec
import function.webapi.slap | 0312birdzhang/pyIRCbot | function/webapi/__init__.py | Python | mit | 283 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import mock
import unittest
from conans.client.tools import OSInfo, environment_append, CYGWIN, MSYS2, MSYS, WSL, \
remove_from_path
from conans.errors import ConanException
class OSInfoTest(unittest.TestCase):
def setUp(self):
self._uname = None
... | conan-io/conan | conans/test/unittests/client/tools/os_info/osinfo_test.py | Python | mit | 10,955 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
try different combinations of gap_open and gap_extend to see the changes of score and identity
input seqs in fasta format, output sequence similarity matrix
usuage example
python pairwise_align_parameter example.fasta
"""
import os
import sys
import numpy as np
from Bi... | lituan/tools | pairwise_align_parameters.py | Python | cc0-1.0 | 7,324 |
# coding=utf-8
#
# This file is part of SickGear.
#
# SickGear is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SickGear is distribu... | jetskijoe/SickGear | sickbeard/providers/bithdtv.py | Python | gpl-3.0 | 5,627 |
from network import Bluetooth
import time
from machine import Timer
bluetooth = Bluetooth()
bluetooth.set_advertisement(name='LoPy', service_uuid=b'1234567890123456')
def conn_cb(bt_o):
events = bt_o.events()
if events & Bluetooth.CLIENT_CONNECTED:
print("Client connected")
elif events & Bluetoot... | aapris/VekotinVerstas | BleTest/main.py | Python | mit | 1,631 |
# 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/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_0/models/__init__.py | Python | mit | 4,297 |
from distutils.core import setup
setup(
name='yapbl',
version='0.4',
packages=['yapbl'],
url='https://github.com/Spittie/yapbl.py',
license='MIT',
author='Spittie',
author_email='spittiepie@gmail.com',
description='Yet Another PushBullet Library',
requires=['requests']
)
| Spittie/yapbl.py | setup.py | Python | mit | 309 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.