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
from copy import copy from decimal import DecimalTuple import math from hwt.doc_markers import internal from hwt.hdl.value import HValue from pyMathBitPrecise.floatt import FloattVal class HFloatVal(HValue, FloattVal): """ HValue class for Slice type """ @classmethod def from_py(cls, typeObj, va...
Nic30/HWToolkit
hwt/hdl/types/floatVal.py
Python
mit
1,782
from pandac.PandaModules import * from toontown.toonbase.ToontownGlobals import * from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toon import LaffMeter class MinigameAvatarScorePanel(DirectFrame): def __init__(self, avId, avName): self.avId = avId if self.avId in...
Spiderlover/Toontown
toontown/minigame/MinigameAvatarScorePanel.py
Python
mit
1,759
''' Created on Jul 26, 2014 @author: gigemjt ''' class Form(object): def __init__(self, inputFile, fileLength): self._file = inputFile self._totalLength = fileLength self.parseFile() self._formData = dict() def parseFile(self): bytesLeft = self._fileLength left...
dtracers/Development-Graph
Server/python/src/connection/form.py
Python
apache-2.0
983
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
googleads/google-ads-python
google/ads/googleads/v9/resources/types/shared_criterion.py
Python
apache-2.0
4,471
from vmlp_multiclass import vmlp as multiclass_neural_network from embedded_layer import EmbeddedLayer import numpy data = numpy.matrix([[0,0],[0,1],[1,0],[1,1]]) # input data labels = numpy.matrix([[0,0,1],[1,0,0],[1,0,0],[0,0,1]]) # labels user_model = multiclass_neural_network(data, labels, [2], 0.1, 2000) # user...
dakoto747/Machine-Learning-Algorithms
examples.py
Python
mit
1,807
# -*- coding: utf-8 -*- # Copyright 2016 Serpent Consulting Services Pvt. Ltd # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Open Invoices Reports", "summary": "Open Invoices Reports", "version": "8.0.1.0.0", "category": "Accounting", 'website': 'http://www.serpentc...
OpenPymeMx/account-financial-tools
partner_report_open_invoices/__openerp__.py
Python
agpl-3.0
717
""" Handle the NBT (Named Binary Tag) data format """ from struct import Struct, error as StructError from gzip import GzipFile import zlib from collections import MutableMapping, MutableSequence, Sequence import os, io try: unicode basestring except NameError: unicode = str # compatibility for Python 3 ...
cburschka/NBT
nbt/nbt.py
Python
mit
20,029
# Copyright (c) 2013 Hortonworks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
matips/iosr-2015
sahara/plugins/hdp/versions/version_1_3_2/versionhandler.py
Python
apache-2.0
31,052
############################################################################## # # Copyright (C) Zenoss, Inc. 2015, all rights reserved. # # This content is made available according to terms specified in # License.zenoss under the directory where your Zenoss product is installed. # #####################################...
vholer/zenpacklib
tests/data/zenpacks/ZenPacks.zenoss.ZPLTest1/ZenPacks/zenoss/ZPLTest1/__init__.py
Python
gpl-2.0
540
#!/usr/bin/env python import os import sys if __name__ == "__main__": from django.core.management import execute_from_command_line os.environ.setdefault("DJANGO_SETTINGS_MODULE", "worldmap.settings") execute_from_command_line(sys.argv)
waybarrios/worldmap
manage.py
Python
gpl-3.0
253
# -*- coding: utf-8 -*- from __future__ import print_function import sys from sqlalchemy import create_engine from sqlalchemy.types import SchemaType from sqlalchemy.engine import reflection from sqlalchemy.schema import ( MetaData, Table, DropTable, ForeignKeyConstraint, DropConstraint, ) from .ba...
Lehych/iktomi
iktomi/cli/sqla.py
Python
mit
7,471
""" Common utility functions useful throughout the contentstore """ import logging from contextlib import contextmanager from datetime import datetime from django.conf import settings from django.urls import reverse from django.utils import translation from django.utils.translation import ugettext as _ from opaque_k...
EDUlib/edx-platform
cms/djangoapps/contentstore/utils.py
Python
agpl-3.0
22,783
# # Copyright (C) 2013 Savoir-Faire Linux Inc. # # This file is part of Sageo # # Sageo 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 optio...
smlacombe/sageo
app/controllers/side.py
Python
gpl-3.0
1,232
import rectangle class particle: def __init__(self, x, y, w, h, c): self.rectangle = rectangle.rectangle(x, y, w, h, c)
martflu/adaptive-audio
src/particle.py
Python
gpl-2.0
137
############################################################################### ## ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## "Redistribution and use in source and binary for...
Nikea/VisTrails
vistrails/gui/port_documentation.py
Python
bsd-3-clause
4,253
#! /bin/env python # # Generate random fake participant data # import argparse # pylint: disable=superfluous-parens # pylint: disable=broad-except import csv import logging import sys from time import sleep from rdr_service.tools.tool_libs import GCPProcessContext from rdr_service.services.gcp_utils import gcp_get_a...
all-of-us/raw-data-repository
rdr_service/client/client_libs/random_data_generator.py
Python
bsd-3-clause
7,259
# -*- coding: utf-8 -*- from flags import FLAGS __all__ = ( "get_device", ) device = None class Device(object): @property def device_list(self): """ """ devices = range(FLAGS.num_gpus) if len(devices) is 0: devices = [0] return devices @propert...
tokuda109/tensorflow-docker-skeleton
src/train/device.py
Python
mit
1,009
#!/opt/local/bin/python # Python program to print prime factors import sys import math import timeit import time # A function to print all prime factors of # a given number n def primeFactors(n): factors = [] # Print the number of two's that divide n while n & 1 == 0: factors.app...
perlygatekeeper/glowing-robot
Project_Euler/03_largest_prime_factor/prime_factors.py
Python
artistic-2.0
1,189
# from .db import db from db import db from Authors import * from model import * import uuid class Posts(db.Model): __tablename__ = 'posts' post_id = db.Column(db.String(100), primary_key=True) title = db.Column(db.String(64)) description = db.Column(db.String(128)) content_type =...
CMPUT404-Fall2016/cmput404-project
Model/Posts.py
Python
gpl-3.0
2,713
import re from cloudinary import CloudinaryResource, forms, uploader from django.core.files.uploadedfile import UploadedFile from django.db import models from cloudinary.uploader import upload_options from cloudinary.utils import upload_params # Add introspection rules for South, if it's installed. try: from sout...
JonnyWong16/plexpy
lib/cloudinary/models.py
Python
gpl-3.0
5,449
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Widget.progress' db.add_column('workflows_widget', 'progress', self.gf('django.db.models.f...
janezkranjc/clowdflows
workflows/migrations/0021_auto__add_field_widget_progress.py
Python
gpl-3.0
14,878
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import ModeType, timestampStringFromTime, timestampStringFromTimeSeconds from zope.interface import implementer from datetime import datetime from t...
Heufneutje/txircd
txircd/modules/rfc/cmd_mode.py
Python
bsd-3-clause
10,635
# encoding: utf-8 """ Test data for relationship-related unit tests. """ from __future__ import absolute_import from docx.opc.constants import RELATIONSHIP_TYPE as RT from docx.opc.rel import Relationships from docx.opc.constants import NAMESPACE as NS from docx.opc.oxml import parse_xml class BaseBuilder(object)...
eruffaldi/python-docx
tests/opc/unitdata/rels.py
Python
mit
8,804
"""Helper functions """ import numpy as np import datetime as dt def bstr2seconds(data): """ Converts a byte string to a timedelta object Parameters ---------- data : bytestring Contains a bytestring representing a timedelta Returns ------- dt.timedelta timedelta object ...
mattihappy/mtibattery
mtibattery/helper.py
Python
gpl-3.0
1,265
# -*- Mode: Python -*- # Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # Permission to use, copy, modify,...
invisiblek/python-for-android
python3-alpha/python3-src/Lib/asyncore.py
Python
apache-2.0
21,009
from .common import generic_url_role def url_role(name, rawtext, text, lineno, inliner, options={}, content=[]): """Role for linking to url articles. :url:`https://google.com` -> link: https://google.com text: https://google.com :url:`Google <https://google.com>` -> link: https://g...
tony/django-docutils
django_docutils/lib/roles/url.py
Python
mit
581
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.home, name='home'), url(r'^ourstory$', views.our_story, name='our_story'), url(r'^ourteam$', views.our_team, name='our_team'), url(r'^childrensprogram$', views.childrens_program, name='childrensprogram'), url(r'^...
DjangoGirlsSeoul/lightandleadership
spanish_content/urls.py
Python
apache-2.0
1,012
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from .. import Error, Tags, Warning, register REFERRER_POLICY_VALUES = { 'no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-ori...
wkschwartz/django
django/core/checks/security/base.py
Python
bsd-3-clause
8,149
from Products.DataCollector.plugins.CollectorPlugin import ( SnmpPlugin, GetTableMap, ) class TrueNASDataset(SnmpPlugin): relname = 'trueNASDatasets' modname = 'ZenPacks.iXsystems.TrueNAS.TrueNASDataset' deviceProperties = SnmpPlugin.deviceProperties + ('zTrueNASIgnorePools', 'zTrueNASIgnoreDat...
N-faycal/ZenPacks.iXsystems.TrueNAS
build/lib/ZenPacks/iXsystems/TrueNAS/modeler/plugins/iXsystems/snmp/TrueNASDataset.py
Python
bsd-2-clause
1,799
#!/usr/bin/python # uart-eg01.py # # to run on the other end of the UART # screen /dev/ttyUSB1 115200 import serial def readlineCR(uart): line = b'' while True: byte = uart.read() line += byte if byte == b'\r': return line uart = serial.Serial('/dev/ttyUSB0', baudrate=115200, timeout=1) while True: uart...
CurtisLeeBolin/Examples_Python
UART01.py
Python
unlicense
567
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
malmiron/incubator-airflow
tests/operators/test_http_operator.py
Python
apache-2.0
1,793
# 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 ...
racker/rackspace-monitoring
test/test_rackspace.py
Python
apache-2.0
37,921
# 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 a...
luci/luci-py
appengine/third_party/python-adb/adb/common_cli.py
Python
apache-2.0
4,894
# coding: utf-8 import logging from core.config import config from core.utils import exception_handler from core.clients.docker_client import DockerManageClient log = logging.getLogger(__name__) class DockerNetwork: network = None def __init__(self): self.name = config.DOCKER_NETWORK_NAME ...
2gis/vmmaster
core/network/__init__.py
Python
mit
1,033
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of Pyswisseph. # # Copyright (c) 2007-2021 Stanislas Marquis <stan@astrorigin.com> # # Pyswisseph 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 ...
astrorigin/pyswisseph
setup.py
Python
gpl-2.0
9,298
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst. from django.conf import settings from django.conf.urls import include from django.conf.urls import patterns from django.conf.urls import url from django.contrib import admin from lizard_ui.urls import debugmode_urlpatterns from controlnext import views admin....
lizardsystem/controlnext
controlnext/urls.py
Python
gpl-3.0
1,448
import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton # from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot class App(QWidget): def __init__(self): super().__init__() self.title = 'PyQt5 button - pythonspot.com' self.left = 600 self.top = 500 ...
sidro/excodpy
python-exemple/design.py
Python
bsd-2-clause
1,073
#!/usr/bin/env python # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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 # # Unle...
emonty/pymox
setup.py
Python
apache-2.0
794
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os from marionette_test import MarionetteTestCase class TestState(MarionetteTestCase): def test_isEnabled(se...
sergecodd/FireFox-OS
B2G/gecko/testing/marionette/client/marionette/tests/unit/test_elementState.py
Python
apache-2.0
2,451
# -*- coding: utf-8 -*- """ ================================================================================= 1D Wasserstein barycenter comparison between exact LP and entropic regularization ================================================================================= This example illustrates the computation of r...
rflamary/POT
docs/source/auto_examples/plot_barycenter_lp_vs_entropic.py
Python
mit
5,934
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DCSaunders/tensorflow
tensorflow/tensorboard/plugins/projector/plugin.py
Python
apache-2.0
15,720
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) install_requires = [ 'requests==2.8.1...
technoarch-softwares/facebook-auth
setup.py
Python
bsd-2-clause
1,410
#!/usr/bin/python import redis import time ## Connect local redis service client =redis.Redis(host='127.0.0.1',port=6379,db=0) print "Connection to server successfully!" dicKeys = client.keys("*") print dicKeys ### Redis hash command part Start ### # hset: Set key to value with hash name,hset(self, name, key, value) #...
MarsBighead/mustang
Python/redis.hash.py
Python
mit
2,981
#!/usr/bin/env python """ Couchbase collector Refer to the following cbstats documentation for more details: http://docs.couchbase.com/couchbase-manual-2.1/#cbstats-tool """ import os import sys import time import subprocess import re from collectors.etc import couchbase_conf from collectors.lib import utils CONF...
wangy1931/tcollector
collectors/0/couchbase.py
Python
lgpl-3.0
4,853
# coding=utf-8 """ The EepURL Report API endpoint Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/reports/eepurl/ Schema: https://api.mailchimp.com/schema/3.0/Reports/Eepurl/Collection.json """ from __future__ import unicode_literals from mailchimp3.baseapi import BaseApi class Repor...
charlesthk/python-mailchimp
mailchimp3/entities/reporteepurl.py
Python
mit
1,175
from nose.tools import * import glob import json import os import sys import cli PY3 = sys.version_info[0] == 3 def load_commented_json(path): lines = open(path).read().split('\n') return json.loads('\n'.join( [line for line in lines if not line.startswith('#')])) def test_all(): specs = glob....
Digitalxero/pyjsonselect
tests/integration_test.py
Python
apache-2.0
942
# Make difference plots for the paper import os import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from astropy.visualization import LinearStretch, PercentileInterval from astropy.visualization.mpl_normalize import ImageNormalize import astropy.units as u from astropy.coordinates import SkyC...
wafels/jets
py/paper1_make_difference_maps_for_paper.py
Python
lgpl-3.0
8,372
#!/usr/bin/env python from __future__ import division, print_function def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('ma', parent_package, top_path) config.add_data_dir('tests') return config if __name__ == "__main__": ...
DailyActie/Surrogate-Model
01-codes/numpy-master/numpy/ma/setup.py
Python
mit
433
# -*- encoding: utf-8 -*- # # Copyright 2013 Hewlett-Packard Development Company, L.P. # Copyright 2014 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
naototty/vagrant-lxc-ironic
ironic/drivers/modules/image_cache.py
Python
apache-2.0
16,000
# Generated by Django 2.0.4 on 2018-04-13 08:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pa3', '0018_auto_20180413_1001'), ] operations = [ migrations.AlterField( model_name='newestnumberbatch', name='src'...
sistason/pa3
src/pa3_frontend/pa3_django/pa3/migrations/0019_auto_20180413_1012.py
Python
gpl-3.0
1,619
from django.core.management.base import BaseCommand from optparse import make_option from sam.models import Website import os class Command(BaseCommand): help = 'This creates Website objects from text file input or writes Websites to text file' option_list = BaseCommand.option_list + ( make_option('-...
samolds/samster
sam/management/commands/websites.py
Python
mit
1,601
from . import purchase_order
OCA/stock-logistics-warehouse
stock_orderpoint_origin_mrp_link/models/__init__.py
Python
agpl-3.0
29
""" ======================================== The :mod:`array_split.split_plot` Module ======================================== Uses :mod:`matplotlib` to plot a split. Classes and Functions ===================== .. autosummary:: :toctree: generated/ SplitPlotter - Plots a split. plot - Plots split shapes. ...
array-split/array_split
array_split/split_plot.py
Python
mit
744
from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import GridSearchCV, cross_val_score from .common import Benchmark, Estimator, Predictor from .datasets import _synth_classification_dataset from .utils import make_gen_classif_scorers class CrossValidationBenchmark(Benchmark): """ ...
glemaitre/scikit-learn
asv_benchmarks/benchmarks/model_selection.py
Python
bsd-3-clause
2,511
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'NewsBlogConfig', fields ['type', 'namespace'] ...
mkoistinen/aldryn-newsblog
aldryn_newsblog/south_migrations/0012_auto__add_newsblogconfigtranslation__add_unique_newsblogconfigtranslat.py
Python
bsd-3-clause
18,529
from clint.textui import puts def as_table(data): offset = data['offset'] limit = data['limit'] total = data['total_count'] first = offset + 1 last = offset + limit if offset + limit <= total else total issues = data['issues'] if not total: puts('No issues matching your query.') ...
dmedvinsky/redcliff
redcliff/renderer/issues.py
Python
mit
794
# elog/mod_save_summary.py - elog dispatch module # Copyright 2006-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import codecs import time from portage import os from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode from porta...
Neuvoo/legacy-portage
pym/portage/elog/mod_save_summary.py
Python
gpl-2.0
1,485
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google/oss-fuzz
infra/cifuzz/run_fuzzers_test.py
Python
apache-2.0
19,890
#-*-coding:Utf-8 -* # TheSecretTower # Copyright (C) 2011 Pierre SURPLY # # This file is part of TheSecretTower. # # TheSecretTower 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 ver...
dusty141/TheSecretTower
element.py
Python
gpl-3.0
1,664
from PyQt5 import QtWidgets, QtCore, QtGui from card import Card, Ranks, Suits from enum import Enum from random import shuffle class DeckStrategy(Enum): visible = 1 invisible = 2 class Deck(QtWidgets.QStackedWidget): target = None def __init__(self, strategy: DeckStrategy, parent=None): su...
EpicUsaMan/univer
deck.py
Python
mit
3,550
#!/usr/bin/env python # This file is part of cxqwatch, released under the MIT license. # The MIT License (MIT) # Copyright (c) 2014, 2016 Christian T. Jacobs # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
ctjacobs/cxqwatch
cxqwatch.py
Python
mit
3,467
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
Karel-van-de-Plassche/bokeh
bokeh/sampledata/tests/test_us_marriages_divorces.py
Python
bsd-3-clause
2,015
""" Functions for the analysis of integral field spectroscopy. Author: Daniel Ruschel Dutra Website: https://github.com/danielrd6/ifscube """ from numpy import * import pyfits as pf import spectools as st import matplotlib as mpl import matplotlib.pyplot as plt from scipy.integrate import trapz from copy import deepc...
danielrd6/ifscube
cubetools.py
Python
gpl-3.0
39,584
# -*- coding: utf-8 -*- # ***************************************************************************** # Marche - A server control daemon # Copyright (c) 2015-2016 by the authors, see LICENSE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public Licens...
birkenfeld/marche
marche/jobs/nicos.py
Python
gpl-2.0
5,669
#!/usr/bin/python import xmlrpclib server = xmlrpclib.Server("http://localhost:8086"); session = server.Session.do_login_with_password("user", "passwd")['Value'] server.VM.do_unpause(session, '7366a41a-e50e-b891-fa0c-ca5b4d2e3f1c')
sharady/xen-api
ocaml/idl/ocaml_backend/python/unpause_vm.py
Python
lgpl-2.1
233
# -*- coding: utf-8 -*- """ Helper functions used in views. """ import csv from json import dumps from functools import wraps from datetime import datetime from flask import Response from main import app import logging log = logging.getLogger(__name__) # pylint: disable=invalid-name def jsonify(function): ""...
stxnext-kindergarten/presence-analyzer-dbrzoskowski
src/presence_analyzer/utils.py
Python
mit
3,251
import argparse import subprocess import ntpath import tempfile import shutil parser = argparse.ArgumentParser(description='Compile to SPIRV and generate header/implementation') parser.add_argument('files', metavar='files', nargs='+', help='list of glsl files') parser.add_argument('--output', action='store', dest='out...
mmaldacker/Vortex2D
Scripts/GenerateSPIRV.py
Python
mit
2,206
# 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. from measurements import session_restore from telemetry import test # crbug.com/325479: Disabling this test for now since it never ran before. @test.Disabl...
patrickm/chromium.src
tools/perf/benchmarks/session_restore.py
Python
bsd-3-clause
752
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
antgonza/qiita
qiita_pet/handlers/api_proxy/sample_template.py
Python
bsd-3-clause
8,355
from vsg.rules import token_case from vsg.token import architecture_body as token class rule_028(token_case): ''' This rule checks the **architecture** keyword in the **end architecture** has proper case. |configuring_uppercase_and_lowercase_rules_link| **Violation** .. code-block:: vhdl ...
jeremiah-c-leary/vhdl-style-guide
vsg/rules/architecture/rule_028.py
Python
gpl-3.0
627
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <maurizio....
dr-prodigy/python-holidays
test/countries/test_new_zealand.py
Python
mit
24,166
import os import time from django.conf import settings from django.db import connections from django.dispatch import receiver, Signal from django.template import context from django.utils import timezone template_rendered = Signal(providing_args=["template", "context"]) setting_changed = Signal(providing_args=["sett...
azurestandard/django
django/test/signals.py
Python
bsd-3-clause
2,021
""" Settings that are expected to be changed by the user. They influence the system as a whole """ import os FULLTEXT_EXTRACT_PATH = "/vagrant/live" FULLTEXT_EXTRACT_PATH_UNITTEST = "tests/test_unit/stub_data" PROJ_HOME = os.path.dirname(os.path.realpath(__file__)) config = { "FULLTEXT_EXTRACT_PATH"...
jonnybazookatone/adsfulltext_old
settings.py
Python
gpl-3.0
2,178
# -*- coding: utf-8 -*- # memorystore.py # Copyright (C) 2014 LEAP # # 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. # #...
laborautonomo/leap_mail
src/leap/mail/imap/memorystore.py
Python
gpl-3.0
44,071
# -*- coding: utf-8 -*- import logging import os import sys from datetime import datetime import wormhole.errors from PyQt5.QtCore import QFileInfo, Qt, QTimer, pyqtSignal from PyQt5.QtGui import QFont, QIcon from PyQt5.QtWidgets import ( QDialog, QFileIconProvider, QGridLayout, QGroupBox, QLabel,...
gridsync/gridsync
gridsync/gui/share.py
Python
gpl-3.0
19,086
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
devopservices/ansible
lib/ansible/cache/jsonfile.py
Python
gpl-3.0
4,163
# Natural Language Toolkit: TIMIT Corpus Reader # # Copyright (C) 2001-2006 University of Pennsylvania # Author: Haejoong Lee <haejoong@ldc.upenn.edu> # Steven Bird <sb@ldc.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """ Read tokens, phonemes and audio data from the NLTK T...
rossgoodwin/musapaedia
musapaedia/en/parser/nltk_lite/corpora/timit.py
Python
mit
12,505
""" Class for accessing the swig process """ import shutil, subprocess, os from pylib.logwrapper import LogWrapper from pylib.process import Process # Wrapper class for logging class SwigProcess(Process): def __init__(self): super().__init__() self.log = LogWrapper.getlogger() # Swig Pr...
grbd/GBD.Audio.SoxSharp.Soxbuild
bin/pylib/subproc/swig_process.py
Python
lgpl-3.0
1,537
from django.urls import reverse from django_comments.models import Comment from fiscal.forms import OrganizationCreateForm from workshops.models import Organization, Event from workshops.tests.base import TestBase class TestOrganization(TestBase): def setUp(self): super().setUp() self._setUpUsers...
swcarpentry/amy
amy/fiscal/tests/test_organization.py
Python
mit
3,256
# Copyright 2018 Open Source Robotics Foundation, 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...
ros2/launch
launch/launch/events/process/process_io.py
Python
apache-2.0
1,913
from queries import queries from datetime import datetime, date, time import xml.parsers.expat import httplib class rest_request: def __init__(self, from_, to, refdate = 'now'): if refdate == 'now': self._from = from_ self._to = to else: time = datetime.strptime...
niavok/elveos
stats/src/bloatitstats/queries/dashboard_queries.py
Python
agpl-3.0
12,021
#!/usr/bin/python3 # This program is intended to run in a cron schedule. # If there is no action from user within 30mins the computer powers off. # The action is detected through X by invoking xautolock(1). # If xautolock is running already the process doesn't start. # Dependencies: # # Linux OS # python ...
kalopsik-math/scripts
labs/check_idle.py
Python
gpl-3.0
2,740
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com import logging import logging.config import os import socket import ...
kkopachev/thumbor
thumbor/server.py
Python
mit
4,551
from pymongo.errors import DuplicateKeyError from master.boostrap.db_client import SingleDBClient from master.beans.pws_entries import PwsEntry from master.encryption.encrypt_bfish import MyBlowFish from pymongo import ASCENDING, DESCENDING class PwsStore: def __init__(self): self.client = SingleDBClient...
hungh/masterpass
master/persistence/pws_store.py
Python
apache-2.0
2,729
#!/usr/bin/env python2 import json import os import sys import django django.setup() # dashboard from main import models # This is the UUID of SIP from the `MetadataAppliesToTypes` table INGEST_METADATA_TYPE = '3e48343d-e2d2-4956-aaa3-b54d26eb9761' def main(sip_uuid, dc_path): # If there's no metadata, that's ...
eckardm/archivematica
src/MCPClient/lib/clientScripts/loadDublinCore.py
Python
agpl-3.0
1,064
from pandac.PandaModules import PythonCallbackObject from pandac.PandaModules import CallbackNode, VBase3 from direct.directbase import DirectStart from OpenGL.GL import * import sys VSHADER = """ void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } """ FSHADER = """ uniform sampler2D tex; void m...
faruk/opticfoo
inspiration/glsl.py
Python
gpl-3.0
1,579
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) Spyder Project Contributors # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Terminal ...
andfoy/spyder-terminal
spyder_terminal/widgets/terminalgui.py
Python
mit
7,823
# Copyright 2014 Objectif Libre # Copyright 2015 DotHill Systems # # 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 # # U...
Hybrid-Cloud/cinder
cinder/volume/drivers/dothill/dothill_client.py
Python
apache-2.0
14,788
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import sys import click import click_spinner import cli_common.cli import please_cli...
La0/mozilla-relengapi
lib/please_cli/please_cli/run.py
Python
mpl-2.0
12,167
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import, divisi...
klahnakoski/ActiveData
vendor/jx_elasticsearch/es52/expressions/gte_op.py
Python
mpl-2.0
525
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-21 06:20 from __future__ import unicode_literals from django.db import migrations import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): dependencies = [ ('laboratory', '0034_group_perms'), ] op...
solvo/organilab
src/laboratory/migrations/0035_auto_20180621_0020.py
Python
gpl-3.0
694
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: 2005-05-18 # Author: Francesc Alted - faltet@pytables.org # Author: Ivan Vilata - ivan@selidor.net # # $Id$ # ######################################################################## """Test mo...
cpcloud/PyTables
tables/tests/test_nestedtypes.py
Python
bsd-3-clause
52,114
# Copyright 2017,2018,2019,2020,2021 Sony Corporation. # # 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...
sony/nnabla
python/benchmark/function/function_benchmark.py
Python
apache-2.0
10,661
# test memoryview accessing maximum values for signed/unsigned elements try: from array import array memoryview except: import sys print("SKIP") sys.exit() print(list(memoryview(b'\x7f\x80\x81\xff'))) print(list(memoryview(array('b', [0x7f, -0x80])))) print(list(memoryview(array('B', [0x7f, 0x80, 0...
cwyark/micropython
tests/basics/memoryview2.py
Python
mit
460
# -*- coding: utf-8 -*- """ Username Resolver ~~~~~ :copyright: (c) 2015 by Openname.org :license: MIT, see LICENSE for more details. """ from bs4 import BeautifulSoup GITHUB_GIST_TAG = 'gist-description' GITHUB_TEXT_TAG = 'blob-wrapper data type-text js-blob-data' GITHUB_MARDOWN_TAG = 'blob-wrapper ...
jetbox/resolver
server/proofcheck/htmlparsing.py
Python
mit
1,899
""" module queue ~~~~~~~~~~~~~~ FIFO. :copyright: (c) 2017 by 0xE8551CCB. :license: MIT, see LICENSE for more details. """ class Queue(object): def __init__(self): self._elements = [] def __repr__(self): return '<Queue size={!r}>'.format(len(self)) def enqueue(s...
AjithPanneerselvam/pyalgorithm
pyalgorithm/datastructures/queue.py
Python
mit
590
#!/usr/bin/env yamtbx.python """ (c) RIKEN 2015. All rights reserved. Author: Keitaro Yamashita This software is released under the new BSD License; see LICENSE. """ import sys, os, optparse, math from collections import OrderedDict from yamtbx.dataproc.scale_data import kBdecider import iotbx.mtz import iotbx.phi...
keitaroyam/yamtbx
yamtbx/dataproc/command_line/plot_I_d.py
Python
bsd-3-clause
10,298
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib2 import re import json class ItudouResolver: def fetch_url(self, url): return urllib2.urlopen(url).read() def resolve(self,iid,res): url="http://v2.tudou.com/v2/cdn?id="+ iid html = self.fetch_url(url) find1 = re.sea...
HDPxbmc/script.module.urlresolvercn
lib/urlresolvercn/plugins/lib/ItudouResolver.py
Python
gpl-2.0
711
#!/usr/bin/env python #coding=utf-8 import os from app import create_app, db from flask.ext.script import Manager, Shell from flask.ext.migrate import Migrate, MigrateCommand from app.model.users import User app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) de...
youqingkui/wx.youqingkui.me
manage.py
Python
mit
543
#!/usr/bin/env python # # Copyright 2010 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...
canvasnetworks/canvas
common/facebook.py
Python
bsd-3-clause
10,217