text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# Waver module __init__.py
"""
*******************************
WAVER
*******************************
This subpackage contains various utilities for WAVER,
the SuperDARN Wave Analysis Software Package.
DEV: functions/modules/classes with a * have not been developed yet
*******************************
"""
#... | garimamalhotra/davitpy | pydarn/proc/music/__init__.py | Python | gpl-3.0 | 678 | 0.00885 |
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import warnings
from flask_wtf import Form
from wtforms import TextField, IntegerField, SelectField, validators
from werkzeug import redirect, abort
from jinja2 import Template... | PritishC/nereid | trytond_nereid/party.py | Python | gpl-3.0 | 12,239 | 0.000163 |
import pytest
from waterbutler.providers.osfstorage.exceptions import OsfStorageQuotaExceededError
class TestExceptionSerialization:
@pytest.mark.parametrize(
'exception_class',
[(OsfStorageQuotaExceededError),]
)
def test_tolerate_dumb_signature(self, exception_class):
"""In orde... | CenterForOpenScience/waterbutler | tests/providers/osfstorage/test_exceptions.py | Python | apache-2.0 | 803 | 0.007472 |
#
# 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... | bolkedebruin/airflow | airflow/providers/google/cloud/hooks/kubernetes_engine.py | Python | apache-2.0 | 10,778 | 0.002227 |
import asyncio
import logging
import os
import signal
from collections import defaultdict
import aiohttp.web
from aiohttp_index import IndexMiddleware
logger = logging.getLogger('rc-car.vechicle')
class Vechicle:
DEFAULT_CFG = {}
def __init__(self, cfg=None, loop=None):
self.loop = loop or asynci... | habibutsu/rc-car | rc_car/vechicle.py | Python | mit | 3,174 | 0 |
#!/usr/bin/env python
"Module to aggregate all pdf figures of a directory \
into a single latex file, and compile it."
from __future__ import division, print_function
import os
import sys
import re
from optparse import OptionParser
_VERSION = '1.0'
def latex_dir(outfile_name, directory, column=2, eps=False):
"Pr... | LouisPlisso/analysis_tools | latex_directory_1_2.py | Python | gpl-3.0 | 5,070 | 0.002959 |
from tests import BaseTestCase
import mock
import time
from redash.models import User
from redash.authentication.account import invite_token
from tests.handlers import get_request, post_request
class TestInvite(BaseTestCase):
def test_expired_invite_token(self):
with mock.patch('time.time') as patched_ti... | pubnative/redash | tests/handlers/test_authentication.py | Python | bsd-2-clause | 2,213 | 0.003163 |
from servicemanager.actions import actions
from servicemanager.smcontext import SmApplication, SmContext, ServiceManagerException
from servicemanager.smprocess import SmProcess
from servicemanager.service.smplayservice import SmPlayService
from servicemanager.serviceresolver import ServiceResolver
import pytest
from ... | hmrc/service-manager | test/it/test_actions.py | Python | apache-2.0 | 11,909 | 0.002015 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
########## boafi Pentest script
########## - Perform various pentests automatically and save reports for further study
########## - Features/TODOs: Ipv6,DHCP,DNS,NTP,exploits,mitm..
########## - Router bruteforce for easy guessable passwords
########## - Scan networks hosts and... | fnzv/Boafi | BoafiPenTest.py | Python | mit | 12,450 | 0.020484 |
#!/usr/bin/env python3
# Copyright (c) 2020 VMware Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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.ap... | mbudiu-vmw/hiero | data/metadata/differential-privacy/data/ontime_private/gen_metadata.py | Python | apache-2.0 | 3,456 | 0.005498 |
from apps.plus_permissions.default_agents import get_admin_user
from apps.plus_permissions.models import GenericReference
def patch():
for ref in GenericReference.objects.filter(creator=None):
ref.creator = get_admin_user()
ref.save()
patch()
| thehub/hubplus | scripts/patch_ref_creator_field.py | Python | gpl-3.0 | 267 | 0.011236 |
"""Websocekt API handlers for the hassio integration."""
import logging
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.components.websocket_api.connection import ActiveConnection
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_... | aronsky/home-assistant | homeassistant/components/hassio/websocket_api.py | Python | apache-2.0 | 3,538 | 0 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bokeh/bokeh | tests/unit/bokeh/protocol/test_receiver.py | Python | bsd-3-clause | 5,417 | 0.00683 |
# Copyright 2013 OpenStack Foundation
#
# 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... | atheendra/access_keys | keystone/token/providers/uuid.py | Python | apache-2.0 | 929 | 0 |
# Copyright (c) 2008, 2009, 2010, 2011 Andrey Golovizin
#
# 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... | rybesh/pybtex | pybtex/backends/html.py | Python | mit | 2,255 | 0.002661 |
# -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals, absolute_import,
division)
import json
import re
import six
import sys
channel_name_re = re.compile('\A[-a-zA-Z0-9_=@,.;]+\Z')
app_id_re = re.compile('\A[0-9]+\Z')
pusher_url_re = re.compile('\A(http|htt... | hkjallbring/pusher-http-python | pusher/util.py | Python | mit | 1,209 | 0.014888 |
import unittest, test.support
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
try:
import threading
except ImportError:
threading = None
cla... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.2/Lib/test/test_sys.py | Python | mit | 32,006 | 0.001843 |
#!/usr/bin/python
import json
with open("test_json.json","r") as f:
new_list = json.load(f)
print new_list
| nkripper/pynet | week1/json_intro_read.py | Python | apache-2.0 | 111 | 0.018018 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('ccx', '0008_auto_20170523_0630'),
]
operations = [
migrations.AlterField(
model_name='customcour... | mbareta/edx-platform-ft | lms/djangoapps/ccx/migrations/0009_auto_20170608_0525.py | Python | agpl-3.0 | 735 | 0.002721 |
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import threading
class TimeoutError(Exception):
pass
class Datasrc(object):
def __init__(self, length=0):
... | sosey/ginga | ginga/misc/Datasrc.py | Python | bsd-3-clause | 3,565 | 0.001964 |
""" ./examples/attachment/attachment_step.rst """
from hamcrest import assert_that
from allure_commons_test.report import has_test_case
from allure_commons_test.result import has_step
from allure_commons_test.result import has_attachment
def test_step_with_attachment(executed_docstring_path):
assert_that(execute... | allure-framework/allure-python | allure-pytest/test/acceptance/attachment/attachment_step_test.py | Python | apache-2.0 | 622 | 0 |
"""
showspec is my homegrown spectrum plotter, meant to somewhat follow STARLINK's
SPLAT and have functionality similar to GAIA, but with an emphasis on producing
publication-quality plots (which, while splat may do, it does unreproducibly)
.. todo::
-add spectrum arithmetic tools
(as is, you can use nump... | keflavich/agpy | agpy/showspec.py | Python | mit | 51,670 | 0.020302 |
#
# Loxodo -- Password Safe V3 compatible Password Vault
# Copyright (C) 2008 Christoph Sommer <mail@christoph-sommer.de>
#
# 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 ... | hupf/passwordchest | src/loxodo/twofish/twofish_ecb.py | Python | gpl-2.0 | 2,538 | 0.003546 |
"""
XML serializer.
"""
from django.conf import settings
from django.core.serializers import base
from django.db import models, DEFAULT_DB_ALIAS
from django.utils.xmlutils import SimplerXMLGenerator
from django.utils.encoding import smart_unicode
from xml.dom import pulldom
class Serializer(base.Serializer):
"""
... | nycholas/ask-undrgz | src/ask-undrgz/django/core/serializers/xml_serializer.py | Python | bsd-3-clause | 11,755 | 0.003063 |
invites = ['Queen Elizabeth II', 'Prince Philip','Duchess Kate','Prince William']
hello = "Your majesty "
message = ", you are invited to the Royal Dinner Party. \n- King George"
rsvp_qe = hello + invites[0] + message
rsvp_pp = hello + invites[1] + message
rsvp_dk = hello + invites[2] + message
rsvp_pw = hello + invite... | lukeebhert/python_crash_course | Chapter_3/dinner_guests.py | Python | gpl-3.0 | 740 | 0.005405 |
'''
Numberjack is a constraint satisfaction and optimisation library
Copyright (C) 2009 Cork Constraint Computation Center, UCC
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; eith... | eomahony/Numberjack | tests/SolverTests.py | Python | lgpl-2.1 | 32,022 | 0.02339 |
from collections import namedtuple
from foil.formatters import format_repr
from postpy.ddl import (
compile_column, compile_qualified_name, compile_primary_key,
compile_create_table, compile_create_temporary_table
)
__all__ = ('Database', 'Schema', 'Table', 'Column', 'PrimaryKey', 'View')
class Database:
... | portfoliome/postpy | postpy/base.py | Python | mit | 4,942 | 0 |
from oplogreplayer import OplogReplayer | uberVU/mongo-oplogreplay | oplogreplay/__init__.py | Python | mit | 39 | 0.025641 |
import os
import pytest
import requests
from keybar.client import TLS12SSLAdapter
from keybar.tests.helpers import LiveServerTest
from keybar.tests.factories.user import UserFactory
from keybar.tests.factories.device import (
AuthorizedDeviceFactory, PRIVATE_KEY, PRIVATE_KEY2)
from keybar.utils.http import Insecu... | keybar/keybar | src/keybar/tests/test_client.py | Python | bsd-3-clause | 4,080 | 0.001225 |
from django.db import models
from django.utils import timezone
import datetime
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self): # __unicode__ on Python 2
retur... | chandu-atina/User-Management | rfxapp/models.py | Python | mit | 893 | 0.006719 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | QingChenmsft/azure-cli | src/azure-cli-core/azure/cli/core/tests/test_command_registration.py | Python | mit | 15,404 | 0.003635 |
"""Print effective userid
SYNOPSIS:
whoami
DESCRIPTION:
Print the user name associated with current remote
server access rights.
* PASSIVE PLUGIN:
No requests are sent to server, as current user
is known by $USER environment variable (`env USER`);
AUTHOR:
nil0x42 <http://goo.gl/kb2wf>
""... | nil0x42/phpsploit | plugins/system/whoami/plugin.py | Python | gpl-3.0 | 371 | 0 |
import json, io, re, requests
from bs4 import BeautifulSoup
from datetime import datetime
def get_datasets(url):
r = requests.get(url.format(0))
soup = BeautifulSoup(r.text)
href = soup.select('#block-system-main a')[-1]['href']
last_page = int(re.match(r'.*page=(.*)', href).group(1))
for page in... | nbi-opendata/metadaten-scraper | get-metadata.py | Python | mit | 3,412 | 0.003224 |
# #!/usr/bin/env python
#
# import nlopt # THIS IS NOT A PACKAGE!
# import numpy as np
#
# print(('nlopt version='+nlopt.__version__))
#
# def f(x, grad):
# F=x[0]
# L=x[1]
# E=x[2]
# I=x[3]
# D=F*L**3/(3.*E*I)
# return D
#
# n = 4
# opt = nlopt.opt(nlopt.LN_COBYLA, n)
# opt.set_min_objective(f)... | PMBio/limix | External/nlopt/test/test_std.py | Python | apache-2.0 | 727 | 0 |
#!/usr/bin/env python
# coding=utf-8
"""
Copyright (C) 2010-2013, Ryan Fan <ryan.fan@oracle.com>
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 opti... | rfancn/wxgigo | wxgigo/wxmp/sdk/plugin/fshelper.py | Python | mit | 5,556 | 0.00324 |
#!/usr/bin/env python
import copy
import datetime as dt
import re
from decimal import Decimal, InvalidOperation
from openpyxl import *
from openpyxl.cell import Cell
from openpyxl.utils import get_column_letter
from openpyxl.worksheet import Worksheet
# OPENPYXL WITH INSERT ROW
# ----------------------------------... | mpdevilleres/tbpc_app | tbpc/resource_mgt/utils.py | Python | mit | 5,806 | 0.002756 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.internet import task, reactor, defer
from twisted.python import failure
class TestableLoopingCall(task.LoopingCall):
def __init__(self, clock, *a, **kw):
super(TestableLoopi... | kenorb-contrib/BitTorrent | twisted/test/test_task.py | Python | gpl-3.0 | 6,793 | 0.004122 |
class Object:
def __init__(self, name):
self._name = name
@property
def name(self):
return self._name
| gnovis/swift | swift_fca/swift_core/object_fca.py | Python | gpl-3.0 | 131 | 0 |
"""
This app is a simple extension of built in auth_views which overrides login and
logout to provide messages on successful login/out.
"""
from django.contrib.auth import views as auth_views
from django.utils.translation import ugettext as _
from django.core.exceptions import PermissionDenied
from django.core.urlreso... | yourcelf/btb | scanblog/accounts/views.py | Python | agpl-3.0 | 2,880 | 0.002431 |
import datetime
from flask import abort, render_template, request, redirect, Response
import ctrl.blog
from . import handlers
@handlers.route('/blog')
def blog_index():
pageNo = 0
if request.args.get('page'):
pageNo = int(request.args.get('page'))
if pageNo < 0:
pageNo = 0
posts = ctrl.blog.getP... | codeka/wwmmo | website/handlers/blog.py | Python | mit | 1,074 | 0.015829 |
# Django settings for flexy project.
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine',
'NAME': 'sheesh',
... | sheeshmohsin/venturesity | flexy/flexy/settings.py | Python | mit | 5,241 | 0.000763 |
"""
Benchmark for SGD regression
Compares SGD regression against coordinate descent and Ridge
on synthetik data.
"""
print(__doc__)
# Author: Peter Prettenhofer <peter.prettenhofer@gmail.com>
# License: BSD Style.
import numpy as np
import pylab as pl
import gc
from time import time
from sklearn.linear_model imp... | florian-f/sklearn | benchmarks/bench_sgd_regression.py | Python | bsd-3-clause | 4,512 | 0.002216 |
from django.db import models
from django.core.urlresolvers import reverse
from django.conf import settings
import misaka
from groups.models import Group
# Create your models here.
# POSTS MODELS.PY
from django.contrib.auth import get_user_model
User = get_user_model()
class Post(models.Model):
user = models.Fo... | srijannnd/Login-and-Register-App-in-Django | simplesocial/posts/models.py | Python | mit | 984 | 0.003049 |
## @file
# process compress section generation
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text o... | google/google-ctf | third_party/edk2/BaseTools/Source/Python/GenFds/CompressSection.py | Python | apache-2.0 | 3,896 | 0.009497 |
# -*- coding: utf-8 -*-
import sqlite3
VERBOSE = 0
CTABLE_DOMAIN = '''
CREATE TABLE IF NOT EXISTS Domains(
did INTEGER PRIMARY KEY AUTOINCREMENT,
domain VARCHAR(64) UNIQUE,
indegree INTEGER,
outdegree INTEGER
)'''
CTABLE_WEBSITE = '''
CREATE TABLE IF NOT EXISTS Websites(
wid INTEGER PRIMARY KEY AUTOINCREMENT,
... | JaySon-Huang/WebModel | WebModel/database/databasehelper.py | Python | mit | 4,676 | 0.032 |
#!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2012 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, e... | artefactual/archivematica-history | src/MCPClient/lib/clientScripts/archivematicaClamscan.py | Python | agpl-3.0 | 2,652 | 0.003771 |
outfile=open("helloworld.txt","w")
for num1 in range(1,10):
for num2 in range(1,10):
if num2<=num1 :
outfile.write("{}*{}={} ".format(num2, num1 ,num1 * num2))
outfile.write(" \n")
outfile.flush()
outfile.close()
infile=open("helloworld.txt","r")
for line in infile.readlines():
print... | sinomiko/project | python_project/python/PythonProj/ReadWriteFile.py | Python | bsd-3-clause | 1,234 | 0.028363 |
#!/usr/bin/env python
"""
PURPOSE: The routines in this file test the get_neighborhoods module.
Created on 2015-04-02T21:24:17
"""
from __future__ import division, print_function
#import numpy as np
#from types import *
#from nose.tools import raises
#import pandas as pd
import nhrc2.backend.read_seeclickfix_api_to... | newhavenrc/nhrc2 | tests/test_get_neighborhoods.py | Python | mit | 1,060 | 0.007547 |
"""Wrappers around Ta-Lib technical indicators
Python native indicators in 'tanolib.py' file.
"""
import numpy as np
import pandas as pd
import talib
from . import utils
from .valid import VALID_TA_KWARGS
# Overlap studies
def add_MA(self, timeperiod=20, matype=0,
type='line', color='secondary', **kwa... | jackwluo/py-quantmod | quantmod/ta.py | Python | mit | 33,467 | 0 |
import json
import uuid
import unittest
from main import app
from app import redis
class FlaskTestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.app = app.test_client()
self.site_host = str(uuid.uuid4())
def tearDown(self):
pass # self.delete_site... | andychase/classwork | cs496/assignment_3/test.py | Python | mit | 2,361 | 0.000424 |
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
from os.path import expanduser
import sys
import glob
import atexit
import readline
import traceback
from viper.common.out import print_error, print_output
from viper.common.colors import... | cwtaylor/viper | viper/core/ui/console.py | Python | bsd-3-clause | 9,307 | 0.002256 |
"""autogenerated by genpy from rosserial_msgs/TopicInfo.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TopicInfo(genpy.Message):
_md5sum = "0ad51f88fc44892f8c10684077646005"
_type = "rosserial_msgs/TopicInfo"
_has_header = False #flag to... | blutjens/perc_neuron_ros_ur10 | pn_ros/bjorn_ws/devel/lib/python2.7/dist-packages/rosserial_msgs/msg/_TopicInfo.py | Python | gpl-3.0 | 7,843 | 0.021293 |
# Copyright 2006-2007 Lukas Lalinsky
# Copyright 2005-2006 Joe Wreschnig
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# $Id: asf.py 4224 2007-12-03 09:01:49Z luks $
"""Read and... | berdario/mutagen | mutagen/asf.py | Python | gpl-2.0 | 21,198 | 0.000849 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
[tests/stdlib/test_help.py]
Test the help command.
"""
import unittest
#import os
#from ergonomica import ergo, ENV
class TestHelp(unittest.TestCase):
"""Tests the 'help' command."""
def test_list_commands(self):
"""
Tests listing all comma... | ergonomica/ergonomica | tests/stdlib/test_help.py | Python | gpl-2.0 | 375 | 0.010667 |
from som.interp_type import is_ast_interpreter
from som.primitives.primitives import Primitives
from som.vm.globals import trueObject, falseObject, nilObject
from som.vmobjects.primitive import UnaryPrimitive, BinaryPrimitive, TernaryPrimitive
if is_ast_interpreter():
from som.vmobjects.block_ast import AstBlock a... | SOM-st/PySOM | src/som/primitives/true_primitives.py | Python | mit | 1,649 | 0.003032 |
#!/usr/bin/env python
# Copyright 2012 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
#
# Unles... | wikimedia/integration-zuul | tests/base.py | Python | apache-2.0 | 52,328 | 0.000191 |
#!/usr/bin/env python2
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
"""
Classify an image using individual model files
Use this script as an example to build your own tool
"""
import argparse
import os
import time
import struct
from google.protobuf import text_format
import numpy as np
impor... | dgschwend/hls_OO | TESTDATA_MAXI/data/classify.py | Python | gpl-3.0 | 14,639 | 0.012637 |
# Written by Bram Cohen
# see LICENSE.txt for license information
from zurllib import urlopen, quote
from btformats import check_peers
from bencode import bdecode
from threading import Thread, Lock
from socket import error, gethostbyname
from time import time
from random import randrange
from binascii import b2a_hex
... | mgp/bittorrent-dissected | Rerequester.py | Python | mit | 9,039 | 0.006195 |
# -*- coding: utf-8 -*-
# Author : Repubic of Korea, Seoul, JungSan HS 31227 Lee Joon Sung
# Author_Helper : Republic of Korea, KyungGido, Kim Min Seok
# youtube : anonymous0korea0@gmail.com ;;;; tayaka
# Email : miho0_0@naver.com
import hashlib
import logging
#from FoxDBinfor import DB_Pattern
def M... | miho030/FoxVc | versions - 1.2.x/FoxVc Ver 1.2.7/Foxcore/matchingHashValue.py | Python | gpl-3.0 | 1,103 | 0.024679 |
# -*- coding: utf-8 -*-
__version__ = '1.1.0'
default_app_config = 'ipware.apps.AppConfig'
| devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/ipware/__init__.py | Python | agpl-3.0 | 93 | 0 |
import os
root_dir = os.path.dirname(os.path.realpath(__file__))
f = open(".modulerc", "w")
f.write("#%Module\n")
sub_dirs = os.walk(root_dir)
next(sub_dirs)
for dir_name, _, file_list in sub_dirs:
for file_name in file_list:
module_version = file_name.rstrip(".lua")
module_name = os.path.relpath... | ntuhpc/modulefiles | all/hide.py | Python | mit | 413 | 0 |
# -*- coding: utf-8 -*-
#
# ecstasy documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 5 21:42:49 2015.
#
# 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.
#
# A... | goldsborough/ecstasy | docs/source/conf.py | Python | mit | 9,617 | 0.005303 |
''' Initiation procedure for the auth module
Yields:
- Initiates the Login Manager
'''
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
from flask_login import LoginManager
from .. import app
# --... | jtannas/NOA | app/mod_auth/__init__.py | Python | mit | 613 | 0.001631 |
from flask import render_template
def home():
return render_template('index.html') | andymitrich/pygask | application/views.py | Python | mit | 88 | 0.011364 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-09 10:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('groups', '0001_initial'),
]
op... | MilyMilo/sci-organizer | agenda/migrations/0001_initial.py | Python | mit | 1,029 | 0.002915 |
# -*-coding:Utf-8 -*
# ====================================================================
# ====================================================================
# Packages
# ====================================================================
import sys
import numpy as np
from muLAn.models.multipole import hexamag... | muLAn-project/muLAn | muLAn/models/fhexaBL.py | Python | mit | 2,911 | 0.003435 |
# Copyright (C) 2010 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 writ... | samuelclay/NewsBlur | vendor/oauth2client/django_orm.py | Python | mit | 4,342 | 0.008521 |
import os
import re
import sys
from pywb.manager.manager import CollectionsManager
from pywb.utils.canonicalize import canonicalize
from pywb.warcserver.access_checker import AccessChecker
from pywb.warcserver.index.cdxobject import CDXObject
# ========================================================================... | ikreymer/pywb | pywb/manager/aclmanager.py | Python | gpl-3.0 | 10,869 | 0.001012 |
"""Test that boolean conditions simplify to a constant value"""
# pylint: disable=pointless-statement
from unknown import Unknown # pylint: disable=import-error
def func(_):
"""Pointless function"""
CONSTANT = 100
OTHER = 200
# Simplifies any boolean expression that is coerced into a True/False value
bool(CON... | ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/c/condition_evals_to_constant.py | Python | mit | 1,666 | 0.001801 |
"""split gsm signal in two analytics, one per sim card
Revision ID: 31d36774c549
Revises: 528f90a47515
Create Date: 2019-01-23 15:16:58.514742
"""
# revision identifiers, used by Alembic.
revision = '31d36774c549'
down_revision = '528f90a47515'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.... | rootio/rootio_web | alembic/versions/31d36774c549_first_and_second_sim.py | Python | agpl-3.0 | 673 | 0.007429 |
import todsynth
import os
import numpy
import json
import pandas
class Calibrator( object ):
'''
A todsynth.calibrator object is a container that stores coefficients
that transform RAW dac units to physical units for a given TOD.
'''
# Calibrator description.
#00000000000000000000000000... | pafluxa/todsynth | build/lib.linux-x86_64-2.7/todsynth/calibration/calibrator.py | Python | gpl-3.0 | 2,810 | 0.025267 |
# -*- coding: utf-8 -*-
# *********************************************************************
# lewis - a library for creating hardware device simulators
# Copyright (C) 2016-2017 European Spallation Source ERIC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | DMSC-Instrument-Data/lewis | src/lewis/core/devices.py | Python | gpl-3.0 | 19,330 | 0.004656 |
__source__ = 'https://leetcode.com/problems/sliding-window-median/'
# Time: O(n*logk)
# Space: O()
#
# Description: 480. Sliding Window Median
#
# Median is the middle value in an ordered integer list.
# If the size of the list is even, there is no middle value.
# So the median is the mean of the two middle value.
#
#... | JulyKikuAkita/PythonPrac | cs15211/SlidingWindowMedian.py | Python | apache-2.0 | 5,180 | 0.004826 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-data-fusion | google/cloud/data_fusion_v1/services/data_fusion/transports/base.py | Python | apache-2.0 | 8,521 | 0.001291 |
#!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import os
import getpass
import subprocess
import pytest
from sos import execute_workflow
from sos._version import __version__
from sos.utils import env, loa... | BoPeng/SOS | test/test_config.py | Python | gpl-3.0 | 5,574 | 0 |
#!/usr/bin/python3
'''
TRY Exception
SYNTAX
-----------------------------------------------------------------
try:
You do your operations here;
......................
except ExceptionI:
If there is ExceptionI, then execute this block.
except ExceptionII:
If there is ExceptionII, then execute this block.
... | hackerpals/Python-Tutorials | Python-Intro-Workshops/Exceptions-handling/try.py | Python | gpl-3.0 | 890 | 0.001124 |
from django.utils.translation import ugettext_lazy as _
from keops.db import models
STATUS = (
('draft', _('Draft')),
('open', _('In Progress')),
('pending', _('Pending')),
('done', _('Done')),
('cancelled', _('Cancelled'))
)
class Category(models.Model):
name = models.CharField(null=False, u... | mrmuxl/keops | keops/modules/project/models.py | Python | agpl-3.0 | 832 | 0 |
# Copyright 2015-2016 NEC Corporation. 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 requ... | openstack/networking-nec | networking_nec/nwa/common/constants.py | Python | apache-2.0 | 877 | 0 |
from django.utils.translation import ugettext_lazy as _
def get():
""" Site glossary. """
return {
'construction' : [
{
'term' : _('Bienes'),
'text' : _('Objetos o cosas susceptibles de apropiación (art. 333 CC). Los bienes son de domino público o de propied... | Ale-/grrr.tools | apps/views/glossary.py | Python | gpl-3.0 | 9,637 | 0.010611 |
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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.a... | johnwallace123/dx-toolkit | src/python/dxpy/bindings/dxapp.py | Python | apache-2.0 | 15,467 | 0.002069 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Administrator of the National Aeronautics and Space Administration.
# 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... | ntt-sic/nova | nova/tests/consoleauth/test_consoleauth.py | Python | apache-2.0 | 7,413 | 0.001349 |
from ..broker import Broker
class IssueDetailBroker(Broker):
controller = "issue_details"
def show(self, **kwargs):
"""Shows the details for the specified issue detail.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required... | infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_8_0/issue_detail_broker.py | Python | apache-2.0 | 78,423 | 0.002193 |
# 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 | 0.001606 |
import re
from bs4 import BeautifulSoup
from ..const import constant
from ..bsopener import BSOpener
class RGArtist(object):
"""RapGeniusArtist"""
class _Const(object):
""" Contains constants used in outter class """
@constant
def RG_ARTIST_BASE_URL():
return "http://genius... | iluxonchik/lyricist | lyricist/rapgenius/rgartist.py | Python | mit | 5,427 | 0.006633 |
__all__ = ["test_avl", "test_binary", "test_bloom", "test_fortune", "test_hashtable",
"test_kd", "test_kd_factory", "test_knapsack", "test_mergesort", "test_quad",
"test_R"] | heineman/algorithms-nutshell-2ed | PythonCode/test/__init__.py | Python | mit | 199 | 0.025126 |
import os
import sys
sys.path.insert(0,os.path.abspath(__file__+"/../.."))
import unittest
import json
from transgression import config
class ConfigTest(unittest.TestCase):
def setUp(self):
self.mJsonString = open(os.path.abspath(os.path.dirname(os.path.realpath(__file__))+"/data/testConfig.json"), 'r').read()
... | jwir3/transgression | src/transgression/test/test_config.py | Python | mpl-2.0 | 4,338 | 0.011296 |
from pyscf.pbc.gto import Cell
from pyscf.pbc.scf import RHF
from pyscf.pbc.tdscf import TDHF
from pyscf.pbc.tdscf.rhf_slow import PhysERI, PhysERI4, PhysERI8, TDRHF
from pyscf.tdscf.common_slow import eig
from test_common import retrieve_m, retrieve_m_hf, assert_vectors_close
import unittest
from numpy import testin... | gkc1000/pyscf | pyscf/pbc/tdscf/test/test_rhf_slow.py | Python | apache-2.0 | 3,697 | 0.000541 |
import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
from multiprocessing import Pool
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator(): # type: ignore[no-redef]
... | nmayorov/scipy | scipy/_lib/_util.py | Python | bsd-3-clause | 16,576 | 0.000241 |
import os
import unittest
import tempfile
from git import Repo
from oeqa.utils.commands import get_bb_var
from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs
class TestBlobParsing(unittest.TestCase):
def setUp(self):
import time
self.repo_path = tempfile.mkdtemp(prefix='selftest-... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/oelib/buildhistory.py | Python | gpl-2.0 | 3,191 | 0.01943 |
import json
from zoom.common.types import UpdateType
class TimeEstimateMessage(object):
def __init__(self):
self._message_type = UpdateType.TIMING_UPDATE
self._contents = dict()
@property
def message_type(self):
return self._message_type
@property
def contents(self):
... | spottradingllc/zoom | server/zoom/www/messages/timing_estimate.py | Python | gpl-2.0 | 855 | 0 |
from __future__ import print_function
from tree import create_tree
def get_height(root):
if root is None:
return 0
return max(get_height(root.left), get_height(root.right)) + 1
def is_balanced(root):
"""O(n^2)"""
if root is None:
return True
lb = is_balanced(root.left)
rb = i... | shichao-an/ctci | chapter4/question4.1.py | Python | bsd-2-clause | 1,025 | 0 |
"""
This module implements fast estimators for the time-profiles of
growth rate, promoter activity, and protein concentrations.
These estimators rely on a simple model in which gene expression
is modeled as a one-step process. This enables to compute the
observation matrix directly using an ad-hoc formula.
As a cons... | yannickmartin/wellFARE | wellfare/ILM/fast_estimators.py | Python | lgpl-3.0 | 5,629 | 0.013857 |
"""
Module for managing ext2/3/4 file systems
"""
import logging
import salt.utils.platform
log = logging.getLogger(__name__)
def __virtual__():
"""
Only work on POSIX-like systems
"""
if salt.utils.platform.is_windows():
return (
False,
"The extfs execution module ... | saltstack/salt | salt/modules/extfs.py | Python | apache-2.0 | 8,988 | 0.000111 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from scripts.db_api import accident
def usa_query(hour):
return '''
SELECT count(*), (select count(*) from accident
join vehicle on(acc_id = accident.id)
where country = 'USA'
and vehicle.speed > accident.speed_limit
and vehicle.speed > -1
and acciden... | lopiola/integracja_wypadki | scripts/statistics/speed_limit_exceeded_by_hour.py | Python | mit | 817 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('member', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Broadcast',
fields=[
... | lantip/sms-komunitas | medkom/message/migrations/0001_initial.py | Python | gpl-3.0 | 1,783 | 0.002804 |
# Copyright 2015 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 ... | torgartor21/solar | solar/solar/test/test_orm.py | Python | apache-2.0 | 15,583 | 0.000385 |
from __future__ import absolute_import
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import TagKey, TagKeyStatus, TagValue
class ProjectTagKeyValuesEndp... | hongliang5623/sentry | src/sentry/api/endpoints/project_tagkey_values.py | Python | bsd-3-clause | 1,277 | 0 |
#! /usr/bin/env python3
import contextlib
import threading
import mwparserfromhell
import ws.ArchWiki.lang as lang
from ws.utils import LazyProperty
from ws.parser_helpers.title import canonicalize
from ws.parser_helpers.wikicode import get_parent_wikicode, get_adjacent_node
__all__ = ["get_edit_summary_tracker", "... | lahwaacz/wiki-scripts | ws/checkers/CheckerBase.py | Python | gpl-3.0 | 3,021 | 0.001655 |
"""
Copyright (C) 2013-2018 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
run_checks.py
~~~~~~~~~~~~~
Checks for model consistency and possible errors when preparing run in the backend.
"""
import ruamel.yaml
import numpy as np
import pandas as pd
import xarray a... | brynpickering/calliope | calliope/backend/checks.py | Python | apache-2.0 | 6,761 | 0.002219 |
# -*- coding: utf-8 -*-
from patient_evaluation_report import *
| kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/health_history/report/__init__.py | Python | gpl-3.0 | 66 | 0.015152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.