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 -*- # import qrcode try: #pylint: disable = E, W, R, C from PyQt6.QtGui import QImage, QPixmap,QPainter # @UnusedImport @Reimport @UnresolvedImport from PyQt6.QtCore import Qt # @UnusedImport @Reimport @UnresolvedImport except Exception: #pylint: disable = E, W, R, C from PyQ...
artisan-roaster-scope/artisan
src/artisanlib/qrcode.py
Python
gpl-3.0
1,715
import cv2 import numpy as np from matplotlib import pyplot as plt from time import sleep from camera import Camera from front_camera import FrontCamera from rear_camera import RearCamera run_front = True run_rear = True white = (255, 255, 255) black = (0, 0, 0) if run_front: front_camera = Camera(src=1) fr...
jbpacker/lolcam
run.py
Python
mit
938
import logging try: import torch from transformers import pipeline except ImportError: # No installation required if not using this function pass from nlpaug.model.lang_models import LanguageModels class FmTransformers(LanguageModels): def __init__(self, model_path='bert-base-uncased', model_typ...
makcedward/nlpaug
nlpaug/model/lang_models/fill_mask_transformers.py
Python
mit
3,614
import unittest import os import copy import scipy import SloppyCell.Utility as Utility from SloppyCell.ReactionNetworks import * import SloppyCell.daskr from SloppyCell.daskr import daeint # Load the fast reaction example from the SBML semantic test suite. # To avoid extra dependencies on libsbml, we use verions bu...
GutenkunstLab/SloppyCell
test/test_crossReferences.py
Python
bsd-3-clause
4,044
# Copyright (c) 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
sajuptpm/murano
murano/utils.py
Python
apache-2.0
4,377
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
kogotko/carburetor
horizon/middleware/base.py
Python
apache-2.0
9,397
# Authors: Chris Holdgraf <choldgraf@gmail.com> # # License: BSD (3-clause) import os.path as op import pytest import numpy as np from numpy import einsum from numpy.fft import rfft, irfft from numpy.testing import assert_array_equal, assert_allclose, assert_equal from mne.utils import requires_sklearn from mne.deco...
rkmaddox/mne-python
mne/decoding/tests/test_receptive_field.py
Python
bsd-3-clause
22,664
# -*- coding: utf-8 -*- ############################################################################### # # SegmentationForVisitorsTodayViaSearch # Retrieves segmentation data for visitors today who arrived via a search. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache Li...
jordanemedlock/psychtruths
temboo/core/Library/Clicky/SegmentationForVisitorsTodayViaSearch.py
Python
apache-2.0
4,690
# simpleSQL.py # # simple demo of using the parsing library to do simple-minded SQL parsing # could be extended to include where clauses etc. # # Copyright (c) 2003, Paul McGuire # from pyparsing import Literal, CaselessLiteral, Word, Upcase, delimitedList, Optional, \ Combine, Group, alphas, nums, alphanum...
dbbhattacharya/kitsune
vendor/packages/pyparsing/examples/simpleSQL.py
Python
bsd-3-clause
4,698
#******************************************************************************** #-------------------------------------------------------------------------------- # # Significance Labs # Brooklyn, NYC # # Author: Alexandra Berke (aberke) # Written: Summer 2014 # # # # util file # # #---------------------------------...
cromulus/check-list
app/lib/util.py
Python
mit
3,902
#!/usr/bin/env python # encoding: utf-8 """ Created by Jeff Verkoeyen on 2011-06-07. Copyright 2011 Jeff Verkoeyen 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/...
jyotiness/ARTSDK
thirdparty/nimbus/scripts/ios/__init__.py
Python
mit
747
#/###################/# # Import modules # #ImportModules import ShareYourSystem as SYS #/###################/# # Build the model # #Define MyTransferer=SYS.TransfererClass( ).stationarize( _MeanWeightVariable=[ [0.,-10.], [10.,0.] ], _RateVariable = [5.,5.], _InteractionStr = "Spike" ).stabilize( ...
Ledoux/ShareYourSystem
Pythonlogy/ShareYourSystem/Specials/_Lifers/Transferer/tests/test_13_transfer_lif_ExampleCell.py
Python
mit
480
# Generated by Django 2.2.13 on 2020-07-06 15:28 from __future__ import unicode_literals from django.db import migrations import re PERMISSIONS = ['view', 'add', 'change', 'delete'] MODELS = {'core': ['Annotation', 'Attachment', 'Build', 'Environment', ...
Linaro/squad
squad/core/migrations/0131_create_squad_auth_group_and_add_users.py
Python
agpl-3.0
2,033
import sys import os import inspect from PyQt5 import QtWidgets, QtCore, QtGui import plugnplay from uptime import boottime from TardisUtil import TardisOptions, TimeSubmitter class TardisDiff(QtWidgets.QMainWindow): def __init__(self): super(TardisDiff, self).__init__() self.difference = 0 ...
git-commit/TardisDiff
TardisDiff.py
Python
isc
4,981
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # 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...
f3at/feat
src/feat/models/applicationjson.py
Python
gpl-2.0
14,537
from mdt import CompartmentTemplate, FreeParameterTemplate from mdt.model_building.parameter_functions.transformations import ScaleTransform __author__ = 'Robbert Harms' __date__ = "2015-06-21" __maintainer__ = "Robbert Harms" __email__ = "robbert@xkls.nl" class TimeDependentZeppelin(CompartmentTemplate): """Imp...
cbclab/MDT
mdt/data/components/standard/compartment_models/TimeDependentZeppelin.py
Python
lgpl-3.0
1,598
""" Functions provided to user for saving / loading / combining times data objects. """ from __future__ import absolute_import from timeit import default_timer as timer try: import cPickle as pickle except: import pickle import copy # import mmap # import os from gtimer.private import focus as f from gtimer.p...
astooke/gtimer
gtimer/public/io.py
Python
mit
9,738
# coding=utf-8 # Copyright 2022 The TensorFlow Datasets Authors. # # 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 appl...
tensorflow/datasets
tensorflow_datasets/image_classification/binary_alpha_digits_test.py
Python
apache-2.0
998
import os from setuptools import setup, find_packages requirements_file = open('%s/requirements.txt' % os.path.dirname(os.path.realpath(__file__)), 'r') install_requires = [line.rstrip() for line in requirements_file] base_dir = os.path.dirname(os.path.abspath(__file__)) setup( name="pyhttp", version="1.0.0"...
felixcarmona/pyhttp
setup.py
Python
mit
875
# -*- encoding: utf8 -*- # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2017 Marek Marczykowski-Górecki # <marmarek@invisiblethingslab.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # ...
woju/qubes-core-admin
qubes/ext/block.py
Python
lgpl-2.1
11,039
#!/usr/bin/env python import logging import os import runpy import shutil import sys import textwrap import argparse import config from path import path import utils # Be a good neighbour. if sys.platform == 'win32': GLOBAL_CONFIG_FILE = 'tipfy.cfg' else: GLOBAL_CONFIG_FILE = '.tipfy.cfg' MISSING_GAE_SDK_MS...
adilhz/tipfy
manage/__init__.py
Python
bsd-3-clause
20,992
from flask_testing import TestCase from project import create_app, logger, db import os import logging app = create_app() class BaseTestCase(TestCase): def create_app(self): app.config.from_object('config.TestingConfig') logger.setLevel(logging.ERROR) return app def setUp(self): ...
Radu-Raicea/Stock-Analyzer
flask/tests/base_database_test.py
Python
bsd-3-clause
467
# -*- coding: utf-8 -*- # # This file is part of CERN Document Server. # Copyright (C) 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your opti...
CERNDocumentServer/cds-sorenson
cds_sorenson/ext.py
Python
gpl-2.0
2,551
#!/usr/bin/env python3 # -*- coding: utf-8 -* # Supervisor process - reads config.yaml and checks services # installation on Ubuntu # sudo apt-get install python3-yaml # sudo pip3 install paho-mqtt # # or (if running python 2.7): # sudo apt-get install python-yaml # sudo pip install paho-mqtt # + backport of ipaddress...
mkalus/mqtt-supervisor
mqtt_supervisor.py
Python
mit
2,529
import traceback class DbUtils(object): #FIXME change to plugin style and read query from custom config files db = None db_conn = None def __init__(self, db): self.db = db def __del__(self): # dtor if self.db_conn: self.db_conn.close() def ...
hsrky/pythoninfo
pythoninfo/lib/db_utils.py
Python
mit
1,831
#!/usr/bin/python3 #coding=utf-8 ''' ************************** * File Name :base_line.py * Author:Charlley88 * Mail:charlley88@163.com ************************** ''' import sys sys.path.append('..') import insummer from insummer.query_expansion.entity_finder import NgramEntityFinder from insummer.summarization.l...
lavizhao/insummer
code/exp/base_line.py
Python
mit
1,195
# -*- coding: utf-8 -*- import pytest import mock from itertools import combinations from biseqt.sequence import Alphabet from biseqt.stochastics import rand_seq, MutationProcess, rand_read from biseqt.stochastics import np # to mock def test_rand_seq(): _bak = np.random.choice np.random.choice = mock.Mock(...
amirkdv/biseqt
tests/test_stochastics.py
Python
bsd-3-clause
4,450
from httprpc.client import Client a = Client("http://127.0.0.1:8000", username='a', password='a') print a.hello(a=1, b=1) print a.demo.hello(a=1, b=1)
ya790206/httprpc-python
client.py
Python
apache-2.0
152
from mxl import MXLFile import fileinput SEP = ',' COLUMNS = ( 'time.upper', 'time.lower', 'key.fifths', 'maj.min', 'melody.staff.1', 'melody.staff.2', 'num.dynamic.changes', 'A', 'B', 'C', 'D', 'E', 'F', 'G', '16th', 'eighth', 'half', 'quarter', ...
themichaellai/musicxml-stats
output.py
Python
mit
2,098
''' Kivy standard library imports ''' import kivy from kivy.config import Config #kivy.config.Config.set('graphics','resizable', False) #config needs to be set before kivy.app is imported Config.set('graphics', 'fullscreen', 'auto') from kivy.app import App from time import time from os.path import dirname, join from...
LBCC-SpaceClub/HAB2017
AntennaTracker/data/libs/Dependencies.py
Python
mit
1,235
import logging import markdown from flask import Markup from flask import render_template from sqlalchemy import text, column from pajbot.managers.db import DBManager from pajbot.models.user import User from pajbot.models.webcontent import WebContent from pajbot.modules import ChattersRefreshModule log = logging.get...
pajlada/pajbot
pajbot/web/routes/base/points.py
Python
mit
2,923
#!/usr/bin/env python a = [5, 3, 6, 4, 1, 2, 0, 8, 9] class Node(object): def __init__(self, value, left, right): self.value, self.left, self.right = value, left, right def __repr__(self): return str(self.value) class BTree(object): def __init__(self, value): self.root_node = N...
Ramyak/CodingPractice
algo_practice/sort/binary_search.py
Python
gpl-2.0
4,558
import unittest import src.vector_gen.generateWeatherVectors as gwv import pandas as pd from test import test_path as path class GenerateWeatherVectorsTest(unittest.TestCase): trajectories_df = None weather_df = None def setUp(self): self.trajectories_df = pd.read_csv(path.trajectories_training_...
Superchicken1/SambaFlow
python/traffic-prediction/test/test_generateWeatherVectors.py
Python
apache-2.0
935
# ============================================================================= # COPYRIGHT 2013 Brain Corporation. # License under MIT license (see LICENSE file) # ============================================================================= import logging import os import platform from utility import run_shell, cp, ...
braincorp/robustus
robustus/detail/install_openni.py
Python
mit
4,406
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This tool helps you to rebase package to the latest version # Copyright (C) 2013-2014 Red Hat, 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 # he Free Software Foundat...
uhliarik/rebase-helper
setup.py
Python
gpl-2.0
3,564
# Python3 def allLongestStrings(inputArray): maxLen = max(len(s) for s in inputArray) return [ s for s in inputArray if len(s) == maxLen ]
RevansChen/online-judge
Codefights/arcade/intro/level-3/9.All-Longest-Strings/Python/solution1.py
Python
mit
148
# -*- coding: utf-8 -*- """ Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U This file is part of fiware-pep-steelskin fiware-pep-steelskin is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, eithe...
agroknow/fiware-pep-steelskin
test/acceptance/tools/deploy_pep.py
Python
agpl-3.0
11,656
#!/usr/bin/env python # -*- coding:utf8 -*- from __future__ import print_function import sys from os.path import dirname, abspath import nose def run_all(argv=None): sys.exitfunc = lambda: sys.stderr.write('Shutting down....\n') # always insert coverage when running tests if argv is None: argv...
NetEase-Object-Storage/nos-python-sdk
test_nos/run_tests.py
Python
mit
707
#!/usr/bin/env python #coding:utf-8 # Purpose: cell spanning controller # Created: 13.02.2011 # Copyright (C) 2011, Manfred Moitzi # License: MIT license from __future__ import unicode_literals, print_function, division __author__ = "mozman <mozman@gmx.at>" from .xmlns import wrap from .tableutils import iter_cell_ran...
chalbersma/btcaddrtocsv
ezodf/cellspancontroller.py
Python
lgpl-2.1
2,749
import logging from xml.etree import ElementTree as etree from xml.parsers import expat try: from oslo_serialization import jsonutils except ImportError: from oslo.serialization import jsonutils from builtins import int import six from . import constants from . import exceptions as exception from ..i18n impo...
nttcom/eclcli
eclcli/network/networkclient/common/serializer.py
Python
apache-2.0
11,379
"""Copyright (C) 2013 COLDWELL AG 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...
MoroGasper/client
client/account/__init__.py
Python
gpl-3.0
4,393
# -*- coding: utf-8 -*- """Tools for visualizing ADCP data that is read and processed by the adcpy module This module is imported under the main adcpy, and should be available as adcpy.plot. Some methods can be used to visualize flat arrays, independent of adcpy, and the plots may be created quickly using the IPanel a...
esatel/ADCPy
adcpy/adcpy_plot.py
Python
mit
27,568
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>) # # Thi...
VitalPet/c2c-rd-addons
sale_order_2_purchase/invoice.py
Python
agpl-3.0
1,994
#!/usr/bin/python """Simple server that listens on port 6000 and echos back every input to the client. Connect to it with: telnet localhost 6000 Terminate the connection by terminating telnet (typically Ctrl-] and then 'quit'). """ import gevent from gevent.server import StreamServer def discard(socket, address): ...
smurfix/HomEvenT
test/scripts/wago_job.py
Python
gpl-3.0
772
from bin_heap import binHeap import pytest import random def test_empty_heap(): blist = binHeap() assert blist.heap == [0] def test_push_pop(): blist = binHeap() blist.push(123) assert blist.pop() == 123 def all_list(heap): value_input = [] while True: try: value_inp...
alibulota/data-structures
test_bin_heap.py
Python
mit
582
"""CLI tests for Repository setup. :Requirement: Repository :CaseAutomation: Automated :CaseLevel: Component :CaseComponent: Repositories :TestType: Functional :CaseImportance: High :Upstream: No """ import pytest from robottelo.cli.factory import ( make_lifecycle_environment, make_org, ) from robottelo...
ldjebran/robottelo
tests/foreman/cli/test_vm_install_products_package.py
Python
gpl-3.0
2,762
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='pytest-yapf', version='0.1.1', author='Roman Osipenk...
django-stars/pytest-yapf
setup.py
Python
mit
1,383
# Copyright 2014 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Continuous Integration Database Library.""" import glob import logging import os import re import sqlalchemy from chromite.cbuildbot import constants...
chadversary/chromiumos.chromite
lib/cidb.py
Python
bsd-3-clause
6,868
# Copyright 2018, 2020, 2021 Smithsonian Astrophysical Observatory # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this list of conditions an...
anetasie/sherpa
sherpa/models/tests/test_regrid.py
Python
gpl-3.0
16,594
"""WSGI Components This module implements WSGI Components. """ try: from urllib.parse import unquote except ImportError: from urllib import unquote # NOQA from operator import itemgetter from traceback import format_tb from types import GeneratorType from sys import exc_info as _exc_info from circuits.tool...
treemo/circuits
circuits/web/wsgi.py
Python
mit
6,348
# -*- coding: UTF-8 -*- """Module for defining report element classes. """ import numpy as np import pandas as pd from .base import * __all__ = __features__ = ["Code", "Footer", "Header", "Table", "Section", "Text", "Title"] HEAD_CSS = "@%(pos)s-left{%(left)s};@%(pos)s-center{%(center)s};...
dhondta/tinyscript
tinyscript/report/objects.py
Python
agpl-3.0
5,115
#!/usr/bin/env python class DiscUsage(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.""" def __init__(self): """ Attributes: swaggerTypes (dict): The key is attribute name and the value is attribute type. ...
imranwar/AsposeStoragePHP
SDKs/Aspose.Storage_Cloud_SDK_For_Python/asposestoragecloud/models/DiscUsage.py
Python
mit
713
#!/usr/bin/python #============================ adjust path ===================================== import sys import os if __name__ == '__main__': here = sys.path[0] sys.path.insert(0, os.path.join(here, '..')) #============================ imports ========================================= import...
bubbalinear/smartmeshsdk
dustUI/dustFrameSensorTx.py
Python
bsd-3-clause
7,785
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="scatter3d.legendgrouptitle.font", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=p...
plotly/plotly.py
packages/python/plotly/plotly/validators/scatter3d/legendgrouptitle/font/_family.py
Python
mit
554
"""Computes active users over the last one year.""" import datetime import logging import isoweek import luigi from edx.analytics.tasks.common.mapreduce import MapReduceJobTask, MapReduceJobTaskMixin from edx.analytics.tasks.common.pathutil import EventLogSelectionDownstreamMixin, EventLogSelectionMixin from edx.ana...
Stanford-Online/edx-analytics-pipeline
edx/analytics/tasks/warehouse/load_internal_reporting_active_users.py
Python
agpl-3.0
6,350
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleapis/python-compute
tests/unit/gapic/compute_v1/test_region_backend_services.py
Python
apache-2.0
149,814
# Copyright 2010 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ht...
openstack/ironic
ironic/common/image_service.py
Python
apache-2.0
12,149
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
uranusjr/django
django/utils/cache.py
Python
bsd-3-clause
15,727
from PyQt4 import QtGui class BooksListWidget(QtGui.QWidget): """ Uneditable list's books """ def __init__(self, label): super(BooksListWidget, self).__init__() # init label and table widgets self.title_label = QtGui.QLabel(label) self.books_list = QtGui.QListView() ...
franramirez688/Taric-Challange
taric_challange/gui/widgets/books_list.py
Python
mit
1,089
result = 1 for i in range(1, int(input()) + 1): result *= i print(result)
burakkose/HackerRank
Challenges/extra_long_factorials.py
Python
unlicense
78
"""Utilities relating to data handling and processing. This module does not define datatypes itself. See L{jazzparser.data} for that. """ """ ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding This file is par...
markgw/jazzparser
src/jazzparser/utils/data.py
Python
gpl-3.0
2,389
from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.conf import settings urlpatterns = patterns('', url(r'^$', 'docbucket.views.home', name='home'), url(r'^create/(?P<compiler>.+)$', 'docbucket.views.create', name='create'), url(r'^list/$', 'docbucket...
NaPs/Docbucket
docbucket/urls.py
Python
mit
1,082
"""Dependency downloader for open_fortran_parser.""" import logging import os import pathlib import platform import typing as t import urllib import wget _LOG = logging.getLogger(__name__) def ensure_dependencies( dependencies: t.Mapping[str, t.Tuple[urllib.parse.ParseResult, pathlib.Path]], target...
mbdevpl/open-fortran-parser-xml
open_fortran_parser/dependencies.py
Python
apache-2.0
2,086
from edmunds.globals import abc, ABC class BaseDriver(ABC): """ The base driver for storage-drivers """ def __init__(self, app): """ Initiate the instance :param app: The application :type app: Edmunds.Application ...
LowieHuyghe/edmunds
edmunds/storage/drivers/basedriver.py
Python
apache-2.0
3,058
from __future__ import unicode_literals from pydoc import deque from threading import Thread from Queue import Queue import gc import time from traceback import print_exc from django.db import connection from py4j.java_gateway import JavaGateway from py4j.protocol import Py4JJavaError from codebase.models import CodeEl...
bartdag/recodoc2
recodoc2/apps/codebase/parser/java_code_parser.py
Python
bsd-3-clause
20,241
from rest_framework import viewsets from rest_framework.permissions import IsAuthenticated from .models import Submission from .serializers import SubmissionSerializer from django.views.generic import ListView, DetailView from django.views.generic.edit import CreateView from django.utils.decorators import method_deco...
wangzitian0/BOJ-V4
submission/views.py
Python
mit
2,454
#!/usr/bin/env python """ Simplest demo of using PyGame to playback audio from Python https://www.scivision.co/playing-sounds-from-numpy-arrays-in-python/ """ import pygame from time import sleep from pyimagevideo import dialtone fs = 8000 # Hz x = (dialtone(fs) * 32768).astype('int16') # scale to int16 for sound c...
scienceopen/pyimagevideo
audio_pygame.py
Python
gpl-3.0
549
from izrazi_cnf import * #################### primeri za cnf, SAT #################### p = Spr('p') r = Spr('r') q = Spr('q') a = Spr('a') b = Spr('b') c = Spr('c') d = Spr('d') e = Spr('e') f = Spr('f') p1, p1_cnf = Ali(a), a p2, p2_cnf = In(a,Neg(a)), F() p3, p3_cnf = Ali(a,Neg(a)), T() p4, p4_cnf = In(T(),F(),Ali...
JanaVi/LVR
primeri.py
Python
apache-2.0
4,471
"""Constants for the auth module.""" from datetime import timedelta ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30) MFA_SESSION_EXPIRATION = timedelta(minutes=5) GROUP_ID_ADMIN = "system-admin" GROUP_ID_USER = "system-users" GROUP_ID_READ_ONLY = "system-read-only"
Danielhiversen/home-assistant
homeassistant/auth/const.py
Python
apache-2.0
267
from django.core.exceptions import ObjectDoesNotExist from rest_framework.compat import NoReverseMatch class MockObject(object): def __init__(self, **kwargs): self._kwargs = kwargs for key, val in kwargs.items(): setattr(self, key, val) def __str__(self): kwargs_str = ', '...
atombrella/django-rest-framework
tests/utils.py
Python
bsd-2-clause
1,646
# Roundware Server is released under the GNU Affero General Public License v3. # See COPYRIGHT.txt, AUTHORS.txt, and LICENSE.txt in the project root directory. from __future__ import unicode_literals from django.conf.urls import patterns, url, include from roundware.api1 import views import logging logger = logging.g...
yangjackascd/roundware-server
roundware/api1/urls.py
Python
agpl-3.0
1,338
#!/usr/bin/env python # -*- coding: utf-8 -*- import factory reload(factory) from factory import * def pyethapp_factory(branch='master'): factory = BuildFactory() for step in [ Git( haltOnFailure=True, logEnviron=False, repourl='https://github.com/ethereum/pyethapp....
vaporry/ethereum-buildbot
factories/pyethapp.py
Python
mit
1,885
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 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 ...
Dziolas/invenio
modules/webstyle/lib/webinterface_handler_wsgi_utils.py
Python
gpl-2.0
29,713
## ## File: user_stats.py ## ## Author: Schuyler Martin <sam8050@rit.edu> ## ## Description: Python class that defines a datagram for storing statistics ## on users ## from datagrams.datagram import Datagram class UserStats(Datagram): ''' Class for storing statistics on a user ''' de...
RIT-CS-Mentoring-Center-Queueing/mmcga_project
server/datagrams/user_stats.py
Python
mit
2,044
from .core import * from .viz import * __version__ = "0.0.5"
nmarincic/numbasom
numbasom/__init__.py
Python
mit
61
#--------------------------------------------------------------------------- # Introdução a Programação de Computadores - IPC # Universidade do Estado do Amazonas - UEA # Prof. Jucimar Jr # # Adham Lucas da Silva Oliveira 1715310059 # Gabriel Barroso da Silva Lima 1715310011 # Guilherme Silva de Ol...
jucimarjr/IPC_2017-1
lista06/lista06_lista02_questao23.py
Python
apache-2.0
1,566
Enter file contents here""" object_name.py: Put the text of the current NVDA navigator object into a new window. To install, place this file in the globalPlugins folder. You can get to this folder by typing the following into your run box (windows key + r): %appdata%\nvda\globalPlugins Once this is done, simply reload...
chrisnorman7/object_name
object_name.py
Python
gpl-2.0
3,969
#encoding=utf-8 import ldap SERVER_NAME = '192.168.0.9' SERVER_PORT = 389 try: conn = ldap.open("127.0.0.1") conn.protocol_version = ldap.VERSION3 #设置ldap协议版本 username = "cn=Manager,o=example.com" #身份信息 password = "secret" #访问密码 conn.simple_bind_s(username,password) # 开始绑定,验证成功的话不会抛出异常 except ld...
solvery/lang-features
python/network/ldap_1/ldap_client_1.py
Python
gpl-2.0
431
# -*- coding: utf-8 -*- import unittest import numpy as np import sys sys.path.append('..') from rt1.scatter import Scatter class TestScatter(unittest.TestCase): def test_p(self): S = Scatter() theta_0 = np.pi/2. theta_s = 0.234234 phi_0 = np.pi/2. phi_s = 0. p...
TUW-GEO/rt1
tests/test_scatter.py
Python
apache-2.0
717
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. import argparse import os import simplejson as json import grpc from google.protobuf.json_format import MessageToJson from qrl.core import config from qrl.core.AddressS...
cyyber/QRL
src/qrl/grpcProxy.py
Python
mit
9,400
VERSION = '1.5.2-dev'
twosigma/waiter
cli/waiter/version.py
Python
apache-2.0
22
#!/usr/bin/python3 from qgmap import * if __name__ == '__main__' : def goCoords() : def resetError() : coordsEdit.setStyleSheet('') try : latitude, longitude = coordsEdit.text().split(",") except ValueError : coordsEdit.setStyleSheet("color: red;") QtCore.QTimer.singleShot(500, resetError) else : ...
vokimon/python-qgmap
qgmap-example.py
Python
gpl-3.0
2,964
# coding=utf-8 """ Copyright 2015 Load Impact 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 writ...
loadimpact/loadimpact-sdk-python
test/test_fields.py
Python
apache-2.0
3,246
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on Feb 20, 2013 @author: maribelacosta ''' class Revision(object): ''' classdocs ''' def __init__(self): self.id = 0 # Fake sequential id. Starts in 0. self.wikipedia_id = 0 # Wikipedia revision id. ...
priyankamandikal/wiki_accuracy_review
structures/Revision.py
Python
mit
1,304
"""A filter that reduces CitcomS vtk input data. """ #Author: Martin Weier #Copyright (C) 2006 California Institute of Technology #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...
geodynamics/citcoms
visual/Mayavi2/original_plugins/plugins/filter/CitcomSreduce.py
Python
gpl-2.0
7,907
# Copyright (c) 2014. Mount Sinai School of Medicine # # 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...
dmnfarrell/epitopemap
modules/pepdata/pmbec.py
Python
apache-2.0
2,894
import bbcode import markdown import html from c2corg_ui.format.wikilinks import C2CWikiLinkExtension from c2corg_ui.format.img import C2CImageExtension from c2corg_ui.format.video import C2CVideoExtension from c2corg_ui.format.important import C2CImportantExtension from c2corg_ui.format.warning import C2CWarningExten...
Courgetteandratatouille/v6_ui
c2corg_ui/format/__init__.py
Python
agpl-3.0
1,630
class Solution(object): def fizzBuzz(self, n): """ :type n: int :rtype: List[str] """ num_str_arr = [""] * n for i in range(1, n+1): num_str = "" if i % 3 != 0 and i % 5 != 0: num_str = str(i) else: i...
zqfan/leetcode
algorithms/412. Fizz Buzz/solution.py
Python
gpl-3.0
506
#!/usr/bin/python # -*- coding: utf-8 -*- if __name__ != '__main__': __dicErros__ = { 00: "[Erro]: Arquivo contendo o código fonte não foi passado!", 01: "[Erro]: O arquivo passado possui extensão incompatível.", 02: "[Erro]: Erro lexico na linha " } __listaErros__ = [] def ...
Lucasgscruz/AnalisadorLexico
src/erros.py
Python
gpl-3.0
952
#!/usr/bin/env python3 # coding: utf-8 import logging import api # :REFACTOR: import datetime def set_timer(seconds, func): period = datetime.timedelta(seconds=seconds) def on_timeout(): func() io_loop.add_timeout(period, on_timeout) io_loop.add_timeout(period, on_timeout) if __name_...
BradburyLab/show_tv
show_tv/test_connection.py
Python
gpl-3.0
1,417
#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK server. # # REDHAWK server is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License...
RedhawkSDR/rtl-demo-app
server/test.py
Python
lgpl-3.0
1,041
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Number of "papers using libmesh" by year. # # Note 1: this does not count citations "only," the authors must have actually # used libmesh in part of their work. Therefore, these counts do not include # things like Wolfgang citing us in his pap...
vikramvgarg/libmesh
doc/statistics/libmesh_citations.py
Python
lgpl-2.1
2,350
# core.py # # by Shaun Astbury # # Import required modules. try: from osgeo import ogr, osr except: import ogr import osr import os ogr.UseExceptions() # Driver names matched to driver instances. drivers = {ogr.GetDriver(i).GetName(): ogr.GetDriver(i) for i in range(ogr.Get...
ssast/easyogr
core.py
Python
gpl-3.0
17,159
# Ensure that tests are importing the local copy of trex rather than # any system-installed copy of trex that might exist in the path. import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) import trex sys.path.pop(0)
anthonyalmarza/trex
tests/__init__.py
Python
mit
259
""" After running the recipe in this directory, we get a large JSON file called all_covid19_datasets.json. This script reads that JSON file, adds to it using the directives pull from a Google sheet, and produces a new JSON file called demo_data.json. """ import csv import dataclasses import json import os import pathl...
linkedin/WhereHows
metadata-ingestion/examples/demo_data/enrich.py
Python
apache-2.0
7,385
# Copyright 2002-2005 Vladimir Prus. # Copyright 2002-2003 Dave Abrahams. # Copyright 2006 Rene Rivera. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import TestCmd import copy import fnmatch import glob import ...
nawawi/poedit
deps/boost/tools/build/test/BoostBuild.py
Python
mit
53,880
import getopt import os import sys import logging from pcs import ( settings, usage, utils, ) from pcs.cli.common import ( capabilities, completion, errors, parse_args, routing, ) from pcs.cli.reports import process_library_reports, output from pcs.cli.routing import ( acl, ale...
feist/pcs
pcs/app.py
Python
gpl-2.0
9,230
from collections import OrderedDict import json from django.db import models from django.contrib.postgres.fields import JSONField as Builtin_JSONField from django.core.serializers.json import Serializer as Builtin_Serializer from django.utils.encoding import smart_text class JSONField(Builtin_JSONField): def valu...
Fakor/congov
web/values/models.py
Python
mit
484
#!/usr/bin/env python """ sha1Hash_test.py Unit tests for sha1.py """ from crypto.hash.sha1Hash import SHA1 import unittest import struct assert struct.calcsize('!IIIII') == 20, '5 integers should be 20 bytes' class SHA1_FIPS180_TestCases(unittest.TestCase): """ SHA-1 tests from FIPS180-1 Appendix A, B and ...
realms-team/basestation-fw
libs/smartmeshsdk-REL-1.3.0.1/external_libs/cryptopy/crypto/hash/sha1Hash_test.py
Python
bsd-3-clause
2,119
import json from corehq.apps.api.models import ApiUser, PERMISSION_POST_SMS from corehq.apps.domain.models import Domain from corehq.apps.hqcase.utils import update_case from corehq.apps.sms.api import (send_sms, send_sms_to_verified_number, send_sms_with_backend, send_sms_with_backend_name) from corehq.apps.sms.mi...
qedsoftware/commcare-hq
corehq/apps/sms/tests/test_backends.py
Python
bsd-3-clause
52,667