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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# 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 under the Apache License, Version 2.0 (the
#... | owlabs/incubator-airflow | tests/test_configuration.py | Python | apache-2.0 | 18,495 |
import frappe
from frappe import _
def execute():
frappe.reload_doctype("System Settings")
settings = frappe.get_doc("System Settings")
settings.db_set("app_name", "ERPNext", commit=True)
| ESS-LLP/erpnext | erpnext/patches/v13_0/set_app_name.py | Python | gpl-3.0 | 192 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_spannertools_Spanner___contains___01():
class MockSpanner(spannertools.Spanner):
def __init__(self, components=None):
spannertools.Spanner.__init__(self, components)
note = Note("c'4")
spanner = MockSpanner()
attach(spanner... | mscuthbert/abjad | abjad/tools/spannertools/test/test_spannertools_Spanner___contains__.py | Python | gpl-3.0 | 366 |
"""
Supports flushing statsite metrics to InfluxDB
"""
import sys
import httplib, urllib, logging, json, re
##
# InfluxDB sink for statsite
# ==========================
#
# Use with the following stream command:
#
# stream_command = python sinks/influxdb.py influxdb.ini INFO
#
# The InfluxDB sink takes an INI format ... | zeedunk/statsite | sinks/influxdb.py | Python | bsd-3-clause | 7,527 |
#!/usr/bin/env python
"""
Show how to make date plots in matplotlib using date tick locators and
formatters. See major_minor_demo1.py for more information on
controlling major and minor ticks
All matplotlib date plotting is done by converting date instances into
days since the 0001-01-01 UTC. The conversion, tick lo... | cactusbin/nyt | matplotlib/examples/pylab_examples/date_demo1.py | Python | unlicense | 1,500 |
import renderdoc as rd
import rdtest
class GL_Queries_In_Use(rdtest.TestCase):
demos_test_name = 'GL_Queries_In_Use'
def check_capture(self):
last_action: rd.ActionDescription = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
tex_details = self.get_te... | moradin/renderdoc | util/test/tests/GL/GL_Queries_In_Use.py | Python | mit | 3,257 |
# (C) Wegener Center for Climate and Global Change, University of Graz, 2015
#
# This file is part of pyCAT.
#
# pyCAT is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by the
# Free Software Foundation.
#
# pyCAT is distributed in the ... | wegener-center/pyCAT | pycat/analysis/indices.py | Python | gpl-3.0 | 8,838 |
from django.shortcuts import render, redirect, get_object_or_404
from feeds.views import feeds
from django.contrib.auth.models import User
from feeds.models import Feed
from feeds.views import FEEDS_NUM_PAGES
from django.core.paginator import Paginator
from django.contrib.auth.decorators import login_required
from core... | kngeno/gis_kenya | apps/core/views.py | Python | mit | 4,694 |
# -*- encoding: utf-8 -*-
#
# Copyright 2014 Red Hat, 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 applicabl... | CiscoUcs/Ironic-UCS | ironic/tests/drivers/test_image_cache.py | Python | apache-2.0 | 21,937 |
# Кириллов Алексей, ИУ7-22
# Уточнение корней методом brenth
from math import sin, cos, ceil, log
from scipy.optimize import brenth
from time import perf_counter as perfc
from prettytable import PrettyTable
from numpy import arange
import matplotlib.pyplot as plt
'''
def f(x):
return sin(x)
def fs(x)... | aspadm/labworks | module1-2/roots.py | Python | mit | 4,384 |
import swaf.engine
import swaf.resp
import swaf
@swaf.handler('/')
def root():
return swaf.resp.ok('text/plain','hello world')
e = swaf.engine.Engine()
e.addHandler(root)
application = e.wsgi
| xelphene/swaf | examples/helloworld.py | Python | gpl-3.0 | 201 |
# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 vers... | srluge/SickRage | tests/pp_tests.py | Python | gpl-3.0 | 2,742 |
"""Test feature extractor and classifier together"""
import os
from common import config
from feature_parser import feature_extractor
from learner import svm
def test_feat_class():
"""Test both feature extraction and classification"""
data_config = config.Section('data')
root = data_config.get('data-small... | jamlamberti/bogo_probe | tests/complete_suite/test_feat_class.py | Python | gpl-3.0 | 819 |
import unittest
from doku import dlx
class NodeTestCase(unittest.TestCase):
def test_init_is_referential(self):
node = dlx.Node()
assert node.column is node
assert node.left is node
assert node.right is node
assert node.up is node
assert node.down is node
def... | collinwat/doku | tests/dlx_test.py | Python | mit | 12,115 |
#!/usr/bin/python
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (2, 7, 0):
sys.exit("Error: Electrum requires Python version >= 2.7.0...")
data_files = [... | creditbit/electrum-creditbit | setup.py | Python | gpl-3.0 | 1,922 |
# -*- coding: UTF-8 -*-
# views.py
#
# Copyright (C) 2013 Degustare
#
# Author(s): Cédric Gaspoz <cga@degustare.ch>
#
# This file is part of Degustare.
#
# Degustare 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 Foundat... | Degustare/degustare | degustare/winesonomies/views.py | Python | gpl-3.0 | 807 |
import os
from hedwig.core import settings
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='hedwig... | anzev/hedwig | setup.py | Python | mit | 1,040 |
class FileTypeError(Exception):
"""
Thrown when an XML dump file is not of an expected type.
"""
pass
class MalformedXML(Exception):
"""
Thrown when an XML dump file is not formatted as expected.
"""
pass
| halfak/Mediawiki-Utilities | mw/xml_dump/errors.py | Python | mit | 239 |
# -*- coding: utf-8 -*-
from django.contrib.auth import get_user_model
from django.test import TestCase
from wagtail.admin.navigation import (
get_explorable_root_page, get_pages_with_direct_explore_permission)
from wagtail.tests.utils import WagtailTestUtils
class TestExplorablePages(TestCase, WagtailTestUtils... | nimasmi/wagtail | wagtail/admin/tests/test_navigation.py | Python | bsd-3-clause | 3,670 |
import asyncio, functools, logging, os, ssl
from aiohttp import web
from threading import Thread
from http.server import BaseHTTPRequestHandler, HTTPServer
from utils import class_from_name
from sinks.base_bot_request_handler import BaseBotRequestHandler, AsyncRequestHandler
import threadmanager
from plugins import... | johnwiseheart/HangoutsBot | hangupsbot/sinks/__init__.py | Python | gpl-3.0 | 6,205 |
import random
import time
random.seed(time.time())
SYSTEMS = []
def gen():
return ([random.random()*10 for _ in range(2)],
[random.random()*10 for _ in range(3)])
for i in range(3):
SYSTEMS.append(gen())
| DaivdZhang/tinyControl | tcontrol/tests/data_generator.py | Python | bsd-3-clause | 229 |
from imageSpider.items import ImageItem
from scrapy.selector import Selector
import scrapy
class ImageSpider(scrapy.Spider):
name = 'pyImageSearch'
def __init__(self, title='', *args, **kwargs):
super(ImageSpider, self).__init__(*args, **kwargs)
self.start_urls =['http://imgur.com/search/score... | chris-redhead/hackforharambe | imageSpider/imageSpider/spiders/imgspider.py | Python | mit | 747 |
"""
Descriptor computation helper utility. Checks data content type with respect
to the configured descriptor generator to skip content that does not match
the accepted types. Optionally, we can additionally filter out image content
whose image bytes we cannot load via ``PIL.Image.open``.
"""
import collections
import ... | Purg/SMQTK | python/smqtk/bin/compute_many_descriptors.py | Python | bsd-3-clause | 8,740 |
"""This module defines IP(6)Table configuration. Due to the current (sad)
state of affairs of IPv6, one is required to explicitly make two different
daemon instances, one to manage iptables, one to manage ip6tables ..."""
from itertools import groupby
from operator import attrgetter
from os import EX_OK
from ipmininet... | oliviertilmans/ipmininet | ipmininet/router/config/iptables.py | Python | gpl-2.0 | 10,248 |
import unittest
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import webapp2
import web
class TestHandlers(unittest.TestCase):
def setUp(self):
# First, create an instance of the... | vishy16/test_repo | handlers_test.py | Python | apache-2.0 | 1,312 |
# Copyright 2018 Cloudbase Solutions Srl
#
# 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... | stackforge/compute-hyperv | compute_hyperv/tests/unit/cluster/test_volumeops.py | Python | apache-2.0 | 1,838 |
from .jobs import JobSection
class DeploySection(JobSection):
schema_file = 'deploy.json'
def __init__(self, image, run, **kwargs):
super(DeploySection, self).__init__(image, run) | riseml/config-parser | config_parser/sections/deploy.py | Python | mit | 198 |
# Copyright (C) 2003-2011 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 (a... | mirrorcoder/paramiko | paramiko/__init__.py | Python | lgpl-2.1 | 3,768 |
from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
class TestAuthenticationMiddleware(TestCase):
def setUp(self):
self.user = User.objects.create_user('test_user', 'test@exampl... | nesdis/djongo | tests/django_tests/tests/v22/tests/auth_tests/test_middleware.py | Python | agpl-3.0 | 1,247 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved
#
# This program is free software: you can redistr... | iw3hxn/LibrERP | sale_order_version/models/__init__.py | Python | agpl-3.0 | 1,120 |
"""Functions for interacting with user accounts."""
from datetime import timedelta
from sqlalchemy.engine import Connection
from dokomoforms.api import json_response
from dokomoforms.db.auth_user import get_auth_user_by_email, \
UserDoesNotExistError, create_auth_user, generate_api_token, set_api_token
def crea... | wesley1001/dokomoforms | dokomoforms/api/user.py | Python | gpl-3.0 | 2,101 |
# vim: set fileencoding=utf-8 :
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
# * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is *
# * also a registered trademark of Insecure.Com LLC. ... | grongor/school_rfid | lib/nmap-6.40/zenmap/radialnet/gui/Application.py | Python | gpl-2.0 | 12,159 |
from cms.test_utils.testcases import CMSTestCase
from cms.models.pluginmodel import CMSPlugin
from ..models import (Project, ProjectType, Theme, NetworkGroup,
NetworkGroupList)
from ..models import FeaturedProject, ProjectList, SignupForm
from ..cms_plugins import (FeaturedProjectPlugin, ProjectL... | okfn/website | foundation/organisation/tests/test_cms_plugins.py | Python | mit | 6,894 |
# (C) Fractal Industries, Inc. 2016
# (C) Datadog, Inc. 2010-2016
# (C) Luca Cipriani <luca@c9.io> 2013
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict
import time
# 3p
import psutil
# project
from checks import AgentCheck
from config import _i... | pmav99/praktoras | checks.d/process.py | Python | bsd-3-clause | 12,612 |
# boosterMissileVelocityPenalty
#
# Used by:
# Implants named like: Crash Booster (3 of 4)
# Implants named like: X Instinct Booster (3 of 4)
type = "boosterSideEffect"
# User-friendly name for the side effect
displayName = "Missile Velocity"
# Attribute that this effect targets
attr = "boosterMissileVelocityPenalty"... | bsmr-eve/Pyfa | eos/effects/boostermissilevelocitypenalty.py | Python | gpl-3.0 | 549 |
from collections import defaultdict
from datetime import timedelta
import markus
import numpy
from geocalc import circle_radius, distance
from ichnaea.db import retry_on_mysql_lock_fail
from ichnaea.geocode import GEOCODER
from ichnaea.models import (
decode_cellid,
encode_cellarea,
BlueObservation,
C... | mozilla/ichnaea | ichnaea/data/station.py | Python | apache-2.0 | 20,684 |
# Signal handler is giving ability connect and emit to all widgets.
#
# This file is part of Simpleline Text UI library.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# Simpleline 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 S... | rhinstaller/python-simpleline | simpleline/render/screen/signal_handler.py | Python | gpl-2.0 | 3,352 |
# Copyright 2014 NEC Corporation. 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 ... | affo/nova | nova/api/openstack/compute/schemas/v3/disk_config.py | Python | apache-2.0 | 745 |
import pickle
from .record import Record
import csv
import os.path
import re
import time
from .log import logger
from typing import List, Set, Iterable
import socket
import urllib.request
import urllib.parse
import json
import collections
import sys
from .mock_json import mock_json
""" Part of inspiderweb: Tool to ana... | klieret/inspiderweb | inspiderweb/database.py | Python | mit | 24,708 |
from __future__ import division
import numpy as np
import formula as fa
import neuralnet
import os
def dofeedforward(nn, insrc_bs, tgsrc_bs):
si = len(insrc_bs)
nn.odata[0] = np.concatenate((np.ones((si, 1)), insrc_bs), axis=1)
for i in range(1, nn.arrln-1):
if nn.actfc is 'sigm':
nn.... | evanrao/NNReserve | deepLearn/ffbp.py | Python | apache-2.0 | 3,110 |
# -*- coding: utf-8 -*-
from .version import __version__ # noqa: F401
from .tts import gTTS, gTTSError
__all__ = ['gTTS', 'gTTSError']
| pndurette/gTTS | gtts/__init__.py | Python | mit | 137 |
# -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 option) any ... | freeworldxbmc/pluging.video.Jurassic.World.Media | resources/lib/sources/movieshd_mv.py | Python | gpl-3.0 | 3,774 |
# coding: utf-8
import os
from tempfile import NamedTemporaryFile
from django.core.files.storage import get_storage_class
from django.db import models
from django.db.models.signals import post_delete
from django.utils.translation import ugettext as _
from onadata.apps.logger.models import XForm
def export_delete_ca... | kobotoolbox/kobocat | onadata/apps/viewer/models/export.py | Python | bsd-2-clause | 6,342 |
# sysdiag.py
#
# 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
# distributed u... | jentenma/pfscfg | project/sfv2/pfsimg/scripts/apsysdiag/aptype/sfv2/sysdiag.py | Python | apache-2.0 | 1,365 |
"""
This module provides some useful functions for working with
scrapy.http.Request objects
"""
import hashlib
from typing import Dict, Iterable, Optional, Tuple, Union
from urllib.parse import urlunparse
from weakref import WeakKeyDictionary
from w3lib.http import basic_auth_header
from w3lib.url import canonicalize... | pawelmhm/scrapy | scrapy/utils/request.py | Python | bsd-3-clause | 5,070 |
# django imports
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template import RequestContext
from django.template.loader import render... | lichong012245/django-lfs-0.7.8 | lfs/manage/views/marketing/topseller.py | Python | bsd-3-clause | 6,859 |
# -*- coding: UTF-8 -*-
logger.info("Loading 0 objects to table ledger_ledgerinfo...")
# fields: user, entry_date
loader.flush_deferred_objects()
| lino-framework/welfare | lino_welfare/projects/gerd/tests/dumps/18.8.0/ledger_ledgerinfo.py | Python | agpl-3.0 | 147 |
from functools import wraps
from django.http import HttpResponseForbidden
def forbidden_if_not_authenticated(f):
""" Very similar to :func:`django.contrib.auth.decorators.login_required`,
however it returns class:`django.http.HttpResponseForbidden` instead of
redirecting to login. """
@wraps(f)
de... | vegarang/devilry-django | devilry/restful/forbidden.py | Python | bsd-3-clause | 524 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "mrp_subcontracting",
'version': '0.1',
'summary': "Subcontract Productions",
'description': "",
'website': 'https://www.odoo.com/app/manufacturing',
'category': 'Manufacturing/Manufactu... | jeremiahyan/odoo | addons/mrp_subcontracting/__manifest__.py | Python | gpl-3.0 | 997 |
#!/usr/local/bin/python
import datetime
import logging
import logging.config
import os
import config
# you were looking for pretty? hah.
single_format = '%(asctime)s [%(process)d] %(levelname)s %(user_id)s %(guru)s - %(message)s'
serious_format = '%(asctime)s [%(process)d] %(levelname)s %(user_id)s %(guru)s %(file... | ddierschow/bamca | bin/logger.py | Python | mit | 7,918 |
"""
homeassistant.components.sensor.dht
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adafruit DHT temperature and humidity sensor.
You need a Python3 compatible version of the Adafruit_Python_DHT library
(e.g. https://github.com/mala-zaba/Adafruit_Python_DHT,
also see requirements.txt).
As this requires access to the... | EricRho/home-assistant | homeassistant/components/sensor/dht.py | Python | mit | 4,790 |
# -*- coding: utf-8 -*-
"""Tests for REST API: empty files"""
from invenio.testsuite import make_test_suite, run_test_suite
from .helpers import B2ShareAPITestCase, TemporaryDirectory, create_file
from flask import current_app
class TestB2ShareEmptyFiles(B2ShareAPITestCase):
"""Unit tests for the REST API: empt... | cjhak/b2share | invenio/b2share/testsuite/test_rest_empty_files.py | Python | gpl-2.0 | 2,033 |
#!/usr/bin/env python
"""
"""
import os,sys
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import pylab as p
import cPickle as pkl
from scipy import interpolate
matplotlib.rc('xtick',labelsize=25)
matplotlib.rc('ytick',labelsize=25)
modeTitle=['Total Intensity','Invariant Interval','Matrix Template Ma... | griffinfoster/pulsar-polarization-sims | scripts/plotLineValVsTint.py | Python | mit | 5,743 |
# Copyright 2017 The Bazel Authors. 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 la... | bazelbuild/rules_pkg | tests/make_rpm_test.py | Python | apache-2.0 | 5,368 |
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2021 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import abc
import io
import os.path
import importlib
import logging
import collections
from typing impor... | Keeper-Security/Commander | keepercommander/importer/importer.py | Python | mit | 10,233 |
import uuid
from django.db import models
from django.utils import timezone
class CourseAssignment(models.Model):
A = 'A'
B = 'B'
V = 'V'
G = 'G'
ALL = 'ALL'
ASSIGNMENT_TARGET = (
(A, 'A class'),
(B, 'B class'),
(V, 'V class'),
(G, 'G class'),
(ALL, 'ALL... | L3K0V/lifebelt | server/api/assignments/models.py | Python | mit | 3,203 |
import numpy as np
import time
import cv2
from threading import Thread
#from picamera.array import PiRGBArray
#from picamera import PiCamera
import openface
from sklearn.externals import joblib
from livenessDetection import colbp, lpq
import threading
class DetectFace(Thread):
"""
Class constructor. Rece... | psilva-leo/AutonomousDoorman | system/detectFace2.py | Python | mit | 4,803 |
"""
INSTALL
Flask
Flask-Login
requests
"""
from flask import Flask, request, render_template, redirect, url_for, flash
from flask.ext.login import (LoginManager, current_user, login_required,
login_user, logout_user, UserMixin, AnonymousUser,
... | codeanu/flask-login-oauth2 | server.py | Python | bsd-3-clause | 3,986 |
# Copyright 2016 Red Hat, 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... | stratis-storage/stratis-cli | tests/whitebox/monkey_patching/test_keyboard_interrupt.py | Python | apache-2.0 | 1,934 |
# License: BSD 3 clause
import unittest, pickle
import numpy as np
from scipy.sparse import csr_matrix
from tick.survival import SimuCoxReg, ModelCoxRegPartialLik
from tick.base_model.tests.generalized_linear_model import TestGLM
class Test(TestGLM):
def test_ModelCoxRegPartialLik(self):
"""...Numerica... | Dekken/tick | tick/survival/tests/model_coxreg_partial_lik_test.py | Python | bsd-3-clause | 1,467 |
"""The tests for the nx584 sensor platform."""
import requests
import unittest
from unittest import mock
from nx584 import client as nx584_client
from homeassistant.components.binary_sensor import nx584
from homeassistant.bootstrap import setup_component
from tests.common import get_test_home_assistant
class StopM... | philipbl/home-assistant | tests/components/binary_sensor/test_nx584.py | Python | mit | 7,561 |
"""
The functions benchmarked in this file depend _almost_ exclusively on
_libs, but not in a way that is easy to formalize.
If a PR does not change anything in pandas/_libs/ or pandas/core/tools/, then
it is likely that these benchmarks will be unaffected.
"""
import numpy as np
from pandas import (
NaT,
Se... | jorisvandenbossche/pandas | asv_bench/benchmarks/inference.py | Python | bsd-3-clause | 9,245 |
#!/usr/bin/python
# LADITools - Linux Audio Desktop Integration Tools
# Copyright (C) 2011-2012 Alessio Treglia <quadrispro@ubuntu.com>
# Copyright (C) 2007-2010, Marc-Olivier Barre <marco@marcochapeau.org>
# Copyright (C) 2007-2009, Nedko Arnaudov <nedko@arnaudov.name>
#
# This program is free software: you can redist... | alessio/laditools | laditools/jack.py | Python | gpl-3.0 | 8,258 |
from wikidataintegrator import wdi_core, wdi_login
import os
print("Logging in...")
if "WDUSER" in os.environ and "WDPASS" in os.environ:
WDUSER = os.environ['WDUSER']
WDPASS = os.environ['WDPASS']
else:
raise ValueError("WDUSER and WDPASS must be specified in local.py or as environment variables")
login ... | SuLab/scheduled-bots | scheduled_bots/disease_ontology/disease_ontology/deprecated_code/change_references.py | Python | mit | 1,868 |
# -*- coding: utf-8 -*-
"""
Display songs currently playing in DeaDBeeF.
Configuration parameters:
cache_timeout: refresh interval for this module (default 5)
format: display format for this module (default '[{artist} - ][{title}]')
sleep_timeout: when deadbeef is not running, this interval will be used
... | tobes/py3status | py3status/modules/deadbeef.py | Python | bsd-3-clause | 4,338 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
import os
import time
import shutil
import requests
import json
from pprint import pprint
import errno
import logging
import logging.handlers
#######################################
def get_logger(wdir, logName=None, isDefault=False):
if isDefault:
... | gakarak/BTBDB_ImageAnalysisSubPortal | app/core/utils/log.py | Python | apache-2.0 | 1,126 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2013 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... | SamiHiltunen/invenio-messages | tests/test_messages.py | Python | gpl-2.0 | 5,465 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from unittest import TestCase
import six
__all__ = ['call', 'parametrize', 'ParametrizedTestCase']
try:
# Try Python3 version, maybe someone will back-port this in the future?
from functools import partialmethod
except ImportEr... | canni/ptestcase | ptestcase/__init__.py | Python | bsd-2-clause | 1,945 |
# 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 agreed to in writing, ... | google/gazoo-device | gazoo_device/utility/retry.py | Python | apache-2.0 | 3,404 |
from decimal import Decimal
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Sequence, Set, Tuple, Type, Union
from .typing import display_as_type
if TYPE_CHECKING:
from .typing import DictStrAny
# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc... | samuelcolvin/pydantic | pydantic/errors.py | Python | mit | 17,547 |
"""
"""
import tensorflow as tf
from six.moves import range
tf.app.flags.DEFINE_integer('image-size', 128, '')
# arXiv:1703.10717v2
# 4.1
# we used Nh = Nz = 64 in most of our experiments with this dataset.
tf.app.flags.DEFINE_integer('seed-size', 64, '')
tf.app.flags.DEFINE_integer('embedding-size', 64, '')
# arX... | imironhead/ml_gans | began/began.py | Python | mit | 8,780 |
# -*- coding: utf-8 -*-
""" Supply
@author: Michael Howden (michael@sahanafoundation.org)
@date-created: 2010-08-16
Generic Supply functionality such as catalogs and items that will be used across multiple modules
"""
module = request.controller
resourcename = request.function
if not (de... | sinsai/Sahana_eden | controllers/supply.py | Python | mit | 2,847 |
class Base(object):
def __init__(self, path, options, *args, **kwargs):
self.options = options
self.args = args
self.kwargs = kwargs
self.path = path
def run(self):
raise NotImplementedError('You must implement the run() method yourself!')
| Ostralyan/xudo | xudo/commands/base.py | Python | mit | 306 |
# Copyright (c) 2018 PaddlePaddle Authors. 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 appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/sequence/test_sequence_concat.py | Python | apache-2.0 | 3,737 |
"""This module provides the connection to the user interface elements."""
# Imports
# If wpilib not available use pyfrc
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import os
import common
import parameters
import datalog
class JoystickAxis(object):
"""Enumerates joystick axis."""
... | TechnoJays/robot2014 | src/robot/userinterface.py | Python | gpl-2.0 | 11,737 |
#
# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from . import digital_python as digital
import struct
def gen_and_append_crc32(s):
crc = digital.crc32(s)
return s + struct.pack(">I", crc)
def check_crc32(s):
... | mrjacobagilbert/gnuradio | gr-digital/python/digital/crc.py | Python | gpl-3.0 | 592 |
# (c) 2015, Brian Coca <bcoca@ansible.com>
#
# 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 published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | RackSec/ansible | lib/ansible/plugins/lookup/url.py | Python | gpl-3.0 | 2,348 |
import json
import numpy
import time
import pyspark
from pyspark.mllib.classification import *
from pyspark.mllib.clustering import *
from pyspark.mllib.regression import *
from pyspark.mllib.recommendation import *
from pyspark.mllib.stat import *
from mllib_data import *
class PerfTest:
def __init__(self, sc):... | XiaoqingWang/spark-perf | pyspark-tests/mllib_tests.py | Python | apache-2.0 | 16,014 |
"""Test for RFlink sensor components.
Test setup of rflink sensor component/platform. Verify manual and
automatic sensor creation.
"""
from homeassistant.components.rflink import (
CONF_RECONNECT_INTERVAL,
TMP_ENTITY,
DATA_ENTITY_LOOKUP,
EVENT_KEY_COMMAND,
EVENT_KEY_SENSOR,
)
from homeassistant.c... | Cinntax/home-assistant | tests/components/rflink/test_sensor.py | Python | apache-2.0 | 6,384 |
# -*- coding: utf-8 -*-
# Copyright 2020 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 o... | javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/google/api/context_pb2.py | Python | apache-2.0 | 5,563 |
# Licensed to the StackStorm, Inc ('StackStorm') 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 under the Apache License, Version 2.0
# (the "License"); you may not use th... | punalpatel/st2 | st2common/st2common/triggers.py | Python | apache-2.0 | 3,681 |
import braintree
braintree.Configuration.configure(braintree.Environment.Sandbox,
merchant_id="mpq4wrxc24y3vbvh",
public_key="bk2ry3gtc2v2spbm",
private_key="bef5caa64ef7ba35eb5c1fa215aa8071")
# result = braintree.Cu... | saihou/Smoove | Server/braintree_api.py | Python | gpl-2.0 | 3,142 |
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys, errno
import unittest
from test import test_support
threading = test_support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module does... | HiSPARC/station-software | user/python/Lib/test/test_winreg.py | Python | gpl-3.0 | 20,832 |
import os
import sys
import subprocess
import shlex
import sys
import StringIO
import datetime
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + os.sep + os.pardir + os.sep + "makahiki" + os.sep)
from apps.utils import script_utils
def termination_string():
"""
Gets the current system time and app... | jtakayama/makahiki-draft | install/run_initialize_instance.py | Python | mit | 7,542 |
#!/usr/bin/env python
#
# 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 requir... | Aloomaio/googleads-python-lib | examples/ad_manager/v201808/label_service/get_active_labels.py | Python | apache-2.0 | 1,878 |
#!/usr/bin/env python
# coding=utf-8
"""110. Diophantine reciprocals II
https://projecteuler.net/problem=110
In the following equation x, y, and n are positive integers.
It can be verified that when n = 1260 there are 113 distinct solutions and
this is the least value of n for which the total number of distinct solu... | openqt/algorithms | projecteuler/pe110-diophantine-reciprocals-ii.py | Python | gpl-3.0 | 633 |
import os
import sys
import re
import copy
import logging
import textwrap
from lxml import etree
from path import path
from fs.errors import ResourceNotFoundError
from pkg_resources import resource_string
import dogstats_wrapper as dog_stats_api
from xmodule.annotator_mixin import html_to_text
from xmodule.contentstor... | B-MOOC/edx-platform | common/lib/xmodule/xmodule/html_module.py | Python | agpl-3.0 | 14,426 |
# Test the functions and main class method of FormatParagraph.py
import unittest
from idlelib import FormatParagraph as fp
from idlelib.EditorWindow import EditorWindow
from Tkinter import Tk, Text
from test.test_support import requires
class Is_Get_Test(unittest.TestCase):
"""Test the is_ and get_ functions"""
... | svanschalkwyk/datafari | windows/python/Lib/idlelib/idle_test/test_formatparagraph.py | Python | apache-2.0 | 14,354 |
{
# Financial Page - event tab
"uidFinanceTabEventPanel": {
W3Const.w3PropType: W3Const.w3TypePanel,
W3Const.w3PropSubUI: [
"uidFinanceTabEventQueryPanel",
"uidFinanceTabEventAddPanel"
]
},
# Finance Page - event tab, add
"uidFinanceTabEventAddPan... | eddiedb6/ej | web/metadata/EJUIFinanceEventTab.py | Python | mit | 6,047 |
from django.forms.fields import CharField, MultiValueField
from django.forms import ValidationError
from django.forms.widgets import TextInput, MultiWidget, HiddenInput
from django.core.exceptions import ImproperlyConfigured
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_laz... | arneb/django-simple-captcha | captcha/fields.py | Python | mit | 4,028 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com>
# Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.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 Softw... | migasfree/migasfree-backend | migasfree/client/serializers.py | Python | gpl-3.0 | 9,791 |
# -*- coding: utf-8 -*-
"""
ORCA Open Remote Control Application
Copyright (C) 2013-2020 Carsten Thielepape
Please contact me by : http://www.orca-remote.org/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publi... | thica/ORCA-Remote | src/ORCA/widgets/core/ScrollableLabelLarge.py | Python | gpl-3.0 | 15,619 |
import sys, getopt, traceback, os
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir), 'CountryReconciler'))
sys.path.append(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir), "Land... | landportal/landbook-importers | Simple_XLS_Importer/main.py | Python | mit | 1,930 |
# Copyright 2021 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, ... | google-research/DBAP-algorithm | third_party/rlkit_library/rlkit/exploration_strategies/gaussian_and_epsilon_strategy.py | Python | apache-2.0 | 1,817 |
import unittest
import mock
import sys
import os
sys.path.append(os.path.join('..\..', 'src'))
from backend.util.coords import Coords
class CoordsTest(unittest.TestCase):
def test_set(self):
test_x, test_y, test_z = (1, 2, 3)
test_coords = Coords(test_x, test_y)
self.assertEqual(test_coo... | tsvetelina-aleksandrova/Spacekatz | test/util/coords_test.py | Python | mit | 784 |
from time import sleep
from nose.tools import assert_raises
from rainmaker.net.utils import LStore
def test_lstore_times_out():
fb = LStore(0.2)
key = fb.append(5)
assert fb.get(key) == 5
key = fb.append(5)
sleep(0.25)
assert_raises(KeyError, lambda: fb[key])
def test_lstore_refreshes_timer_o... | hattwj/rainmaker | rainmaker/tests/unit/net/utils_test.py | Python | gpl-3.0 | 971 |
import numpy as np
import calcFeatures
import calcAuthor
import AUTHORS
from classifiers import neural
debug = True
authors = ["Jane Austen", "Walter Scott", "Arthur Conan Doyle", "Charles Dickens", "Mark Twain", "Louisa Alcott"]
#Index coresponds to authors array
textDirs = ["texts/Jane_Austen", "texts/Walter_Scott", ... | darksteelcode/authorship | mainNeuralClassifier.py | Python | gpl-3.0 | 1,669 |
from codecs import open
from os import path
from textwrap import dedent
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.rst"), encoding='utf-8') as f:
long_description = f.read()
setup(
name='python-rush',
version='1.0.0',
description="",
... | Code0x58/python-rush | setup.py | Python | mit | 1,531 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('game', '0007_auto_20150127_2251'),
]
operations = [
migrations.AlterField(
model_name='game',
name='... | HappyJimmy1993/HappyJimmy1993.github.io | game/migrations/0008_auto_20150128_1256.py | Python | gpl-2.0 | 487 |
# -*- coding: utf-8 -*-
#
# license: AGPLv3, see LICENSE for details. In addition we strongly encourage
# you to buy us beer if we meet and you like the software.
"""Test event model specific validators."""
import json
from amivapi.tests.utils import WebTestNoAuth
class EventModelTest(WebTestNoAuth):
... | amiv-eth/amivapi | amivapi/tests/events/test_model.py | Python | agpl-3.0 | 7,931 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.