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 |
|---|---|---|---|---|---|
# Copyright 2019 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | quantumlib/Cirq | cirq-core/cirq/qis/states_test.py | Python | apache-2.0 | 30,827 |
import unittest
from pg4nosql.PostgresNoSQLClient import PostgresNoSQLClient
from __init__ import TEST_DB_HOST, TEST_DATABASE, TEST_DB_USER, TEST_DB_PASSWORD
class PostgresNoSQLViewTest(unittest.TestCase):
def setUp(self):
self.client = PostgresNoSQLClient(host=TEST_DB_HOST, user=TEST_DB_USER, password=T... | cansik/pg4nosql | test/PostgresNoSQLViewTest.py | Python | mit | 1,544 |
import argparse
import os
from nimoy.ast_tools import ast_chain
from nimoy.runner import fs_resource_reader
from nimoy.runner.metadata import RunnerContext
from nimoy.runner.spec_executor import SpecExecutor
from nimoy.runner.spec_finder import SpecFinder
from nimoy.runner.spec_loader import SpecLoader
from nimoy.runn... | browncoat-ninjas/nimoy | nimoy/spec_runner.py | Python | apache-2.0 | 2,280 |
# file contains.py of Learing Python(5th Edition) P907
class Iters:
def __init__(self, value):
self.data = value
def __getitem__(self, i):
print('get[%s]:' % i, end=' ')
return self.data[i]
def __iter__(self):
print('iter=> ', end=' ')
self.ix = 0
return se... | spencerpomme/coconuts-on-fire | contains.py | Python | apache-2.0 | 1,888 |
# -*- coding: utf-8 -*-
import copy
from functools import wraps
import json
import sys
import django
from django.contrib.admin.helpers import AdminForm
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.models import LogEntry, CHANGE
... | keimlink/django-cms | cms/admin/pageadmin.py | Python | bsd-3-clause | 69,366 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2017-2021 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# This file is part of qutebrowser.
#
# qutebrowser 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... | qutebrowser/qutebrowser | qutebrowser/completion/models/listcategory.py | Python | gpl-3.0 | 3,945 |
from Screen import Screen
from Screens.TimerEdit import TimerSanityConflict
from Screens.ChoiceBox import ChoiceBox
from Components.ActionMap import ActionMap
from Components.Button import Button
from Components.Label import Label
from Components.ScrollLabel import ScrollLabel
from Components.PluginComponent import plu... | ACJTeam/enigma2 | lib/python/Screens/EventView.py | Python | gpl-2.0 | 11,653 |
class RecordingException(Exception):
pass
class Recording(object):
def __init__(self, stream, lenght):
import command
self.name = None
self.time = None
self.lenght = lenght
self.path = None
self._temp_path = None
self._processing_list = []
if i... | rizen1892/SmartHomeSolutions-Web | app/recording.py | Python | gpl-2.0 | 3,094 |
from inline import Inline | raku-cat/telegram-rakubot | __init__.py | Python | gpl-3.0 | 25 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import requests
import requests.sessions
import argparse
import getpass
import sys
import re
import os
import json
import wget
import subprocess
# Version
__version__ = '1.7.1'
# User Agent String
useragent = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/3... | rinodung/udemy-dl-windows | udemy-dl.py | Python | unlicense | 9,877 |
# coding=utf-8
# Copyright 2022 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... | google-research/google-research | bonus_based_exploration/intrinsic_motivation/intrinsic_dqn_agent.py | Python | apache-2.0 | 10,489 |
H_SETTINGS_FOLDER_NAME = "helper"
H_SETTINGS_FOLDER = os.path.join(PACKAGE_PATH, H_SETTINGS_FOLDER_NAME)
| pichillilorenzo/JavaScript-Completions | helper/helper_class.py | Python | mit | 105 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Objects used to store data, compute fits, and generate PDFs.
"""
from __future__ import (print_function, division)
import six
from six.moves import range
import sys
import os
import warnings
import math
import numpy as np
import warnings
try:
from scipy.special... | joshspeagle/frankenz | frankenz/fitting.py | Python | mit | 621 |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from isbntools import app
# Create your models here.
class Isbn(models.Model):
code = models.CharField(max_length=20)
title = models.CharField(max_length=400)
... | pankajlal/prabandh | books/models.py | Python | apache-2.0 | 1,561 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br)
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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... | vincent-noel/libSigNetSim | libsignetsim/sedml/container/ListOfIds.py | Python | gpl-3.0 | 1,503 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 License, or
# (at your... | blckshrk/Weboob | weboob/tools/application/qt/qt.py | Python | agpl-3.0 | 13,100 |
# -*- coding: utf-8 -*-
from openprocurement.tender.core.utils import optendersresource
from openprocurement.tender.openeu.views.lot import (
TenderEULotResource as TenderLotResource
)
from openprocurement.tender.competitivedialogue.constants import (
CD_EU_TYPE, CD_UA_TYPE
)
@optendersresource(name='{}:Tende... | openprocurement/openprocurement.tender.competitivedialogue | openprocurement/tender/competitivedialogue/views/stage1/lot.py | Python | apache-2.0 | 1,031 |
r"""
DONE 1. read files in dir/sorted
DONE 2. intrusive test file name inside if match format "vmware-dr-4245.log"
DONE 3. If there is _a_ match in file format, unzip the whole gz file
DONE 4. zip file with input filename / test it / delete original file
"""
__package__ = "srmparserlite.splFileManager"
from ..splGener... | verbalsaintmars/srmparserlite | srmparserlite/splFileManager/zipper.py | Python | mit | 6,409 |
#
# @lc app=leetcode id=637 lang=python3
#
# [637] Average of Levels in Binary Tree
#
# https://leetcode.com/problems/average-of-levels-in-binary-tree/description/
#
# algorithms
# Easy (66.42%)
# Total Accepted: 200.1K
# Total Submissions: 301K
# Testcase Example: '[3,9,20,null,null,15,7]'
#
# Given the root of a ... | vermouth1992/Leetcode | python/637.average-of-levels-in-binary-tree.py | Python | mit | 1,888 |
class CreateClass():
""" This class will generate the required class of desired content type
and form the string that will be written to the python script file
"""
def __init__(self, name, member_dict,is_leaf):
self.import_string = 'from blogging import tag_lib\nfrom django.db import model... | PirateLearner/pi | PirateLearner/blogging/create_class.py | Python | gpl-2.0 | 7,154 |
# -*- coding: utf-8 -*-
"""
An API for client-side validation of (potential) user data.
"""
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.throttling import AnonRateThrottle
from openedx.core.djangoapps.user_api.accounts.api import (
get_email_validation_... | philanthropy-u/edx-platform | openedx/core/djangoapps/user_api/validation/views.py | Python | agpl-3.0 | 7,749 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
from rtfw.PropertySets import (AttributedList, Colours, Fonts, Papers,
MarginsPS, ShadingPS,... | yeleman/rtfw | rtfw/__init__.py | Python | gpl-2.0 | 1,181 |
#===============================================================================
#
# Errbot Configuration
#
#-------------------------------------------------------------------------------
# {{ ansible_managed }}
#===============================================================================
import logging
{% if er... | jmcvetta/ansible-role-errbot | templates/config.py | Python | apache-2.0 | 3,843 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pprint
import struct
import argparse
EV_LOG = "ev_double.log"
EV_PIPE = "/tmp/emu_event"
def gen_ev_from_log_entry(line):
values = line.split("|")
return {
"time": {
"sec": int(values[3]),
"usec": int(values[4]),
... | Hzj-jie/koreader-base | ev_replay.py | Python | agpl-3.0 | 1,114 |
import os
import sys
import argparse
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermisc.selfcheck import harvesterPackageInfo
def main():
oparser = argparse.ArgumentParser(prog='prescript', add_help=True)
oparser.add_argument('-f', '--local_info_file', action='store... | dougbenjamin/panda-harvester | pandaharvester/harvesterscripts/prescript.py | Python | apache-2.0 | 901 |
# Created By: Virgil Dupras
# Created On: 2009-09-19
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licens... | hsoft/musicguru | qt/fs_model.py | Python | bsd-3-clause | 7,759 |
import re
from django.db import models
from django.db.models import Count
from django.utils import timezone as tz
from cfp.models import PaperApplication
from people.models import User, TShirtSize
from talks.models import Talk
from utils.behaviors import Permalinkable
class Event(Permalinkable):
title = models.... | WebCampZg/conference-web | events/models.py | Python | bsd-3-clause | 3,876 |
#!/usr/bin/python
# Copyright (C) 2016 Bitergia
#
# 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 program is di... | dicortazar/ceres | cereslib/dfutils/filter.py | Python | lgpl-3.0 | 2,641 |
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
Utils functions, like timer and random string generator.
"""
import sys
from random import choice
from threading import Event, Timer
from string import ascii_letters, digits
__license__ = """
OpenVAS connector for OMP protocol.
This program is free... | golismero/golismero | thirdparty_libs/openvas_lib/utils.py | Python | gpl-2.0 | 3,654 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2013, 2014 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 ... | egabancho/invenio | invenio/modules/textminer/testsuite/test_textminer_references.py | Python | gpl-2.0 | 16,939 |
# Copyright 2013 IBM Corp.
#
# 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 agree... | phenoxim/nova | nova/tests/unit/objects/test_compute_node.py | Python | apache-2.0 | 26,603 |
# Under MIT License, see LICENSE.txt
""" Module définissant des constantes de programmations python pour l'IA """
from .Position import Position
__author__ = 'RoboCupULaval'
ROBOT_RADIUS = 90
BALL_RADIUS = 22
PLAYER_PER_TEAM = 6
KICK_MAX_SPD = 8.0
# Field Parameters
FIELD_Y_TOP = 3000
FIELD_Y_BOTTOM = -3000
FIELD_X_L... | AlexandraMercier/RULEngine | Util/constant.py | Python | mit | 1,671 |
import re
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
from variables.models import Variable
@register.simple_tag
def variable(key):
return mark_safe(Variable.objects.get(key=key).value) | mykonosbiennale/mykonosbiennale.github.io | variables/templatetags/variable_tags.py | Python | apache-2.0 | 251 |
# -*- coding: utf-8 -*-
"""
General analysis functions.
Try to write all methods such that they take a dataframe as input
and return a dataframe or list of dataframes.
"""
import datetime as dt
import pandas as pd
class Analysis(object):
"""
Generic Analysis
An analysis should have a dataframe as input... | JrtPec/opengrid | opengrid/library/analysis.py | Python | apache-2.0 | 2,065 |
# -*- coding: utf-8 -*-
import os
import re
import sys
import json
import types
import logging
import datetime
import requests
import ssl
from requests.exceptions import ConnectionError
from requests.packages.urllib3.exceptions import ProtocolError
from .decorators import *
from twarc.version import version, user_ag... | DocNow/twarc | twarc/client.py | Python | mit | 43,625 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 28 13:18:34 2016
@author: okada
"""
import unittest
import os
import sys
import test_utils
import subprocess
class TestSet(unittest.TestCase):
CURRENT = os.path.abspath(os.path.dirname(__file__) + "/../")
dataset = CURRENT + "/dataset/qc/"
REF = CURRENT + "... | Genomon-Project/paplot | tests/python/test_qc.py | Python | mit | 8,792 |
__author__ = 'alrik'
| alrik11es/pyagent | pyagent/plugins/events/__init__.py | Python | mit | 21 |
# noinspection PyPackageRequirements
import wx
import gui.utils.color as colorUtils
import gui.utils.draw as drawUtils
from gui.utils.helpers_wxPython import HandleCtrlBackspace
SearchButton, EVT_SEARCH_BTN = wx.lib.newevent.NewEvent()
CancelButton, EVT_CANCEL_BTN = wx.lib.newevent.NewEvent()
TextEnter, EVT_TEXT_ENTER... | pyfa-org/Pyfa | gui/builtinMarketBrowser/pfSearchBox.py | Python | gpl-3.0 | 9,376 |
# ../gungame/plugins/included/gg_reload/__init__.py
"""Reload weapons when players get a kill."""
| GunGame-Dev-Team/GunGame-SP | addons/source-python/plugins/gungame/plugins/included/gg_reload/__init__.py | Python | gpl-3.0 | 99 |
#!/usr/bin/python2.7
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | google/apis-client-generator | src/googleapis/codegen/filesys/library_package.py | Python | apache-2.0 | 4,550 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | HybridF5/jacket | jacket/tests/compute/functional/api_sample_tests/test_remote_consoles.py | Python | apache-2.0 | 5,166 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | emgirardin/compassion-modules | partner_communication/wizards/mail_compose_message.py | Python | agpl-3.0 | 3,536 |
#!/usr/bin/env python
from pymongo import MongoClient
import json
import sys
# print message and die
def msgDie(msg):
print msg
sys.exit(2)
if len(sys.argv) != 4:
msgDie("usage: unifi-minder.py config.json site-name minSNR")
# load config
cfgFile = sys.argv[1]
siteName = sys.argv[2]
minSNR = sys.argv[3]
with ope... | jda/unifi-tools | gen-minrssi.py | Python | mit | 828 |
r"""
==================================
Constants (:mod:`scipy.constants`)
==================================
.. currentmodule:: scipy.constants
Physical and mathematical constants and units.
Mathematical constants
======================
================ ===========================================================... | WarrenWeckesser/scipy | scipy/constants/__init__.py | Python | bsd-3-clause | 12,116 |
# Copyright 2015 Lockheed Martin Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | Epidilius/laikaboss | laikaboss/modules/scan_yara.py | Python | apache-2.0 | 6,177 |
"""
Test course_catalog.api
"""
import json
from datetime import datetime, timedelta
from subprocess import CalledProcessError
import boto3
import pytest
import pytz
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
from mock import ANY
from moto import mock_s3
from course_c... | mitodl/open-discussions | course_catalog/api_test.py | Python | bsd-3-clause | 36,910 |
import sys
sys.path.append("..")
import re
pattern = re.compile(r'\s+')
from data_mining.association_rule.base import rules, lift, support
from data_mining.association_rule.apriori import apriori
from data_mining.association_rule.liftmin import apriorilift
def load_data(fil):
with open(fil, 'r') as f:
... | JoaoFelipe/data-mining-algorithms | examples/pat_data_association_rules.py | Python | mit | 1,596 |
from req import WebRequestHandler
from req import Service
import tornado
class WebIndexHandler(WebRequestHandler):
@tornado.gen.coroutine
def get(self):
self.redirect("/banks/info/")
| kevchentw/nctu_hackathon | backend/web/index.py | Python | mit | 201 |
import numpy as np
import cv2
def region_of_interest(edges):
"""
Purpose: Limit search space to reasonable areas.
Inputs: Image array (edges)
Outputs: Image array with mask applied.
Only keeps the region of the image defined by the polygon
formed from `vertices`. The rest of the image is set ... | swirlingsand/self-driving-car-nanodegree-nd013 | p4-CarND-Advanced-Lane-Lines/methods/laneDetection/regionOfInterest.py | Python | mit | 1,291 |
# Copyright 2019 The Magenta 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 applicable law or agreed to in ... | adarob/magenta | magenta/models/onsets_frames_transcription/create_dataset_maestro.py | Python | apache-2.0 | 5,839 |
# Copyright (c) 2018 PaddlePaddle 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 app... | jacquesqiao/Paddle | python/paddle/fluid/tests/unittests/test_fake_quantize_op.py | Python | apache-2.0 | 1,823 |
#!/usr/bin/env python2
import array
import binascii
import zmq
import struct
port = 25555
zmqContext = zmq.Context()
zmqSubSocket = zmqContext.socket(zmq.SUB)
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashblock")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx")
zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawblock")
zmqSub... | navcoindev/navcoin-core | contrib/zmq/zmq_sub.py | Python | mit | 1,234 |
import re
from io import BytesIO
from streamlink import NoStreamsError
from streamlink.options import Options
from streamlink.plugin import PluginArgument, PluginArguments, pluginmatcher
from streamlink.plugins import Plugin
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStream
from... | bastimeyer/streamlink | tests/plugin/testplugin.py | Python | bsd-2-clause | 2,309 |
from setuptools import setup, find_packages
from afscripting import __version__
setup(
name='afscripting',
version=__version__,
license='GPLv3+',
author='Joel Dubowy',
author_email='jdubowy@gmail.com',
packages=find_packages(),
scripts=[],
classifiers=[
"Development Status :: 3... | pnwairfire/afscripting | setup.py | Python | gpl-3.0 | 926 |
# coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class CreateCartRuleRequest(object):
"""
NOTE: This clas... | kinow-io/kinow-python-sdk | kinow_client/models/create_cart_rule_request.py | Python | apache-2.0 | 18,991 |
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery_conf import app as celery_app
| jberci/resolwe | tests/__init__.py | Python | apache-2.0 | 152 |
import sys
from textwrap import dedent
from rope.base.builtins import File, BuiltinClass
try:
import unittest2 as unittest
except ImportError:
import unittest
from rope.base import exceptions
from rope.base import libutils
from rope.base.pycore import _TextChangeDetector
from rope.base.pyobjects import get_b... | python-rope/rope | ropetest/pycoretest.py | Python | lgpl-3.0 | 53,172 |
# -*- coding: utf-8 -*-
from dp_tornado.engine.controller import Controller
class TimestampController(Controller):
def get(self):
backup_zone = self.model.tests.helper_test.datetime.switch_timezone('Asia/Seoul')
assert_tuple = self.model.tests.assert_tuple
tzx_seoul = 'Asia/Seoul'
... | why2pac/dp-tornado | example/controller/tests/helper/datetime/timestamp.py | Python | mit | 3,271 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-23 16:48
from __future__ import unicode_literals
from django.db import migrations, models
import powerschool_apps.health_care_plan.models.fields
class Migration(migrations.Migration):
dependencies = [
('health_care_plan', '0027_auto_2017032... | IronCountySchoolDistrict/powerschool_apps | powerschool_apps/health_care_plan/migrations/0028_auto_20170323_1048.py | Python | mit | 2,844 |
#!/usr/bin/env python3
import sys
from pathlib import Path
ALLOWED_SUFFIXES = ['.feature',
'.bugfix',
'.doc',
'.removal',
'.misc']
def get_root(script_path):
folder = script_path.absolute().parent
while not (folder / '.git').ex... | arthurdarcet/aiohttp | tools/check_changes.py | Python | apache-2.0 | 1,224 |
# -*- 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 'Company', fields ['slug']
db.create_unique(u'ecg_balancing_company', ['slug']... | sinnwerkstatt/ecg-balancing | ecg_balancing/migrations/0012_auto__add_unique_company_slug.py | Python | mit | 10,698 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lothian/psi4 | psi4/driver/procrouting/dft/mgga_functionals.py | Python | lgpl-3.0 | 6,903 |
# 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 sys
from measurements import media
from telemetry import test
class Media(test.Test):
"""Obtains media metrics for key user scenarios."""
test =... | DirtyUnicorns/android_external_chromium-org | tools/perf/benchmarks/media.py | Python | bsd-3-clause | 1,514 |
#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run all python tests in this directory."""
import sys
import unittest
MODULES = [
'directory_storage_test',
'gsd_stor... | endlessm/chromium-browser | native_client/pynacl/run_pynacl_tests.py | Python | bsd-3-clause | 757 |
import matplotlib.pyplot as plt
import numpy as np
def gen_data(n, start=0, end=10):
x = np.linspace(start, end, n)
y = np.sin(10*x) - x*x
return y
def gen_data_osc(n):
return np.array([1024 + (-2)**(-i/25) for i in range(n)])
def gen_data_rand(n):
return np.random.randn(n) + 0.3*np.linspace(0, 1... | Raphael-C-Almeida/Wireless-Sensor-Network | Data Fusion Test/Kalman Filter Final.py | Python | mit | 4,967 |
import os
import time
import ccmlib.common
import parse
from ccmlib.node import ToolError
from dtest import Tester, debug
from tools.decorators import since
from tools.jmxutils import (JolokiaAgent, enable_jmx_ssl, make_mbean,
remove_perf_disable_shared_mem)
from tools.misc import generate... | spodkowinski/cassandra-dtest | jmx_test.py | Python | apache-2.0 | 15,999 |
input_count=2 # how many types of inputs there are (must be 2: finger and magnitude)
N_input=200 # number of neurons to represent the input
N_pointer=400 # number of neurons per pointer
N_reference=1000 # number of neurons to store the value of the pointer (dereferenced)
N_memory=2000 # number of neu... | tcstewar/finger_gnosis | pointer7.py | Python | gpl-2.0 | 7,555 |
import datetime
print 'Content-Type: text/html'
print ''
print '<html>'
print '<head>'
print '<title>Welcome to MarkCC\'s chat service</title>'
print '</head>'
print '<body>'
print '<h1>Welcome to MarkCC\'s chat service</h1>'
print ''
print 'Current time is: %s' % (datetime.datetime.now())
print '</body>'
print '</htm... | z2care/sample-code-in-the-cloud | chatone/chat.py | Python | artistic-2.0 | 324 |
#!/usr/bin/python
def convert_to_upper(string):
''' returns string converting it into upper case'''
return str.upper(string)
f1 = convert_to_upper
def convert_to_upper(string , y=10):
return str.upper(string + str(y))
f2 = convert_to_upper
def convert_to_lower(string):
''' returns string converting i... | RGU5Android/PythonLectureNotes | HomeWork/09-28-14/upper_lower_string.py | Python | gpl-2.0 | 612 |
import subprocess
import pytest
from utils import *
@all_available_simulators()
def test_filter(tmp_path, simulator):
unit_test = tmp_path.joinpath('some_unit_test.sv')
unit_test.write_text('''
module some_unit_test;
import svunit_pkg::*;
`include "svunit_defines.svh"
string name = "some_ut";
svun... | svunit/svunit | test/test_run_script.py | Python | apache-2.0 | 9,783 |
# Copyright 2013 Jack David Baucum
#
# This file is part of Orthosie.
#
# Orthosie 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 l... | kkoci/orthosie | register/tests.py | Python | gpl-3.0 | 6,472 |
# -*- coding: utf-8 -*-
import os
z1 = 1.5 + 3j
z2 = 1.5 + 1.5j
z1 + z2
z1 - z2
z1 * z2
z1 / z2
- z1
z1.conjugate()
abs(z1)
z1 ** z2
z1.real
z1.imag
os.system("pause")
| NicovincX2/Python-3.5 | Théorie des nombres/Arithmétique/Opération arithmétique/complex_ops_example.py | Python | gpl-3.0 | 173 |
#!/usr/bin/env python3
import argparse
import os
import re
import shutil
from collections import OrderedDict
EXTRACT_TAGS = ["description", "brief_description", "member", "constant", "theme_item", "link"]
HEADER = """\
# LANGUAGE translation of the Godot Engine class reference.
# Copyright (c) 2007-2021 Juan Linietsk... | DmitriySalnikov/godot | doc/translations/extract.py | Python | mit | 9,878 |
import json
from flask import request
from flask_login import login_required
from flask_login import current_user
from monetario.models import db
from monetario.models import User
from monetario.models import Account
from monetario.models import GroupCurrency
from monetario.views.api.v1 import bp
from monetario.vie... | monetario/core | monetario/views/api/v1/accounts.py | Python | bsd-3-clause | 3,226 |
from setuptools import setup
setup(
name='base58',
py_modules=['base58'],
version='0.2.5',
description='Base58 and Base58Check implementation',
author='David Keijser',
author_email='keijser@gmail.com',
url='https://github.com/keis/base58',
license='MIT',
entry_points={
'cons... | p2p-today/base58 | setup.py | Python | mit | 738 |
#
# Copyright (C) 2009-2011, 2014 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# This program is distributed ... | UNINETT/nav | python/nav/mibs/entity_mib.py | Python | gpl-2.0 | 15,040 |
#!/usr/bin/env python3
# -------------------------------------------------------------------------------
# Name: fffbuild
# Purpose:
#
# Author: Amir Geva
#
# Created: 07/04/2014
# Copyright: (c) Amir Geva 2014
# Licence: GPL V2
# -------------------------------------------------------------------... | amirgeva/fastfilefind | fffbuild.py | Python | gpl-2.0 | 4,047 |
import ctypes
libc = ctypes.CDLL("/usr/lib/libc.dylib")
print(libc.rand())
print(libc.time())
cPrintF = libc.printf
value = b"I'm a C function!"
print(value)
printValue = ctypes.c_char_p(value)
print(printValue.value)
print(printValue)
cPrintF("%s", printValue)
| torchhound/projects | python/ffi.py | Python | gpl-3.0 | 264 |
import numpy as np
import scikits.statsmodels.tsa.vector_ar.util as util
try:
import matplotlib.pyplot as plt
import matplotlib as mpl
except ImportError:
pass
class MPLConfigurator(object):
def __init__(self):
self._inverse_actions = []
def revert(self):
for action in self._inve... | wesm/statsmodels | scikits/statsmodels/tsa/vector_ar/plotting.py | Python | bsd-3-clause | 6,956 |
__all__=["hash_tables", "heap", "linked_list", "queues", "stacks"] | switchkiller/Python-and-Algorithms-and-Data-Structures | src/abstract_structures/__init__.py | Python | mit | 66 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Alberto Buitrago <echo YWJiYXJyYXNhQGdtYWlsLmNvbQo= | base64 -d>
#
# 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 ve... | abbarrasa/openbox | logout-trayicon.py | Python | gpl-3.0 | 4,066 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import unittest
import frappe
test_ignore = ["Leave Block List"]
class TestDepartment(unittest.TestCase):
def test_remove_department_data(self):
doc = create_department("Test Dep... | mhbu50/erpnext | erpnext/hr/doctype/department/test_department.py | Python | gpl-3.0 | 764 |
# 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
# distrib... | dmsimard/python-cicoclient | cicoclient/__init__.py | Python | apache-2.0 | 772 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import codecs
import datetime
import urllib2
import csv
import getpass
import os
import tempfile
import unicodedata
imp... | rhelmer/socorro-lib | socorro/cron/jobs/fetch_adi_from_hive.py | Python | mpl-2.0 | 7,399 |
from unittest import TestCase
from abl.util.checks import (equals,
attribute,
key,
compose,
)
class Obj(object):
def __init__(self, **kwargs):
self.__dict__ = kwargs
class CheckTests(TestCase):
def test_equals(self):
... | AbletonAG/abl.util | test/test_checks.py | Python | mit | 2,251 |
"""Adarna URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | glugmpstme/dotjot | Adarna/Adarna/urls.py | Python | apache-2.0 | 795 |
import os
import sys
import logging
import argparse
from .discovery import UPnPLoopbackException
from .environment import Environment
from .config import in_home, WemoConfiguration
from .utils import matcher
reqlog = logging.getLogger("requests.packages.urllib3.connectionpool")
reqlog.disabled = True
NOOP = lambda *... | tomjmul/wemo | wemo/cli.py | Python | bsd-3-clause | 13,226 |
"""
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | mwcraig/aplpy | ah_bootstrap.py | Python | mit | 36,165 |
#!/usr/bin/env python
# coding: utf-8
DESCRIPTION="convert feature list into affinity matrix"
import numpy as np
import argparse
import sklearn.metrics as sm
import logging
import sys
from os.path import dirname
sys.path.append(dirname(__file__))
from my_target_counter import TargetCounter
logger = logging.getLogge... | AtsushiHashimoto/exp_idc | tools/make_affinity_matrix.py | Python | bsd-2-clause | 4,321 |
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import os
from octoprint.se... | ymilord/OctoPrint-MrBeam | src/octoprint/plugin/__init__.py | Python | agpl-3.0 | 5,253 |
"""The suite of window functions."""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy import special, linalg
from scipy.fftpack import fft
from scipy.lib.six import string_types
__all__ = ['boxcar', 'triang', 'parzen', 'bohman', 'blackman', 'nuttall',
... | maciejkula/scipy | scipy/signal/windows.py | Python | bsd-3-clause | 48,620 |
import numpy as np
from Other_samples.testCases import *
from Other_samples.Gradient_check.gc_utils import sigmoid, relu, dictionary_to_vector, vector_to_dictionary, \
gradients_to_vector
def forward_propagation(x, theta):
"""
Implement the linear forward propagation (compute J) presented in Figure 1 (J(... | adexin/Python-Machine-Learning-Samples | Other_samples/Gradient_check/gradient_check.py | Python | mit | 7,033 |
import time
import gzip
import simplejson
def parse(filename):
f = gzip.open(filename, 'r')
entry = {}
for l in f:
l = l.strip()
colonPos = l.find(':')
if colonPos == -1:
yield entry
entry = {}
continue
eName = l[:colonPos]
rest = l[colonPos+2:]
entry[eName] = rest
yie... | seanjh/data-analysis-CM | processRaw.py | Python | mit | 2,005 |
from .. import ServiceConstants
class Sigv4ServiceConstants(ServiceConstants):
"""Logical grouping of Signature Version 4 service constants
This class sets the appropriate Signature v4 specific parameters required
for signing.
"""
# Minimum required headers for signature v4 signed requests
__R... | nfcharles/python-aws-sign | aws_sign/v4/__init__.py | Python | mit | 1,295 |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenSynergy Indonesia
# Copyright 2020 PT. Simetri Sinergi Indonesia
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "General Ledger Report",
"version": "8.0.1.5.1",
"summary": "Report General Ledger",
"category": "Accounting",
"web... | open-synergy/opnsynid-accounting-report | opnsynid_general_ledger_aeroo_report/__openerp__.py | Python | agpl-3.0 | 726 |
import os
from modelos.Arquivo import Arquivo
class Analise():
def __init__(self):
pass
def analisar(self, arquivo, quarentena):
baseVirus = open("bases/Base_Virus",'r')
pipe = os.popen("md5sum -b " + arquivo + "|cut -f1 -d\' \'")
hash = pipe.read().replace('\n','')
h... | klok-univali/kanschau-anti-virus | analise/Analise.py | Python | gpl-3.0 | 1,316 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 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.... | netscaler/neutron | neutron/db/db_base_plugin_v2.py | Python | apache-2.0 | 66,754 |
num = 4; # will be integer variable
str = "Hello, String."; # will be string variable
flnum = 4.0; # will be float num
print "First condition for variable num:", num;
print "First condition for variable str:", str;
print "First condition for variable flnum:", flnum;
num+=2;
str+=" Love you";
flnum-=2.0;
print "Second c... | getsadzeg/python-codes | src/variables.py | Python | mit | 455 |
# -*- coding: utf-8 -*-
# © 2016 Akretion (http://www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# @author Alexis de Lattre <alexis.delattre@akretion.com>
from odoo.tests.common import TransactionCase
class TestVatSanitized(TransactionCase):
def test_vat_sanitized(self):
... | sergiocorato/partner-contact | base_vat_sanitized/tests/test_vat.py | Python | agpl-3.0 | 650 |
""" Tests the implementation of the solution to the Euclidean Minimum Spanning
Tree (EMST) problem """
import pytest
from exhaustive_search.point import Point
from exhaustive_search.euclidean_mst import solve, edist
def compare_solutions(actual, expected):
assert len(actual) == len(expected), "expected %d to equ... | ciarand/exhausting-search-homework | test/test_euclidean_mst.py | Python | isc | 2,000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.