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 |
|---|---|---|---|---|---|
#*************************************************************************************************
#
# File Name: gui.py
# Project: Erebus Labs Sensor
# Revision Date: 04/13/2014
# Description: This file contains the main Erebus Sensor gui class
#
#***********************************************************... | erebus-labs/PSU-VOC-SENSOR-2K14 | Code/python_gui/erebus_sensor/gui.py | Python | gpl-2.0 | 15,795 |
from . import FixtureTest
class TrolleybusIsABus(FixtureTest):
def test_industrial_street(self):
self.load_fixtures([
'http://www.openstreetmap.org/way/397268717',
'http://www.openstreetmap.org/relation/2996736',
], clip=self.tile_bbox(16, 10484, 25339))
self.asser... | mapzen/vector-datasource | integration-test/629-trolleybus-is-a-bus.py | Python | mit | 1,163 |
# 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... | eadgarchen/tensorflow | tensorflow/contrib/bayesflow/python/kernel_tests/csiszar_divergence_test.py | Python | apache-2.0 | 33,008 |
class Player:
self.rating = 1500 # Actual rating
self.rd = 350 # Rating deviation
self.sigma = 0.06 # Volatility
self.mu = None
self.phi = None
class Glicko2:
self.tau = 1.0 # Should be between 0.3 and 1.2, use higher numbers for more predicatable games
def step2(self, player):
player.mu = (player.... | Rensselaer-AI-League/GeneralizedGameServer | helpers/glicko2.py | Python | mit | 993 |
# 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... | eadgarchen/tensorflow | tensorflow/contrib/distributions/python/ops/negative_binomial.py | Python | apache-2.0 | 7,419 |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | jmcnamara/XlsxWriter | xlsxwriter/test/comparison/test_chart_format05.py | Python | bsd-2-clause | 1,480 |
#coding=utf-8
import C
import requests
import time, re, json
from lxml import etree
import bar
#=====some const========
Home = "http://192.168.8.119/"
log_in = "http://192.168.8.119/login"
Base = "http://192.168.8.119/ol/"
Refresh = "http://192.168.8.119/ol/studycourse/update"
Finish = "http://192.168.8.11... | NKUCodingCat/NKU-SSS-in-One | prog/src/Dang.py | Python | gpl-2.0 | 5,479 |
import unittest
import datetime
import os.path
from davies.compass import *
DATA_DIR = 'tests/data/compass'
# Example Compass Project with:
# - NAD83 UTM Zone 13 base location
# - Two imported Data Files
# - One with 25 cave surveys, four fixed stations
# - One with 4 surface surveys
TESTFILE = os.path.join(DAT... | riggsd/davies | tests/test_compass.py | Python | mit | 8,034 |
import os
import logging
import aexpect
from autotest.client.shared import error
from virttest import utils_selinux
from virttest import virt_vm
from virttest import virsh
from virttest import remote
from virttest.utils_test import libvirt
from virttest.libvirt_xml import vm_xml
from virttest.libvirt_xml.devices.dis... | waynesun09/tp-libvirt | libvirt/tests/src/virtual_disks/virtual_disks_multivms.py | Python | gpl-2.0 | 17,315 |
# py3kcompat.py - compatibility definitions for running hg in py3k
#
# Copyright 2010 Renato Cunha <renatoc@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import builtins
from numbers import Number
def bytesformatter... | ya790206/temp_hg | mercurial/py3kcompat.py | Python | gpl-2.0 | 2,104 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Process (extract, filter, merge) Vossantos in an org mode file.
#
# Usage: Without any arguments, extracts all Vossanto canidates from
# the given org file.
#
# Author: rja
#
# Changes:
# 2019-12-18 (rja)
# - added field sourceImageLicense
# 2019-12-16 (rja)
# - added opt... | weltliteratur/vossanto | org.py | Python | gpl-3.0 | 20,210 |
import webapp2
from google.appengine.ext import db
import logging
import charbuilder
import traits
import traceback
import random
import string
instance_key = "".join(
(random.choice(string.ascii_uppercase + string.digits) for i in xrange(25)))
def getFile(_file):
with open(_file, "r") as f: return f.read().re... | jtsmith1287/gurpscg | main.py | Python | apache-2.0 | 5,971 |
# Copyright (C) 2011 Walter Bender
#
# 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 ... | gusDuarte/sugar | src/jarabe/view/customizebundle.py | Python | gpl-2.0 | 7,424 |
## @file
# process FD Region generation
#
# Copyright (c) 2007 - 2018, 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 of the l... | MattDevo/edk2 | BaseTools/Source/Python/GenFds/Region.py | Python | bsd-2-clause | 16,223 |
print "hello world"
for i in range(10):
print i
print "Hello my friend!"
| mephisto1073/pynet-class | test1.py | Python | apache-2.0 | 79 |
# _*_ coding:utf-8 _*_
# !/usr/bin/env python
# auth: nevermore
import time
import hashlib
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from overseas.models.access import InfUser
def get_token():
timestamp = time.time()
data = '{}{}'.format(timestamp, settings.SECRET... | nevermoreluo/privateoverseas | utils/user_tools.py | Python | gpl-3.0 | 936 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Set of tools to deals with colors in python
"""
import hashlib
class NotAValidComponentException(Exception):
""" Exception raised when trying to get an invalid component """
pass
class Color(object):
""" Object to create, convert and manipulate color in ... | avcreation/pyPoppins | poppinsbag/colors.py | Python | mit | 6,431 |
from flask import Flask, send_from_directory, render_template
import os
import socket
app = Flask(__name__)
hostname = socket.gethostname()
if "DEBUG" in os.environ:
app.debug = True
@app.errorhandler(500)
def error(e):
return render_template('error.html', hostname=hostname, error=e), 500
@app.route("/")
de... | bchav/docker-flask | app.py | Python | apache-2.0 | 547 |
from __future__ import absolute_import
__all__ = ['TaskRunner']
# from celery import current_app
from contextlib import contextmanager
from django.conf import settings
@contextmanager
def TaskRunner():
pass
# settings.CELERY_ALWAYS_EAGER = True
# current_app.conf.CELERY_ALWAYS_EAGER = True
# yield
... | wanghe4096/WangBlog | src/wangblog/testutils/helpers/task_runner.py | Python | bsd-2-clause | 413 |
# ylplines - Clarity for Yelp
# Copyright (C) 2016 Jeff Lee
#
# 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 ... | jcjl013/ylplines | wsgi/djYlplines/djYlplines/wsgi.py | Python | gpl-3.0 | 1,093 |
# coding=utf-8
# Copyright The XTREME Benchmark Authors.
# Copyright (c) 2018, NVIDIA 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.apa... | google-research/xtreme | third_party/evaluate_retrieval.py | Python | apache-2.0 | 30,770 |
from __future__ import unicode_literals
# works in Python 2 & 3
class _Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = \
super(_Singleton, cls).__call__(*args, **kwargs)
return cls._instances[c... | bearstech/modoboa | modoboa/lib/singleton.py | Python | isc | 396 |
# Copyright (c) 2020, DjaoDjin inc.
# see LICENSE.
from django.db import transaction
from rest_framework import generics
from rest_framework.generics import get_object_or_404
from survey.models import EnumeratedQuestions
from ..serializers import ConsumptionSerializer
from ..mixins import BreadcrumbMixin
from ..model... | djaodjin/envconnect | envconnect/api/consumption.py | Python | gpl-2.0 | 5,465 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site domain and name."""
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID... | shanenater/shanecookie | cookiedjango/contrib/sites/migrations/0002_set_site_domain_and_name.py | Python | bsd-3-clause | 950 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2016_09_01/operations/express_route_service_providers_operations.py | Python | mit | 4,238 |
#!/usr/bin/env python
"""
Test of the Tables service
Copyright 2009 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import path
import unittest, os
import omero, omero.tables
from omero.rtypes import *
from integration import library as lib
class T... | rleigh-dundee/openmicroscopy | components/tools/OmeroPy/test/tablestest/service.py | Python | gpl-2.0 | 8,897 |
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 7 13:44:32 2016
@author: agiovann
"""
#%%
%load_ext autoreload
%autoreload 2
from glob import glob
import numpy as np
import pylab as pl
import os
mpl.rcParams['pdf.fonttype'] = 42
#%%
fls=[ '/mnt/ceph/users/agiovann/ImagingData/eyeblink/b37/20160627105... | agiovann/CalBlitz | calblitz/granule_cells/powell_graph.py | Python | gpl-3.0 | 7,490 |
# This file is part of beets.
# Copyright 2015, Rafael Bodill http://github.com/rafi
#
# 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 ... | andremiller/beets | beetsplug/lastimport.py | Python | mit | 6,476 |
import logging
import floto.specs
import json
logger = logging.getLogger(__name__)
class DecisionInput:
def __init__(self):
self.history = None
#def get_input_task(self, task, is_failed_task=False):
#if is_failed_task:
#event_type = None
#if isinstance(task, floto.spec... | babbel/floto | floto/decider/decision_input.py | Python | mit | 2,677 |
from elephantblog.models import Entry
from feincms.module.page.models import Page
from feincms.content.application.models import ApplicationContent
from feincms.content.medialibrary.v2 import MediaFileContent
from feincms.content.raw.models import RawContent
from feincms.content.video.models import VideoContent
from fo... | JJarczyk12/AlyssaJarczykPhotography | photographer/models.py | Python | bsd-3-clause | 2,244 |
#!/usr/bin/python
import sys, os.path, random
import json
from mwm import MWM
if len(sys.argv) < 2:
print('Dumps some MWM structures.')
print('Usage: {0} <country.mwm>'.format(sys.argv[0]))
sys.exit(1)
mwm = MWM(open(sys.argv[1], 'rb'))
mwm.read_types(os.path.join(os.path.dirname(sys.argv[0]), '..', '..',... | stangls/omim | tools/python/mwm/dump_mwm.py | Python | apache-2.0 | 1,325 |
"""Tests which check the various ways you can set DJANGO_SETTINGS_MODULE
If these tests fail you probably forgot to install django-configurations.
"""
import pytest
pytest.importorskip('configurations')
try:
import configurations.importer
configurations
except ImportError as e:
if 'LaxOptionParser' in e.... | thedrow/pytest-django | tests/test_django_configurations.py | Python | bsd-3-clause | 3,044 |
"""Diagnostics support for the Mazda integration."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core ... | rohitranjan1991/home-assistant | homeassistant/components/mazda/diagnostics.py | Python | mit | 1,836 |
import tvm
import numpy as np
import scipy.signal
from tvm.contrib import nnpack
def test_fully_connected_output():
n = 1024
l = 128
m = 235
bias = tvm.var('bias', dtype=tvm.float32)
A = tvm.placeholder((n, l), name='A')
B = tvm.placeholder((m, l), name='B')
C = nnpack.fully_connected_outpu... | phisiart/tvm | tests/python/contrib/test_nnpack.py | Python | apache-2.0 | 6,793 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "coloursite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| richbs/colourlens | manage.py | Python | mit | 253 |
from typing import Generator, Tuple, Union
import inspect
import os.path
from sacred.utils import PathType
from typing import Sequence, Optional
from collections import OrderedDict
from sacred.config import (
ConfigDict,
ConfigScope,
create_captured_function,
load_config_file,
)
from sacred.dependenci... | IDSIA/sacred | sacred/ingredient.py | Python | mit | 14,173 |
#
# Copyright 2008-2014 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 ... | txomon/vdsm | vdsm/virt/vm.py | Python | gpl-2.0 | 197,160 |
import string
import unittest
from dict import Dict
from list import List
from packer import Packer
from set import Set
class TestPacker(unittest.TestCase):
def test_integer(self):
buf = bytearray(1024)
packer = Packer(buf)
packer.pack_integer('b', 42)
self.assertEqual(1, packer... | decimalbell/devnull | python/sidl/test_packer.py | Python | mit | 5,078 |
"""
Plugin for UrlResolver
Copyright (C) 2011 t0mm0
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 distribute... | dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/veeHD.py | Python | gpl-2.0 | 3,832 |
# Copyright (c) Alexander Borgerth 2010
# See LICENSE for details.
class PirateException(Exception):
pass
class TableError(PirateException):
pass
class InvalidTable(TableError):
pass
class InvalidRow(TableError):
pass
class ElementNotFound(PirateException):
pass
| Arthan/piratebay | piratebay/exceptions.py | Python | mit | 292 |
#
# *WIP* Example script to write 'nsets.conf'
#
outfile = open("nsets.conf","wb")
numEs = 2
v=-10.0
m = 0.0
n = 0.0
h = 0.0
ms = 0.0
mhf = 0.0
mhs = 0.0
mtc = 0.0
htc = 0.0
mck = 0.0
ca = 0.0
gna = 52.0
ena = 55.0
gk = 11.0
ek = -90.0
gl = .55
el = -65.0
iext = -2.5450#-1.8#-2.545
for i in range(numEs):
outfile.... | rhnshrma/insilico | insilico-0.16/script/make_nsets.py | Python | gpl-3.0 | 574 |
# YouTube Video: https://www.youtube.com/watch?v=QvSIAB27Vdk
A = [6, 3, 2, 7, 5, 5]
A = sorted(A)
for i in range(len(A)//2):
print(A[i], A[~i])
| vprusso/youtube_tutorials | algorithms/greedy_algorithms/optimal_task_assingment.py | Python | gpl-3.0 | 150 |
from MA_version import version as __version__
from MA_version import version_info as __version_info__
from MA import *
| fxia22/ASM_xf | PythonD/site_python/Numeric/MA/__init__.py | Python | gpl-2.0 | 119 |
# 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
# d... | FrankDuan/df_code | dragonflow/common/exceptions.py | Python | apache-2.0 | 2,616 |
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
@pytest.mark.parametrize("na", [None, np.nan, pd.NA])
def test_setitem_missing_values(na):
arr = pd.array([True, False, None], dtype="boolean")
expected = pd.array([True, None, None], dtype="boolean")
arr[1] = na
tm.ass... | dsm054/pandas | pandas/tests/arrays/boolean/test_indexing.py | Python | bsd-3-clause | 361 |
algorithm = "fourier"
potential = "quadratic"
T = 7.5
dt = 0.01
eps = 0.1
f = 4.0
ngn = 4096
basis_size = 4
P = 1.0j
Q = 1.0
S = 0.0
initial_values = [[ 0, (P, Q, S, 0.0, 2.0), [(0,1.0)]],
[ 0, (P, Q, S, 0.0, -2.0), [(0,1.0)]]]
write_nth = 2
| WaveBlocks/WaveBlocks | demos/demo_collision/demo_harmonic_oscillator_particle_collision_fourier.py | Python | bsd-3-clause | 273 |
from wtforms import Form, IntegerField
class MyForm(Form):
a = IntegerField()
def test_errors():
form = MyForm.from_json({'a': 'not an integer!'})
form.validate()
assert form.errors == {'a': [u'Not a valid integer value']}
| kvesteri/wtforms-json | tests/test_errors.py | Python | bsd-3-clause | 243 |
# -*- coding: utf-8 -*-
"""
"""
# Author: Avraam Marimpis <avraam.marimpis@gmail.com>
from .ng import NeuralGas
from .mng import MergeNeuralGas
from .rng import RelationalNeuralGas
from .gng import GrowingNeuralGas
from .som import SOM
from .umatrix import umatrix
from .validity import ray_turi, davies_bouldin
__a... | makism/dyfunconn | dyconnmap/cluster/__init__.py | Python | bsd-3-clause | 485 |
from fabric.api import run, settings, env
from cloudferrylib.base.action import action
from cloudferrylib.utils import forward_agent
from cloudferrylib.utils import utils as utl
INSTANCES = 'instances'
DIFF = 'diff'
EPHEMERAL = 'ephemeral'
DIFF_OLD = 'diff_old'
EPHEMERAL_OLD = 'ephemeral_old'
PATH_DST = 'path_dst'
HOS... | andybondar/CloudFerry | cloudferrylib/os/actions/load_compute_image_to_file.py | Python | apache-2.0 | 1,551 |
import sdl2
import sdl2ui
class Debugger(sdl2ui.Component):
def init(self):
self.frames = 0
self.p1 = sdl2.SDL_GetPerformanceCounter()
self.p2 = 0
self.freq = sdl2.SDL_GetPerformanceFrequency()
self.threshold = self.props.get('refresh_delay', 0.1) * self.freq
def acti... | cecton/pysdl2-sdl2ui | sdl2ui/debugger.py | Python | mit | 854 |
import json
attrnames = ['field', 'ID', 'ra', 'dec', 'P', 't0', 'I', 'V_I', 'A', 'type']
types = [str, str, str, str, float, float, float, float, float, str]
data = []
ogle1_type = {'EW': 'ecl',
'E': 'ecl',
'EA': 'ecl',
'EB': 'ecl',
'EA?': 'ecl',
'E... | zhewang/lcvis | python_scripts/ogle_7K/ogle_to_objlist_all.py | Python | gpl-2.0 | 2,396 |
from serial_settings import SerialSettings
class AbstractStream(object):
def __init__(self, config, name):
"""
:type name: str
"""
self.config = config
self.name = name
def open(self):
raise NotImplementedError
def close(self):
raise... | ThomasGerstenberg/serial_monitor | stream/__init__.py | Python | bsd-3-clause | 551 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | junghans/espressopp | src/analysis/AnalysisBase.py | Python | gpl-3.0 | 3,450 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_pdtools
----------------------------------
Tests for `pdtools` module.
"""
import unittest
from pdtools import pdtools
class TestPdtools(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self)... | NigelCleland/pdtools | tests/test_pdtools.py | Python | bsd-3-clause | 382 |
import signal
from twisted.internet import reactor, defer
from scrapy.core.engine import ExecutionEngine
from scrapy.resolver import CachingThreadedResolver
from scrapy.extension import ExtensionManager
from scrapy.signalmanager import SignalManager
from scrapy.utils.ossignal import install_shutdown_handlers, signal_... | rahul-c1/scrapy | scrapy/crawler.py | Python | bsd-3-clause | 5,540 |
#!/usr/bin/env python
# coding: utf-8
import json, sys, re, random
from bs4 import BeautifulSoup
from json_stats import jsonify
DATE_FMT = re.compile(r'\d{4}-\d{2}-\d{2}')
INT_FMT = re.compile(r'^\d+$')
FLOAT_FMT = re.compile(r'^\d+\.\d+$')
WHITESPACE_FMT = re.compile(r'\s+')
"""
Extract values from the key given,... | participedia/data-transport | json_values.py | Python | mit | 798 |
import csv
import requests
from lxml import html
writer = csv.writer(open('output.csv', 'wb'))
writer.writerow(['Company', 'Symbol', 'Time', 'Date'])
visited_urls = []
def scrape_page(url):
visited_urls.append(url)
page = requests.get(url)
tree = html.fromstring(page.content)
non_working_days = tr... | Lazar-T/earnings-announcements-scraper | earnings_scraper.py | Python | mit | 2,026 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-12 19:55
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ui", "0010_video_default_sort"),
]
operations = [
migrations.AddField(
... | mitodl/odl-video-service | ui/migrations/0011_collection_created_at.py | Python | bsd-3-clause | 602 |
"""
A python library for interacting with the Disqus commenting system.
For integrating with your applications look at the 'Disqus' class.
"""
from api import *
| jarodl/disqus.py | disqus/__init__.py | Python | mit | 162 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | timj/scons | test/Alias/errors.py | Python | mit | 1,595 |
import os
import gpaw
elements='H He Li Be B C N O F Ne Na Mg Al Si P S Cl Ar'
os.system("gpaw-setup -n --name=nrel -f PBE " + elements)
os.system("gpaw-basis -t dzp " + elements)
| robwarm/gpaw-symm | gpaw/test/big/g2_1/generate.py | Python | gpl-3.0 | 181 |
# PyMoBu - Python enhancement for Autodesk's MotionBuilder
# Copyright (C) 2010 Scott Englert
# scott@scottenglert.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 3 of the ... | CountZer0/PipelineConstructionSet | python/moBu/site-packages/PyMoBu-0.1/pymobu/__init__.py | Python | bsd-3-clause | 2,544 |
from src.ipevo import IZiggiClient
ipevoClient = IZiggiClient()
resSetResolution = ipevoClient.set_resolution("1024x768")
print("1. Change the streaming resolution of iZiggi-HD\r")
print(resSetResolution)
print("\r\r")
resGetResolution = ipevoClient.get_resolution()
print("2. Get the current streaming resolution of ... | IPEVO/ipevo-iziggi-api-python3 | src/sample.py | Python | mit | 2,035 |
import logging
from salt import client, runner, wheel
from django.conf import settings
from kvmate.models import Host
class SaltBackend(object):
def __init__(self):
self.logger = logging.getLogger(__name__)
self.client = client.LocalClient()
self.runner = runner.RunnerClient()
sel... | asmaps/kvmate | kvmate/backends/mysalt.py | Python | mit | 2,916 |
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | fluxer/spm | nuitka/nuitka/nodes/CodeObjectSpecs.py | Python | gpl-2.0 | 3,167 |
###############################################################################
# lazyflow: data flow based lazy parallel computation framework
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/o... | stuarteberg/lazyflow | benchmarks/operatorWrapper.py | Python | lgpl-3.0 | 3,483 |
import constants
from socialsent import util
import collections
import numpy as np
import itertools
"""
Helper methods for creating and managing existing lexicons.
"""
def make_kuperman_scores_lexicon():
polarities = {}
for i, line in enumerate(util.lines(constants.LEXICONS + "kuperman/raw_ratings.csv")):
... | williamleif/socialsent | socialsent/lexicons.py | Python | apache-2.0 | 7,436 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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.... | tuskar/tuskar-ui | openstack_dashboard/dashboards/admin/roles/tests.py | Python | apache-2.0 | 4,022 |
#!/usr/bin/env python
# imports and basic setup
from glob import glob
import time
# If your GPU supports CUDA and Caffe was built with CUDA support,
# uncomment the following to run Caffe operations on the GPU.
# caffe.set_mode_gpu()
# caffe.set_device(0) # select GPU device if multiple devices exist
from settings.e... | Sitin/neuromatriarchy | emotions.py | Python | artistic-2.0 | 958 |
#!/usr/bin/env python
'''
OWASP ZSC | ZCR Shellcoder
ZeroDay Cyber Research
Z3r0D4y.Com
Ali Razmjoo
shellcode template used : http://shell-storm.org/shellcode/files/shellcode-57.php
'''
from core import stack
from core import template
def run(dirname):
command = 'mkdir %s' %(str(dirname))
return template.sys(stack.... | Yas3r/OWASP-ZSC | lib/generator/linux_x86/dir_create.py | Python | gpl-3.0 | 378 |
import os as _os
import matplotlib as _mpl
import pylab as _pylab
from functools import partial as _partial
try: from . import _pylab_tweaks
except: import _pylab_tweaks
import spinmob as _s
_qtw = _s._qtw
_qt = _s._qt
_qtcore = _s._qtc
# make sure... | Spinmob/spinmob | _pylab_colormap.py | Python | gpl-3.0 | 18,278 |
# Copyright 2013 Intel 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 require... | eharney/nova | nova/api/openstack/compute/plugins/v3/pci.py | Python | apache-2.0 | 5,394 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | xorpaul/shinken | shinken/objects/checkmodulation.py | Python | agpl-3.0 | 4,462 |
from control import TextControl, ALIGNMENT_LEFT
from Tkinter import Radiobutton as TkRadio, IntVar
STYLE_BUTTON = 0
STYLE_RADIO = 1
class RadioGroup(object):
def __init__(self):
self.var = IntVar()
class RadioButton(TextControl):
def __init__(self, parent, **kwargs):
TextControl.__init__(self... | todd-x86/tkplus | radio.py | Python | apache-2.0 | 1,225 |
#!/usr/bin/env python
##################################################
# Parallel MLMC: Config class #
# #
# Jun Nie #
# Last modification: 19-09-2017 #
##########################################... | henrynj/PMLMC | v0.0/config.py | Python | gpl-3.0 | 2,156 |
#!/home/bgris/miniconda3/envs/odl-lddmm-CP/bin/python
# Author:
# Contact: grubert@users.sf.net
# Copyright: This module has been placed in the public domain.
"""
man.py
======
This module provides a simple command line interface that uses the
man page writer to output from ReStructuredText source.
"""
import loca... | bgris/ODL_bgris | bin/rst2man.py | Python | gpl-3.0 | 635 |
def recite(start, take=1):
results = []
for idx in range(start, start - take, -1):
results.extend(verse(idx))
if idx > start - take + 1:
results.append('')
return results
def verse(number):
return [
f'{_bottles(number).capitalize()} of beer on the wall, {_bottles(nu... | jmluy/xpython | exercises/practice/beer-song/.meta/example.py | Python | mit | 972 |
#!/usr/bin/env python
import datetime
import json
import optparse
import os
import re
import py_compile
import sys
import tempfile
import urllib
import xbundle
import pkg_resources
try:
from collections import OrderedDict
except:
from ordereddict import OrderedDict
from path import path # needs path.py
from... | jefrench/latex2edx | latex2edx/main.py | Python | agpl-3.0 | 75,317 |
#!/usr/bin/env python
import uuid
import inspect
import json
import os, sys
import copy
from .config import get_config
from .helpers import dumper, merge
from .process import summarize_run
def capture_input(args, kwargs, metadata):
"""
Capture the function parameters for the functions that have been ins... | FourthLion/pydatasentry | pydatasentry/capture.py | Python | mit | 1,585 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.automate.explorer.domain import DomainCollection
from cfme.automate.service_dialogs import ServiceDialog
from cfme.services.catalogs.catalog import Catalog
from cfme.services.catalogs.service_... | rananda/cfme_tests | cfme/tests/services/test_dynamicdd_dialogelement.py | Python | gpl-2.0 | 3,678 |
# -*- coding: utf-8 -*-
import re
import logging
import urlparse
import furl
from flask import request, url_for
from website import settings
# Keep me: Makes rubeus importable from website.util
from . import rubeus # noqa
logger = logging.getLogger(__name__)
guid_url_node_pattern = re.compile('^/project/[a-zA-... | revanthkolli/osf.io | website/util/__init__.py | Python | apache-2.0 | 3,996 |
#! /usr/bin/env python
# -*- encoding: UTF-8 -*-
# DOCUMENTATION
import qi
import argparse
import sys
import os
import time
import threading
import math
from naoqi import ALProxy
import conditions
from conditions import set_condition
import requests
import json
import action_base
from action_base import *
'''
... | LCAS/spqrel_tools | actions/iotset.py | Python | mit | 2,644 |
import microbit
class LED():
def __init__(self, x, y):
self.x = x
self.y = y
def on(self, brightness = 9):
microbit.display.set_pixel(self.x, self.y, brightness)
def off(self):
microbit.display.set_pixel(self.x, self.y, 0)
led = LED(2,2)
while True:
led.on()
... | martinohanlon/microbit-micropython | examples/ledclass.py | Python | mit | 383 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'timemanager.tests.south_settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ateoto/django-timemanager | manage.py | Python | mit | 292 |
# -*- coding: utf-8 -*-
# This code is part of Ansible, but is an independent component
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own lic... | KohlsTechnology/ansible | lib/ansible/module_utils/network/meraki/meraki.py | Python | gpl-3.0 | 11,211 |
def extractFriendshipIsPower(item):
"""
'Friendship Is Power'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'Forty Millenniums of Cultivation Chapters' in item['tags']:
return buildReleaseMessageW... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractFriendshipIsPower.py | Python | bsd-3-clause | 431 |
# Copyright 2020 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... | tensorflow/tensorflow | tensorflow/python/dlpack/dlpack_test.py | Python | apache-2.0 | 4,183 |
from gwpy.signal import (highpass, lowpass, concatenate_zpks)
hp = highpass(100, 4096)
lp = lowpass(1000, 4096)
zpk = concatenate_zpks(hp, lp)
from gwpy.plotter import BodePlot
plot = BodePlot(zpk, sample_rate=4096)
plot.show() | gwpy/gwpy.github.io | docs/v0.5/signal/index-9.py | Python | gpl-3.0 | 228 |
import lan
import collect_loop as cl
def _is_binop_plus(binop):
return binop.op == '+'
def _is_binop_times(binop):
return binop.op == '*'
class _NormBinOp(lan.NodeVisitor):
def __init__(self, loop_index):
self.loop_index = loop_index
self.new_subscript = list()
def visit_BinOp(self... | dikujepsen/OpenTran | v3.0/framework/unused/collect_array_rewrite_unused.py | Python | mit | 3,526 |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Currentvalue(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.slider"
_path_str = "layout.slider.currentvalue"
_valid_props = {"font", "of... | plotly/python-api | packages/python/plotly/plotly/graph_objs/layout/slider/_currentvalue.py | Python | mit | 8,331 |
class AttackResult:
def __init__(self, attackId, attackingCountry, defendingCountry, attackingPlayer, defendingPlayer, nbAttackingDice, nbDefendingDice):
self._attackId = attackId
self._nbAttackingLost = 0
self._nbDefendingLost = 0
self._attackingCountry = attackingCountry
se... | RaphaelLapierre/INF4215 | TP3/RiskAI/AttackResult.py | Python | mit | 1,189 |
from django.core.cache import cache
from treenav.models import MenuItem
def treenav_active(request):
menus = cache.get("menus")
if not menus:
menus = MenuItem.objects.filter(parent__isnull=True).all()
cache.set("menus", menus)
treenav_active = {}
for menu in menus:
root = menu... | caktus/django-treenav | treenav/context_processors.py | Python | bsd-3-clause | 537 |
from . import db
import math
class ZipCodes(db.Model):
id = db.Column(db.Integer, primary_key=True)
zipcode = db.Column(db.Integer)
latitude = db.Column(db.Float)
longitude = db.Column(db.Float)
def __init__(self, details):
self.zipcode = details[0]
self.latitude = float(details[1]... | itsnauman/HotspotFinder | app/models.py | Python | mit | 1,725 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import requests
from bs4 import BeautifulSoup
def get_class_cancels(date_fill=False):
url = "http://www.c.u-tokyo.ac.jp/zenki/classes/cancel/index.html"
res = requests.get(url)
soup = BeautifulSoup(res.text)
# updated
updated = soup.find('div', {'id... | wkentaro/utaskweb | src/utaskweb/kyuko.py | Python | mit | 1,233 |
import pygame
import random
pygame.init()
pantalla=pygame.display.set_mode((480,500))
salir=False
reloj1= pygame.time.Clock()
listarec=[]
r1= pygame.Rect(0,0,25,25)
for x in range(25):
w= random.randrange(10,30)
h= random.randrange(10,40)
x= random.randrange(450)
y=random.randrange(450)
listarec.a... | chelinho139/Tutoriales-Pygame | tut12.py | Python | apache-2.0 | 1,010 |
import sys
from setuptools import setup
import versioneer
if sys.version_info < (3, 0):
sys.stdout.write("At least Python 3.0 is required.\n")
sys.exit(1)
with open('README.md') as f:
long_description = f.read()
setup(
name = 'secapr',
version = versioneer.get_version(),
cmdclass = versioneer.get_cmdclass(),
... | AntonelliLab/seqcap_processor | setup.py | Python | mit | 1,116 |
#!/usr/bin/python
# -*- coding: gb2312 -*-
from main import Person
class Book:
def __init__(self, name, author, comment):
self.name = name
self.author = author
self.comment = comment
| emperrors/fetchLinuxIDC | main/Book.py | Python | gpl-3.0 | 214 |
import tornado.web
import tornado.escape
import json
from bson import json_util
import tornado.gen
from mingus.serializers import JSONSerializer
class MotorHandler(tornado.web.RequestHandler):
def initialize(self, model, prefix, mtype):
self.model = model
self.prefix = prefix
self.mtype = ... | tgonzales/mingus | mingus/handler.py | Python | apache-2.0 | 5,854 |
#!user/bin/env python
# coding:utf-8
| x522758754/XlsTools | algorithms/avlTree.py | Python | mit | 40 |
#!/usr/bin/env python
"""
Monitor the jobs present in the repository
"""
import DIRAC
from DIRAC.Core.Base.Script import Script
@Script()
def main():
# Registering arguments will automatically add their description to the help menu
Script.registerArgument("RepoDir: Location of Job Repository")
_, args = ... | DIRACGrid/DIRAC | src/DIRAC/Interfaces/scripts/dirac_repo_monitor.py | Python | gpl-3.0 | 731 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.