text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from core.exception import ProductError
from core.core import Core
from core.helpers.yaml_literal import Literal
from core.env_manager import EnvManager
from core.helpers.version import compare_versions
from core.download_manager import DownloadManager
from core.log_manager import LogManager
... | helicontech/zoo | Zoocmd/core/models/base_product.py | Python | apache-2.0 | 16,060 | 0.002684 |
# Copyright (c) 2010 Mark Sandstrom
#
# 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, dis... | dnerdy/django-reroute | reroute/verbs.py | Python | mit | 4,764 | 0.009236 |
"""
GitHub WebHooks Server.
"""
| chevah/txghserf | txghserf/__init__.py | Python | bsd-3-clause | 32 | 0 |
import pytest
def test_fallback_on_default(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx-proxy.tld/port")
assert r.status_code == 200
assert r.text == "answer from port 81\n" | jwilder/nginx-proxy | test/test_default-host.py | Python | mit | 212 | 0.004717 |
from jupyter_server.utils import url_path_join as ujoin
from .config import Lmod as LmodConfig
from .handler import default_handlers, PinsHandler
def _jupyter_server_extension_paths():
return [{"module": "jupyterlmod"}]
# Jupyter Extension points
def _jupyter_nbextension_paths():
return [
dict(
... | cmd-ntrf/jupyter-lmod | jupyterlmod/__init__.py | Python | mit | 1,051 | 0.001903 |
def twoRepEle(array):
if not array:
return None
else:
hash_table={}
for x in array:
if x in hash_table:
hash_table[x]+=1
elif x !=' ':
hash_table[x]=1
else:
hash_table[x]=0
for x in array:
if hash_table[x]==2:
print x
array=[1,2,3,1,2,5,6,7]
twoRepEle(array) | cmjagtap/Algorithms_and_DS | searching/twoRepetedEle.py | Python | gpl-3.0 | 296 | 0.101351 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# This file is in the public domain
### END LICENSE
import gettext
from gettext import gettext as _
gettext.textdomain('brazo')
import logging
logger = logging.getLogger('brazo')
from brazo_lib.AboutDialog import AboutDialog... | nickpascucci/Robot-Arm | software/desktop/brazo/brazo/AboutBrazoDialog.py | Python | mit | 725 | 0.011034 |
from django import forms
class LoginForm(forms.Form):
login = forms.CharField(max_length=255)
password = forms.CharField(widget=forms.PasswordInput())
target = forms.CharField()
| sstacha/uweb-install | cms_files/forms.py | Python | apache-2.0 | 192 | 0.005208 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
from lib.core.common import Backend
from lib.core.common import isStackingAvailable
from lib.core.common import readInput
from lib.core.common import runningAsAdmin... | V11/volcano | server/sqlmap/plugins/generic/takeover.py | Python | mit | 17,888 | 0.001453 |
#
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... | locationtech/geowave | python/src/main/python/pygw/statistics/statistic.py | Python | apache-2.0 | 5,623 | 0.001067 |
# Copyright (C) 2015 Universidad Politecnica de Madrid
#
# 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 la... | ging/keystone | keystone/tests/test_v3_two_factor_auth.py | Python | apache-2.0 | 19,566 | 0.001738 |
import asyncio
import random
import names
from chilero.web.test import asynctest
from chilero.pg import Resource
from chilero.pg.test import TestCase, TEST_DB_SUFFIX
import json
class Friends(Resource):
order_by = 'name ASC'
search_fields = ['name']
allowed_fields = ['name', 'meta']
required_fields ... | dmonroy/chilero.pg | tests/test_sample_app.py | Python | mit | 8,628 | 0.000695 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http:# mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __... | klahnakoski/esReplicate | pyLibrary/queries/es09/expressions.py | Python | mpl-2.0 | 26,115 | 0.003178 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from djangocms_carousel import __version__
INSTALL_REQUIRES = [
]
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
... | mirskytech/djangocms-carousel | setup.py | Python | bsd-3-clause | 1,241 | 0 |
{
"name" : "GII",
"version" : "1.0",
"depends" : ['sale','product'],
"author" : "Novasoft Consultancy Services Pvt. Ltd.",
'category' : 'Generic Modules/Others',
"description": """ GII - Management Module
""",
'website': 'http://www.novasoftindia.com',
'data': ['giisa.... | Novasoft-India/OperERP-AM-Motors | openerp/addons/giicourse/__openerp__.py | Python | agpl-3.0 | 444 | 0.018018 |
import base64
import io
import os
import os.path
import json
import shlex
import sys
import tarfile
import tempfile
import warnings
from distutils.version import StrictVersion
from datetime import datetime
from fnmatch import fnmatch
import requests
import six
from .. import constants
from .. import errors
from .. im... | bfirsh/docker-py | docker/utils/utils.py | Python | apache-2.0 | 39,231 | 0.000051 |
from pupa.scrape import Person, Scraper
from openstates.utils import LXMLMixin
class VIPersonScraper(Scraper, LXMLMixin):
def scrape(self, chamber, term):
pass
yield Person()
# home_url = 'http://www.legvi.org/'
# doc = lxml.html.fromstring(self.get(url=home_url).text)
# U... | openstates/openstates | openstates/vi/legislators.py | Python | gpl-3.0 | 490 | 0.002041 |
KRONOS_MIDDLEWARE = {
'host': 'http://localhost:9191/',
'stream': 'django_middleware',
'blocking': True,
'log_exception_stack_trace': True
}
| Locu/chronology | pykronos/tests/conf/django_settings.py | Python | mit | 149 | 0 |
# Query Github public timeline using Bigquery and display top new repositories
# Modified from sources
## https://developers.google.com/bigquery/bigquery-api-quickstart#completecode
## https://gist.github.com/igrigorik/f8742314320e0a4b1a89
import httplib2
import pprint
import sys
import time
import json
import logging... | harishvc/tools | bigquery-github/TopGithubRepos.py | Python | mit | 4,367 | 0.0158 |
# -*- coding: utf-8 -*-
# Copyright 2011 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 require... | fishjord/gsutil | gslib/commands/rm.py | Python | apache-2.0 | 15,054 | 0.004849 |
from django.conf import settings
from django.core.management.base import BaseCommand
from proso_common.models import CustomConfig
import os.path
import yaml
from django.db import transaction
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option... | adaptive-learning/proso-apps | proso_common/management/commands/load_global_custom_config.py | Python | mit | 1,269 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:et:
# Simple debugging module
import os
import inspect
from .config import OPTIONS
__all__ = ["__DEBUG__", "__LINE__", "__FILE__"]
# --------------------- END OF GLOBAL FLAGS ---------------------
def __DEBUG__(msg, level=1):
if level > OPTIONS.de... | boriel/zxbasic | src/api/debug.py | Python | gpl-3.0 | 810 | 0.001235 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def port_models(apps, schema_editor):
Proposal = apps.get_model('core', 'Proposal')
Notice = apps.get_model('core', 'Notice')
n = Notice()
n.title = "Edital"
n.description = "Edital info"
... | hackultura/procult | procult/core/migrations/0004_auto_20160905_0938.py | Python | gpl-2.0 | 1,233 | 0.001622 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
"""This module provides a general interface to EFI variables using platform-
specific methods. Current Windows and Linux (with sysfs and efivars) are
supported.
Under Windows the pywin32 extensions ... | aroth-arsoft/arsoft-python | python3/arsoft/efi/__init__.py | Python | gpl-3.0 | 4,063 | 0.006153 |
#coding=utf-8
# SSSD
#
# upgrade_config.py
#
# Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2009
#
# 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 3 of the Licens... | spbnick/sssd | src/config/SSSDConfig/sssd_upgrade_config.py | Python | gpl-3.0 | 18,663 | 0.008359 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | lrocheWB/navitia | source/jormungandr/tests/authentication_tests.py | Python | agpl-3.0 | 17,792 | 0.003147 |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import hgnc_client
from indra.util import unicode_strs
from nose.plugins.attrib import attr
def test_get_uniprot_id():
hgnc_id = '6840'
uniprot_id = hgnc_client.get_uniprot_id(hgnc_id)
... | sorgerlab/belpy | indra/tests/test_hgnc_client.py | Python | mit | 2,834 | 0 |
"""
File: chromatic_tonal_reflection_function.py
Purpose: Class defining a function that tonally reflects over a given tone.
"""
from tonalmodel.diatonic_foundation import DiatonicFoundation
from tonalmodel.tonality import Tonality
from transformation.functions.pitchfunctions.diatonic_pitch_reflection_function impor... | dpazel/music_rep | transformation/functions/tonalfunctions/chromatic_tonal_reflection_function.py | Python | mit | 8,810 | 0.003973 |
from kivy.uix.label import Label
from kivy.uix.behaviors import ButtonBehavior
from widgets.layoutint import GridLayoutInt
from kivy.uix.image import Image
from kivy.properties import StringProperty, ListProperty, ObjectProperty, NumericProperty, BooleanProperty
from kivy.compat import string_types
from kivy.factory im... | insiderr/insiderr-app | app/widgets/bar.py | Python | gpl-3.0 | 1,558 | 0.000642 |
# dirtool.py - diff tool for directories
# Copyright (C) 2018 Ingo Ruhnke <grumbel@gmail.com>
#
# 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 3 of the License, or
# (at your opt... | Grumbel/dirtool | dirtools/extractor.py | Python | gpl-3.0 | 2,353 | 0.000425 |
from raw import points
from raw import vertices
from raw import edges
from raw import polygons
__all__ = ['points', 'vertices', 'edges', 'polygons']
| selaux/numpy2vtk | numpy2vtk/data/raw/__init__.py | Python | lgpl-3.0 | 150 | 0 |
# This file is part of Codeface. Codeface 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | bockthom/codeface | codeface/fileCommit.py | Python | gpl-2.0 | 7,096 | 0.002114 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import get_url, cint
from frap... | kressi/erpnext | erpnext/buying/doctype/request_for_quotation/request_for_quotation.py | Python | gpl-3.0 | 10,014 | 0.027062 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('budgets', '0003_auto_20150717_0147'),
]
operations = [
migrations.RemoveField(
model_name='budgetelement',
... | m1k3r/gvi-accounts | gvi/budgets/migrations/0004_remove_budgetelement_subcategory.py | Python | mit | 364 | 0 |
from vsvbp import container, solver
import argparse, sys, os, re
def parse(inputfile):
""" Parse a file using format from
Brandao et al. [Bin Packing and Related Problems: General Arc-flow Formulation with Graph Compression (2013)]
Format:
d (number of dimensions)
C_1 ... C_d ca... | mgabay/Variable-Size-Vector-Bin-Packing | scripts/vbp-optim.py | Python | gpl-3.0 | 4,279 | 0.00631 |
# Copyright 2012-2013 Eric Ptak - trouch.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 required by applicable l... | myDevicesIoT/Cayenne-Agent | myDevices/devices/digital/pcf8574.py | Python | mit | 2,274 | 0.006157 |
# Copyright 2019 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 agreed to in writing, ... | lablup/sorna-repl | vendor/benchmark/minigo/oneoffs/ladder_detector.py | Python | lgpl-3.0 | 3,787 | 0.003169 |
import os
import sys
import subprocess
from contextlib import contextmanager
import argparse
import glob
ENV_ROOT = 'test_ambertools'
AMBER_VERSION = 'amber17'
def is_conda_package(package_dir):
basename = os.path.basename(package_dir)
return not (basename.startswith('osx') or basename.startswith('linux'))
... | Amber-MD/ambertools-conda-build | conda_tools/validate_ambertools_build.py | Python | mit | 5,502 | 0.000545 |
"""Two dimensional checkerboard lattice with real hoppings"""
import pybinding as pb
import matplotlib.pyplot as plt
from math import pi
pb.pltutils.use_style()
def checkerboard(d=0.2, delta=1.1, t=0.6):
lat = pb.Lattice(a1=[d, 0], a2=[0, d])
lat.add_sublattices(
('A', [0, 0], -delta),
('B', ... | dean0x7d/pybinding | docs/examples/lattice/checkerboard.py | Python | bsd-2-clause | 801 | 0.003745 |
import json
from django.core.urlresolvers import reverse
from django.http import HttpResponseNotFound
from django.test import TestCase
from mock import Mock
from utils import use_GET_in
from api.views import msas, tables
class ConversionTest(TestCase):
def test_use_GET_in(self):
fn, request = Mock(), Mo... | mehtadev17/mapusaurus | mapusaurus/api/tests.py | Python | cc0-1.0 | 4,338 | 0.014292 |
# -*- coding: utf-8 -*-
import os
def onemode(values):
return max(set(values), key=values.count)
os.system("pause")
| NicovincX2/Python-3.5 | Statistiques/Statistique descriptive/Mode (statistiques)/one_mode.py | Python | gpl-3.0 | 124 | 0.008065 |
"""Unit tests for psrfits_to_sdfits.py."""
import unittest
import sys
import scipy as sp
import numpy.random as rand
import psrfits_to_sdfits as p2s
import kiyopy.custom_exceptions as ce
class TestFormatData(unittest.TestCase) :
def setUp(self) :
self.ntime = 5
self.npol = 4
self.nfreq... | kiyo-masui/SDdata | sddata/tests/test_psrfits_to_sdfits.py | Python | gpl-2.0 | 9,556 | 0.009209 |
# -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import os
from datetime import datetime
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .status_codes import codes
from .auth import HTTPBasicAuth, ... | samabhi/pstHealth | venv/lib/python2.7/site-packages/requests/models.py | Python | mit | 26,299 | 0.001711 |
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 us... | jhgg/discord.py | discord/channel.py | Python | mit | 12,385 | 0.001857 |
'''functions to work with contrasts for multiple tests
contrast matrices for comparing all pairs, all levels to reference level, ...
extension to 2-way groups in progress
TwoWay: class for bringing two-way analysis together and try out
various helper functions
Idea for second part
- get all transformation matrices ... | yarikoptic/pystatsmodels | statsmodels/sandbox/stats/contrast_tools.py | Python | bsd-3-clause | 28,737 | 0.004941 |
import sublime, sublime_plugin
from indenttxt import indentparser
class IndentToList(sublime_plugin.TextCommand):
def run(self, edit):
parser = indentparser.IndentTxtParser()
#Get current selection
sels = self.view.sel()
selsParsed = 0
if(len(sels) > 0):
for sel... | Harrison-M/indent.txt-sublime | indentsublime.py | Python | mit | 967 | 0.004137 |
"""
# The NASA93 Data Set
Standard header:
"""
from __future__ import division,print_function
import sys
sys.dont_write_bytecode = True
from lib import *
"""
data.dat:
"""
def nasa93():
vl=1;l=2;n=3;h=4;vh=5;xh=6
return data(indep= [
# 0..8
'Prec', 'Flex', 'Resl', 'Team', 'Pmat', 'rely', 'data.dat'... | rahlk/WarnPlan | warnplan/commons/tools/axe/nasa93.py | Python | mit | 7,488 | 0.31437 |
# IVLE
# Copyright (C) 2007-2009 The University of Melbourne
#
# 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 ... | dcoles/ivle | ivle/webapp/security/views.py | Python | gpl-2.0 | 6,811 | 0.001175 |
# coding=gbk
import os
import re
import string
def isMov(filename):
# ÅжÏÊÇ·ñΪµçÓ°Îļþ
suffix = filename.split('.')[-1].lower() # ÌáÈ¡ºó׺
pattern = re.compile(r'mpg|mpeg|m2v|mkv|dat|vob|avi|wmv|rm|ram|rmvb|mov|avi|mp4|qt|viv')
if pattern.search(suffix): # Æ¥ÅäÊÇ·ñΪµçÓ°¸ñʽ
return True... | windcode/xtools | CleanMoviePrefix.py | Python | mit | 1,426 | 0.019635 |
from __future__ import division, print_function, absolute_import
from scipy import stats
import numpy as np
from numpy.testing import assert_almost_equal, assert_, assert_raises, \
assert_array_almost_equal, assert_array_almost_equal_nulp, run_module_suite
def test_kde_1d():
#some basic tests comparing to no... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/scipy/stats/tests/test_kdeoth.py | Python | agpl-3.0 | 6,021 | 0.000997 |
from psycopg2 import InterfaceError
class CursorContextManager:
"""Instantiated once per :func:`~postgres.Postgres.get_cursor` call.
:param pool: see :mod:`psycopg2_pool`
:param bool autocommit: see :attr:`psycopg2:connection.autocommit`
:param bool readonly: see :attr:`psycopg2:connection.readonly`
... | gratipay/postgres.py | postgres/context_managers.py | Python | mit | 5,280 | 0.001136 |
#!/usr/bin/env python3
import urllib3
import sys
import os
import json
from datetime import datetime
import urllib.parse
import requests
import time
import argparse
urllib3.disable_warnings()
debug = os.getenv('DEBUG', 0)
batch_size = 100
workspace = os.getenv('WORKSPACE', os.getcwd())
user_name = 'jenkins-testerdh'
u... | gwsu2008/automation | python/git-branch-diff.py | Python | gpl-2.0 | 3,650 | 0.001644 |
## PyZUI 0.1 - Python Zooming User Interface
## Copyright (C) 2009 David Roberts <d@vidr.cc>
##
## 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... | davidar/pyzui | pyzui/ferntileprovider.py | Python | gpl-2.0 | 4,684 | 0.009821 |
"""
Tests for users API
"""
import datetime
from django.utils import timezone
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory
from xmodule.modulestore.django import modulestore
from student.models import CourseEnrollment
from .. import errors
from ..testutils import MobileAPITestCase, Mobi... | olexiim/edx-platform | lms/djangoapps/mobile_api/users/tests.py | Python | agpl-3.0 | 9,422 | 0.002972 |
from time import strftime, monotonic
import pigpio
import CABmanager
class clock(object):
"""Clock"""
def __init__( self, pigpio_pi ):
if type( pigpio_pi ) is CAB_manager.CABmanager:
self.pigpio_pi = pigpio_pi.pi
else:
self.pigpio_pi = pigpio_pi
self.t... | Don-Li/CABexpt | CABexpt/clock.py | Python | gpl-3.0 | 1,906 | 0.026233 |
from django.db import models
from django.contrib import auth
from django.db.models.signals import post_save
class Priority(object):
Aggregate_Admin = 12000
Campus_Admin = 10000
Department_Admin = 8000
Building_Admin = 6000
Group_Admin = 4000
Strict_User... | dana-i2cat/felix | optin_manager/src/python/openflow/optin_manager/users/models.py | Python | apache-2.0 | 1,961 | 0.022947 |
import logging
import pickle
import random
from gevent import Greenlet, sleep
from threading import Lock
from app import create_app
from dota_bot import DotaBot
from models import db, DynamicConfiguration, Game, GameStatus, GameVIP
from helpers.general import divide_vip_list_per_type
# Log
logging.basicConfig(format=... | FroggedTV/grenouilleAPI | backend/bot_app.py | Python | gpl-3.0 | 3,850 | 0.003377 |
import datetime
import logging
from django.contrib.auth.models import User
from django.test import Client
from django.test import TestCase
from django.urls import reverse
from person.models import Person
from parliament.models import ParliamentMember
from parliament.models import PoliticalParty
from document.models... | openkamer/openkamer | website/tests.py | Python | mit | 13,880 | 0.001225 |
from __future__ import unicode_literals
import sys
import os
import random
import matplotlib
# Make sure that we are using QT5
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from numpy import arange, sin, pi
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib... | RyanChinSang/ECNG3020-ORSS4SCVI | BETA/TestCode/Matplotlib/mpl1.py | Python | gpl-3.0 | 3,865 | 0.001811 |
# vim:set fileencoding=utf-8
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... | dashea/anaconda | tests/pyanaconda_tests/user_create_test.py | Python | gpl-2.0 | 15,039 | 0.001596 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | pferreir/indico-backup | indico/MaKaC/common/MaKaCConfig.py | Python | gpl-3.0 | 1,407 | 0.013504 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/operations/_connection_monitors_operations.py | Python | mit | 42,196 | 0.00519 |
from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class SpmDevicesVendorModelGridRemote(RemoteModel):
"""
This table lists all SPM devices that existed within the user specified period of time sorted by the Device Name in ascending order.
| ``id:`` The int... | infobloxopen/infoblox-netmri | infoblox_netmri/api/remote/models/spm_devices_vendor_model_grid_remote.py | Python | apache-2.0 | 4,572 | 0.00175 |
import os
import rospkg
import lxml.etree as ET
from openag_brain import params
from openag.models import SoftwareModule, SoftwareModuleType
from openag.db_names import SOFTWARE_MODULE, SOFTWARE_MODULE_TYPE
# maping from python types to roslaunch acceptable ones
PARAM_TYPE_MAPPING = {'float' : 'double'}
def create_n... | serein7/openag_brain | src/openag_brain/commands/update_launch.py | Python | gpl-3.0 | 5,299 | 0.001698 |
# -*- coding: utf-8 -*-
""" Tests for the alarms module """
from __future__ import unicode_literals
from soco.alarms import is_valid_recurrence
def test_recurrence():
for recur in ('DAILY', 'WEEKDAYS', 'WEEKENDS', 'ONCE'):
assert is_valid_recurrence(recur)
assert is_valid_recurrence('ON_1')
asse... | oyvindmal/SocoWebService | unittest/test_alarms.py | Python | mit | 538 | 0.003717 |
#!/usr/bin/env python
import os,sys
folder = "/media/kentir1/Development/Linux_Program/Fundkeep/"
def makinGetYear():
return os.popen("date +'%Y'").read()[:-1]
def makinGetMonth():
return os.popen("date +'%m'").read()[:-1]
def makinGetDay():
return os.popen("date +'%d'").read()[:-1]
def makinGetPrevYear(daypassed)... | imakin/PersonalAssistant | Fundkeep/modul/b__main_backu.py | Python | mit | 2,347 | 0.041329 |
# -*- coding: utf-8 -*-
"""
Basic unit tests for LibraryContentBlock
Higher-level tests are in `cms/djangoapps/contentstore/tests/test_libraries.py`.
"""
import six
from bson.objectid import ObjectId
from fs.memoryfs import MemoryFS
from lxml import etree
from mock import Mock, patch
from search.search_engine_base i... | stvstnfrd/edx-platform | common/lib/xmodule/xmodule/tests/test_library_content.py | Python | agpl-3.0 | 26,994 | 0.002741 |
from django.contrib import admin
from . import models
# Register your models here.
#admin.site.register(models.MyUser)
@admin.register(models.MyUser)
class MyUserAdmin(admin.ModelAdmin):
list_display = ['user'] | pacocampo/Backend | traveleando/project/usuario/admin.py | Python | gpl-3.0 | 213 | 0.018779 |
from flask import request
from cache import (
add_to_queue, get_from_queue, get_from_any_queue, set_cache, get_cache,
delete_cache
)
import config
import consts
from connections import send_ws
from consts import WS_CHAT_MESSAGE
from decorators import validate
import errors
from game import Game
from handlers.v... | AHAPX/dark-chess | src/handlers/v2/game.py | Python | gpl-3.0 | 7,424 | 0.002963 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from odoo.addons.http_routing.models.ir_http import slug
class EventEvent(models.Model):
_inherit = "event.event"
community_menu = fields.Boolean(
"Community Men... | ygol/odoo | addons/website_event_track_online/models/event_event.py | Python | agpl-3.0 | 2,962 | 0.002701 |
"""Ring buffer for automatic storage of images"""
import os.path
import logging
from datetime import datetime
import numpy as np
from scipy.misc import imsave
import tables
class RingBuffer(object):
"""Ring buffer class.
Attributes
----------
directory : str
Location to store the ring buffer ... | mivade/qCamera | qcamera/ring_buffer.py | Python | bsd-2-clause | 4,596 | 0.001958 |
# Build a simple house.
# Import necessary modules.
import mcpi.minecraft as minecraft
import mcpi.block as block
# Connect to Minecraft.
mc = minecraft.Minecraft.create()
# Set a base size for the house.
SIZE = 20
# Create the house function.
def house():
# Calculate the midpoints, used to position doors and... | craigem/MyAdventures | buildHouse2.py | Python | gpl-3.0 | 1,494 | 0 |
"""
raven.transport.registry
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import sys
# TODO(dcramer): we really should need to import all of these by default
from raven.trans... | inspirehep/raven-python | raven/transport/registry.py | Python | bsd-3-clause | 2,913 | 0.00103 |
#!/usr/bin/python2
'''
This is an example of how to build a simple generator
'''
def my_reverse(data):
for index in range(len(data) - 1, -1, -1):
yield data[index]
for char in my_reverse('golf'):
print(char)
'''
Notice that 'my_reverse' is still recognized as a plain function and not
'generator' or... | nonZero/demos-python | src/examples/short/iteration/iterator_generator.py | Python | gpl-3.0 | 652 | 0.001534 |
# coding: utf-8
#
# GIL limit python multi-thread effectiveness.
# But is seems fine, because these operation have so many socket IO
# So it seems no need to use multiprocess
#
import uiautomator2 as u2
import adbutils
import threading
from logzero import logger
def worker(d: u2.Device):
d.app_start("io.appium.a... | openatx/uiautomator2 | examples/multi-thread-example.py | Python | mit | 747 | 0.001339 |
# 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/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2016_09_01/aio/operations/_management_locks_operations.py | Python | mit | 49,288 | 0.005011 |
#coding: UTF-8
'''This script would guide the seafile admin to setup seafile with MySQL'''
import sys
import os
import time
import re
import shutil
import glob
import subprocess
import hashlib
import getpass
import uuid
import warnings
import MySQLdb
from ConfigParser import ConfigParser
try:
import readline # ... | Chilledheart/seafile | scripts/setup-seafile-mysql.py | Python | gpl-3.0 | 43,261 | 0.002104 |
from django.conf.urls import include, url
from .views import alquiler_nuevo, home
from django.contrib.auth.decorators import login_required
from departamentos.views import home, details
urlpatterns = [
]
| acs-um/deptos | deptos/departamentos/urls.py | Python | apache-2.0 | 209 | 0.004785 |
"""Tests for UIAWrapper"""
from __future__ import print_function
from __future__ import unicode_literals
import time
import os
import sys
import unittest
import mock
import six
sys.path.append(".")
from pywinauto.application import Application, WindowSpecification # noqa: E402
from pywinauto.sysinfo import is_x64_Py... | airelil/pywinauto | pywinauto/unittests/test_uiawrapper.py | Python | bsd-3-clause | 89,050 | 0.002223 |
# PyeNalysis
__author__ = "Edwin Dalmaijer"
import copy
import numpy
from scipy.interpolate import interp1d
# DEBUG #
#from matplotlib import pyplot
# # # # #
def interpolate_blink(signal, mode='auto', velthresh=5, maxdur=500, margin=10, invalid=-1, edfonly=False):
"""Returns signal with interpolated results, ... | esdalmaijer/PyGazeAnalyser | pygazeanalyser/traces.py | Python | gpl-3.0 | 19,865 | 0.037352 |
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
import miscClin
import tsvIO
import sys
# -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
remapDict = {}
DAYS_PER_YEAR = 365.2425
# ----------------------------------------------------------------------... | cancerregulome/gidget | commands/feature_matrix_construction/main/cleanClinTSV.py | Python | mit | 98,495 | 0.004041 |
from ..base import BaseTaskRunnerBackend
class SocketIOBackend(BaseTaskRunnerBackend):
def __init__(self):
from . import sockets
def get_detail_template(self):
return 'task_runners/deployment_detail_socketio.html'
| npardington/fabric-bolt | fabric_bolt/task_runners/socketio/__init__.py | Python | mit | 241 | 0 |
import abc
import json
import codecs
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from rest_framework.parsers import BaseParser
from rest_framework import status
from rest_framework.exceptions import ParseError, APIException
from common.utils import get_logger
logger =... | skyoo/jumpserver | apps/common/drf/parsers/base.py | Python | gpl-2.0 | 4,553 | 0.001349 |
from argparse import ArgumentParser
import socket
import struct
import sys
import threading
import time
from ._fakeds import FakeDS
__all__ = ["Netconsole", "main", "run"]
def _output_fn(s):
sys.stdout.write(
s.encode(sys.stdout.encoding, errors="replace").decode(sys.stdout.encoding)
)
sys.stdo... | robotpy/pynetconsole | netconsole/netconsole.py | Python | isc | 6,782 | 0.000885 |
# coding=utf-8
__author__ = "zephor"
class TestResultPipeLine(object):
@classmethod
def from_crawler(cls, crawler):
crawler.spider.test_result = []
return cls()
@staticmethod
def process_item(item, spider):
spider.test_result.append(item)
| Zephor5/zspider | zspider/pipelines/test_result.py | Python | mit | 283 | 0 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import define
import tw8836
import spi
def quad_check():
status = spi.status1_read()
if (status & 0x40):
print 'SPI flash is already in QUAD mode'
return define.TRUE
else:
print 'SPI flash is not in QUAD mode yet'
return def... | lgnq/RPI8836 | issi.py | Python | lgpl-3.0 | 2,227 | 0.015267 |
import csv
from datetime import datetime
import re
from StringIO import StringIO
from PIL import Image
import formencode
from pylons import tmpl_context as c
from pylons.i18n import _
from webhelpers.html import literal
from sqlalchemy import func
from adhocracy import config
from adhocracy.lib.auth import can
from ... | DanielNeugebauer/adhocracy | src/adhocracy/forms/common.py | Python | agpl-3.0 | 30,325 | 0.000297 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio 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... | drjova/cds-demosite | cds/modules/records/minters.py | Python | gpl-2.0 | 1,381 | 0 |
"""
sentry.rules.actions
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .base import * # NOQA
| jokey2k/sentry | src/sentry/rules/actions/__init__.py | Python | bsd-3-clause | 241 | 0 |
import datetime
from operator import attrgetter
from .models import (
Country, Person, Group, Membership, Friendship, Article,
ArticleTranslation, ArticleTag, ArticleIdea, NewsArticle)
from django.test import TestCase, skipUnlessDBFeature
from django.utils.translation import activate
from django.core.exception... | helenst/django | tests/foreign_object/tests.py | Python | bsd-3-clause | 18,027 | 0.003495 |
"""Copyright 2008 Orbitz WorldWide
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... | g76r/graphite-web | webapp/graphite/settings.py | Python | apache-2.0 | 6,812 | 0.009689 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# cRedditscore documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | gautsi/cRedditscore | docs/conf.py | Python | bsd-3-clause | 9,078 | 0.003855 |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | docusign/docusign-python-client | docusign_esign/models/app_store_product.py | Python | mit | 4,127 | 0.000242 |
from django import forms
from django.db.models import Avg, Count, Max, Min, StdDev
from django.db.models import Q
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.simple import direct_to_template
from main.util... | pyropeter/archweb | mirrors/views.py | Python | gpl-2.0 | 4,912 | 0.003054 |
# GUI frame for the dftModel_function.py
from Tkinter import *
import tkFileDialog, tkMessageBox
import sys, os
import pygame
from scipy.io.wavfile import read
import dftModel_function
class DftModel_frame:
def __init__(self, parent):
self.parent = parent
self.initUI()
pygame.init()
def ini... | georgid/sms-tools | software/models_interface/dftModel_GUI_frame.py | Python | agpl-3.0 | 4,273 | 0.040019 |
# -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import datetime
import os
from ansible.module_utils.urls import (Request, o... | cchurch/ansible | test/units/module_utils/urls/test_Request.py | Python | gpl-3.0 | 14,937 | 0.001674 |
class InvalidValueState(ValueError):
pass
| szopu/datadiffs | datadiffs/exceptions.py | Python | mit | 46 | 0 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 12); | antoinecarme/pyaf | tests/artificial/transf_Integration/trend_ConstantTrend/cycle_12/ar_12/test_artificial_128_Integration_ConstantTrend_12_12_0.py | Python | bsd-3-clause | 271 | 0.084871 |
import bpy
op = bpy.context.active_operator
op.radius = 0.5
op.arc_div = 8
op.lin_div = 0
op.size = (0.0, 0.0, 3.0)
op.div_type = 'CORNERS'
| Microvellum/Fluid-Designer | win64-vc/2.78/Python/bin/2.78/scripts/addons/presets/operator/mesh.primitive_round_cube_add/Capsule.py | Python | gpl-3.0 | 141 | 0 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'SourceRegion.is_high_risk'
db.execute('''
ALTER... | SeedScientific/polio | source_data/migrations/0113_auto__del_field_sourceregion_is_high_risk.py | Python | agpl-3.0 | 20,716 | 0.008351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.