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 google import GoogleAuthentication
from mock import MockAuthentication
def get_authentication_object(token,mock):
if mock:
return MockAuthentication(token)
else:
return GoogleAuthentication(token)
| Sotera/Datawake | server/datawake/util/authentication/factory.py | Python | apache-2.0 | 227 |
# -*- coding: utf-8 -*-
"""This module contains methods for discovering Sonos devices on the
network."""
from __future__ import unicode_literals
import logging
import socket
import select
from textwrap import dedent
import time
import struct
from . import config
from .utils import really_utf8
_LOG = logging.getLogg... | lawrenceakka/SoCo | soco/discovery.py | Python | mit | 8,603 |
from textwrap import dedent
import json
from gluon import current
from constants import TPS
from helpers import iDecode
class RECORD:
"""Handles record data.
This is about some aspects of query and note records and
organization and project records by which they are organized.
And it is about word r... | ETCBC/shebanq | modules/record.py | Python | mit | 14,481 |
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
from IPython import embed
from tensorflow import flags
def main(_):
mnist = input_data.read_data_sets("./data", one_hot=True)
# defien model input: image and ground-truth label
model_inputs = tf.placeholder(dty... | kiseyno92/SNU_ML | Practice7/code/eval.py | Python | mit | 1,438 |
#!/usr/bin/env python3
# Copyright (C) 2017 Dmitry Malko
# This file is part of PeptoVar (Peptides of Variations): the program for annotation of genomic variations and generation of variant peptides.
#
# PeptoVar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | open-projects/PeptoVar | lib/variation.py | Python | gpl-3.0 | 11,464 |
# -*- coding: utf-8 -*-
"""
Update summary time series CSV file.
"""
import argparse
import os
import sys
from configparser import ConfigParser
from datetime import date
from datetime import datetime
from datetime import time
from datetime import timedelta
# use this because numpy/openblas is automatically multi-thr... | tmilliman/python-vegindex | src/vegindex/update_summary_timeseries.py | Python | mit | 16,803 |
# -*- coding: utf-8 -*-
""" Sahana Eden Survey Tool
@copyright: 2011-2015 (c) Sahana Software Foundation
@license: MIT
ADAT - Assessment Data Analysis Tool
For more details see the blueprint at:
http://eden.sahanafoundation.org/wiki/BluePrint/SurveyTool/ADAT
Permission is hereby granted, fr... | flavour/RedHat | modules/s3db/survey.py | Python | mit | 142,578 |
#
# Copyright (c) 2008-2015 Citrix 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 applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/ntp/ntpparam.py | Python | apache-2.0 | 6,102 |
import math
class RMQ:
MAX_VALUE = 2 ** 31
def __init__(self, size):
self.level = RMQ.determine_level(size)
self.values = [RMQ.MAX_VALUE] * (2 ** (self.level + 1))
@staticmethod
def determine_level(elements_count):
a = 1
level = 0
while a < elements_count:
... | pepincho/Python101-and-Algo1-Courses | Algo-1/week3/7-Range-Minimum-Query/rmq.py | Python | mit | 2,114 |
#!/usr/bin/env python
# This file is part of Responder
# Original work by Laurent Gaffie - Trustwave Holdings
#
# 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, o... | j4s0nh4ck/Responder | servers/SMB.py | Python | gpl-3.0 | 13,579 |
#!/usr/bin/python
include_dirs = []
output = "-"
import os
import sys
m_template = """/* %(module)s.m (auto-generated) */
#include <objc/objc.h>
#include <stdint.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import "%(module)s.h"
%(exception_init)s
stati... | Distrotech/sogo | SoObjects/SOGo/gen-saml2-exceptions.py | Python | lgpl-2.1 | 3,821 |
# confirm_dialog.py
# Copyright (C) 2010 Julien Miotte <miotte.julien@gmail.com>
#
# This module is part of gitbuster and is released under the GPLv3
# License: http://www.gnu.org/licenses/gpl-3.0.txt
#
from PyQt4.QtCore import QString, Qt
from PyQt4.QtGui import QCheckBox, QDialog, QLabel
from gitbuster.confirm_dialo... | mike-perdide/gitbuster | gitbuster/confirm_dialog.py | Python | gpl-3.0 | 2,802 |
# coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility a... | antoine-de/navitia | source/jormungandr/jormungandr/interfaces/v1/Journeys.py | Python | agpl-3.0 | 23,747 |
from datetime import datetime, timedelta
from requests.exceptions import HTTPError
from sqlalchemy import func
from nylas.logging import get_logger
logger = get_logger()
from inbox.basicauth import AccessNotEnabledError, OAuthError
from inbox.config import config
from inbox.sync.base_sync import BaseSyncMonitor
from ... | Eagles2F/sync-engine | inbox/events/remote_sync.py | Python | agpl-3.0 | 12,503 |
#encoding=utf-8
#TODO build for cmake, autoconfig, and makefile
| boully/comake | comake/LocalBuild.py | Python | mit | 65 |
# Copyright 2017 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... | cshallue/models | research/object_detection/builders/image_resizer_builder.py | Python | apache-2.0 | 5,754 |
import datetime
from django.db import models
from simple_comments.models import BaseComment
from simple_comments import comments
class Article(models.Model):
title = models.CharField(max_length=12)
allow_comments = models.BooleanField(default=False)
pub_date = models.DateTimeField(default=datetime.dateti... | strange/django-simple-comments | example/articles/models.py | Python | bsd-3-clause | 643 |
from . import Journal, util
from cryptography.fernet import Fernet, InvalidToken
from cryptography.hazmat.primitives import hashes, padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
import hashlib
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazma... | maebert/jrnl | jrnl/EncryptedJournal.py | Python | mit | 5,033 |
from nist import NIST
from nistClient import NISTClient
from testing import CompareNIST
| jacobkrantz/ProbSyllabifier | nist/__init__.py | Python | mit | 88 |
# Copyright 2020 Google Research. 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... | google/automl | efficientdet/inference.py | Python | apache-2.0 | 26,156 |
#!/usr/bin/env python
import os
import re
import string
import sys
import time
import posixpath
import subprocess
from starcluster.clustersetup import ClusterSetup
from starcluster.logger import log
class NfsShares (ClusterSetup):
"""
Automatically mounts external NFS shares on StarCluster nodes
"""
d... | agua/agua | bin/install/resources/starcluster/plugins/automount.py | Python | mit | 14,392 |
# -*- coding: utf-8 -*-
# <markment - markdown-based documentation generator for python>
# Copyright (C) <2013> Gabriel Falcão <gabriel@nacaolivre.org>
#
# 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 Fou... | grahamc/markment | tests/unit/test_html_rendering.py | Python | mit | 7,784 |
# Copyright 2016 MongoDB, 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, so... | americanstone/mongo-connector | mongo_connector/namespace_config.py | Python | apache-2.0 | 22,090 |
import copy
import json
import logging
import traceback
from sqlalchemy import text
from dart.context.database import db
from dart.model.orm import ActionDao
from dart.tool.tool_runner import Tool
_logger = logging.getLogger(__name__)
class MigrateConsumeSubscriptionActionsRedshift(Tool):
def __init__(self):
... | RetailMeNotSandbox/dart | src/python/dart/tool/migration/migrate_consume_subscription_actions_redshift.py | Python | mit | 2,477 |
import json
import logging
from datetime import date, datetime, timedelta
from elasticsearch.exceptions import ConnectionError
from nose.tools import eq_
from pyquery import PyQuery
from django.contrib.auth.models import Group
from django.http import QueryDict
from fjord.analytics import views
from fjord.base.tests ... | DESHRAJ/fjord | fjord/analytics/tests/test_views.py | Python | bsd-3-clause | 16,139 |
"""Converts pandas DataFrames to and from
RGF format
"""
import pandas as pd
def convert_to_rgf(
df, fname_prefix, response_column=None, verbose=True,
exclude_columns=None):
"""Takes the pandas DataFrame df and stores it in RGF format
in fname_prefix.x and fname_prefix.y (if response_column i... | jrings/pyRGF | pyrgf/convert.py | Python | mit | 1,979 |
# -*- coding: utf-8 -*-
from mock import patch, Mock
from six import u
from twilio.rest import resources
@patch("httplib2.Http")
@patch("twilio.rest.resources.base.Response")
def test_ascii_encode(resp_mock, mock):
http = mock.return_value
http.request.return_value = (Mock(), Mock())
data = {
"bo... | jessekl/flixr | venv/lib/python2.7/site-packages/tests/test_unicode.py | Python | mit | 2,466 |
# coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | googleinterns/lasertagger | preprocess_main.py | Python | apache-2.0 | 4,665 |
"""
This file defines ACM resource static configuration parameters for CDK Constructs
"""
from aws_cdk import aws_certificatemanager
ACM_Certs_List = {
# Pattern
# "cdk-id": ("domain-name", "validation-method")
# Example:
"cdk-poc-grafana-dashboard": (
"dashboard.cdk-poc.kubeflow-testing.com",... | kubeflow/testing | aws/IaC/CDK/test-infra/config/static_config/ACM_Resources.py | Python | apache-2.0 | 520 |
__author__ = 'xiaoxiaol'
__author__ = 'xiaoxiaol'
__author__ = 'xiaoxiaoliu'
import pandas as pd
import os
import sys
import platform
if (platform.system() == "Linux"):
WORK_PATH = "/local1/xiaoxiaol/work"
else:
WORK_PATH = "/Users/xiaoxiaoliu/work"
p = WORK_PATH + '/src/morphology_analysis'
sys.path.appe... | XiaoxiaoLiu/morphology_analysis | bigneuron/run_gold166_consensus_pstar.py | Python | gpl-3.0 | 5,061 |
__author__ = 'sandro'
from distutils.core import setup
setup(
author='Sandro Covo',
author_email="sandro@covo.ch",
packages=['brainfuck'],
scripts=['scripts/pyfuck'],
name="Pyfuck",
description="Brainfuck interpreter written in python"
) | sacovo/brainfuck | setup.py | Python | gpl-2.0 | 262 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
# 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 = {'metadata_version': '1.1',
... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_vmkernel_ip_config.py | Python | bsd-3-clause | 3,594 |
import os, re, sys
import unittest
""" Greatly imspired from Dive into Python chap. 16.7 """
sys.path = [os.path.dirname(os.path.dirname(os.path.abspath(__file__)))] + sys.path
def allTests():
path = os.path.abspath(os.path.dirname(__file__))
files = os.listdir(path)
print(files)
test = re.compile("^... | benallard/pythoncard | test/runtests.py | Python | lgpl-3.0 | 783 |
"""Support for Almond."""
import asyncio
from datetime import timedelta
import logging
import time
from typing import Optional
from aiohttp import ClientError, ClientSession
import async_timeout
from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI
import voluptuous as vol
from homeassistant impor... | sdague/home-assistant | homeassistant/components/almond/__init__.py | Python | apache-2.0 | 10,125 |
def f():
x = 1
return 0
| JHU-PL-Lab/CoPylot | lines.py | Python | gpl-3.0 | 28 |
# Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | xqms/catkin_tools | catkin_tools/verbs/catkin_build/cli.py | Python | apache-2.0 | 9,623 |
"""html2text: Turn HTML into equivalent Markdown-structured text."""
__version__ = "3.1"
__author__ = "Aaron Swartz (me@aaronsw.com)"
__copyright__ = "(C) 2004-2008 Aaron Swartz. GNU GPL 3."
__contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
# TODO:
# Support decoded entities with unifi... | thorwhalen/ut | parse/html2text_formated.py | Python | mit | 26,358 |
#!/usr/bin/env python
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder.
#
# This file is part of Slamdunk.
#
# Slamdunk 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, either version 3 of the
#... | t-neumann/slamdunk | slamdunk/dunks/tcounter.py | Python | agpl-3.0 | 23,555 |
#!/usr/bin/env python
# coding=utf-8
#
# Copyright 2016 cnddu
import tornado.web
import lib.jsonp
from tornado.options import define, options
from base import *
from form.user import *
import hashlib
import json
from lib.utils import getJsonKeyValue
def do_login(self, user_id):
user_info = self.user_model.get_use... | cnddu/cactusblog | handler/admin.py | Python | gpl-3.0 | 9,344 |
# -*- 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/activity/tasks.py | Python | mit | 3,738 |
#!/usr/bin/env python
# coding=utf-8
from random import choice
import string
def Makepass(length=8, chars=string.letters+string.digits):
return ''.join([choice(chars) for i in range(length)])
if __name__ == '__main__':
for i in range(20):
print Makepass(16)
| zhaochl/python-utils | utils/passwd_maker.py | Python | apache-2.0 | 275 |
# Copyright 2014 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 ... | koder-ua/nailgun-fcert | fuelclient/fuelclient/cli/actions/fact.py | Python | apache-2.0 | 4,428 |
"""
==============
Module pymorph
==============
pymorph a powerful collection of state-of-the-art gray-scale morphological
tools that can be applied to image segmentation, non-linear filtering,
pattern recognition and image analysis.
- `add4dilate()` : Addition for dilation
- `addm()` : Addition of two ima... | agile-geoscience/pickthat | pickthat/mmorph.py | Python | apache-2.0 | 128,189 |
from django.contrib import admin
from .models import Location, Type, Item
admin.site.register(Location)
admin.site.register(Type)
admin.site.register(Item)
| lebib/motherforker | lacave/admin.py | Python | gpl-3.0 | 159 |
# -*- coding: utf-8 -*-
#
# This file is part of PyGaze - the open-source toolbox for eye tracking
#
# PyGaze is a Python module for easily creating gaze contingent experiments
# or other software (as well as non-gaze contingent experiments/software)
# Copyright (C) 2012-2013 Edwin S. Dalmaijer
#
# This program... | smathot/PyGaze | pygaze/_eyetracker/libtobii.py | Python | gpl-3.0 | 59,066 |
# encoding: utf-8
from django.contrib import auth
from django.contrib.auth.decorators import *
from django.contrib.auth.models import User
from django.shortcuts import *
from django.http import *
from ..models import *
from .. import Utils
import json
import time
from DjangoUeditor.forms import UEditorField
from dja... | October-66/Traveler-Pal | traveler_pal/app/views/user.py | Python | mit | 2,099 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 23 11:24:38 2018
@author: nkarasiak
"""
try:
# if use in Qgis 3
from . import function_dataraster as dataraster
from .mainfunction import pushFeedback
except BaseException:
import function_dataraster as dataraster
from mainfunc... | lennepkade/dzetsaka | scripts/domainAdaptation.py | Python | gpl-3.0 | 12,927 |
#! /usr/bin/env python
import yaml
import rospy
import traceback
from utils import *
from roconservice_instance import *
from op_msgs.msg import *
from op_msgs.srv import *
from concert_msgs.msg import *
class ServiceManager(object):
rocon_services = {}
param = {}
srv = {}
pub = {}
sub = {}
... | jihoonl/orchestra | concert_servicemanager/src/concert_servicemanager/servicemanager.py | Python | bsd-3-clause | 3,612 |
#!/usr/bin/env python3
# @author Slandau3
def ranges(input: list) -> list:
# The patterns_found list keeps track of the definite ranges we have completed
patterns_found = []
# pattern_in_progress keeps track of a pattern we are tracing
pattern_in_progress = []
for i in input:
if len(patter... | erocs/2017Challenges | challenge_6/python/slandau3/ranges.py | Python | mit | 1,713 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import subprocess
import threading
from telemetry.core import util
from telemetry.internal.backends.chrome import android_browser_f... | Pluto-tv/chromium-crosswalk | tools/telemetry/telemetry/internal/platform/profiler/java_heap_profiler.py | Python | bsd-3-clause | 3,363 |
# Unit tests related to 'Parcel' (https://www.easypost.com/docs/api#parcels).
import pytest
import easypost
@pytest.mark.vcr()
def test_parcel_creation():
# Simply create a Parcel and assert on saved data.
parcel = easypost.Parcel.create(
predefined_package="RegionalRateBoxA",
length=10.2,
... | EasyPost/easypost-python | tests/test_parcel.py | Python | mit | 541 |
#
# 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 us... | cloudera/spark | python/examples/logistic_regression.py | Python | apache-2.0 | 2,737 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | google/ota-generator | web_server.py | Python | apache-2.0 | 8,880 |
#!/usr/bin/env python3
from sorts import bubble_sort, consecutive_minimum_swaps, non_consecutive_minimum_swaps
ret = consecutive_minimum_swaps([7, 3, 8, 4, 1, 5, 2, 6])
print(ret)
ret = non_consecutive_minimum_swaps([1, 3, 5, 4, 6, 9, 8])
print(ret)
# ret = bubble_sort([7, 1, 3, 2, 4, 5, 6])
# print(ret)
| jingwangian/tutorial | python/basic/sort_alg/test_sorts.py | Python | gpl-3.0 | 310 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013 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 yo... | MSusik/invenio | invenio/modules/formatter/testsuite/test_formatter_utils.py | Python | gpl-2.0 | 6,862 |
#!/usr/bin/env python
# imglob - expand list of image filenames
# Stephen Smith, Mark Jenkinson and Matthew Webster FMRIB Image Analysis Group
# Copyright (C) 2009 University of Oxford
# Part of FSL - FMRIB's Software Library
# http://www.fmrib.ox.ac.uk/fsl
# fsl@fmrib.ox.ac.uk
#
# Developed at FMRIB (Oxf... | carolFrohlich/nipype | nipype/external/fsl_imglob.py | Python | bsd-3-clause | 5,702 |
try:
import doctest
doctest.OutputChecker
except AttributeError:
import util.doctest24 as doctest
try:
import xml.etree.ElementTree as ET
except ImportError:
import elementtree.ElementTree as ET
from xml.parsers.expat import ExpatError as XMLParseError
RealOutputChecker = doctest.OutputChecker
def... | santisiri/popego | envs/ALPHA-POPEGO/lib/python2.5/site-packages/FormEncode-1.0.1-py2.5.egg/formencode/doctest_xml_compare.py | Python | bsd-3-clause | 4,060 |
# Natural Language Toolkit: Chart Parser Application
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Jean Mark Gawron <gawron@mail.sdsu.edu>
# Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A graphical t... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/app/chartparser_app.py | Python | mit | 86,103 |
import glob
import logging
import os
import threading
import pytest
import sys
import shutil
import yaml
from yandextank.core import TankCore
from yandextank.core.consoleworker import parse_options
logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)
console_handler = logging.StreamHandler(sys.stdout)
fmt ... | fomars/yandex-tank | yandextank/core/tests/test_tankcore.py | Python | lgpl-2.1 | 6,198 |
import os
import subprocess
import datetime
import shlex
import sys
def termination_string():
"""
Gets the current system time and appends it to a termination notice.
"""
now = datetime.datetime.now()
time = now.strftime("%Y-%m-%d %H:%M:%S.%f")
end_time = "Script exiting at %s\n" % time
ret... | jtakayama/makahiki-installation-python-scripts | install/run_initialize_instance.py | Python | mit | 2,651 |
#!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
'''
Pass initial guess to SCF calculation.
SCF kernel function takes one argument dm (density matrix) as the initial
guess. If not given, SCF constructs an atomic density superposition for the
initial guess.
'''
import tempfile
from pyscf import ... | gkc1000/pyscf | examples/scf/15-initial_guess.py | Python | apache-2.0 | 2,092 |
# -*- coding: utf-8 -*-
{
'name': "MQO Programs",
'summary': """Manage programs""",
'description': """
MQO module for managing programs:
""",
'author': "Your Company",
'website': "http://www.yourcompany.com",
# Categories can be used to filter modules in modules list... | drummingbird/mqo | mqo_program/__openerp__.py | Python | agpl-3.0 | 936 |
"""File related wrapper functions to streamline common use cases"""
import manage as manage
from manage import find_file, find_file_re, list_dir
import operation as operation
from operation import hash_file, read_file, slice_file, write_file
| qevo/py_file_helper | file_helper/__init__.py | Python | mit | 243 |
from urllib import urlencode
import formencode
from pylons import request
from pylons import response
from pylons import session
from pylons.controllers.util import redirect
from pylons.i18n import _
from adhocracy import config
from adhocracy import forms
from adhocracy.lib import helpers as h
from adhocracy.lib.auth ... | SysTheron/adhocracy | src/adhocracy/controllers/shibboleth.py | Python | agpl-3.0 | 6,998 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from typing import Iterable
from shuup.core.models import OrderLi... | shoopio/shoop | shuup/front/template_helpers/order.py | Python | agpl-3.0 | 518 |
# vim: ts=4:sw=4:expandtab
# -*- coding: UTF-8 -*-
# BleachBit
# Copyright (C) 2008-2019 Andrew Ziem
# https://www.bleachbit.org
#
# 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... | az0/bleachbit | bleachbit/Diagnostic.py | Python | gpl-3.0 | 4,194 |
from lib.lib_game import Window
if __name__ == '__main__':
a = Window('first_map_for_test')
a.Run()
| azon1272/War-for-cookies-v2 | game_window.py | Python | bsd-3-clause | 114 |
"""A set of utility functions."""
class cached_property:
""" A property that is only computed once per instance and then replaces
itself with an ordinary attribute. Deleting the attribute resets the
property.
"""
def __init__(self, function):
self.__doc__ = getattr(function, '__doc__')
... | AlanCristhian/symbolic_old | symbolic/utils.py | Python | mit | 527 |
"""
Imports all submodules
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import deepchem.data
import deepchem.feat
import deepchem.hyper
import deepchem.metrics
import deepchem.models
import deepchem.nn
import deepchem.splits
import deepchem.trans
im... | bowenliu16/deepchem | deepchem/__init__.py | Python | gpl-3.0 | 361 |
# Lint as: python3
# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from absl import app
from iree.tf.support import tf_test_utils
import numpy as np
i... | google/iree | integrations/tensorflow/test/python/iree_tf_tests/uncategorized/simple_stateful_test.py | Python | apache-2.0 | 1,254 |
# Copyright 2012 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 requ... | sebrandon1/neutron | neutron/tests/unit/testlib_api.py | Python | apache-2.0 | 13,177 |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import sys
from participantCollection import ParticipantCollection
names = sys.argv[1::]
participants = ParticipantCollection()
for name in names:
if participants.hasParticipantNamed(name)... | foobarbazblarg/stayclean | stayclean-2020-september/relapse.py | Python | mit | 688 |
#!/usr/bin/env python3
"""
This module provides a set of physical constants that are used frequently.
"""
__version__ = '0.3.6'
__license__ = 'LGPL v3'
__copyright__ = 'Copyright 2016, Ex Mente Technologies (Pty) Ltd'
__author__ = 'Johan Zietsman'
__credits__ = ['Johan Zietsman']
__maintainer__ = 'Johan Zietsman'
__em... | Ex-Mente/auxi.0 | auxi/tools/physicalconstants.py | Python | lgpl-3.0 | 1,769 |
#-----------------------------------------------------------------
# pycparser: c_lexer.py
#
# CLexer class: lexer for the C language
#
# Copyright (C) 2008-2011, Eli Bendersky
# License: BSD
#-----------------------------------------------------------------
import re
import sys
import ply.lex
from ply.lex import TOK... | pombredanne/pycparser-1 | pycparser/c_lexer.py | Python | bsd-3-clause | 12,639 |
# -*- coding: utf-8 -*-
"""
Django settings for django_reportes project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, uni... | chrisRubiano/django_reportes | config/settings/base.py | Python | mit | 9,751 |
from embedding import SVDEmbedding, EnsembleEmbedding, Embedding
from explicit import PositiveExplicit
def create_representation(args):
rep_type = args['<representation>']
path = args['<representation_path>']
neg = int(args['--neg'])
w_c = args['--w+c']
eig = float(args['--eig'])
... | hellrich/JeSemE | pipeline/transform_models/representations/representation_factory.py | Python | mit | 1,144 |
# Simple tests for an adder module
import os
import sys
import cocotb
import logging
from cocotb.result import TestFailure
from nysa.host.sim.sim_host import NysaSim
from cocotb.clock import Clock
import time
from array import array as Array
from dut_driver import wb_host_interface_testerDriver
SIM_CONFIG = "sim_confi... | CospanDesign/nysa-verilog | verilog/wishbone/slave/wb_host_interface_tester/cocotb/test_dut.py | Python | mit | 1,532 |
#-*- coding: utf-8 -*-
import scanner
import numpy as np
import cv2
import pickle
import time
import progressbar
class Detector(object):
def __init__(self, descriptor, classifier):
self.descriptor = descriptor
self.classifier = classifier
def dump(self, filename)... | penny4860/object-detector | object_detector/detector.py | Python | mit | 8,224 |
import os
import re
import xml.etree.ElementTree as etree
import random
import logging
import utils_random
import utils_xml_gen
from xml.sax import saxutils
class XMLError(Exception):
pass
SCHEMAS_PATH = '/usr/share/libvirt/schemas'
MAX_DEEPTH = 100
def load_rng(file_name, is_root=True):
xml_str = open(fi... | Hao-Liu/virt-trinity-obsolete | virtTrinity/xml_gen.py | Python | gpl-2.0 | 8,160 |
# -*- coding: utf-8 -*-
'''
nereid_checkout test suite
:copyright: (c) 2010-2015 by Openlabs Technologies & Consulting (P) Ltd.
:license: GPLv3, see LICENSE for more details
'''
import unittest
from ast import literal_eval
from mock import patch
from decimal import Decimal
from datetime import date
impor... | openlabs/nereid-checkout | tests/test_checkout.py | Python | gpl-3.0 | 55,126 |
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test
class Tox(test):
def initialize_options(self):
test.initialize_options(self)
self.tox_args = None
def finalize_options(self):
test.finalize_options(self)
se... | hackaugusto/metrics.py | setup.py | Python | mit | 996 |
"""The tests for the Radarr platform."""
import unittest
import pytest
import homeassistant.components.radarr.sensor as radarr
from homeassistant.const import DATA_GIGABYTES
from tests.async_mock import patch
from tests.common import get_test_home_assistant
def mocked_exception(*args, **kwargs):
"""Mock except... | nkgilley/home-assistant | tests/components/radarr/test_sensor.py | Python | apache-2.0 | 15,283 |
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
(r'^polls/', include('project.askmeanything.urls')),
(r'^polldone/$', 'project.views.polldone'),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs' ... | MidwestCommunications/django-askmeanything | project/urls.py | Python | mit | 540 |
# Copyright 2018 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.
"""Acceptable values for the Telemetry compatibility_mode flag.
"""
NO_FIELD_TRIALS = 'no-field-trials'
IGNORE_CERTIFICATE_ERROR = 'ignore-certificate-errors... | endlessm/chromium-browser | third_party/catapult/telemetry/telemetry/compat_mode_options.py | Python | bsd-3-clause | 724 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/apiproxy.py | Python | bsd-3-clause | 8,364 |
# Copyright 2015-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in... | oVirt/vdsm | tests/storage/storagetestlib.py | Python | gpl-2.0 | 21,169 |
# -*- coding: utf-8 -*-
"""
This module contains various utility functions for the concurrent modules.
"""
import random
import logging
import threading
from functools import wraps
from future.utils import iteritems
logger = logging.getLogger('nbs.concurrent.utils')
# timeout for the Queue object put/ge... | matthewghgriffiths/nestedbasinsampling | nestedbasinsampling/concurrent/utils.py | Python | gpl-3.0 | 8,082 |
import urllib2
import json
from StringIO import StringIO
import base64
#==== configurations =======
username = "user@example.com"
password = "naked_password"
src_repo = "octocat/Hello-World"
dst_repo = "helloworld-inc/Hello-World"
#==== end of configurations ===
server = "api.github.com"
src_url = "https://%s/repos/%... | viswimmer1/PythonGenerator | data/python_files/80468891/gh-issues-import.py | Python | gpl-2.0 | 4,203 |
"""
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | schakrava/rockstor-core | src/rockstor/smart_manager/urls/sprobes.py | Python | gpl-3.0 | 3,547 |
# -*- coding: utf-8 -*-
from flask import Flask, session, jsonify, abort, request, make_response, url_for
from flask_restful import Resource, reqparse, abort
from flask_session import Session
import pymysql.cursors
import dbSettings
from decorators import login_required, admin_required
import jsondate as json
from pym... | wightman/Lists | api/resources/item.py | Python | lgpl-3.0 | 6,651 |
class DoAnnotator:
# get the gene, disease_dataset in bulk, do_dataset
@staticmethod
def attach_annotations(id, dataset):
return dataset[id]
| alliance-genome/agr_prototype | indexer/src/annotators/id_annotator.py | Python | mit | 171 |
from ml_buff.database import session_scope
from ml_buff.models import feature, feature_value, input_data, base_feature_record
from ml_buff.helpers.feature_value_helper import FeatureValueHelper
class TestFeature1(base_feature_record.BaseFeatureRecord):
def calculate(self, input_data):
return [1]
class Tes... | tinenbruno/ml-buff | tests/helpers/feature_value_helper_test.py | Python | mit | 2,534 |
"""
Django settings for citygrow project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
... | mirkoemirbc/citygrow | citygrow/settings.py | Python | gpl-3.0 | 3,348 |
# This python file use the following encoding: utf-8
from eapi import (
theme_object_set
)
""" theme_object_set(obj, gadget_name, group_name)
You must use this function to load additional groups from your
edje file. This function will search the group first in the E theme
and then in your local edje file.
Args:... | JeffHoogland/edgar-moksha | python/e.py | Python | gpl-3.0 | 4,833 |
#!/usr/bin/env python
# first we need to import the module
import mirheo as mir
dt = 0.001 # simulation time step
ranks = (1, 1, 1) # number of ranks in x, y, z directions
domain = (32.0, 16.0, 16.0) # domain size in x, y, z directions
# create the coordinator
u = mir.Mirheo(ranks, domain,... | dimaleks/uDeviceX | tests/doc_scripts/hello.py | Python | gpl-3.0 | 396 |
from .Lifeform import Lifeform
from .Enemy import Enemy
from .Npc import Npc
from .Player import Player
from .Zones import Zones
from .npc.Merchant import Merchant
from .npc.NpcTemplate import NpcTemplate
__all__ = ["Lifeform", "Enemy", "Player", "Npc","NpcTemplate", "Zones", "Merchant"]
| etkirsch/legends-of-erukar | erukar/system/engine/lifeforms/__init__.py | Python | agpl-3.0 | 290 |
# This file is part of beets.
# Copyright 2012, Adrian Sampson.
#
# 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, ... | MusikPolice/beets | test/test_art.py | Python | mit | 11,126 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './SqlBrowser/SqlBrowserWidget.ui'
#
# Created: Tue Nov 18 17:53:57 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SqlBrowserWidget(... | davy39/eric | SqlBrowser/Ui_SqlBrowserWidget.py | Python | gpl-3.0 | 6,030 |
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""VM-related helper functions/classes."""
# pylint: disable=bad-continuation
from __future__ import print_function
import logging
import os
import... | mxOBS/deb-pkg_trusty_chromium-browser | third_party/chromite/lib/vm.py | Python | bsd-3-clause | 7,979 |
# Copyright 2019 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, ... | tensorflow/lattice | examples/keras_sequential_uci_heart.py | Python | apache-2.0 | 11,437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.