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/python
# Copyright (c) 2009, Purdue University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of... | stephenlienharrell/roster-dns-management | roster-config-manager/roster_config_manager/tree_exporter.py | Python | bsd-3-clause | 40,841 |
from datetime import datetime, timedelta
from django.db import models
class InventoryManager(models.Manager):
def get_queryset(self):
return super(InventoryManager, self).get_queryset().filter(
shipment__isnull=True, ).distinct()
def days_0_30(self):
# Example method
start... | vandorjw/django-traceability | traceability/managers/item.py | Python | bsd-3-clause | 518 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 lat... | TeutoNet-Netzdienste/ansible | v2/ansible/plugins/action/raw.py | Python | gpl-3.0 | 1,666 |
#!/usr/bin/python
# --------------------------------------------------------------------------
# Class definition of LedController - utility functions for the LED-strip
#
# This class also takes care of updating the LEDs during idle time
# (e.g. for clock-simulation)
#
# Please edit /etc/nerd-alarmclock.conf to configu... | bablokb/nerd-alarmclock | files/usr/local/lib/python2.7/site-packages/nclock/LedController.py | Python | gpl-3.0 | 12,106 |
import wx
from gooey.gui.util import wx_util
from gooey.gui.windows.advanced_config import ConfigPanel
from gooey.gui.windows.sidebar import Sidebar
basic_config = {
'widgets': [{
'type': 'CommandField',
'required': True,
'data': {
'display_name': 'Enter Commands',
'h... | jschultz/Gooey | gooey/gui/windows/layouts.py | Python | mit | 1,386 |
"""
Django settings for server project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | krsoninikhil/cloud-clipboard | server/server/settings.py | Python | mit | 3,593 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^$', 'affiliations.views.affiliations', name = 'affiliations_url'),
url(r'^fetch', 'affiliations.views.fetch', name = 'aff_fetch_url'),
url(r'^add', 'affiliations.views.add', name... | salimm/django-affiliations | build/lib/affiliations/urls.py | Python | mit | 518 |
# Copyright (c) 2013 Zelin.io
# Copyright (C) 2015 Nippon Telegraph and Telephone 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
#
# htt... | Nexenta/cinder | cinder/tests/unit/volume/drivers/test_sheepdog.py | Python | apache-2.0 | 68,464 |
# -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#***... | zscproject/OWASP-ZSC | module/readline_windows/pyreadline/lineeditor/wordmatcher.py | Python | gpl-3.0 | 3,535 |
def setUp(self):
import os
ov_binany_path=os.environ['OV_BINARY_PATH']
self.terminal = App.open("xterm -e " + ov_binany_path +"/openvibe-designer.sh --no-session-management")
while not self.terminal.window():
wait(1)
wait("StartInterface.png",10)
def test_boxSetAttributes(self):
click("... | avilleret/openvibe | applications/platform/designer/test/testBoxSetAttribute.UNIX.sikuli/testBoxSetAttribute.UNIX.py | Python | agpl-3.0 | 825 |
# 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 "License"); you may not use ... | ninefold/libcloud | libcloud/common/aws.py | Python | apache-2.0 | 874 |
"""Generic, built-in renderers."""
from dagny.action import Action
from dagny.utils import camel_to_underscore, resource_name
@Action.RENDERER.html
def render_html(action, resource, content_type=None, status=None,
current_app=None):
"""
Render an appropriate HTML response for an action.
... | zacharyvoase/dagny | src/dagny/renderers.py | Python | unlicense | 2,106 |
# Generate some random 64-bit values to use as contants for random array.
import numpy as np
import binascii
np.random.seed(0)
# TODO: check that hashes are optimal. This should be straightforward, but I'm
# checking this in early because even a potentially non-optimal version is a
# huge improvement.
num_entries =... | BitFunnel/BitFunnel | src/Scripts/get-random-hashes.py | Python | mit | 451 |
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_equal, assert_allclose
import pytest
from scipy.spatial import geometric_slerp
def _generate_spherical_points(ndim=3, n_pts=2):
# generate uniform points on sphere
# see: https://stackoverflo... | person142/scipy | scipy/spatial/tests/test_slerp.py | Python | bsd-3-clause | 15,574 |
# encoding: utf-8
from __future__ import absolute_import, division, print_function
import pytest
from pytest_sftpserver.sftp.server import SFTPServer
@pytest.yield_fixture(scope="session")
def sftpserver(request):
server = SFTPServer()
server.start()
yield server
if server.is_alive():
serv... | ulope/pytest-sftpserver | pytest_sftpserver/plugin.py | Python | mit | 334 |
"""
Copyright (c), Privacy By Design Foundation
All rights reserved.
This source code has been ported from https://github.com/privacybydesign/irmago
The authors of this file are not -in any way- affiliated with the original authors or organizations.
"""
import binascii
import calendar
import datetime
import hashlib
im... | qstokkink/py-ipv8 | ipv8/attestation/wallet/irmaexact/gabi/attributes.py | Python | lgpl-3.0 | 4,832 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-19 14:00
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lifts', '0001_initial'),
]
operations = [
... | davishayden/gains | lifts/migrations/0002_cardio_cardioinstance_liftinstance_workout_workoutinstance.py | Python | mit | 3,125 |
from __future__ import absolute_import, print_function, division
import petl as etl
table = [['foo', 'bar'],
['a', 1],
['b', None]]
# raises exception under Python 3
etl.select(table, 'bar', lambda v: v > 0)
# no error under Python 3
etl.selectgt(table, 'bar', 0)
# or ...
etl.select(table, 'bar', l... | psnj/petl | examples/comparison.py | Python | mit | 353 |
import gc
import os
import sys
import traceback
import gtk
import pango
try:
import gtksourceview
GTK_SOURCE_VIEW = True
except:
GTK_SOURCE_VIEW = False
import events
import urk
import ui
import editor
try:
editorwindows = editor.editorwindows
except AttributeError:
editorwindows = {}
class Edi... | madewokherd/urk | platform/gtk/scripts/editor.py | Python | gpl-2.0 | 15,495 |
# 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 under t... | ging/python-keystoneclient | keystoneclient/tests/unit/v3/test_federation.py | Python | apache-2.0 | 15,242 |
#(C) Copyright Syd Logan 2021
#(C) Copyright Thousand Smiles Foundation 2021
#
#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 a... | slogan621/tscharts | tools/exportcsv/headers.py | Python | apache-2.0 | 822 |
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ServicePosition import ServicePositionGauge
from Components.ActionMap import HelpableActionMap
from Components.MultiContent import MultiContentEntryText
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase... | kingvuplus/rr | lib/python/Plugins/Extensions/CutListEditor/ui.py | Python | gpl-2.0 | 13,115 |
""" pgp.py
this is where the armorable PGP block objects live
"""
import binascii
import calendar
import collections
import contextlib
import copy
import functools
import itertools
import operator
import os
import re
import warnings
import weakref
import six
from datetime import datetime
from cryptography.hazmat.pr... | J08nY/PGPy | pgpy/pgp.py | Python | bsd-3-clause | 108,901 |
from ckan.lib.base import BaseController, render
from ckanext.statreports.statistics.user import UserStats
from ckanext.statreports.statistics.package import PackageStats
from ckan.model.meta import engine
class StatisticsController(BaseController):
'''
StatisticsController renders a simple stat page
which... | kata-csc/ckanext-statreports | ckanext/statreports/controllers.py | Python | agpl-3.0 | 1,634 |
import win32api
import os
import sys
import subprocess
import logging
from itertools import izip_longest
#itertools recipe
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
def harddrive_enumer... | yoavfrancis/KeepItUp | KeepItUp/harddrive_enumerator.py | Python | mit | 1,589 |
import os
import django
def rel(path):
return os.path.join(os.path.abspath(os.path.dirname(__file__)), path)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'HOST': 'localhost',
'NAME': '',
'USER': '',
... | coderholic/django-cities | example/settings.py | Python | mit | 1,545 |
from django.apps import AppConfig
class ThemeConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "hav.apps.theme"
| whav/hav | src/hav/apps/theme/apps.py | Python | gpl-3.0 | 151 |
#
# Copyright (C) 2003-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code for the... | ptosco/rdkit | rdkit/Chem/Pharm2D/UnitTestLazyGenerator.py | Python | bsd-3-clause | 2,437 |
#
# 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
# ... | dims/neutron | neutron/db/migration/alembic_migrations/versions/mitaka/expand/32e5974ada25_add_neutron_resources_table.py | Python | apache-2.0 | 1,390 |
from tpg.program import Program
import numpy as np
import random
from tpg.utils import flip
from tpg.action_object import ActionObject
"""
Action Object has a program to produce a value for the action, program doesn't
run if just a discrete action code.
"""
class ConfActionObject:
def init_def(self, initParams=N... | Ryan-Amaral/PyTPG | tpg/configuration/conf_action_object.py | Python | mit | 9,785 |
#!/usr/bin/env python3
import sys
import os
import math
import numpy
import matplotlib.pyplot as plt
sys.path.append('../climatemaps')
import climatemaps
from climatemaps.logger import logger
DATA_OUT_DIR = 'website/data'
TYPES = {
'precipitation': {
'filepath': 'data/precipitation/cpre6190.dat',
... | bartromgens/climatemaps | bin/create_contour.py | Python | mit | 4,856 |
#! /usr/bin/env python
"""
Create a multiple sample table of Pathway Abundances using individual sample
pathabundance files from HUMAnN2
Copyright:
table_from_humann2 Create a multiple sample table of Pathway Abundances using individual sample path abundance files from HUMAnN2
Copyright (C) 2016 William B... | Brazelton-Lab/lab_scripts | table_from_humann2.py | Python | gpl-2.0 | 4,037 |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2008-2009,2011, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the a... | jeffmahoney/supybot | src/conf.py | Python | bsd-3-clause | 48,640 |
#!BPY
"""
Name: 'Inter-Quake Model'
Blender: 249
Group: 'Export'
Tip: 'Export Inter-Quake Model files'
"""
import struct, math
import Blender
import BPyArmature
IQM_POSITION = 0
IQM_TEXCOORD = 1
IQM_NORMAL = 2
IQM_TANGENT = 3
IQM_BLENDINDEXES = 4
IQM_BLENDWEIGHTS = 5
IQM_COLOR ... | lsalzman/iqm | blender-2.49/iqm_export.py | Python | mit | 40,875 |
import os
import sys
import threading
import time
if len(sys.argv) < 3:
sys.exit ("Usage: %s [num threads] [path]".format (sys.argv[0]))
class ThreadClass (threading.Thread):
def run(self):
total_files = 0
total_dirs = 0
for dirname, dirnames, filenames in os.walk (sys.argv[2]):
... | SaqlainAbbas/s3ffs | tests/test_dir_list.py | Python | gpl-3.0 | 867 |
import yapi
from django.test import TestCase
from django.utils import timezone
from django.conf import settings
from songs import fetch_songs
class FetchSongsTestCase(TestCase):
def test_column_enum_values_are_correct(self):
"""
The Spreadsheet Column Enum should have columns in the following or... | zaneswafford/songaday_searcher | songs/tests/test_fetch_songs.py | Python | bsd-3-clause | 5,672 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# Metaprogramming Driven Development
import unittest
import struct
import cf as math
eps = 1E-05
math_testcases = 'math_testcases.txt'
test_file = 'cmath_testcases.txt'
def ulps_check(expected, got, ulps=20):
"""Given non-NaN floats `expected` and `got`,
check that they're... | AdamPrzybyla/python-cf | test_math_mdd.py | Python | lgpl-3.0 | 7,253 |
# -*- coding: utf-8 -*-
# Informations utilisée par l'installeur sous Windows.
# titre : description sommaire du module
# description : description détaillée
# defaut : par défaut, le module est-il installé ou non ?
description = {
"titre": "Statistiques",
"description": "Création ... | wxgeo/geophar | wxgeometrie/modules/statistiques/description.py | Python | gpl-2.0 | 432 |
"""
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, ... | nthuoj/NTHUOJ_web | users/admin.py | Python | mit | 5,871 |
# #################################################################################### #
# ########################### IMPORTING USEFUL DEFINITIONS ########################### #
## standard library imports
import os, sys
## external libraries imports
import numpy as np
from pdbparser.pdbparser import pdbparser
fro... | bachiraoun/fullrmc | Examples/removes/run.py | Python | agpl-3.0 | 6,878 |
# Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | leeseuljeong/leeseulstack_neutron | neutron/quota.py | Python | apache-2.0 | 12,508 |
__author__ = 'nlelab'
import os
import MySQLdb
import time
import json
import config as cfg
print os.getcwd()
db = MySQLdb.connect(host=cfg.mysql['host'], # your host, usually localhost
user=cfg.mysql['user'], # your username
passwd=cfg.mysql['passwd'], # your password
db=cfg.mys... | mirkolai/polarization_of_emotional_engagement_in_social_media | 012 - analysis script - extract retweet relation.py | Python | mit | 1,154 |
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... | smartsheet-platform/smartsheet-python-sdk | smartsheet/models/sheet_email.py | Python | apache-2.0 | 2,274 |
# Copyright 2018 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... | deepmind/lab | python/tests/teleporter_test.py | Python | gpl-2.0 | 2,547 |
import logging
import signal
from autotest.client.shared import error
from virttest import utils_misc
from tests import guest_test
@error.context_aware
def run_yonit_bitmap(test, params, env):
"""
Run yonit bitmap benchmark in Windows guests, especially win7 32bit,
for regression test of BZ #556455.
... | spiceqa/virt-test | qemu/tests/yonit_bitmap.py | Python | gpl-2.0 | 3,573 |
"""dc views """
import datetime as dt
import collections
from collections import OrderedDict as od_dict
import os
import json
from nested_dict import nested_dict
import pytz
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import ListView
from django.shortcuts import render
from django.htt... | cmos3511/cmos_linux | python/pj/cas_site/pj_app/dc_views.py | Python | gpl-3.0 | 13,719 |
#!/usr/bin/env python
"""
Find files in the FileCatalog using file metadata
"""
import DIRAC
if __name__ == "__main__":
from DIRAC.Core.Base import Script
Script.registerSwitch( '', 'Path=', ' Path to search for' )
Script.registerSwitch( '', 'SE=', ' (comma-separated list of) SEs/SE-groups to be search... | Andrew-McNab-UK/DIRAC | DataManagementSystem/scripts/dirac-dms-find-lfns.py | Python | gpl-3.0 | 2,651 |
# -*- coding: utf-8 -*-
"""MacOS keychain database files."""
import collections
from dtfabric.runtime import data_maps as dtfabric_data_maps
from dtformats import data_format
from dtformats import errors
class KeychainDatabaseColumn(object):
"""MacOS keychain database column.
Attributes:
attribute_data_ty... | libyal/dtformats | dtformats/keychain.py | Python | apache-2.0 | 32,572 |
"""
SARIMAX Model
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
from statsmodels.compat.python import long
from warnings import warn
import numpy as np
import pandas as pd
from .kalman_filter import KalmanFilter
from .mlemodel import MLEModel, MLERes... | bert9bert/statsmodels | statsmodels/tsa/statespace/sarimax.py | Python | bsd-3-clause | 82,327 |
import warnings
from copy import deepcopy
from scipy import fftpack as fp
from scipy import signal
import numpy as np
from matplotlib import pyplot as plt
from lib2.IQPulseSequence import IQPulseBuilder
from lib2.MeasurementResult import MeasurementResult
import lib2.directMeasurements.digitizerTimeResolvedDirectMeasur... | vdrhtc/Measurement-automation | lib2/simultaneousReflectionTransmission.py | Python | gpl-3.0 | 20,018 |
from req import ApiRequestHandler
from req import Service
import tornado
class ApiLoginHandler(ApiRequestHandler):
@tornado.gen.coroutine
def post(self):
args = ['username', 'password']
meta = self.get_args(args)
err, token = yield from Service.User.login(self, meta)
if err: sel... | kevchentw/nctu_hackathon | backend/api/login.py | Python | mit | 380 |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... | project-magpie/enigma2-openpli | lib/python/Components/config.py | Python | gpl-2.0 | 49,143 |
# -*- coding:utf-8 -*-
## src/common/dbus_support.py
##
## Copyright (C) 2005 Andrew Sayman <lorien420 AT myrealbox.com>
## Dimitur Kirov <dkirov AT gmail.com>
## Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com>
## Copyright (C) 2005-2007 Yann Leboulanger <asterix AT lagaule.org>
## Cop... | kevin-teddy/gajim | src/common/dbus_support.py | Python | gpl-3.0 | 4,314 |
from django.contrib import admin
from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType
from offensivecontent.models import OffensiveContent, OffensiveContentData
try:
from offensivecontent import registry
except ImportError:
from registration import regist... | callowayproject/django-offensivecontent | offensivecontent/admin.py | Python | apache-2.0 | 5,082 |
import csv
import boto3
import io
import tempfile
import logging
from django.conf import settings
from .models import (
HouseholdServiceTotal,
HouseholdBillTotal,
DataSetFile,
BudgetPhase,
HouseholdService,
FinancialYear,
HouseholdClass,
)
from scorecard.models import Geography
from django.... | Code4SA/municipal-data | household/upload.py | Python | mit | 4,221 |
#!/usr/bin/python2
'''
Based on http://jeremyblythe.blogspot.co.uk code
2015-05-29: changed to use official Python wrapper from Google to avoid deprecated ClientLogin (stef@nstrahl.de)
== Installation of PyDrive and OAuth2 ==
> apt-get install python-pip
> pip install PyDrive
== Step 1: register pydrive itself ==
Go ... | strahl/gdrive_uploader | uploader.py | Python | gpl-2.0 | 5,852 |
import logging
from datetime import datetime
from google.appengine.api.taskqueue import Task
from gcp_census.bigquery.bigquery_table_metadata import BigQueryTableMetadata
from gcp_census.bigquery.bigquery_table_streamer import BigQueryTableStreamer
from gcp_census.tasks import Tasks
class BigQueryTask(object):
... | ocadotechnology/gcp-census | gcp_census/bigquery/bigquery_task.py | Python | apache-2.0 | 4,536 |
'''
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 later version.
This program is distributed in the hope that it will be useful,
but WITHOUT... | francocurotto/GraphSLAM | src/python-helpers/commons/slamData.py | Python | gpl-3.0 | 2,205 |
# vim: set et ts=4 sw=4 fdm=marker
"""
MIT License
Copyright (c) 2016 Jesse Hogan
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 u... | jhogan/commonpy | configfile.py | Python | mit | 2,882 |
#from flask import render_template
#from flask.ext.mail import Message
from tinysmtp import Connection, Message
from decorators import async
#from almlogic import almlogic #import this to get config vars
#almlogic.config.from_object('config')
#from almlogic import models
@async
def send_async_email(msg):
#send ema... | evanmj/calzone | almlogic/emails.py | Python | bsd-3-clause | 1,575 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | alanljj/tkobr-addons | tko_partner_sequence/partner.py | Python | agpl-3.0 | 1,524 |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | anache/ana-se-python-17 | selenium-py-training-chernova/php4dvd/2016_05_08_HW_02/test_hw_02_02_remove.py | Python | apache-2.0 | 2,547 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import mojom
import mojom_pack
import mojom_test
import sys
EXPECT_EQ = mojom_test.EXPECT_EQ
EXPECT_TRUE = mojom_test.EXPECT_TRUE
RunTest = mojom_test.RunTe... | ChromiumWebApps/chromium | mojo/public/bindings/pylib/generate/mojom_pack_tests.py | Python | bsd-3-clause | 5,268 |
import os
import time
import glob
import importlib
import sys
isVerbose = False
thisFile = "all_python"
workDir = os.path.dirname(os.path.realpath(__file__))
thisDir = os.path.dirname(os.path.realpath(__file__))
sys.path.extend([os.path.dirname(workDir) + "/pLib"])
print ".. importing files from this SANDBOX directo... | fbrglez/gitBed | xProj/P.lop/pLib/all_python.py | Python | gpl-2.0 | 1,406 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 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.or... | sajuptpm/neutron-ipam | neutron/plugins/nec/db/models.py | Python | apache-2.0 | 2,354 |
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now, timedelta
from sa_api_v2.models import DataSnapshotRequest
import logging
log = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Clear any bulk data snapshots (and requests) older than a day.'
... | codeforsanjose/MobilityMapApi | src/sa_api_v2/management/commands/clearsnapshots.py | Python | gpl-3.0 | 603 |
#!/usr/bin/env python
import datetime
import unittest
import inspect
from nose.plugins.attrib import attr
from pyon.util.int_test import IonIntegrationTestCase
from pyon.public import RT, PRED, OT, log, LCE, LCS, AS
from pyon.public import IonObject
from pyon.util.ion_time import IonTime
from ion.util.enhanced_resou... | ooici/coi-services | ion/services/sa/observatory/test/test_observatory_full_integration.py | Python | bsd-2-clause | 43,907 |
# 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/models/_network_management_client_enums.py | Python | mit | 30,224 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import getpass
import os, subprocess
import socket
import fcntl
import struct
NEWIPADRESS = ""
SMTPSERVER = ""
SMTPUSER = ""
SMTPPORT = "25"
SMTPPASSWD = ""
def get_ip_address(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_n... | mmmarq/scm_box_setup | scm_tool_config.py | Python | gpl-3.0 | 4,354 |
"""The epsonworkforce component."""
| turbokongen/home-assistant | homeassistant/components/epsonworkforce/__init__.py | Python | apache-2.0 | 36 |
# vim: set encoding=utf-8
from unittest import TestCase
from lxml import etree
from regparser.notice import build, changes
from regparser.notice.amdparser import DesignateAmendment, Amendment
from regparser.test_utils.xml_builder import XMLBuilder
from regparser.tree.xml_parser.preprocessors import ParseAMDPARs
from ... | cmc333333/regulations-parser | tests/notice_build_tests.py | Python | cc0-1.0 | 25,573 |
# Copyright 2016 Isotoma Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | yaybu/touchdown | touchdown/tests/test_aws_vpc_elastic_ip.py | Python | apache-2.0 | 5,757 |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
"""Module used to convert ChipWhisperer project files into Riscure's trs format.
Example:
./cw_to_trs.py --input=path/to/project_name --output=proje... | lowRISC/ot-sca | util/cw_to_trs.py | Python | apache-2.0 | 4,728 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017 Jonathan Schultz
#
# 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 lat... | BarraQDA/nvivotools | saveSources.py | Python | gpl-3.0 | 3,534 |
import pytest
from conftest import assert_bash_exec
@pytest.mark.bashcomp(
ignore_env=r"^[+-]((BASHOPTS|MANPATH)=|shopt -. failglob)"
)
class TestMan:
manpath = "$PWD/man"
assumed_present = "man"
@pytest.fixture
def colonpath(self, request, bash):
try:
assert_bash_exec(bash,... | algorythmic/bash-completion | test/t/test_man.py | Python | gpl-2.0 | 4,099 |
# entry point for the websocket loop
import gevent.monkey
import redis.connection
redis.connection.socket = gevent.socket
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
| Frky/django-websocket-redis | examples/wsgi_websocket.py | Python | mit | 217 |
"""
A simple test of stills refinement using fake data.
Only the crystal is perturbed while the beam and detector are known.
"""
from __future__ import annotations
def test(args=[]):
# Python and cctbx imports
from math import pi
from cctbx.sgtbx import space_group, space_group_symbols
# Symmetry ... | dials/dials | tests/algorithms/refinement/test_stills_refinement.py | Python | bsd-3-clause | 7,750 |
"""This script finds all '.properties-MERGED' files with no relevant translation for a given language.
This script requires the python libraries: gitpython, jproperties, pyexcel-xlsx, xlsxwriter and pyexcel along with
python >= 3.9.1 or the requirements.txt file found in this directory can be used
(https://packaging.p... | sleuthkit/autopsy | release_scripts/localization_scripts/unmatchedscript.py | Python | apache-2.0 | 5,117 |
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Python JSON <-> Java Jabsorb format converter
Jabsorb is a serialization library for Java, converting Java beans to JSON
and vice versa.
This module is compatible with the fork of Jabsorb available at
https://github.com/isandlaTech/cohorte-org.jabsorb.ng
:aut... | isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/pelix/misc/jabsorb.py | Python | apache-2.0 | 10,153 |
from os import environ
def pytest_addoption(parser):
parser.addini("env_files",
type="linelist",
help="a line separated list of env files to parse",
default=[])
def pytest_load_initial_conftests(args, early_config, parser):
for file in early_config.getin... | JonnyFunFun/pytest-envfiles | pytest_envfiles/plugin.py | Python | mit | 753 |
import time
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
... | nwjs/nw.js | test/sanity/manifest-html-main-inside/test.py | Python | mit | 506 |
import threading, Queue, cStringIO
import tcp, certutils
import OpenSSL
class ServerThread(threading.Thread):
def __init__(self, server):
self.server = server
threading.Thread.__init__(self)
def run(self):
self.server.serve_forever()
def shutdown(self):
self.server.shutdow... | phase-dev/phase | netlib/test.py | Python | gpl-3.0 | 2,405 |
#! /usr/bin/env python3
#
# Example Python module for prepaid usage using MySQL
# 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 ... | jrouzierinverse/freeradius-server | src/modules/rlm_python/prepaid.py | Python | gpl-2.0 | 6,988 |
import numpy as np
from collections import OrderedDict
class Society:
neighbourhood_rows = 2
neighbourhood_cols = 2
neighbourhood_count = neighbourhood_rows * neighbourhood_cols
childcare_cost = 4000
transportation_cost = 2000
def __init__(self, rng):
self.rng = rng
self.gende... | tcstewar/farm_game | farm_game/model_bak.py | Python | gpl-2.0 | 38,545 |
# Copyright (C) 2005-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is dis... | khertan/ownNotes | python/merge3/merge3.py | Python | gpl-3.0 | 18,698 |
# Program to take the highest predicted links and insert them into
# a new file
# usage: python combine.py <new edges> <old edges> <number of new edges> <output file>
import sys
# Check command line arguments
args = sys.argv
if len(args) != 5:
print "Usage: python " + args[0] + " <new edges> <old edges> <number of ... | coriander-/AA_bipartite_link_prediction | combine.py | Python | mit | 1,003 |
"""Tests for letsencrypt.le_util."""
import errno
import os
import shutil
import stat
import tempfile
import unittest
import mock
from letsencrypt import errors
class MakeOrVerifyDirTest(unittest.TestCase):
"""Tests for letsencrypt.le_util.make_or_verify_dir.
Note that it is not possible to test for a wron... | tdfischer/lets-encrypt-preview | letsencrypt/tests/le_util_test.py | Python | apache-2.0 | 6,111 |
import Image
def merge_images(images):
"""Return the images in `images` joined one next another"""
images_pil = [Image.open(img) for img in images]
width = sum(img.size[0] for img in images_pil)
heigth = max(img.size[1] for img in images_pil)
result = Image.new('RGBA', (width, heigth))
pos ... | omab/faces | pyfaces/utils.py | Python | mit | 432 |
import unittest
from prime_factors import prime_factors
# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0
class PrimeFactorsTest(unittest.TestCase):
def test_no_factors(self):
self.assertEqual(prime_factors(1), [])
def test_prime_number(self):
self.assertEqual(prime... | CubicComet/exercism-python-solutions | prime-factors/prime_factors_test.py | Python | agpl-3.0 | 906 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('scheduletemplates', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='shifttemplate',
... | klinger/volunteer_planner | scheduletemplates/migrations/0002_auto_20151013_2229.py | Python | agpl-3.0 | 465 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-04-05 15:18
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0444_auto_20190412_0948'),
]
operations = ... | uclouvain/OSIS-Louvain | base/migrations/0445_add_field_learning_unit_year.py | Python | agpl-3.0 | 576 |
# Copyright (C) 2010-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | KaiSzuttor/espresso | testsuite/python/constraint_shape_based.py | Python | gpl-3.0 | 36,175 |
import sys
import gzip
import time
import numpy
import json
import time
import logging
import operator
import config
import csv
import StringIO
import subprocess
import HTMLParser
#from py2neo import Graph, Path, Node, Relationship,authenticate
from scipy import stats
from django.shortcuts import render_to_response
f... | MRCIEU/melodi | browser/views.py | Python | mit | 51,244 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 12:55:05 2015
@author: mannion2
"""
import scipy as sp
import numpy as np
import random as r
import matplotlib.pyplot as plt
from bisect import bisect_left
check = 1
def Choice(cdf,x):
''' Returns the the chosen value (corresponding to the CDF) that are clos... | mannion9/Intro-to-Python | Specific Methods/Normalizing-a-PDF.py | Python | mit | 930 |
"""
test_zipballs.py: tests related to core.zipballs module
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
import os
try:
from unittest import... | karanisverma/feature_langpop | tests/core/test_zipballs.py | Python | gpl-3.0 | 14,877 |
# -*- coding: latin-1 -*-
# Author: adaur <adaur.underground@gmail.com>
# URL: https://sickrage.ca
#
# 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 version... | gborri/SickRage | sickrage/providers/torrent/xthor.py | Python | gpl-3.0 | 4,721 |
from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.test.client import RequestFactory
from django.test import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=False, P... | 912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/auth/tests/test_signals.py | Python | gpl-2.0 | 3,272 |
import sys
from PySide import QtGui
from view.main_window import KMainWindow
def main():
# Creates main QTGui App
app = QtGui.QApplication(sys.argv)
# Set a style, options include:
# "cleanlooks", "plastique", "motif",
# "Windows", "CDE", "WindowsXP", "WindowsVista"
# Comment out the two line... | katerina7479/kadre | main.py | Python | mit | 674 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('stats', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='vote',
name='election',... | lordzfc/wyborySam2014 | stats/migrations/0002_auto_20150919_1109.py | Python | mit | 419 |
from Screens.Screen import Screen
from Components.Sources.CanvasSource import CanvasSource
from Components.ActionMap import ActionMap, NumberActionMap
from Tools.Directories import fileExists
from enigma import gFont, getDesktop, gMainDC, eSize, RT_HALIGN_RIGHT, RT_WRAP
def RGB(r,g,b):
return (r<<16)|(g<<8)|b
class ... | kingvuplus/rr | lib/python/Plugins/SystemPlugins/VideoTune/VideoFinetune.py | Python | gpl-2.0 | 10,747 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.