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 utils import *
Clean()
GitUpdate33()
PatchAll()
Build_VC11Express_64()
RunAll()
Build_VC14Express_64()
RunAll()
Build_CodeBlocks()
RunAll()
Clean()
GitUpdate21()
PatchAll()
Build_VC14Express_64()
RunAll()
Clean()
GitUpdate33()
| NelsonBilber/cg.opengltutorial | distrib/tests_potiron.py | Python | mit | 272 |
import tensorflow as tf
import os
def create_single_queue(bucket_id, filename, batch_size, buckets):
"""
Return a shuffle_queue which output element from {bucket_id} bucket
:param bucket_id: int
:param filename: str
:param batch_size: int
:param buckets: list
:return:
"""
file_name... | XefPatterson/INF8225_Project | Model/queues.py | Python | mit | 3,465 |
__all__ = ["w_autocomplete",
"w_inv_item_select",
"w_supply_select",
"w_facility_select",
"w_gis_location",
]
# @todo There are performance issues need to profile and find out in which functions are the bottlenecks
import time
from gluon import current
# ------... | madhurauti/Map-Polygon | modules/tests/core/core_widgets.py | Python | mit | 5,983 |
# Copyright (c) 2009, 2012-2013, 2015 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of t... | Nirvedh/CoarseCoherence | src/arch/arm/ArmSystem.py | Python | bsd-3-clause | 4,862 |
from leapp.actors import Actor
from leapp.tags import ThirdPhaseTag, UnitTestWorkflowTag
class ThirdActor(Actor):
name = 'third_actor'
description = 'No description has been provided for the third_actor actor.'
consumes = ()
produces = ()
tags = (ThirdPhaseTag, UnitTestWorkflowTag)
def proces... | vinzenz/prototype | tests/data/workflow-tests/actors/thirdactor/actor.py | Python | apache-2.0 | 426 |
# -*- coding: utf-8 -*-
#
# TwitterMonitor documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 20 02:47:09 2014.
#
# 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... | alissonperez/TwitterMonitor | docs/conf.py | Python | apache-2.0 | 8,278 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@license:
'''
SPELL=u'zhōngzhǔ'
CN=u'中渚'
NAME=u'zhongzhu13'
CHANNEL='sanjiao'
CHANNEL_FULLNAME='SanjiaoChannelofHand-Shaoyang'
SEQ='SJ3'
if __name__ == '__main__':
pass
| sinotradition/meridian | meridian/acupoints/zhongzhu13.py | Python | apache-2.0 | 237 |
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Osmo Salomaa
#
# 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 pr... | otsaloma/gaupol | data/extensions/custom-framerates/custom-framerates.py | Python | gpl-3.0 | 9,196 |
#!/usr/bin/env python
# Copyright 2009-2014 Eucalyptus Systems, 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 ... | tbeckham/DeploymentManager | config_manager/eucalyptus/topology/__init__.py | Python | apache-2.0 | 4,399 |
'''
Created on Nov 11, 2013
@author: samriggs
'''
from collections import deque
class ClumpTracker():
'''
Contains:
* the particular k-mer to track
* number of sequences in the clump
* a queue that holds the indices of the subsequences
'''
def __init__(self, subSeq, subSeqIndex, subSeqLe... | samriggs/bioinf | Homeworks/bi-Python/chapter1/ClumpTracker.py | Python | gpl-2.0 | 2,140 |
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | datacommonsorg/data | scripts/us_epa/superfund/site_and_funding_status/process_sites_test.py | Python | apache-2.0 | 1,626 |
# -*- coding: Latin-1 -*-
"""Graphviz's dot language Python interface.
This module provides with a full interface to create handle modify
and process graphs in Graphviz's dot language.
References:
pydot Homepage: http://code.google.com/p/pydot/
Graphviz: http://www.graphviz.org/
DOT Language: http://www.grap... | margulies/topography | utils_py/pydot/pydot.py | Python | mit | 61,340 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Metadata for Flood Vector
Impact on OSM Buildings using QGIS libraries.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pu... | Jannes123/inasafe | safe/impact_functions/inundation/flood_vector_building_impact/metadata_definitions.py | Python | gpl-3.0 | 3,884 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Script to parse perf data from Chrome Endure test executions, to be graphed.
This script connects via HTTP to a buildbot master... | junmin-zhu/chromium-rivertrail | chrome/test/functional/perf/endure_result_parser.py | Python | bsd-3-clause | 22,820 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-12 20:02
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('myuser', '0003_auto_20160812_1501'),
]
operations = [
migrations.RemoveField(
... | nessalc/django-basics | mysite/myuser/migrations/0004_auto_20160812_1502.py | Python | mit | 498 |
class Solution(object):
def mySqrt(self, x):
"""
:type x: int
:rtype: int
"""
if x <=1: return x
i, j = 1, x
while i < j:
print i, j
m = (i+j) // 2
if m*m == x:
return m
elif m*m < x:
if (m+1)*(m+1) <= x:
i = m+1
else:
return m
else:
j = m-1
return i
print So... | xiaonanln/myleetcode-python | src/69. Sqrt(x).py | Python | apache-2.0 | 338 |
# -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | HewlettPackard/python-hpOneView | hpOneView/resources/data_services/metric_streaming.py | Python | mit | 4,307 |
# -*- coding: UTF-8 -*-
'''
Translate TextLeaf by Google Translate.
'''
__kupfer_name__ = _("Google Translate")
__kupfer_actions__ = ("Translate", "TranslateUrl", 'OpenTranslatePage')
__description__ = _("Translate text with Google Translate")
__version__ = "2010-09-06"
__author__ = "Karol Będkowski <karol.bedkowski@g... | cjparsons74/kupfer | kupfer/plugin/google_translate.py | Python | gpl-3.0 | 7,524 |
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
import time
import freenect
import calibkinect
import pykinectwindow as wxwindow
# I probably need more help with these!
try:
TEXTURE_TARGET = GL_TEXTURE_RECTANGLE
except:
TEXTURE_TARGET = GL_TEXTURE_RECTANGLE_ARB
if not 'win' in globals():
... | Dining-Engineers/left-luggage-detection | misc/demo/ipython/demo_pclview.py | Python | gpl-2.0 | 5,742 |
import wx, os, sys
from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, ListCtrlAutoWidthMixin
from wx.lib.scrolledpanel import ScrolledPanel
from traceback import print_exc
from Tribler.Main.vwxGUI.GuiUtility import GUIUtility
from Tribler.Main.Dialogs.GUITaskQueue import GUITaskQueue
... | egbertbouman/tribler-g | Tribler/Main/vwxGUI/tribler_topButton.py | Python | lgpl-2.1 | 24,111 |
"""Video Analyzer"""
| peragro/peragro-at | src/damn_at/analyzers/video/__init__.py | Python | bsd-3-clause | 21 |
# coding=utf-8
# Copyright 2022 The TensorFlow GAN 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 applicabl... | tensorflow/gan | tensorflow_gan/examples/mnist/infogan_eval.py | Python | apache-2.0 | 2,490 |
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without... | Shouqun/node-gn | tools/depot_tools/third_party/boto/core/credentials.py | Python | mit | 5,644 |
# 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 'AnswerReference.jurisdiction'
db.add_column('website_answerreference', 'jurisdi... | solarpermit/solarpermit | website/migrations/0007_auto__add_field_answerreference_jurisdiction__chg_field_answerreferenc.py | Python | bsd-3-clause | 37,751 |
'''
Subversion module Status class submodule
'''
import logging
import subprocess
import sys
from repoman._portage import portage
from portage import os
from portage.const import BASH_BINARY
from portage.output import red, green
from portage import _unicode_encode, _unicode_decode
from repoman._subprocess import rep... | hackers-terabit/portage | repoman/pym/repoman/modules/vcs/svn/status.py | Python | gpl-2.0 | 4,051 |
from random import choice
minusculas = "abcdefgh"
maiusculas = "ABCDEFGH"
senha = []
pos = 0
while pos < 8:
senha.append(choice(maiusculas))
senha.append(choice(minusculas))
pos += 1
print(''.join(senha))
#https://pt.stackoverflow.com/q/461052/101
| bigown/SOpt | Python/String/PasswordGenerator.py | Python | mit | 262 |
"""
aiDistanceLocator v1.0.2
----------------------------------------------------------------------------------------------------
- create a locator as a reference to adjust camera's focus distance or light attenuation parameters
--------------------------------------------------------------------------------------... | aaibfer/mtoaUtils | scripts/aiDistanceLocator.py | Python | mit | 13,950 |
"""
Django settings for {{ project_name }} project.
Generated by 'django-admin startproject' using Django {{ django_version }}.
For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.c... | zerolab/wagtail | wagtail/project_template/project_name/settings/base.py | Python | bsd-3-clause | 4,622 |
#
# 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... | pbokoc/pykickstart | tests/commands/liveimg.py | Python | gpl-2.0 | 4,453 |
import traceback
from couchpotato import get_db
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from .index import CategoryIndex, Categor... | gchaimovitz/CouchPotatoServer | couchpotato/core/plugins/category/main.py | Python | gpl-3.0 | 4,316 |
import re
from magichour.api.local.util.namedtuples import DistributedLogLine
from magichour.api.local.util.namedtuples import DistributedTransformLine
from magichour.api.local.util.log import log_time
def transformLine(line):
'''
process transformations into RDD format
Args:
line(string): line ... | d-grossman/magichour | magichour/api/dist/preprocess/preProcess.py | Python | apache-2.0 | 4,263 |
from fabric.api import task # , env, cd
# import the fabric tasks and templates from cotton
import cotton.fabfile as cotton
# load application-specific settings from this module
cotton.set_fabric_env('cotton_settings')
@task
def init():
"""
Initialize the app deployment
"""
cotton.install()
#co... | evilchili/hugops-marvin | build/fabfile.py | Python | mit | 916 |
"""
@author: dhoomakethu
"""
from __future__ import absolute_import, unicode_literals
from apocalypse.utils.vaurien_utils import (VaurienConfigFileParser
as ConfigFileParser)
from apocalypse.utils.vaurien_utils import settings_dict
__all__ = ["ConfigFileParser", "DEFAULT_SETTIN... | dhoomakethu/apocalypse | apocalypse/utils/config_parser.py | Python | mit | 1,634 |
from datetime import datetime
from decimal import Decimal
from urllib.error import URLError
import mechanicalsoup
from django.test import TestCase
from lxml.builder import E
from mock import MagicMock, Mock
from currency_convert import convert
from currency_convert.factory.currency_convert_factory import (
Monthl... | openaid-IATI/OIPA | OIPA/currency_convert/tests.py | Python | agpl-3.0 | 7,477 |
import argparse
import time
import subprocess
import logging
from deep_architect import search_logging as sl
from deep_architect import utils as ut
from deep_architect.contrib.communicators.mongo_communicator import MongoCommunicator
from search_space_factory import name_to_search_space_factory_fn
from searcher impor... | negrinho/deep_architect | examples/contrib/kubernetes/master.py | Python | mit | 9,581 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils._text import to_text
from ansible.module_utils.bas... | wilvk/ansible | lib/ansible/module_utils/network/f5/common.py | Python | gpl-3.0 | 8,051 |
# pylint: skip-file
# flake8: noqa
class RouterException(Exception):
''' Router exception'''
pass
class RouterConfig(OpenShiftCLIConfig):
''' RouterConfig is a DTO for the router. '''
def __init__(self, rname, namespace, kubeconfig, router_options):
super(RouterConfig, self).__init__(rname,... | brenton/openshift-ansible | roles/lib_openshift/src/class/oc_adm_router.py | Python | apache-2.0 | 21,561 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_data_labels11.py | Python | bsd-2-clause | 1,503 |
from sqlalchemy import Column, Integer, String, ForeignKey, Table, create_engine, MetaData, Date, DateTime, Float, Boolean
from sqlalchemy.orm import relationship, backref, scoped_session, sessionmaker, relation
from sqlalchemy.ext.declarative import declarative_base
import sqlalchemy
Base = declarative_base()
####... | jay-johnson/sci-pype | src/databases/schema/db_schema_stocks.py | Python | apache-2.0 | 1,377 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
# Author: LIN Yu <lin.yu@elico-corp.com>
#
# This program is free software: you can redistribute it a... | udayinfy/openerp-7.0 | move_reports/stock_move_report/stock_move_report.py | Python | agpl-3.0 | 23,230 |
# #
# Copyright 2009-2013 Ghent University
#
# This file is part of hanythingondemand
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundat... | molden/hanythingondemand | hod/config/config.py | Python | gpl-2.0 | 16,895 |
# -*- coding:utf-8-*-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from time import *
import sys
class Windows(QDialog):
def __init__(self, parent=None):
super(Windows, self).__init__(parent)
self.startButton = QPushButton("Start")
self.stopButton = QPushButton("Stop")
... | ptphp/PyLib | src/dev/case/timethread.py | Python | apache-2.0 | 2,356 |
__author__ = 'andrew'
from timeutil import *
class ModemLog(dict):
fields = ('finished', 'message_number', 'datetime',
'logged_message')
# This automagically retrieves values from the dictionary when they are referenced as properties.
# Whether this is awesome or sucks is open ... | whoi-acomms/pyacomms | acomms/modemlog.py | Python | lgpl-3.0 | 2,056 |
from datetime import date
import string
from . import base
from . import mixins
class TransformedRecord(
mixins.GenericCompensationMixin,
mixins.GenericIdentifierMixin,
mixins.GenericPersonMixin,
mixins.MembershipMixin, mixins.OrganizationMixin, mixins.PostMixin,
mixins.RaceMixin, mixins.LinkMix... | texastribune/tx_salaries | tx_salaries/utils/transformers/travis_county.py | Python | apache-2.0 | 2,847 |
from .util import split_package
from osc import conf
DEFAULT_SEARCH_STATES = ("new", "review", "declined")
def search(api, source=None, target=None, user=None, req_type=None, state=DEFAULT_SEARCH_STATES):
if not source and not target and not user:
raise ValueError("You must specify at least one of source... | matejcik/osc | osclib/request.py | Python | gpl-2.0 | 1,550 |
#!/usr/bin/python
#coding=utf-8
'''
@author: sheng
@contact: sinotradition@gmail.com
@copyright: License according to the project license.
'''
NAME='renzi23'
SPELL='rénzǐ'
CN='壬子'
SEQ='49'
if __name__=='__main__':
pass
| sinotradition/sinoera | sinoera/ganzhi/renzi23.py | Python | apache-2.0 | 229 |
"""All Flask blueprints for the entire application.
All blueprints for all views go here. They shall be imported by the views themselves and by application.py. Blueprint
URL paths are defined here as well.
"""
from flask import Blueprint
def _factory(partial_module_string, url_prefix):
"""Generates blueprint obj... | furritos/mercado-api | mercado/blueprints.py | Python | mit | 917 |
from numbers import Integral, Real
from itertools import chain
import string
import numpy as np
import openmc.checkvalue as cv
import openmc.data
# Supported keywords for continuous-energy cross section plotting
PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission',
'absorption', 'capture... | johnnyliu27/openmc | openmc/plotter.py | Python | mit | 38,526 |
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Simple data processing pipeline plugin for Ginga.
**Plugin Type: Local**
``Pipeline`` is a local plugin, which means it is associated with a channel.
An instance can be opened for each channel.
**Usage**
... | pllim/ginga | ginga/rv/plugins/Pipeline.py | Python | bsd-3-clause | 14,214 |
# Generated by Django 2.2.16 on 2020-10-15 17:48
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounting', '0050_app_user_profiles'),
]
operations = [
migrations.AddField(
model_name=... | dimagi/commcare-hq | corehq/apps/accounting/migrations/0051_hubspot_restrictions.py | Python | bsd-3-clause | 773 |
from devilry.apps.core import models
from devilry.simplified import FieldSpec, FilterSpec, FilterSpecs
class SimplifiedExaminerMetaMixin(object):
""" Defines the django model to be used, resultfields returned by
search and which fields can be used to search for a Examiner object
using the Simplified API "... | vegarang/devilry-django | devilry/coreutils/simplified/metabases/examiner.py | Python | bsd-3-clause | 867 |
#!/usr/bin/python2.6
# This file is a part of Metagam project.
#
# Metagam 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
# any later version.
#
# Metagam is distributed ... | JoyTeam/metagam | mg/test/testitems.py | Python | gpl-3.0 | 7,360 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | bmaggard/luigi | test/worker_parallel_scheduling_test.py | Python | apache-2.0 | 5,302 |
#!/usr/bin/env python
"""
Various signal-related context managers
"""
from contextlib import contextmanager
import signal
@contextmanager
def ExceptionOnSignal(s=signal.SIGUSR1, e=Exception, i=None):
"""
Raise a specific exception when the specified signal is detected.
"""
def handler(signum, frame)... | cerrno/neurokernel | neurokernel/ctx_managers.py | Python | bsd-3-clause | 1,627 |
#!/usr/bin/env python
# coding: utf-8
import sys
import os
import argparse
import datetime
import time
import random
# import logging
import numpy as np
import tensorflow as tf
from tensorflow.keras.datasets import fashion_mnist
from solver import solve_isotropic_covariance, symKL_objective
import shared_var
parser = a... | bytedance/fedlearner | example/privacy/label_protection/FL_Label_Protection_FMNIST_Demo.py | Python | apache-2.0 | 35,016 |
from __future__ import absolute_import
from sentry.models import ProjectKey, ProjectKeyStatus
from sentry.testutils import TestCase
class ProjectKeyTest(TestCase):
model = ProjectKey
def test_generate_api_key(self):
assert len(self.model.generate_api_key()) == 32
def test_from_dsn(self):
... | beeftornado/sentry | tests/sentry/models/test_projectkey.py | Python | bsd-3-clause | 2,502 |
#
# Copyright 2018 Telefonica Investigacion y Desarrollo, S.A.U
#
# 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 unde... | telefonicaid/fiware-keystone-spassword | keystone_spassword/contrib/spassword/mailer.py | Python | apache-2.0 | 2,991 |
template = {
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Sample Template to create a KMS Key. The Fn::GetAtt is used to retrieve the ARN",
"Resources": {
"myKey": {
"Type": "AWS::KMS::Key",
"Properties": {
"Description": "Samp... | spulec/moto | tests/test_cloudformation/fixtures/kms_key.py | Python | apache-2.0 | 1,604 |
"""Placeholder models for Teams"""
from teams.base_models import PersonBase
from teams.base_models import SquadBase
class PersonPlaceholder(PersonBase):
"""Person with a Placeholder to edit content"""
@property
def html_content(self):
"""No additional formatting is necessary"""
return sel... | cwilhelm/django-teams | teams_demo/demo/placeholder.py | Python | bsd-3-clause | 788 |
from datetime import datetime
import logging
import pdb
from django import db
from django.core.cache import cache
from django.test import TestCase
from models import TestModelA, TestModelB, TestModelC
logger = logging.getLogger(__name__)
class SimpleTest(TestCase):
"There should be one DB query to get the data, th... | SeanHayes/django-query-caching | django_query_caching_test_project/apps/test_app/tests.py | Python | bsd-3-clause | 4,946 |
import argparse
import os
import subprocess
import time
def parse_command_line():
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description='A utility used to backup tank data')
parser.add_argument('--hadoop_home', default=os.getcwd(),
help='The local ... | zxl200406/minos | tank/backup.py | Python | apache-2.0 | 2,320 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Debbuild(AutotoolsPackage):
"""Build deb packages from rpm specifications."""
homepag... | LLNL/spack | var/spack/repos/builtin/packages/debbuild/package.py | Python | lgpl-2.1 | 566 |
#!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | anudhagat/ConferenceCentral | models.py | Python | apache-2.0 | 4,844 |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from crispy_forms.bootstrap import StrictButton, TabHolder, Tab
class WelcomeForm(forms.Form):
... | niks3089/nixia-console | receiver/welcome_forms.py | Python | gpl-3.0 | 1,209 |
# Copyright 2015 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... | clarko1/Cramd | appengine/standard/memcache/guestbook/main.py | Python | apache-2.0 | 5,338 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# 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 t... | stdweird/aquilon | lib/python2.6/aquilon/worker/formats/network_environment.py | Python | apache-2.0 | 1,413 |
# -*- coding: utf-8 -*-
##########################################################################
# #
# Eddy: a graphical editor for the specification of Graphol ontologies #
# Copyright (C) 2015 Daniele Pantaleone <danielepantaleone@me.com> ... | danielepantaleone/eddy | eddy/ui/__init__.py | Python | gpl-3.0 | 2,349 |
# Copyright 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 or agr... | JioCloud/oslo.config | tests/test_types.py | Python | apache-2.0 | 13,215 |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 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 the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other... | nlgcoin/guldencoin-official | test/functional/wallet_backup.py | Python | mit | 8,674 |
# Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | datastax/python-driver | tests/integration/long/__init__.py | Python | apache-2.0 | 723 |
# coding: utf-8
import os
import sys
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from dataset.mnist import load_mnist
from common.util import smooth_curve
from common.multi_layer_net import MultiLayerNet
from common.optimizer import SGD
# 0:MNISTデータの読み込み... | Takasudo/studyPython | deep/ch06/weight_init_compare.py | Python | gpl-3.0 | 1,951 |
import functools
import logging
from c2corg_api import DBSession, caching
from c2corg_api.caching import cache_sitemap_xml
from c2corg_api.models.cache_version import CacheVersion
from c2corg_api.models.document import Document, DocumentLocale
from c2corg_api.models.route import ROUTE_TYPE, RouteLocale
from c2corg_api... | c2corg/v6_api | c2corg_api/views/sitemap_xml.py | Python | agpl-3.0 | 7,153 |
#!/usr/bin/env python3
"""
backend.py - ffmap-backend runner
https://github.com/ffnord/ffmap-backend
"""
import argparse
import json
import os
import sys
from datetime import datetime
import networkx as nx
from networkx.readwrite import json_graph
from lib import graph, nodes
from lib.alfred import Alfred
from lib.ba... | freifunk-fulda/ffmap-backend | backend.py | Python | bsd-3-clause | 6,391 |
# Copyright 2019 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | aerospike/aerospike-admin | lib/view/sheet/source.py | Python | apache-2.0 | 891 |
# Copyright 2016 Mirantis, 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 b... | bswartz/manila | manila/tests/share/drivers/container/fakes.py | Python | apache-2.0 | 1,795 |
from hubcheck.pageobjects.basepageobject import BasePageObject
from hubcheck.pageobjects.basepageelement import Link
from selenium.common.exceptions import NoSuchElementException
class GenericPage(BasePageObject):
"""Generic Page with just a header and footer"""
def __init__(self,browser,catalog):
sup... | codedsk/hubcheck | hubcheck/pageobjects/po_generic_page.py | Python | mit | 3,505 |
# 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):
# Deleting model 'CategoryGrid'
db.delete_table('smartgrid_categorygrid')
# Deleting model 'Categ... | jtakayama/makahiki-draft | makahiki/apps/widgets/smartgrid/migrations/0017_auto__del_categorygrid__del_category__add_columngrid__add_columnname.py | Python | mit | 20,369 |
"""
ND discretization
=================
Space discretization module groups functions to discretize n-dimensional spaces
in regions and facilitate the retrieve by regions or define neighbourhood with
fixed regions.
"""
| tgquintela/pySpatialTools | pySpatialTools/Discretization/Discretization_nd/__init__.py | Python | mit | 220 |
from dataclasses import dataclass
from typing import List
from monkey_island.cc.database import mongo
from monkey_island.cc.services.node import NodeService
@dataclass
class ManualExploitation:
hostname: str
ip_addresses: List[str]
start_time: str
def get_manual_exploitations() -> List[ManualExploitati... | guardicore/monkey | monkey/monkey_island/cc/services/reporting/exploitations/manual_exploitation.py | Python | gpl-3.0 | 813 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
... | anryko/ansible | lib/ansible/modules/network/meraki/meraki_nat.py | Python | gpl-3.0 | 29,958 |
#This program counts how many multiples of 2 numbers are in the limit you set
print("This program calculates the amount of multiples within a certain range")
name = input("Who is using this program?\n")
choice = input("Would you like to begin? Y/N\n").lower()
#function for fizzing or buzzing depending on which mult... | Vite94/pythondepo | FizzBuzz.py | Python | mit | 2,663 |
from behave import *
import re
import os
from rdopkg.utils import distgitmagic
from rdopkg.utils import specfile
from rdopkg.utils.distgitmagic import git
from rdopkg.utils.testing import exdiff
def _create_distgit(context, version, release, magic_comments=None):
name = 'foo-bar'
context.execute_steps(u'Give... | redhat-openstack/rdopkg | features/steps/distgit.py | Python | apache-2.0 | 6,597 |
"""THIRD PARTY LIBRARY IMPORTS"""
import win32api
"""LOCAL LIBRARY IMPORTS"""
from moduleForFindingTuplesTime import create_dict
from moduleForFindingPressTimes import create_dict
from moduleForRecordingTimelines import start_recording
__verison__ = '1.0'
__author__ = 'Matthew Nowak and Zachary Nowak' | zacandcheese/Keyboard-Biometric-Project | Project_Tuples_Alpha/__init__.py | Python | mit | 305 |
# Copyright (c) 2014-2016 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Handle binary stream returns in NCStream format."""
from collections import OrderedDict
import itertools
import logging
import zlib
import numpy as np
from . import cdm... | Unidata/siphon | src/siphon/cdmr/ncstream.py | Python | bsd-3-clause | 13,574 |
#!/usr/bin/python
import sys
import time
import apt_pkg
import apt
import apt.progress.base
class TextProgress(apt.progress.base.OpProgress):
def __init__(self):
self.last = 0.0
def update(self, percent):
if (self.last + 1.0) <= percent:
sys.stdout.write("\rProgress: %i.2 ... | HuayraLinux/python-apt | doc/examples/progress.py | Python | gpl-2.0 | 2,778 |
from tensorflow.python.ops import init_ops
from tensorflow.python.util import nest
import tensorflow as tf
def stack_bidirectional_dynamic_rnn(cells_fw, cells_bw, inputs, initial_states_fw=None, initial_states_bw=None,
dtype=None, sequence_length=None, parallel_iterations=None, sco... | eske/seq2seq | translate/rnn.py | Python | apache-2.0 | 12,958 |
import os, glob, platform
#find out if we're running on mac or linux and set the dynamic library extension
dylib_ext = ""
if platform.system().lower() == "darwin":
dylib_ext = ".dylib"
else:
dylib_ext = ".so"
print("Running on " + platform.system())
#make sure the release folder exists, and cl... | ewfuentes/SaleaeSDIOAnalyzer | build_analyzer.py | Python | mit | 3,742 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | stdweird/aquilon | lib/python2.6/aquilon/worker/formats/share.py | Python | apache-2.0 | 1,874 |
"""VMware vCenter plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.util import (
find_executable,
display,
)
from lib.docker_util import (
docker_run,
docker_rm,
docker_in... | Deepakkothandan/ansible | test/runner/lib/cloud/vcenter.py | Python | gpl-3.0 | 4,919 |
#!/usr/bin/env python
import unittest
from erlastic import decode, encode
from erlastic.types import *
erlang_term_binaries = [
# nil
([], list, "\x83j"),
# binary
("foo", str, '\x83m\x00\x00\x00\x03foo'),
# atom
(Atom("foo"), Atom, '\x83d\x00\x03foo'),
# atom true
(True, bool, '\x83d... | pombredanne/unuk | src/unuk/libs/erlastic/tests.py | Python | bsd-3-clause | 4,053 |
import os
import sys
from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
from shutil import rmtree
from urlparse import urlparse
from urllib2 import URLError
import urllib2
from numpy.testing import *
from numpy.compat import asbytes
import numpy.lib._datasource as datasource
def urlopen_stub(url, data=None):... | teoliphant/numpy-refactor | numpy/lib/tests/test__datasource.py | Python | bsd-3-clause | 10,225 |
from ..Module import Module
from ..TagData import TagData
### https://tools.ietf.org/html/rfc7848
class smd(Module):
opmap = {
'encodedSignedMark': 'set',
}
def __init__(self, xmlns):
Module.__init__(self, xmlns)
self.name = 'smd'
### RESPONSE parsing
### REQUEST rendering
d... | hiqdev/reppy | heppy/modules/smd.py | Python | bsd-3-clause | 597 |
"""
NGP VAN's `ActionID` Provider
http://developers.ngpvan.com/action-id
"""
from openid.extensions import ax
from .open_id import OpenIdAuth
class ActionIDOpenID(OpenIdAuth):
"""
NGP VAN's ActionID OpenID 1.1 authentication backend
"""
name = 'actionid-openid'
URL = 'https://accounts.ngpvan.com... | tobias47n9e/social-core | social_core/backends/ngpvan.py | Python | bsd-3-clause | 2,097 |
"""
All logic concerning ES-HyperNEAT resides here.
"""
import copy
import neat
import numpy as np
from pureples.hyperneat.hyperneat import query_cppn
from pureples.shared.visualize import draw_es
class ESNetwork:
"""
The evolvable substrate network.
"""
def __init__(self, substrate, cppn, params):
... | ukuleleplayer/pureples | pureples/es_hyperneat/es_hyperneat.py | Python | mit | 11,986 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_access_within_threshold_variable import abstract_access_within_threshold_variable
class employment_within_DDD_minutes_travel_time_hbw_am_walk(abstract... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim_parcel/zone/employment_within_DDD_minutes_travel_time_hbw_am_walk.py | Python | gpl-2.0 | 2,530 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nachi Ueno, NTT MCL, 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... | Frostman/eho-horizon | openstack_dashboard/dashboards/project/routers/urls.py | Python | apache-2.0 | 1,319 |
# coding: utf-8
from lib.models.userbase import UserBase
class Admin(UserBase):
def to_string(self):
return {
"id": self.id,
"username": self.username,
"nickname": self.nickname,
}
def to_detail_string(self):
return self.to_string()
| BillBillBillBill/Take-out | backend/takeout/admin/models/admin.py | Python | mit | 305 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dot_app.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| akiokio/dot | src/dot_app/manage.py | Python | bsd-2-clause | 250 |
# coding: utf-8
from django.http import HttpResponseRedirect as redir
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from eventex.subscriptions.forms import SubscriptionForm
from eventex.subscriptions.models import Subscription
def subscribe(request):
if request.method == 'POST... | xiru/xiru.wttd | eventex/subscriptions/views.py | Python | gpl-2.0 | 1,022 |
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import copy
from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL
from youtube_d... | rzhxeo/youtube-dl | test/test_YoutubeDL.py | Python | unlicense | 14,539 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.