code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#!/usr/bin/env python # -*- coding: utf-8-*- # ------------------------------------------------------------------------------ # Copyright (c) 2007-2021, Ricardo Amézquita Orozco # All rights reserved. # # This software is provided without warranty under the terms of the GPLv3 # license included in LICENSE.txt and may ...
cihologramas/pyoptools
pyoptools/raytrace/mat_lib/material.py
Python
gpl-3.0
5,423
from django.contrib import admin class CandidateAdmin(admin.ModelAdmin): fieldsets = [ (None, { 'fields': ['email', 'first_name', 'last_name', 'gender', 'cv'] }), ('Contact Information', { 'classes': ('collapse',), 'fields': ['mobile_phone'] }), ...
QC-Technologies/HRMS
interview/admin/candidate.py
Python
gpl-3.0
1,067
from setuptools import setup, find_packages setup( name='vmpie', version='0.1a', packages=find_packages(), author='', entry_points={ 'vmpie.subsystems': [ 'VCenter = vmpie.vcenter:VCenter' ], 'console_scripts': [ 'v...
LevyCory/vmpie
setup.py
Python
gpl-3.0
614
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest class TestSoilTexture(unittest.TestCase): def test_texture_selection(self): soil_tex = frappe.get_all('Soil Texture', fields=['name'],...
indictranstech/erpnext
erpnext/agriculture/doctype/soil_texture/test_soil_texture.py
Python
agpl-3.0
518
#!/usr/bin/env python """ This script is an example of why I care so much about Mozharness' 2nd core concept, logging. http://escapewindow.dreamwidth.org/230853.html """ import os import shutil #print "downloading foo.tar.bz2..." os.system("curl -s -o foo.tar.bz2 http://people.mozilla.org/~asasaki/foo.tar.bz2") #os....
Yukarumya/Yukarum-Redfoxes
testing/mozharness/examples/silent_script.py
Python
mpl-2.0
694
# -*- cording: utf-8 -*- from __future__ import unicode_literals __author__ = "wakita181009" __author_email__ = "wakita181009@gmail.com" __version__ = "0.0.4" __license__ = "MIT"
wakita181009/slack-api-utils
slack_api_utils/__init__.py
Python
mit
180
from django.db.models.lookups import Lookup class HashLookup(Lookup): """Lookup to filter hashed values. `HashLookup` is hashing the value on the right hand side with the function specified in `encrypt_sql`. """ lookup_name = 'hash_of' def as_sql(self, qn, connection): """Responsible...
incuna/django-pgcrypto-fields
pgcrypto/lookups.py
Python
bsd-2-clause
737
#!/usr/bin/env python # reference variable to Storyboard Omnet++ module: board import storyboard import timeline print ("demo.py successfully imported...") def createStories(board): # Create coordinates needed for the PolygonCondition coord0 = storyboard.Coord(0.0, 0.0) coord1 = storyboard.Coord(3000.0, 0.0) coo...
riebl/artery
scenarios/storyboard/demo.py
Python
gpl-2.0
2,014
from django.conf.urls import url, include from . import views app_name = 'accounts' urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^update/$', views.update, name='update'), url(r'^register/$', views.register, name='register'), ]
yayoiukai/signalserver
accounts/urls.py
Python
mit
257
def main(): with open('file.txt'): print(42)
smmribeiro/intellij-community
python/testData/quickFixes/PyRemoveUnusedLocalQuickFixTest/withOneTarget_after.py
Python
apache-2.0
56
# coding: utf-8 """ Katib Swagger description for Katib # noqa: E501 The version of the OpenAPI document: v1beta1-0.1 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubeflow.katib.configuration import Configuration class V1beta1Observatio...
kubeflow/katib
sdk/python/v1beta1/kubeflow/katib/models/v1beta1_observation.py
Python
apache-2.0
3,470
from random import shuffle from clusto.drivers import Controller import libvirt class VMController(Controller): @classmethod def allocate(cls, pool, namemanager, ipmanager, memory, disk, swap, storage_pool='vol0'): ''' Allocate a new VM running on a server in the given pool with enough ...
rongoro/clusto
src/clusto/drivers/controllers/VMController.py
Python
bsd-3-clause
2,014
"""Support for MelCloud device sensors.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import Any from pymelcloud import DEVICE_TYPE_ATA, DEVICE_TYPE_ATW from pymelcloud.atw_device import Zone from homeassistant.components.sensor import ( ...
rohitranjan1991/home-assistant
homeassistant/components/melcloud/sensor.py
Python
mit
6,341
MOVEMENT = { '^': (0, 1), 'v': (0, -1), '<': (-1, 0), '>': (1, 0) } def add_points(p1, p2): return (p1[0] + p2[0], p1[1] + p2[1]) def main(): file_data = '' with open('input.txt', 'r') as f: file_data = f.read().strip() positions = [(0, 0), (0, 0)] visiteds = [[(0, 0)], [(0, 0)]] who = 0 for instruction...
The6P4C/adventofcode
2015/day3/part2.py
Python
gpl-3.0
716
"""Vera tests.""" from unittest.mock import MagicMock import pyvera as pv from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_HS_COLOR from homeassistant.core import HomeAssistant from .common import ComponentFactory, new_simple_controller_config async def test_light( hass: HomeAssistant, vera_com...
partofthething/home-assistant
tests/components/vera/test_light.py
Python
apache-2.0
3,023
"""Tests for Vizio init.""" import pytest from homeassistant.components.media_player.const import DOMAIN as MP_DOMAIN from homeassistant.components.vizio.const import DOMAIN from homeassistant.helpers.typing import HomeAssistantType from homeassistant.setup import async_setup_component from .const import MOCK_SPEAKER...
tboyce021/home-assistant
tests/components/vizio/test_init.py
Python
apache-2.0
2,257
#!/usr/bin/env python # standard library imports import sys import os import subprocess import traceback import logging # KBase imports import biokbase.Transform.script_utils as script_utils def validate(input_directory, working_directory, level=logging.INFO, logger=None): """ Validates any file containing ...
aekazakov/transform
plugins/scripts/validate/trns_validate_Sequence.py
Python
mit
4,346
# songgraph.py (mdb.songgraph) # Copyright (C) 2014-2017 Timothy Woodford. All rights reserved. # Create song-related graph structures from datetime import timedelta import random import networkx as nx def make_play_graph(sdb, grtype=nx.DiGraph): """ Read the play times from sdb and return a NetworkX graph struct...
twoodford/mdb
mdb/songgraph.py
Python
gpl-3.0
5,207
# # 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/heat
heat/engine/resources/openstack/heat/random_string.py
Python
apache-2.0
12,500
from base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '0$ip1fb5xtq%a=)-k_4r^(#jn0t^@+*^kihkxkozg-mip7+w3+' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'sigi', # will be actually used as "test_sigi" by pytest-...
interlegis/sigi
sigi/settings/test.py
Python
gpl-2.0
723
from Controller.CommandController import CommandController from Domain.Discipline import Discipline @CommandController.addCommand( name="addDiscipline", help="Adds a Discipline to the database" ) def addDiscipline(studentCatalogController, disciplineId: int, disciplineName: str): studentCatalogController.a...
Zephyrrus/ubb
YEAR 1/SEM1/FP/LAB/l6-l9/Commands/DisciplineCommands.py
Python
mit
930
from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import NumericProperty from kivy.properties import ObjectProperty from kivy.uix.boxlayout import BoxLayout Builder.load_string(''' #:import light plyer.light <LightInterface>: light: light orientation: 've...
kived/plyer
examples/light/main.py
Python
mit
1,744
# -*- coding: utf-8 -*- class Charset(object): common_name = 'NotoSansCuneiform-Regular' native_name = '' def glyphs(self): glyphs = [] glyphs.append(0x0173) #glyph00371 glyphs.append(0x030A) #glyph00778 glyphs.append(0x030B) #glyph00779 glyphs.append(0x02EB) #...
davelab6/pyfontaine
fontaine/charsets/noto_glyphs/notosanscuneiform_regular.py
Python
gpl-3.0
42,569
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "unshorten.tests.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
bitmazk/django-unshorten
manage.py
Python
mit
259
## # OOIPLACEHOLDER # # Copyright 2014 Raytheon Co. ## __author__ = "mworden" import os from mi.logging import config from mi.dataset.driver.moas.gl.dosta.driver_common import DostaAbcdjmGliderDriver from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.core.versioning import version @version("15...
JeffRoy/mi-dataset
mi/dataset/driver/moas/gl/dosta/dosta_abcdjm_glider_telemetered_driver.py
Python
bsd-2-clause
816
#!/usr/bin/env python # -*- coding: utf-8 -*- """Making a PB & J sandwich.""" from task_01.peanut import BUTTER JELLY = BUTTER
slb6968/is210-week-05-warmup
task_03.py
Python
mpl-2.0
131
import colander from flask import Blueprint, render_template, request, redirect from flask.ext.login import current_user, login_user, logout_user from flask import current_app from sqlalchemy.sql.expression import desc, func, or_ from werkzeug.security import check_password_hash, generate_password_hash from flaskboile...
nathanhilbert/flaskboiler
flaskboiler/views/account.py
Python
agpl-3.0
4,417
from ase import Atoms from gpaw import GPAW from gpaw.utilities.sic import NSCFSIC atoms = ['He','Be'] #,'Ne'] # Ne deviates already 2.5 eV EE = [] EREF = [-79.4,-399.8,-3517.6] for a in atoms: s = Atoms(a) s.center(vacuum=4.0) calc = GPAW(h=0.15, txt=a + '.txt') s.set_calculator(calc) E = s.get_p...
qsnake/gpaw
gpaw/test/nscfsic.py
Python
gpl-3.0
774
# Generated by Django 2.2.16 on 2020-09-23 18:08 from django.db import migrations, models import django_jsonfield_backport.models class Migration(migrations.Migration): dependencies = [ ('reviewers', '0008_auto_20200730_1335'), ] operations = [ migrations.AlterField( model_n...
bqbn/addons-server
src/olympia/reviewers/migrations/0009_auto_20200923_1808.py
Python
bsd-3-clause
483
#!/usr/bin/env python # -*- coding: UTF-8 -*- import io, urllib.request, urllib.error, time, datetime import pandas as pd import sqlite3 import requests from bs4 import BeautifulSoup from tqdm import tqdm # REF [site] >> https://tariat.tistory.com/892 def simple_example_1(): """ 한국거래소 XML 서비스 URL. 1. 실시간시세(국문). ...
sangwook236/SWDT
sw_dev/python/rnd/test/finance/krx_test.py
Python
gpl-3.0
12,724
""" @date 2014-11-16 @author Hong-She Liang <starofrainnight@gmail.com> """ import io import types import time import functools import base64 import copy import rabird.core.cstring as cstring from PIL import Image from selenium.common.exceptions import ( NoSuchElementException, WebDriverException, StaleEle...
starofrainnight/rabird.selenium
rabird/selenium/overrides/webelement.py
Python
apache-2.0
14,878
#!/usr/bin/env python # # This work is licensed under the GNU GPLv2 or later. # See the COPYING file in the top-level directory. # create.py: Create a new bug report from __future__ import print_function import time import bugzilla # public test instance of bugzilla.redhat.com. # # Don't worry, changing things her...
wgwoods/python-bugzilla
examples/create.py
Python
gpl-2.0
1,528
import numpy as np from sympy import Rational as frac from sympy import sqrt from ..helpers import article, expand_symmetries, fsd, untangle, z from ._helpers import CnScheme _source = article( authors=["Preston C. Hammer", "Arthur H. Stroud"], title="Numerical Evaluation of Multiple Integrals II", journa...
nschloe/quadpy
src/quadpy/cn/_hammer_stroud.py
Python
mit
1,048
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016 CERN. # # Zenodo 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...
tiborsimko/zenodo
tests/unit/deposit/test_minters.py
Python
gpl-2.0
4,994
import gzip import math import numpy as np class Renderer: def reset(self): self.fmt = getvar('pixel_buffer_format') self.width = int(getvar('pixel_buffer_width')) self.height = int(getvar('pixel_buffer_height')) self.period = getvar('period') with gzip.open('background....
mworks/mworks
examples/Tests/Stimulus/PythonImage/image_gen.py
Python
mit
1,385
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ## # 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 # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show th...
alexandermendes/pybossa-discourse
docs/conf.py
Python
bsd-3-clause
9,364
# -*- coding: utf-8 -*- from django.conf.urls import include, url from django.contrib import admin from DingDingCater import settings import django.views.static as ds from blog.views import page_index, page_article, page_category, ajax_praiseCnt, upload_image urlpatterns = [ # static file router # after inser...
hippowon/DingDingCater
DingDingCater/urls.py
Python
gpl-3.0
1,016
#!/usr/bin/python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai """ Get word, character, and Asian character counts 1. Get a word count as a dictionary: wc = get_wordcount(text) words = wc['words'] # etc. 2. Get a word count as an object wc = get_wordcount_obj(text) words = wc.words # etc. prop...
ashang/calibre
src/calibre/utils/wordcount.py
Python
gpl-3.0
2,390
from electrum_rby.plugins import BasePlugin, hook from electrum_rby_gui.qt.util import WaitingDialog, EnterButton from electrum_rby.util import print_msg, print_error from electrum_rby.i18n import _ from PyQt4.QtGui import * from PyQt4.QtCore import * import traceback import zlib import json from io import BytesIO im...
justinvforvendetta/electrum-rby
plugins/audio_modem.py
Python
gpl-3.0
4,480
from direct.gui.OnscreenImage import OnscreenImage from panda3d.core import TransparencyAttrib from direct.gui.DirectGui import DirectButton from core.game import Game import sys class MainMenu: def __init__(self): self.background = None self.newGameButton = None self.optionsButton = No...
mzdravkov/comori
main_menu.py
Python
mit
2,386
# -*- coding: UTF-8 -*- import datetime from django.core.mail import EmailMessage from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse_lazy from django.views.generic import FormView, TemplateView, ListView, DetailView from .forms import RegForm from .models import Event, Person, R...
hacklab-fi/hhlevents
hhlevents/apps/hhlregistrations/views.py
Python
bsd-3-clause
5,623
from c2corg_api.models.article import Article, ArchiveArticle, ARTICLE_TYPE from c2corg_api.models.document import DocumentLocale, ArchiveDocumentLocale, \ DOCUMENT_TYPE from c2corg_api.scripts.migration.documents.document import MigrateDocuments, \ DEFAULT_QUALITY from c2corg_api.scripts.migration.documents.ro...
c2corg/v6_api
c2corg_api/scripts/migration/documents/articles.py
Python
agpl-3.0
3,724
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-01 22:28 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('zerver', '0050_userprofile_avatar_version'), ('analytics', '0007_remove_interval'), ] operations = [ migrations.Alte...
Galexrt/zulip
analytics/migrations/0008_add_count_indexes.py
Python
apache-2.0
744
#!/usr/bin/env python # # Copyright (c) 2018 Cloudify Platform Ltd. 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 #...
cloudify-incubator/cloudify-utilities-plugin
cloudify_scalelist/examples/scripts/tree_update.py
Python
apache-2.0
1,283
# -*- coding: utf-8 -*- # -*- mode: python -*- import time class Ticker(object): def __init__(self): self.lasttick = 0 def elapsed(self, tick=True) -> int: now = time.monotonic() ltick = self.lasttick if tick: self.lasttick = now if ltick > 0: re...
waipu/bakawipe
lib/sup/ticker.py
Python
gpl-3.0
520
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Nicira, 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 #...
anbangr/trusted-nova
nova/tests/test_libvirt_vif.py
Python
apache-2.0
6,112
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from azure...
Azure/azure-sdk-for-python
sdk/communication/azure-communication-chat/tests/helper.py
Python
mit
855
#quest by zerghase import sys from com.l2scoria import Config from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest qn = "42_HelpTheUncle" WATERS=30828 SOPHYA=30735 TRIDENT=291 MAP...
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/42_HelpTheUncle/__init__.py
Python
gpl-3.0
3,707
#!/usr/bin/env python import datetime import logging import os import re from urllib.parse import urljoin from utils import utils, inspector, admin # https://www.si.edu/OIG archive = 2003 # options: # standard since/year options for a year range to fetch from. # # Notes for IG's web team: # # The general strateg...
divergentdave/inspectors-general
inspectors/smithsonian.py
Python
cc0-1.0
11,701
# -*- encoding: utf-8 -*- """ Cross-validation. :copyright: (c) 2016 H2O.ai :license: Apache License Version 2.0 (see LICENSE for details) """ from __future__ import absolute_import, division, print_function, unicode_literals from h2o.utils.compatibility import * # NOQA class H2OPartitionIterator(object): def...
jangorecki/h2o-3
h2o-py/h2o/cross_validation.py
Python
apache-2.0
2,183
#i/usr/bin/env python import os,sys,time #get network RX,TX def rxtxFunction(): fileName='/proc/net/dev' try: fd=open(fileName) except IOError, e: print e exit(1) content=((fd.read()).replace(':',': ')).split('\n') rxTotal=0 txTotal=0 for item in content: if ...
linwanggm/script
net.py
Python
gpl-2.0
1,294
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors # See license.txt import unittest import frappe test_records = frappe.get_test_records('Monthly Distribution') class TestMonthlyDistribution(unittest.TestCase): pass
mhbu50/erpnext
erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py
Python
gpl-3.0
258
"""Script to read ARIS utility billing data via the ARIS API and transform the data into a format that can be processed by the Fairbanks North Star Borough (FNSB) benchmarking script. The output of this script is a CSV file containing a record for each fuel purchase for a building, placed in the data subdirectory wi...
alanmitchell/fnsb-benchmark
read_aris.py
Python
mit
9,257
#!/usr/bin/python #my_subnet = input("Enter Subnet address:") my_ip = "192.168.1.100" my_subnet = "255.255.255.0" ip = my_ip.split(".") print ip # Check the validity of the ip address while True: #my_ip = input("Enter a ip address:") if int(ip[0]) <= 223 and (int(ip[1]) != 169 or int(ip[2]) != 254) and (int(ip[...
hiteshagrawal/python
networking/subnet-cal.py
Python
gpl-2.0
620
from gwpy.timeseries import TimeSeriesDict
gwpy/gwpy.github.io
docs/v0.5/examples/timeseries/blrms-1.py
Python
gpl-3.0
42
#!/usr/bin/env python # # Copyright 2011 Facebook # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
norus/procstat-json
tornado/process.py
Python
gpl-3.0
9,841
# -*- coding: utf-8 -*- ############################################################################## # # Authors: Adrien Peiffer # Copyright (c) 2015 Acsone SA/NV (http://www.acsone.eu) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
open-synergy/account-closing
account_invoice_accrual/company.py
Python
agpl-3.0
1,152
import string from numpy import log import startup, subject_info from models import CompleteEnrollmentData, SubjectInfo """ Find classes that are most similar to the given keywords """ def keyword_similarity(user_keywords): stop_list = set('for a of also by the and to in on as at from with but how about such eg ...
lchu94/classfinder
recommender/keyword_similarity.py
Python
mit
1,585
""" Premium Question """ __author__ = 'Daniel' """ This is the interface that allows for creating nested lists. You should not implement it, or speculate about its implementation """ class NestedInteger(object): def __init__(self, value=None): """ If value is not specified, initializes an empty ...
algorhythms/LeetCode
364 Nested List Weight Sum II.py
Python
mit
3,219
""" WSGI config for soundphy project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
Soundphy/soundphy
soundphy/wsgi.py
Python
bsd-3-clause
393
# ///////////////////////////////////////////////////////////////////// # # decode.py : decode DOM/FAWS/SerialID... to readable physical units # # # # # # # # //////////////////////////////////////////////////////////////////// import binascii from ctypes import create_string_buffer from math import log10 __author__...
ocpnetworking-wip/oom
oom/decode.py
Python
mit
13,945
from __future__ import print_function from classifier import get_baseline, get_power, get_ksqi, get_pursqi from fastdtw import fastdtw from scipy.spatial.distance import euclidean from scipy.stats import entropy from datetime import datetime from copy ...
MIT-LCP/false-alarm-reduction
pyfar/ventricular_beat_stdev.py
Python
mit
18,573
from abaqus import * from abaqusConstants import * from regionToolset import Region def model_create( mdb, model ): mdb.Model( model.name) class AModel(object): def __init__( self ): self.amodel = amodel print 'CYLINDER MODULE' backwardCompatibility.setValues(includeDeprecated=True, reportDeprec...
saullocastro/mapy
mapy/writer/abaqus.py
Python
bsd-2-clause
6,543
from abc import ABCMeta, abstractmethod from ..operator_tools import hilbert_subspace_index from ..utils import copy_with_new_cache, inspect_repr class DynamicalModel(object): """ Abstract base class defining the DynamicalModel API used by spectroscopy simulation methods A DynamicalModel instance co...
shoyer/qspectra
qspectra/dynamics/base.py
Python
bsd-2-clause
6,614
from django.contrib import admin from custom.m4change.models import McctStatus class McctStatusAdmin(admin.ModelAdmin): model = McctStatus list_display = ('form_id', 'status', 'domain', 'reason', 'received_on', 'registration_date', 'immunized', 'is_booking', 'modified_on', 'user') search_fields = ('form_i...
SEL-Columbia/commcare-hq
custom/m4change/admin.py
Python
bsd-3-clause
374
import fileinput import os import sys log_phrase = 'total counts from' for line in fileinput.input("/tmp/d3s_manager.log"): if log_phrase in line: sys.exit() else: os.system('sudo reboot')
tybtab/dosenet-raspberrypi
d3s_monitor.py
Python
mit
220
#------------------------------------------------------------------------------- # elftools tests # # Karl Vogel (karl.vogel@gmail.com) # Eli Bendersky (eliben@gmail.com) # # This code is in the public domain #------------------------------------------------------------------------------- import unittest import os fro...
pombredanne/pyelftools
test/test_mips_support.py
Python
unlicense
1,223
#!/usr/bin/env python """This modules contains tests for AFF4 API renderers.""" from grr.gui import api_test_lib from grr.gui.api_plugins import aff4 as aff4_plugin from grr.lib import aff4 from grr.lib import flags from grr.lib import test_lib class ApiAff4RendererTest(test_lib.GRRBaseTest): """Test for ApiAff...
pombredanne/grr
gui/api_plugins/aff4_test.py
Python
apache-2.0
3,171
# Implements I/O over asynchronous sockets from time import time from sys import exc_info from traceback import format_exception from asyncore import socket_map from asyncore import loop from pysnmp.carrier.base import AbstractTransportDispatcher from pysnmp.error import PySnmpError class AsynsockDispatcher(AbstractTr...
BoundaryDev/boundary-plugin-mongodb-enterprise-dev
pysnmp/carrier/asynsock/dispatch.py
Python
apache-2.0
1,605
# # Martin Gracik <mgracik@redhat.com> # # Copyright 2009 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. This program is distributed in the hope that it # will be use...
bcl/pykickstart
tests/commands/user.py
Python
gpl-2.0
5,559
# -*- coding: utf-8 -*- import unittest from unittest import TestCase import boto.s3.connection from boto.s3.key import Key import urllib, urllib2 import StringIO s3_cred = { 'host': 'precise64', 'port': 8000, #'port': 80, 'access_key':'4WLAD43EZZ64EPK1CIRO', 'secret_...
DreamLab/ngx_aws_auth
tests/test.py
Python
bsd-2-clause
6,274
from django.contrib.gis.db.backends.base.features import BaseSpatialFeatures from django.db.backends.mysql.features import ( DatabaseFeatures as MySQLDatabaseFeatures, ) from django.utils.functional import cached_property class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures): has_spatialrefsys_ta...
elena/django
django/contrib/gis/db/backends/mysql/features.py
Python
bsd-3-clause
1,481
# -*- encoding: utf-8 from sqlalchemy.testing import eq_ from sqlalchemy import * from sqlalchemy import types, schema, event from sqlalchemy.databases import mssql from sqlalchemy.testing import fixtures, AssertsCompiledSQL, \ ComparesTables from sqlalchemy import testing from sqlalchemy.engine.reflection impo...
wfxiang08/sqlalchemy
test/dialect/mssql/test_reflection.py
Python
mit
8,234
# 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. DEPS = [ 'recipe_engine/buildbucket', 'recipe_engine/context', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recip...
endlessm/chromium-browser
third_party/depot_tools/recipes/recipe_modules/git/examples/full.py
Python
bsd-3-clause
5,942
import itertools from gooey import source_parser, code_prep import tempfile __author__ = 'Chris' """ Pretty Printing util for inspecting the various ast objects """ import ast from _ast import Assign, Call def pretty_print(node, indent): d = node.__dict__ for k, v in d.iteritems(): if isinstan...
garrettcap/Bulletproof-Backup
gooey/dev_utils/ast_inspector.py
Python
gpl-2.0
2,590
import numpy as np from scipy import sparse from scipy.integrate import odeint import matplotlib.pyplot as plt import math as mt # this is the transfer function def phi(x,theta,uc): myphi=nu*(x-theta) myphi[x>uc]=nu*(uc-theta) myphi[theta>x]=0. return myphi def phi_brunel(x,theta,uc): myphi=nu_brunel*((x-theta...
ulisespereira/LearningSequences
fixedConnectivity/popModel/sequences_random.py
Python
gpl-2.0
4,644
from __future__ import absolute_import from django.core import serializers from ajax.exceptions import AlreadyRegistered, NotRegistered from django.db.models.fields import FieldDoesNotExist from django.db import models from django.conf import settings from django.utils.html import escape from django.db.models.query imp...
psu-oit/django-ajax
ajax/encoders.py
Python
bsd-3-clause
5,422
import inspect import re from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.utils.module_loading import import_by_path from django.middleware.csrf import rotate_token from .signals import user_logged_in, user_logged_out, user_login_failed SESSION_KE...
AlexHill/django
django/contrib/auth/__init__.py
Python
bsd-3-clause
5,569
""" Serializer for video outline """ from edxval.api import ValInternalError, get_video_info_for_course_and_profiles from rest_framework.reverse import reverse from courseware.access import has_access from courseware.courses import get_course_by_id from courseware.model_data import FieldDataCache from courseware.modul...
teltek/edx-platform
lms/djangoapps/mobile_api/video_outlines/serializers.py
Python
agpl-3.0
9,122
from collections import OrderedDict import time from itertools import islice import threading import weakref from contextlib import contextmanager def lru_cache_function(max_size=1024, expiration=15*60, **kwargs): """ >>> @lru_cache_function(max_size=3, expiration=1) ... def f(x): ... print("Calling...
stucchio/Python-LRU-cache
lru/__init__.py
Python
gpl-3.0
7,735
#!/usr/bin/python import commons from espeak import espeak import mosquitto import subprocess from os import listdir import random from os.path import join from twython import Twython import ConfigParser #import time import moc import math from datetime import * from pytz import timezone import calendar from dateutil.r...
irzaip/cipi
cp_speak.py
Python
lgpl-3.0
7,663
from Application import app app.run(debug=True)
MishaGarbuz/WinVault
app.py
Python
mit
48
# -*- coding: utf-8 -*- #from django_tables2.utils import A # alias for Accessor #from django.db.models import Sum from django_tables2_reports.tables import TableReport import django_tables2 as tables from core.models import * from seafood.models import * from genotype.models import * class ObTable(TableReport): ...
hdzierz/Kaka
web/tables.py
Python
gpl-2.0
818
# -*- coding: utf-8 -*- import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tests', '0047_restaurant_tags'), ] operations = [ migrations.CreateModel( name='ImportantPages', fields=[ ...
zerolab/wagtail
wagtail/tests/testapp/migrations/0048_importantpages.py
Python
bsd-3-clause
1,135
#! /usr/bin/env python3 """ pcom.py test cases """ import os import unittest import shutil from utils import pcom class TestGenCfg(unittest.TestCase): """test case class for gen_cfg function""" def setUp(self): self.tmp_cfg1_file = "/tmp/test_pcom1.cfg" self.tmp_cfg2_file = "/tmp/test_pcom2.cf...
cmos3511/cmos_linux
python/op/op/tests/test_pcom.py
Python
gpl-3.0
4,016
# -*- coding:utf-8 -*- ''' Create an unified test_stub for E2E test operations @author: Legion ''' import os import re import time import types import random import socket import xml.dom.minidom as minidom from os.path import join from zstackwoodpecker.e2e_lib import E2E import zstackwoodpecker.operations.resource_o...
zstackio/zstack-woodpecker
integrationtest/vm/e2e_mini/test_stub.py
Python
apache-2.0
38,710
""" System tests for `jenkinsapi.jenkins` module. """ import time import logging import pytest from jenkinsapi.build import Build from jenkinsapi.queue import QueueItem from jenkinsapi_tests.test_utils.random_strings import random_string from jenkinsapi_tests.systests.job_configs import LONG_RUNNING_JOB from jenkinsapi...
salimfadhley/jenkinsapi
jenkinsapi_tests/systests/test_invocation.py
Python
mit
3,914
""" MAUS worker utilities. """ # This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus # # MAUS 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 # (a...
mice-software/maus
src/common_py/framework/workers.py
Python
gpl-3.0
7,931
import json import datetime import shlex import os import urllib import urllib2 import urlparse import random import string import logging import pprint import distutils.version import sqlalchemy from sqlalchemy.exc import (ProgrammingError, IntegrityError, DBAPIError, DataError) import psy...
sciamlab/ckanext-lait
custom/ckan/ckanext/datastore/db.py
Python
apache-2.0
40,892
def print_rangoli(size): # your code goes here if __name__ == '__main__': n = int(input()) print_rangoli(n)
jerodg/hackerrank-python
python/02.Strings/10.AlphabetRangoli/template.py
Python
mit
118
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
flgiordano/netcash
+/google-cloud-sdk/lib/googlecloudsdk/api_lib/dns/util.py
Python
bsd-3-clause
2,739
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-12 11:45 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0155_auto_20190205_1344'), ] operations =...
dchaplinsky/pep.org.ua
pepdb/core/migrations/0156_auto_20190512_1445.py
Python
mit
3,445
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para netload # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re from core import logger def get_video_url( page...
ChopChopKodi/pelisalacarta
python/main-classic/servers/netload.py
Python
gpl-3.0
1,786
"""Test using colorlog with logging.config""" import logging import logging.config import os.path def path(filename): """Return an absolute path to a file in the current directory.""" return os.path.join(os.path.dirname(os.path.realpath(__file__)), filename) def test_build_from_file(test_logger): loggi...
borntyping/python-colorlog
colorlog/tests/test_config.py
Python
mit
1,247
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
google/gfw-toolkit
toolkit/tests/directory_api_users_delete_user_test.py
Python
apache-2.0
1,930
# -*- coding: utf-8 -*- # Copyright 2016 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Fleet Work Order Cargo", "version": "8.0.2.0.0", "category": "Fleet", "website": "https://opensynergy-indonesia.com/", "author": "OpenSynergy Indonesia", "lic...
open-synergy/opensynid-fleet
fleet_work_order_cargo/__openerp__.py
Python
agpl-3.0
590
"""Adds a simulated sensor.""" from datetime import datetime import math from random import Random import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity impor...
sdague/home-assistant
homeassistant/components/simulated/sensor.py
Python
apache-2.0
4,535
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly)...
goku1997/bitcoin
qa/rpc-tests/rawtransactions.py
Python
mit
5,874
from distutils.core import setup setup( name='tgboost', version='1.0', description='tiny gradient boosting tree', author='wepon', author_email='wepon@pku.edu.cn', url='http://wepon.me', packages=['tgboost'], package_data={'tgboost': ['tgboost.jar']}, package_dir={'tgboost': 'tgboost...
wepe/tgboost
python-package/setup.py
Python
mit
326
from git.config import SectionConstraint from git.util import join_path from git.exc import GitCommandError from .symbolic import SymbolicReference from .reference import Reference __all__ = ["HEAD", "Head"] class HEAD(SymbolicReference): """Special case of a Symbolic Reference as it represents the repository'...
avinassh/GitPython
git/refs/head.py
Python
bsd-3-clause
8,539