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 ctypes import ( windll, WinError, c_wchar_p, c_ushort, create_unicode_buffer, sizeof, ) import logging __all__ = ["FontContext"] log = logging.getLogger(__name__) CreateCompatibleDC = windll.gdi32.CreateCompatibleDC CreateFont = windll.gdi32.CreateFontW SelectObject = windll.gdi32.SelectObject GetGlyphIndic...
SAPikachu/iriya
iriya/nativeapi.py
Python
apache-2.0
3,179
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
docusign/docusign-python-client
docusign_esign/models/workspace_list.py
Python
mit
7,214
# -*- coding: utf-8 -*- # # Copyright 2020 Ramil Nugmanov <nougmanoff@protonmail.com> # Copyright 2020 Dinar Batyrshin <batyrshin-dinar@mail.ru> # This file is part of CGRtools. # # CGRtools is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as pub...
stsouko/CGRtools
CGRtools/utils/functional_groups.py
Python
lgpl-3.0
1,753
# -*- coding: utf-8 -*- from typing import Optional, Text from zerver.lib.test_classes import WebhookTestCase class GoogleCodeInTests(WebhookTestCase): STREAM_NAME = 'gci' URL_TEMPLATE = "/api/v1/external/gci?&api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = 'gci' def test_abandon_event_message(...
mahim97/zulip
zerver/webhooks/gci/tests.py
Python
apache-2.0
2,860
from amqplib import client_0_8 as amqp # connect to server lConnection = amqp.Connection(host="localhost:5672", userid="guest", password="guest", virtual_host="/", insist=False) lChannel = lConnection.channel() # Create queue. Queues receive messages. # Durable means it'll be recreated at reboot. Auto delete of fal...
yaohuang2005/ntopng-json-rabbitmq-python-analysis
python/client.py
Python
gpl-3.0
2,286
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
eharney/cinder
cinder/tests/unit/api/contrib/test_volume_type_access.py
Python
apache-2.0
16,092
from pyxb.bundles.opengis.gml_3_3.raw.xbt import *
CantemoInternal/pyxb
pyxb/bundles/opengis/gml_3_3/xbt.py
Python
apache-2.0
51
# -*- coding: utf-8 -*- # Copyright (c) 2015-2022, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 from __future__ import absolute_import from __future__ import print_function from __future__ import division import os from os.path import isfile, join, abspath import exatomic from ...
exa-analytics/exatomic
exatomic/widgets/tests/test_widget_base.py
Python
apache-2.0
5,235
name = "corex_topic"
gregversteeg/corex_topic
corextopic/__init__.py
Python
apache-2.0
21
#!/usr/bin/env python3 # Copyright (c) 2014-2015 The Bitcoin Core developers # Copyright (c) 2015-2017 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import test_framework.loginit """ Exercise the ...
BitcoinUnlimited/BitcoinUnlimited
qa/rpc-tests/walletbackup.py
Python
mit
7,323
# # Bacula Python interface script for the Storage Daemon # # You must import both sys and bacula import sys, bacula # This is the list of Bacula daemon events that you # can receive. class BaculaEvents(object): def __init__(self): # Called here when a new Bacula Events class is # is created. Normally no...
anarexia/bacula
examples/python/SDStartUp.py
Python
agpl-3.0
1,667
# Copyright 2017 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 __future__ import print_function from __future__ import division from __future__ import absolute_import import json import unittest import mock from ...
endlessm/chromium-browser
third_party/catapult/dashboard/dashboard/services/crrev_service_test.py
Python
bsd-3-clause
1,606
# Imperialism remake # Copyright (C) 2014-16 Trilarion # # 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 progra...
Trilarion/imperialism-remake
source/imperialism_remake/client/graphics/minimap_nation_item.py
Python
gpl-3.0
2,319
#!/usr/bin/env python3 ################################################################################ # GeneratorExpression ################################################################################ a = [x * 2 for x in range(5)] b = (x * 2 for x in range(5)) print('a=', a) print('b=', b) for t in range(2): ...
crosserclaws/notebook
python/YouDontKnowPython/006_GeneratorExpression.py
Python
mit
535
# # GingaCanvasQt.py -- classes for the display of FITS files in # Matplotlib FigureCanvas # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. from ginga.qtw.QtHelp import QtGui, QtCore from ginga.toolkit import toolkit if toolkit ==...
naojsoft/ginga
ginga/mplw/FigureCanvasQt.py
Python
bsd-3-clause
2,298
# Copyright (C) 2021 Google 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, ...
google-research/python-graphs
python_graphs/data_flow.py
Python
apache-2.0
8,418
"""IDLE Configuration Dialog: support user customization of IDLE by GUI Customize font faces, sizes, and colorization attributes. Set indentation defaults. Customize keybindings. Colorization and keybindings can be saved as user defined sets. Select startup options including shell/editor and default window size. ...
Voluntarynet/BitmessageKit
BitmessageKit/Vendor/static-python/Lib/idlelib/configDialog.py
Python
mit
53,498
#!/usr/bin/python # -*- coding: utf-8 -*- from gobspy import main main()
arypbatista/gobspy
gobspy.py
Python
gpl-3.0
75
# Turns layout power off. # # Invoke this from a Logix in response to your desired e-stop command, # e.g. a panel button that operates an internal sensor # # Author: Bob Jacobsen, copyright 2013 # Part of the JMRI distribution # # The next line is maintained by SVN, please don't change it # $Revision: 27263 $ # powerm...
ctag/cpe453
JMRI/jython/PowerOff.py
Python
gpl-2.0
359
#!/usr/bin/env python # # __COPYRIGHT__ # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
andrewyoung1991/scons
test/runtest/python.py
Python
mit
2,380
# Copyright (c) 2011 OpenStack Foundation # 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 ...
rajalokan/nova
nova/scheduler/filters/compute_capabilities_filter.py
Python
apache-2.0
4,838
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Astropy is a package intended to contain core functionality and some common tools needed for performing astronomy and astrophysics research with Python. It also provides an index for other astronomy packages and tools for managing them. """ from __fut...
joergdietrich/astropy
astropy/__init__.py
Python
bsd-3-clause
10,943
#!/usr/bin/env/python """ We treat each silica atom as its own residue. As a consequence, we have more than 10000 residues in the system. The silly PDB format only allows up to 9999 residues. We solve this issue by manually creating a .gro file, which allows for up to 99999 residues """ from __future__ import print_f...
jmborr/confinedBSA
simulation/silica/cristobalite/confineBSA/poretop/nobonds/adaptPDB.py
Python
mit
1,589
_base_ = './yolox_s_8x8_300e_coco.py' # model settings model = dict( backbone=dict(deepen_factor=1.33, widen_factor=1.25), neck=dict( in_channels=[320, 640, 1280], out_channels=320, num_csp_blocks=4), bbox_head=dict(in_channels=320, feat_channels=320))
open-mmlab/mmdetection
configs/yolox/yolox_x_8x8_300e_coco.py
Python
apache-2.0
274
#!/usr/bin/env python2.4 # This program shows off a python decorator(which implements tail call # optimization. It does this by throwing an exception if it is its own # grandparent, and catching such exceptions to recall the stack. # Original source: http://code.activestate.com/recipes/474088/ # License: PSF import s...
xguse/outspline
src/outspline/static/activestate/tco.py
Python
gpl-3.0
1,346
#!/usr/bin/python import httplib import threading import time import subprocess import signal import sys import string import random port = "8086" sample = string.lowercase + string.digits + string.uppercase + string.punctuation def random_word(digits): return (''.join(random.choice(sample) for i in range(digit...
pombredanne/spiz
src/server/test/http_echo_test.py
Python
bsd-3-clause
1,471
''' Library of functions to visualise data. ''' from plot import * __all__ = ["plot"]
conceptric/pysolar
pysolar/visualisation/__init__.py
Python
mit
87
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import ( AuthIdentity, AuthProvider, OrganizationMember, UserEmail ) from sentry.testutils import AuthProviderTestCase # TODO(dcramer): this is an integration test and repeats tests from # core auth_login clas...
gencer/sentry
tests/sentry/web/frontend/test_auth_organization_login.py
Python
bsd-3-clause
23,619
"""HTTP Client for asyncio.""" import asyncio import base64 import hashlib import json import os import sys import traceback import warnings from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr from yarl import URL from . import connector as connector_mod from . import client_exceptions, client_reqrep,...
Eyepea/aiohttp
aiohttp/client.py
Python
apache-2.0
26,125
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Grid Dynamics # 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/l...
maheshp/novatest
nova/virt/libvirt/imagebackend.py
Python
apache-2.0
15,166
# Monty Hall Paradox - CS5300 Final Project - Andy Ladd, Matt Layher from pybrain.rl.environments.environment import Environment import random # Overiddes Environment Class from PyBrain. # Allows us to reset the game and get the winning and loosing choices class MontyHallEnv(Environment): def __init__(self): self....
mdlayher/archive
python/montyhall/montyhallenv.py
Python
mit
2,012
from __future__ import absolute_import import uuid import six class UUID(object): """ wrapper of uuid.UUID """ def __str__(self): return str(self.v) def to_json(self): return str(self.v) def apply_with(self, _, val, ctx): """ constructor :param val: things used ...
mission-liao/pyswagger
pyswagger/primitives/_uuid.py
Python
mit
876
# -*- coding: utf-8 -*- """ # Copyright Copyright (C) 2012 by Victor victor@caern.de # License This file is part of SoulCreator. SoulCreator 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...
GoliathLeviathan/SoulCreator
src/Widgets/Dialogs/SettingsDialog.py
Python
gpl-3.0
1,884
import pygame from pygame.locals import * from Constants import Constants from FadeTransition import FadeTransition from Menu import Menu from GW_Label import GW_Label from GuiWidgetManager import GuiWidgetManager from xml.sax import make_parser from Localization import Localization import os class ExitMenu(Menu...
reality3d/molefusion
modules/ExitMenu.py
Python
mit
1,885
# -*- coding: utf-8 -*- """ auto rule template ~~~~ :author: LoRexxar <LoRexxar@gmail.com> :homepage: https://github.com/LoRexxar/Kunlun-M :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2017 LoRexxar. All rights reserved """ from utils.api import * class CVI_100...
LoRexxar/Cobra-W
rules/php/CVI_1004.py
Python
mit
1,469
# -*- coding:utf-8 -*- import requests from bs4 import BeautifulSoup class GradeCrawler: """从信息门户获取成绩列表的爬虫 :param username: 用户名 :param password: 密码 """ def __init__(self, username, password): self.loginUrl = u'http://202.119.4.150/nstudent/login.aspx' self.gradeUrl = u'http://202...
Goclis/LittleLittle
notifygrade/crawler.py
Python
mit
2,012
#----------------------------------------------------------------------------- # Copyright (c) 2013-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
etherkit/OpenBeacon2
client/win/venv/Lib/site-packages/PyInstaller/utils/win32/winresource.py
Python
gpl-3.0
10,102
# -*- coding: utf-8 -*- from modernrpc.core import rpc_method from tcms.rpc.decorators import permissions_required from tcms.testcases.models import TestCaseStatus @permissions_required("testcases.view_testcasestatus") @rpc_method(name="TestCaseStatus.filter") def filter(query): # pylint: disable=redefined-builtin...
kiwitcms/Kiwi
tcms/rpc/api/testcasestatus.py
Python
gpl-2.0
828
import sys import random class Heroine: def __init__(self, index, enthusiasm): self.index = index self.enthusiasm = enthusiasm self.revealedLove = [] self.myRealLove = 0 self.dated = False class State: def __init__(self, turn, day, heroines): self.turn = turn self.day = day self.heroines = heroines ...
AI-comp/JavaChallenge2014
ai/ailib.py
Python
apache-2.0
1,681
#-*- encoding:UTF-8 -*- #!/usr/bin/python import socket,threading import time,Queue from xen import Xen import MySQLdb import os,sys import log class DB_doing(): def __init__(self): self.conn = MySQLdb.connect( host = 'localhost', port = 3306, user='root', passwd='xidian320...
myhello/DragonStackServer
update_vm.py
Python
gpl-3.0
2,309
import unittest from dukpy._dukpy import JSRuntimeError import dukpy from diffreport import report_diff class TestJSInterpreter(unittest.TestCase): def test_interpreter_keeps_context(self): interpreter = dukpy.JSInterpreter() ans = interpreter.evaljs("var o = {'value': 5}; o") assert ans...
amol-/dukpy
tests/test_jsinterpreter.py
Python
mit
1,411
import sys import word2vec def get_model_class(model): # class <model_name> from <model_name>.py module = __import__(model) model_class = getattr(module, model) return model_class def sentence_length(sentence): return sentence.count(" ")+1 def index_and_align(sentence, length, generate_new_vector=False): words...
bornabesic/cnn-text-classification
data.py
Python
mit
8,813
from django.contrib import admin from .models import Organization admin.site.register(Organization)
vladimiroff/humble-media
humblemedia/organizations/admin.py
Python
mit
103
# 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...
ghchinoy/tensorflow
tensorflow/python/debug/cli/ui_factory.py
Python
apache-2.0
2,660
import sys import scipy.io import numpy as np import pickle import matplotlib.pyplot as plt import math output_dir = '/home/mark/Desktop' class ActionContent: def __init__(self, name): self.name = name self.times = [] self.time_idx = [] self.palm_forces = [] self.palm_avg...
xiaozhuchacha/OpenBottle
old/force_dist/force-dist.py
Python
mit
14,751
#!/usr/bin/env python3 numbers = [] with open('input.txt', 'r') as f: numbers = f.read().splitlines() tgt_num = 0 tgt_num_pos = 0 #--- challenge 1 for pos in range(25, len(numbers)): found = False tgt_num = int(numbers[pos]) for i in range((pos-25), pos): for j in range((pos-24), pos): first = in...
jekhokie/scriptbox
python--advent-of-code/2020/9/solve.py
Python
mit
1,093
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: user # # Created: 16/01/2014 # Copyright: (c) user 2014 # Licence: <your licence> #-------------------------------------------------------------...
anhhh11/vidlec2img
GetLink.py
Python
mit
1,449
""" Position 300. Trend 145 up. Error 0.54616. Attempt 9. Wed, 27 Aug 2014 15:56:13 Your Best Entry You improved on your best score by 0.34067. You just moved up 175 positions on the leaderboard """ import datetime import pandas as pd from sklearn.cross_validation import train_test_split from sklearn.preprocessing i...
noelevans/sandpit
kaggle/washington_bike_share/random_forest_rms0.55.py
Python
mit
2,471
import sqlalchemy as SA from tornado.escape import xhtml_escape import core.db as db from core.mail import MailQueue from core.requesthandler import RequestHandler import core.util from core.xmppclient import XMPPQueue class CommentRequestServlet(RequestHandler): def post(self): if not self.current_user:...
pombredanne/pushmanager
servlets/commentrequest.py
Python
apache-2.0
2,663
# Copyright 2015 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...
jeffzheng1/tensorflow
tensorflow/python/framework/function.py
Python
apache-2.0
30,389
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/bwa/package.py
Python
lgpl-2.1
2,672
# -*- coding: utf-8 -*- """Production environment settings.""" from .base import * # NOQA SECRET_KEY = env('DJANGO_SECRET_KEY') SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # HSTS SECURE_HSTS_SECONDS = 10 # Change this whent production mode is ready SECURE_HSTS_INCLUDE_SUBDOMAINS = env.bool('DJA...
inventivehack/cookiecutter-django-ihk
{{cookiecutter.project_slug}}/config/settings/prod.py
Python
mit
1,108
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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 #...
jat255/hyperspyUI
hyperspyui/info.py
Python
gpl-3.0
836
# -*- coding: utf-8 -*- # (c) 2016 Andreas Motl <andreas.motl@elmyra.de> from pyramid.config.predicates import RequestMethodPredicate from pyramid.urldispatch import RoutesMapper from pyramid.threadlocal import get_current_registry class PathRoutingEngine(object): """ A simple routing engine for path-based pat...
zerotired/kotori
kotori/io/router/path.py
Python
agpl-3.0
1,956
__author__ = 'jm' import matplotlib as mp print "Testing my hello Wordl" #x = 15 #x = x +52 #print x #name = raw_input("Enter your name") #print "Hello " + name ## This first line is provided for you #hrs = raw_input("Enter Hours:") #rph = raw_input("Enter rate:") #fhrs = float(hrs) #frph = float(rph) #pay = fh...
kevinnguyeneng/R
Python-ProgEvOne/main.py
Python
mit
2,905
# Copyright 2015 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...
apark263/tensorflow
tensorflow/python/keras/optimizer_v2/gradient_descent_test.py
Python
apache-2.0
34,465
# -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014-2022 Matias Bordese # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation t...
matiasb/python-unidiff
unidiff/patch.py
Python
mit
23,548
from pydigree.common import all_same_type from .genoabc import AlleleContainer class LabelledAlleles(AlleleContainer): def __init__(self, spans=None, chromobj=None, nmark=None): if not (chromobj or nmark): raise ValueError('One of chromobj or nmark must be specified') self.spans = spa...
jameshicks/pydigree
pydigree/genotypes/labelledalleles.py
Python
apache-2.0
7,621
import itertools from logging import getLogger import os import signal import threading import time import paste.script import paste.fixture import paste.registry import paste.deploy.config from paste.deploy import loadapp from paste.script.command import Command import rq from adhocracy import model from adhocracy.l...
SysTheron/adhocracy
src/adhocracy/lib/cli.py
Python
agpl-3.0
10,730
#!/usr/bin/python # Removes a particular entitlement from all your systems # Set TARGET_ENTITLEMENT to one of 'enterprise_entitled', 'provisioning_entitled', # 'monitoring_entitled', 'nonlinux_entitled', 'virtualization_host', or 'virtualization_host_platform'. import xmlrpclib import getpass import datetime SATELLITE...
chwilk/rhn-scripts
entitlements.py
Python
gpl-2.0
939
from mpg123 import Mpg123 import wave mp3 = Mpg123('tests/bensound-epic.mp3') rate, channels, encoding = mp3.get_format() wav = wave.open('bensound-epic.wav', 'wb') wav.setnchannels(channels) wav.setframerate(rate) wav.setsampwidth(mp3.get_width_by_encoding(encoding)) for frame in mp3.iter_frames(): wav.writefra...
20tab/mpg123-python
examples/mp3_to_wave.py
Python
mit
344
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## 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. ## ## ...
VisTrails/VisTrails
vistrails/core/vistrail/connection.py
Python
bsd-3-clause
10,497
# This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful,...
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons_contrib/amaranth/animation/motion_paths.py
Python
gpl-3.0
4,805
class UserInfoModel(object): PartenaireID = 0 Mail = "" CodeUtilisateur = "" TypeAbonnement = "" DateExpiration = "" DateSouscription = "" AccountExist = False def __init__(self, **kwargs): self.__dict__.update(kwargs) def create_dummy_model(self): self.Mail = "dumm...
NextINpact/LaPresseLibreSDK
python_django/sdk_lpl/models/UserInfosModel.py
Python
mit
439
#! /usr/bin/env python """ Author: Dan-George Filimon This file is part of SortingBenchmarks. SortingBenchmarks is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (a...
dfilimon/SortingBenchmarks
benchmark.py
Python
gpl-3.0
1,965
# 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...
gerrive/horizon
openstack_dashboard/dashboards/identity/projects/workflows.py
Python
apache-2.0
37,510
import logging from newrelic.agent import (current_transaction, extra_settings, insert_html_snippet, wrap_function_wrapper) from newrelic.packages import six _logger = logging.getLogger(__name__) _boolean_states = { '1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False,...
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/hooks/middleware_flask_compress.py
Python
agpl-3.0
4,521
#!/usr/bin/env python2.7 # __BEGIN_LICENSE__ # # Copyright (C) 2010-2012 Stanford University. # All rights reserved. # # __END_LICENSE__ # rectify.py # # Usage: rectify.py <lightfield_image.{tif,png,etc}> [--pixels-per-lenslet <ppl>] # # This script simply applies a rectification from a # campixel_to_camlens.warp fil...
sophie63/FlyLFM
stanford_lfanalyze_v0.4/lfrectify.py
Python
bsd-2-clause
3,622
from django.db import models from django.dispatch import receiver from django.core.urlresolvers import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from django.utils import timezone from django.conf import settings from djang...
bilbeyt/ituro
ituro/projects/models.py
Python
mit
2,482
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['LinearTrend'] , ['Seasonal_DayOfMonth'] , ['NoAR'] );
antoinecarme/pyaf
tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_LinearTrend_Seasonal_DayOfMonth_NoAR.py
Python
bsd-3-clause
162
from top_level.technical.db import DB, Session from top_level.domain.hourtable import HourTable from top_level.domain.date import Date from top_level.domain.user import User from top_level.domain.event import Event from top_level.domain.hour import Hour user_obj = User('','') hourtable_obj = HourTable('') event_ob...
MaoRodriguesJ/INE5417
top_level/interface/terminal.py
Python
mit
8,555
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicab...
citrix-openstack-build/heat
heat/engine/resources/neutron/subnet.py
Python
apache-2.0
4,333
""" Test the bdb module. A test defines a list of tuples that may be seen as paired tuples, each pair being defined by 'expect_tuple, set_tuple' as follows: ([event, [lineno[, co_name[, eargs]]]]), (set_type, [sargs]) * 'expect_tuple' describes the expected current state of the Bdb instance. ...
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/test/test_bdb.py
Python
gpl-2.0
42,199
import sys import scipy.optimize from scipy.stats import geom from numpy import * from numpy.random import random, seed style = sys.argv[1] if len(sys.argv) >= 3: seed(int(sys.argv[2])) # # Step 1: load the concordance counts # edges = [] word_types = {} phrase_types = {} context_types = {} for line in sys.st...
agesmundo/FasterCubePruning
gi/posterior-regularisation/train_pr_agree.py
Python
apache-2.0
14,556
# -*- coding: 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 unique constraint on 'Category', fields ['name'] db.create_unique(u'website_category', ['name']) ...
LucasMagnum/pyexplain
pyexplain/website/migrations/0003_auto__add_unique_category_name.py
Python
mit
1,760
import collections import os import shlex import subprocess import sys from ._consts import SHELL_NAMES Process = collections.namedtuple('Process', 'args pid ppid') def _get_process_mapping(): """Try to look up the process tree via the output of `ps`. """ output = subprocess.check_output([ 'ps'...
kennethreitz/pipenv
pipenv/vendor/shellingham/posix.py
Python
mit
1,673
import json from django.core.exceptions import PermissionDenied from django.core.files.uploadedfile import SimpleUploadedFile from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render_to_response, redirect from django.template import Reques...
tekton/DocuCanvas
helpdesknew/views.py
Python
gpl-3.0
16,802
#!/usr/bin/python import utils print utils.tmpnam()
DarthMaulware/EquationGroupLeaks
Leak #4 - Don't Forget Your Base/EQGRP-Auction-File/Linux/bin/earlyshovel/tmpnam.py
Python
unlicense
54
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015: # Frederic Mohier, frederic.mohier@gmail.com # # This file is part of (WebUI). # # (WebUI) 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 Foundati...
mohierf/flask-webui
alignak_webui/login.py
Python
agpl-3.0
3,724
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from textw...
mateor/pants
contrib/scrooge/tests/python/pants_test/contrib/scrooge/tasks/test_scrooge_gen.py
Python
apache-2.0
5,097
from datetime import datetime, timedelta import time import unittest from unittest.mock import MagicMock import unittest.mock as mock from plebnet.agent.strategies.last_day_sell import LastDaySell from plebnet.agent.strategies.simple_moving_average import SimpleMovingAverage, MAX_ACCUMULATION_TIME, \ ITERATION_TI...
rjwvandenberg/PlebNet
tests/agent/strategies/test_simple_moving_average.py
Python
lgpl-3.0
14,760
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase from test import t...
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_ftplib.py
Python
mit
26,045
from flask import request,jsonify import ec_forum.error as error import ec_forum.expr as expr from ec_forum.sql import sqlQ from ec_forum.salt import encrypt, decrypt from ec_forum.id_dealer import pack_id, unpack_id from ec_forum.public import default_tags from ec_forum.reputation import event, rule from config import...
imxana/ec_forum
ec_forum/question.py
Python
mit
25,110
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
TheTimmy/spack
lib/spack/spack/build_systems/autotools.py
Python
lgpl-2.1
19,209
import importlib, json from querystring_parser import parser from django.db.models import Q from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.edit import FormView from dingos import DINGOS_INTERNAL_IOBJECT_FAMILY_NAME from dingos.view_cla...
siemens/django-mantis-authoring
mantis_authoring/views.py
Python
gpl-2.0
10,849
from flask import Flask from models import db from controllers.main import main_blueprint from controllers.blog import blog_blueprint def create_app(object_name): """ An flask application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/ Arguments: object_name: t...
nikitabrazhnik/flask2
Module 3/Chapter05/chapter_5/webapp/__init__.py
Python
mit
707
""" ****** Layout ****** Node positioning algorithms for graph drawing. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = """Aric ...
azlanismail/prismgames
examples/games/car/networkx/drawing/layout.py
Python
gpl-2.0
16,139
import unittest import math from skypyblue.core import ConstraintSystem from skypyblue.models import Constraint, Strength, Method, Variable from point import Point class ExtendedMidpointTest(unittest.TestCase): __name__ = "ExtendedMidpointTest" def setUp(self): self.constraint_system = ConstraintSystem() s...
knub/skypyblue
tests/extended_midpoint_tests.py
Python
mit
3,023
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015, 2016, 2017 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...
hachreak/invenio-oauthclient
invenio_oauthclient/views/client.py
Python
gpl-2.0
5,310
import github # -*- coding: iso-8859-15 import sys #funcion para contar los elementos de un conjunto def count(param): acum = 0 for a in param: acum = acum + 1 return acum #Se pasa como argumento de main el indice inicial y final de los proyectos que se quieren parsear if len(sys.argv) == 5: i = int...
elihu/githubAbreforjas
TestingCode/Scripts/projects.py
Python
gpl-2.0
2,328
def isPhoneNumber(text): if len(text) != 12: return False for i in range(0, 3): if not text[i].isdecimal(): return False if text[3] != '-': return False for i in range(4, 7): if not text[i].isdecimal(): return False if text[7] != '-': r...
kristianfzr/AutomateTheBoringStuff
test.py
Python
mit
589
import tkinter from .range import Range class StartEndRange: is_index = False def __init__(self, start, end): self.start = start self.end = end def resolve(self, model): return Range(self.start.resolve(model), self.end.resolve(model)) def __eq__(self, other): return (...
mgautierfr/devparrot
devparrot/core/utils/posrange/modifier.py
Python
gpl-3.0
6,498
from datetime import datetime from .base import BaseModel class Comment(BaseModel): def __init__(self, **kwargs): # Add created and updated attrs by default. self.created = self.updated = datetime.now() super().__init__(**kwargs) def update(self): """ Extends update method to...
oldani/nanodegree-blog
app/models/comment.py
Python
mit
422
import pynmrstar import sys class xplor_to_nmrstar(object): """ Generates xplor script and input files from NMR-STAR """ def __init__(self,fname): seq,noe,angle,rdc = self.read_input_file(fname) self.write_seq_file(seq) self.write_noe_tbl(noe) self.write_dihedral_tbl(an...
kumar-physics/BMRBTranslator
xplor_to_nmrstar/xplor_to_nmrstar.py
Python
gpl-3.0
10,060
import wx class TransparentText(wx.StaticText): def __init__(self, parent, id, label, pos, size): wx.StaticText.__init__(self, parent, id, label, pos, size, wx.TRANSPARENT_WINDOW) self.font = wx.Font(10, wx.MODERN, wx.NORMAL, wx.FONTWEIGHT_NORMAL, face="Tahoma") # self.font_color = self.GetForegroundColou...
Fahreeve/nice_notice
TransparentText.py
Python
mit
796
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the Windows EventLog (EVT) parser.""" import unittest from plaso.lib import definitions from plaso.parsers import winevt from tests.parsers import test_lib class WinEvtParserTest(test_lib.ParserTestCase): """Tests for the Windows EventLog (EVT) parser."...
log2timeline/plaso
tests/parsers/winevt.py
Python
apache-2.0
2,807
#!/usr/bin/env python # Copyright (c) 2015, Carnegie Mellon University # All rights reserved. # Authors: Michael Koval <mkoval@cs.cmu.edu> # Pras Velagapudi <pkv@cs.cmu.edu> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
Stefanos19/prpy
src/prpy/futures.py
Python
bsd-3-clause
9,529
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from Quotes_app.models import Quotes # Register your models here. admin.site.register(Quotes)
GunnerJnr/_CodeInstitute
Stream-3/Full-Stack-Development/4.Hello-Django-Administration/4.-Wire-Up-A-Model-To-A-Template/challenge_solution/QuoteOfTheDay/Quotes_app/admin.py
Python
mit
193
from django.conf.urls.defaults import * # enable django admin from django.contrib import admin admin.autodiscover() handler500 = 'djangotoolbox.errorviews.server_error' urlpatterns = patterns('', ('^_ah/warmup$', 'djangoappengine.views.warmup'), # ('^$', 'django.views.generic.simple.direct_to_template',...
pz325/hornbook-django
urls.py
Python
bsd-3-clause
1,168
# 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 u...
Mega-DatA-Lab/mxnet
example/reinforcement-learning/dqn/replay_memory.py
Python
apache-2.0
12,085