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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rcbweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| piyush82/icclab-rcb-web | virtualenv/rcbweb/manage.py | Python | apache-2.0 | 249 |
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header
import sys
import math
import time
from std_msgs.msg import String
from std_msgs.msg import Int32
PI = math.pi
def main_fcn():
pub = rospy.Publisher('joint_states',JointState,queue_size = 10)
pub2 = rospy.Publ... | uArm-Developer/UArmForROS | visualization/visual_display.py | Python | bsd-2-clause | 1,769 |
__author__ = 'mack0242'
| JonnoFTW/htm-models-adelaide | engine/__init__.py | Python | agpl-3.0 | 24 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('jass', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='inputrequest',
name='ori... | kusigubi/Github | project/jass/migrations/0002_auto_20150908_1503.py | Python | mit | 417 |
"""Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import time as _time, sleep as _sleep
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# Note regarding PEP 8 compliant names
# This threading model was originally inspired by... | cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/threading.py | Python | lgpl-3.0 | 36,652 |
# ------------------------------------------------------------
# Developping with MicroPython in an async way
#
# ------------------------------------------------------------
# === library tests ===
# ------------------------------------------------------------
print("Loading module test_p... | smeenka/esp32 | lolin32/test/lib/test_pwm.py | Python | gpl-2.0 | 1,153 |
# 3. Korrutustabel (5p)
def korrutustabel(a, b):
tabel = []
for a_element in a:
rida = []
for b_element in b:
rida.append(a_element * b_element)
tabel.append(rida)
return tabel
print(korrutustabel([5,2,8,4], [2,4,1])) | macobo/python-grader | tasks/MTAT.03.100/2013/Midterm_1/KT2_N10_korrutustabel_solution.py | Python | mit | 266 |
#!/usr/bin/env python
import time
import random
import xmlrpclib
#create server object
s = xmlrpclib.Server("http://localhost:1234")
#randomly change parameters of the sinusoid
for i in range(10):
#generate random values
new_freq = random.uniform(0, 5000)
new_ampl = random.uniform(0, 2)
new_offset = random.unifo... | gnu-sandhi/sandhi | modules/gr36/grc/examples/xmlrpc/xmlrpc_client_script.py | Python | gpl-3.0 | 463 |
#import the necessarry packages
import numpy as np
import argparse
import imutils
import cv2
# construct the argument parser and parse the argguments
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image",required=True,help="Path to the image")
args = vars(ap.parse_args())
# load the image and show it
image = ... | neoscreenager/PythonOpenCVAdventures | PYCV/rotate.py | Python | gpl-3.0 | 1,538 |
from selenium import webdriver
from fixture.session import Sessionhelper
from fixture.group import Grouphelper
from fixture.contact import Contacthelper
class Application:
def __init__(self,browser,base_url):
if browser=="firefox":
self.wd = webdriver.Firefox()
elif browser == "chrome"... | mari44ka/python_training | fixture/Application.py | Python | apache-2.0 | 1,057 |
import requests
from qds_sdk.connection import Connection
from qds_sdk.exception import ConfigError
class QuboleAuth(requests.auth.AuthBase):
def __init__(self, token):
self.api_token = token
def __call__(self, r):
r.headers['X-AUTH-TOKEN'] = self.api_token
return r
class Qubole:
... | jainavi/qds-sdk-py | qds_sdk/qubole.py | Python | apache-2.0 | 1,781 |
#!/usr/bin/env python3
import os
import csv
import glob
from datetime import datetime
timeformat = '%m/%d/%Y %H:%M:%S'
start = []
end = []
for file in glob.glob('*2016*csv'):
print(file)
with open(file,'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
next(reader)
for row in reader:
start.ap... | Dovisal1/citi-bike | balance.py | Python | mit | 923 |
# This file is part of beets.
# Copyright 2015, Thomas Scholtes.
#
# 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,... | andremiller/beets | beetsplug/types.py | Python | mit | 1,641 |
#! /usr/bin/env python
#
# This script generates a powerpoint presentation using plots generated by runJetQA.sh.
#
# Note: This was designed/tested for PbPb data and Pt-hard pp MC productions -- you may need to
# tweak a few things for other cases. You should in general change what is plotted to suit
# your... | pbuehler/AliPhysics | PWGJE/EMCALJetTasks/macros/JetQA/plotPowerpoint.py | Python | bsd-3-clause | 28,279 |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['MovingMedian'] , ['Seasonal_DayOfWeek'] , ['SVR'] ); | antoinecarme/pyaf | tests/model_control/detailed/transf_Quantization/model_control_one_enabled_Quantization_MovingMedian_Seasonal_DayOfWeek_SVR.py | Python | bsd-3-clause | 167 |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2006-2013 ARM Limited
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 ... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/pyOCD/target/target_nrf51.py | Python | apache-2.0 | 1,678 |
#!/usr/bin/python3
import sys
import spacy
from math import log2
from heapq import nlargest
from functools import partial
from collections import Counter
from multiprocessing import Process, Queue
from redditquery.utils import Numberer, l2_norm
class InvertedIndex:
"""
Creates an InvertedIndex stored in a dat... | kuchenrolle/redditquery | src/redditquery/index.py | Python | mit | 14,870 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-15 09:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | mcallaghan/tmv | BasicBrowser/scoping/migrations/0129_auto_20170815_0946.py | Python | gpl-3.0 | 1,435 |
"""
Copyright (c) 2016, Jose Dolz .All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the f... | josedolz/LiviaNET | src/LiviaNet/Modules/IO/sampling.py | Python | mit | 13,666 |
"""
Serializers for document app.
"""
from rest_framework import serializers
from document.models import Document, Section
from courseware.models import SHORT_TEXT
class DocumentSerializer(serializers.ModelSerializer):
"""ModelSerializer for Document class"""
class Meta:
model = Document
... | kartikshah1/Test | document/serializers.py | Python | mit | 645 |
from rest_framework import serializers
from issues.models import ReportedLink, ReportedUser
class ReportedLinkSerializer(serializers.ModelSerializer):
class Meta:
model = ReportedLink
fields = ('id', 'link', 'created')
read_only_fields = ('created',)
class ReportedUserSerializer(serial... | projectweekend/Links-API | links/issues/serializers.py | Python | mit | 473 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | taknevski/tensorflow-xsmm | tensorflow/contrib/rnn/python/kernel_tests/rnn_cell_test.py | Python | apache-2.0 | 54,731 |
from jobman import DD, flatten
##########################[Laura_Continue]########################
##################################################################
config = DD({
'module_name' : 'Laura_Continue',
'model' : DD({
'rand_seed' : None
... | hycis/Pynet | hps/model_configs/Laura_Continue.py | Python | apache-2.0 | 4,581 |
#!/usr/bin/env python
#
# Copyright 2016 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 require... | sillywilly42/simian | src/simian/mac/common/hw.py | Python | apache-2.0 | 6,663 |
"""SunPy configuration file functionality"""
import os
import tempfile
import ConfigParser
import sunpy
def load_config():
"""
Read the sunpyrc configuration file. If one does not exists in the user's
home directory then read in the defaults from module
"""
config = ConfigParser.SafeConfigParser()... | mjm159/sunpy | sunpy/util/config.py | Python | bsd-2-clause | 5,316 |
# Copyright 2014: Mirantis 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 required b... | aplanas/rally | tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py | Python | apache-2.0 | 8,194 |
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General Public License.
#
# See the LICENSE file in the source distribution ... | slashdd/sos | sos/report/plugins/libraries.py | Python | gpl-2.0 | 1,577 |
import urllib2
import sys
import getopt
from os.path import exists, normpath, sep
import re
DEFAULT_READ_BUF_SZ = 2048
DEFAULT_FILE_LOC = '.'
class DownloadFile(object):
def __init__(self, url, blocks=DEFAULT_READ_BUF_SZ, loc=DEFAULT_FILE_LOC):
try:
self.__url__ = url
if exists(... | rereidy/SPSE | module 4 - Attacking Web Applications/large_file.py | Python | gpl-3.0 | 3,368 |
# Copyright (c) 2014 Cisco Systems
# 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... | yuewko/neutron | neutron/tests/unit/plugins/ml2/drivers/cisco/apic/test_apic_sync.py | Python | apache-2.0 | 3,419 |
from matplotlib.pylab import figure, show
import numpy
x,y = numpy.random.randn(2,100)
fig = figure()
ax1 = fig.add_subplot(211)
ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True)
ax1.grid(True)
ax1.axhline(0, color='black', lw=2)
ax2 = fig.add_subplot(212, sharex=ax1)
ax2.acorr(x, usevlines=True, normed=True, ... | sniemi/SamPy | sandbox/src1/examples/xcorr_demo.py | Python | bsd-2-clause | 392 |
#/* author:@shivkrthakur */
#!/bin/python3
import sys
N = int(input().strip())
if N % 2 == 0:
if N >= 2 and N <=5:
print('Not Weird')
elif N >= 6 and N <= 20:
print('Weird')
elif N > 20:
print('Not Weird')
else:
print('Weird') | shivkrthakur/HackerRankSolutions | Practice/AllDomains/Tutorials/30DaysOfCode/Day3IntroToConditionalStatements.py | Python | mit | 270 |
from yass.batch import vectorize_parameter
# create a function that adds up three numbers, vectorize over parameter a
@vectorize_parameter('a')
def add(a, b, c):
return a + b + c
# same as above, but this time decorate an instance method
class Object(object):
@vectorize_parameter('a')
def add(self, a, b... | paninski-lab/yass | examples/batch/vectorize_parameter.py | Python | apache-2.0 | 423 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 Lukas Hetzenecker <LuHe@gmx.at>
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ui.ui_calendar_edit_recurrence
from lib.ordinal_number_formatter import OrdinalNumberFormatter
from widget.DateSortedListWidgetItem import DateSortedListWidgetItem
from lib.classes ... | ypid/series60-remote | pc/window/calendar_edit_recurrence.py | Python | gpl-2.0 | 13,043 |
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | todaychi/hue | desktop/core/src/desktop/lib/fs/proxyfs_test.py | Python | apache-2.0 | 7,844 |
# Copyright (C) 2009, 2010 Roman Zimbelmann <romanz@lavabit.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 License, or
# (at your option) any later version.
# Al... | AlanWarren/dotfiles | .config/ranger/colorschemes/default.py | Python | gpl-2.0 | 3,245 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('march_madness', '0007_brackets'),
]
operations = [
migrations.RemoveField(
model_name='brackets',
na... | jredd23/March_Madness_Style_Bracket | march_madness/migrations/0008_auto_20150428_1830.py | Python | mit | 455 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Description: (Cold)sweat command-line utility
Copyright (c) 2013—2016 Andrea Peltrin
License: MIT (see LICENSE for details)
"""
from coldsweat.commands import run
if __name__ == '__main__':
run()
| passiomatic/coldsweat | sweat.py | Python | mit | 254 |
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.db import connection
class TitanProgressReport:
def __init__(self):
pass
def dictfetchall(self, cursor):
"Returns all rows from a cursor as a dict"
desc = cursor.description
... | PanDAWMS/panda-bigmon-core | core/reports/TitanProgressReport.py | Python | apache-2.0 | 2,528 |
#! /usr/bin/env python
import argparse
from collections import defaultdict as DefaultDict
import shlex
import subprocess
def execute(command):
try:
process = subprocess.Popen(
shlex.split(command),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
except OSError:
... | NickDaly/interface-detect | interface_detect.py | Python | gpl-3.0 | 1,796 |
"""Helpers for components that manage entities."""
import asyncio
from datetime import timedelta
from itertools import chain
import logging
from homeassistant import config as conf_util
from homeassistant.setup import async_prepare_setup_platform
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_SCAN_INTERVAL... | tinloaf/home-assistant | homeassistant/helpers/entity_component.py | Python | apache-2.0 | 10,538 |
#
# Created by DraX on 2005.08.08
#
# Updated by ElgarL on 28.09.2005
#
print "importing village master data: Talking Island Village ...done"
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jy... | Barrog/C4-Datapack | data/jscript/village_master/7026_bitz_occupation_change/__init__.py | Python | gpl-2.0 | 2,377 |
import unittest
from dart.client.python.dart_client import Dart
from dart.engine.no_op.metadata import NoOpActionTypes
from dart.model.exception import DartRequestException
from dart.model.action import Action, ActionData, ActionState
from dart.model.datastore import Datastore, DatastoreData, DatastoreState
from dart.... | RetailMeNotSandbox/dart | src/python/dart/test/crud/test_action.py | Python | mit | 5,536 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from config.template_middleware import TemplateResponse
from gaebusiness.business import CommandExecutionException
from tekton import router
from gaecookie.decorator import no_csrf
from celula_app import facade
from routes.celulas import a... | lucasgcampos/app-engine-learning | tekton-master/backend/appengine/routes/celulas/admin/new.py | Python | mit | 942 |
from __future__ import absolute_import
from six.moves import xrange
import string
from random import choice
from twisted.internet import reactor
from twisted.internet.defer import succeed
from twisted.internet.task import deferLater
from Tribler.Core.Modules.wallet.wallet import Wallet, InsufficientFunds
class Bas... | Captain-Coder/tribler | Tribler/Core/Modules/wallet/dummy_wallet.py | Python | lgpl-3.0 | 3,349 |
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
# Copies working standard library modules to the provided output directory
# Usage: ipy getModuleList.py <outpu... | slozier/ironpython2 | Src/StdLib/MakeModuleList.py | Python | apache-2.0 | 3,281 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
#
# 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 th... | lochiiconnectivity/boto | tests/unit/glacier/test_layer2.py | Python | mit | 10,771 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Ndiff(Package):
"""The ndiff tool is a binary utility that compares putatively similar
... | LLNL/spack | var/spack/repos/builtin/packages/ndiff/package.py | Python | lgpl-2.1 | 1,065 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class CudaMemtest(CMakePackage):
"""Maintained and updated fork of cuda_memtest.
original h... | LLNL/spack | var/spack/repos/builtin/packages/cuda-memtest/package.py | Python | lgpl-2.1 | 825 |
"""
Created on 2013-12-16
@author: readon
@copyright: reserved
@note: CustomWidget example for mvp
"""
from gi.repository import Gtk
from gi.repository import GObject
class CustomEntry(Gtk.Entry):
"""
custom widget inherit from gtkentry.
"""
def __init__(self):
Gtk.Entry.__init__(self)
... | Readon/mvpsample | src/gtkcustom.py | Python | lgpl-3.0 | 414 |
import logging
from couchdbkit import ResourceNotFound
from dimagi.utils.couch import sync_docs
from dimagi.utils.couch.database import iter_docs
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from corehq.apps.app_manager.const import APP_V1
from corehq.apps.app_manager.de... | puttarajubr/commcare-hq | corehq/apps/app_manager/migrations/__init__.py | Python | bsd-3-clause | 7,429 |
# -*- coding: UTF-8 -*-
#! /usr/bin/python
__author__="ARA"
__all__ = ['color_operator', 'color_field', 'color', 'manager',
'manager_operators', 'manager_fields']
__date__ ="$Mai 08, 2014 10:50:00 PM$"
from numpy import asarray
class myList:
def __init__(self):
self._list = []
self._c... | ratnania/pigasus | python/fem/color.py | Python | mit | 6,761 |
'''
Code for method comparison experiment of HCD cases
Used to compare method usage across different factors:
- User - IDEO vs. Non-IDEO
- Focus Area - Agriculture vs. Healthcare, etc.
Mark Fuge 2014 with some code written by Bud Peters
This experiment code is what is used to the produce ... | IDEALLab/hcd_connect_idetc_2014 | paper_experiments.py | Python | apache-2.0 | 23,729 |
"""Tosca output plugin
Idea copied from tree.
"""
from pyang import plugin
from pyang import statements
import StringIO
import optparse
import pyang.plugins.tree
import pyang.translators.dsdl
import sys
import yaml
from collections import OrderedDict
DERIVED_FROM = 'cloudify.netconf.nodes.xml_rpc'
def pyang_plugi... | cloudify-cosmo/yttc | yttc/plugin/tosca.py | Python | apache-2.0 | 8,573 |
#!/usr/bin/env python
# This file is part of Lerot.
#
# Lerot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Lerot is dist... | hubert667/AIR | src/scripts/learning-experiment.py | Python | gpl-3.0 | 864 |
# 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... | baidu/Paddle | python/paddle/fluid/tests/unittests/test_nearest_interp_op.py | Python | apache-2.0 | 9,219 |
# Copyright 2014 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 required by applicable law or a... | erock2112/python-adb | adb/common_cli.py | Python | apache-2.0 | 4,814 |
#!/usr/bin/env python
# *****************************************************************************
# Copyright (c) 2012, 2013, 2014 Lectorius, Inc.
# Authors:
# Vijay Pandurangan (vijayp@mitro.co)
# Evan Jones (ej@mitro.co)
# Adam Hilss (ahilss@mitro.co)
#
#
# This program is free software: you can redistribute... | WeAreWizards/passopolis-extensions | login/makejsresource.py | Python | gpl-3.0 | 1,921 |
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from struct_pandas import *
from probeMerge import *
from pandas.tools.plotting import *
from mpl_toolkits.mplot3d import Axes3D
import datetime as dt
import matplotlib.dates as dt
def timeslice(panel,start,stop):
... | wesleybowman/aidan-projects | interpolation_code/time_stats.py | Python | gpl-2.0 | 19,396 |
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 Tom Keddie <git@bronwenandtom.com>
# SPDX-License-Identifier: BSD-2-Clause
# Fomu Hacker board:
# - Design files: https://github.com/im-tomu/fomu-hardware/tree/master/hacker/releases/v0.0-19-g154fecc
from litex.build.generic_platform import *
from litex.bu... | litex-hub/litex-boards | litex_boards/platforms/kosagi_fomu_hacker.py | Python | bsd-2-clause | 2,543 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import codecs
import fnmatch
import functools
import inspect
import io
import locale
import logging
import os
import polib
import re
import tarfile
import tempfile
import threading
from collections import defaultdict, nam... | rven/odoo | odoo/tools/translate.py | Python | agpl-3.0 | 50,985 |
# This script invokes blender to import and save external model formats as
# .blend files to be processed further.
#
# Example usage for this importer:
# blender --background --factory-startup --python $HOME/import_3ds.py -- \
# --i="/tmp/hello.3ds" \
# --o="/tmp/hello.blend" \
#
# See blender --help... | weilichuang/jmonkeyengine | sdk/jme3-blender/src/com/jme3/gde/blender/scripts/import_dae.py | Python | bsd-3-clause | 2,677 |
H, W = map(int, input().split())
S = [input().split() for _ in range(H)]
for r, row in enumerate(S):
for c, s in enumerate(row):
if s == "snuke":
print(chr(ord('A') + c) + str(r + 1))
quit()
| knuu/competitive-programming | atcoder/corp/codefes2016_fa.py | Python | mit | 227 |
# Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | codegooglecom/jaikuengine | common/test/throttle.py | Python | apache-2.0 | 1,689 |
import os
import sys
from clint.textui import colored
from pyonenote import mkdir, CONFIG_DIR
from pyonenote.api import client
try:
if not os.path.exists(CONFIG_DIR):
mkdir(CONFIG_DIR)
print(colored.green('Created path "' + CONFIG_DIR + '".'))
except Exception as e:
print(colored.red('Fatal e... | lighht/pyonenote-old | pyonenote/cli/pref_main.py | Python | gpl-2.0 | 669 |
# Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This prog... | jds2001/sos | sos/plugins/azure.py | Python | gpl-2.0 | 1,359 |
# ### Importing All necessary libraries
# In[1]:
import os
import csv
import cv2
import sklearn
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from keras.models import Sequential, Model, model_from_json
from keras.layers import Activation, Dense, Dropout, EL... | WeatherSuperMan/Udacity-Self-driving-Car-Nanodegree | Term_1/Project_3_Behavior_Cloning/myModel.py | Python | mit | 8,997 |
# Copyright 2017 reinforce.io. 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 or... | lefnire/tensorforce | tensorforce/contrib/state_settable_environment.py | Python | apache-2.0 | 1,473 |
class ItemNotReadyError(Exception):
"""
An exception to represent the case where something was not yet ready or does not yet exist, but will definitely
exist at a future point. Example: trying to download the results for a build that has not finished. The web
framework should translate this exception ... | box/ClusterRunner | app/util/exceptions.py | Python | apache-2.0 | 1,410 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ntpc_frontdesk.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| littleq0903/ntpc-social-frontdesk-center | manage.py | Python | mit | 257 |
import sys
if sys.version_info < (3, 10):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points
import logging
from enum import Enum
from ..utils import PersistableDict, retry
from .exceptions import BackendError, DependencyError, TargetError
from .logmanager import Fi... | gwforg/gwf | src/gwf/backends/base.py | Python | gpl-3.0 | 8,513 |
#!/usr/bin/env python3
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | jwhui/openthread | tests/scripts/thread-cert/test_srp_client_save_server_info.py | Python | bsd-3-clause | 5,992 |
#
# ovirt-host-deploy -- ovirt host deployer
# Copyright (C) 2016-2019 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your opt... | oVirt/ovirt-host-deploy | src/plugins/ovirt-host-deploy/kernel/kernel.py | Python | lgpl-2.1 | 6,974 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(regex=r'^request/(?P<pk>\w+)/$', view=views.request_quote, name='req'),
]
| hqpr/findyour3d | findyour3d/quote/urls.py | Python | mit | 153 |
"""Test file descriptor operations
Made for Jython.
"""
import errno
import os
import sys
import tempfile
import test.test_support as test_support
import unittest
class TestFilenoTestCase(unittest.TestCase):
def setUp(self):
self.filename = tempfile.mktemp()
self.fp = open(self.filename, 'w+')
... | EnviroCentre/jython-upgrade | jython/lib/test/test_fileno.py | Python | mit | 11,318 |
#!/usr/bin/env python
#
# Author: Pablo Iranzo Gomez (Pablo.Iranzo@gmail.com)
# Description: Script for accessing RHEV-M DB for gathering app list for a given VM
#
# Requires rhevm-sdk to work and psycopg2 (for PG access)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... | iranzo/rhevm-utils | rhev-vm-applist.py | Python | gpl-3.0 | 4,446 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | kkk669/mxnet | tools/bandwidth/measure.py | Python | apache-2.0 | 5,889 |
"""
Enterprise Course Enrollment page
"""
from bok_choy.page_object import PageObject
class EnterpriseCourseEnrollment(PageObject):
"""
Enterprise Course Enrollment class
"""
COURSE_TYPE_CSS = '.radio>input[value="{}"]'
url = None
def is_browser_on_page(self):
"""
Verifies ... | edx/edx-e2e-tests | regression/pages/enterprise/ent_course_enrollment_page.py | Python | agpl-3.0 | 3,581 |
from argparse import ArgumentParser
from typing import Any
from zerver.lib.actions import do_change_user_delivery_email
from zerver.lib.management import ZulipBaseCommand
class Command(ZulipBaseCommand):
help = """Change the email address for a user."""
def add_arguments(self, parser: ArgumentParser) -> Non... | showell/zulip | zerver/management/commands/change_user_email.py | Python | apache-2.0 | 902 |
from __future__ import division
import nltk
from nltk.util import ngrams
from nltk.stem.lancaster import LancasterStemmer
import numpy as np
import pickle
from tqdm import tqdm
from process_twt import *
class BGClassifier(object):
"""
A Naive Bayes Classifier for sentiment analysis
Attributes:
fe... | qingshuimonk/bhtsa | bhtsa/BGClassifier.py | Python | mit | 4,993 |
# Copyright (c) 2011, 2012 Free Software Foundation
# This program 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 option) any later vers... | gnowgi/gnowsys-studio | gstudio/urls/userpreference.py | Python | agpl-3.0 | 1,008 |
from django.db import models
from django.conf import settings
from ordered_model.models import OrderedModel
from django.utils.safestring import mark_safe
import os
class Sponsor(OrderedModel):
name = models.CharField(max_length=30, unique=True)
def image_upload_to(instance, filename):
name, extension = os.pat... | sreidy/roboticsclub.org | sponsors/models.py | Python | mit | 859 |
from algo import mod_inv
from random import randrange, randint
from ecurves import *
def elgalmal_encrypt(M,k,a,p):
'''
Input:
M - menssage
k - recipient private key
a - generator
p - prime
Output (c1,c2) [Encrypted]
'''
s = randrange... | manikTharaka/al-go-rithms | cryptography/ElGamal/Python/ElGamal.py | Python | mit | 1,960 |
import os
import numpy
import chainer
from chainer.dataset import download
from chainer.datasets._mnist_helper import make_npz
from chainer.datasets._mnist_helper import preprocess_mnist
def get_fashion_mnist(withlabel=True, ndim=1, scale=1., dtype=None,
label_dtype=numpy.int32, rgb_format=Fal... | anaruse/chainer | chainer/datasets/fashion_mnist.py | Python | mit | 3,403 |
# Copyright (C) 2009 Nokia Corporation
# Copyright (C) 2009 Collabora Ltd.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any l... | freedesktop-unofficial-mirror/telepathy__telepathy-mission-control | tests/twisted/account-manager/enable-auto-connect.py | Python | lgpl-2.1 | 2,732 |
#!/usr/bin/env python
""" patrol_smach.py - Version 1.0 2013-04-12
Control a robot to patrol a square area using SMACH
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2013 Patrick Goebel. All rights reserved.
This program is free software; you can redistribute it and/or modif... | Aharobot/inmoov_ros | robbie_test/nodes/patrol_smach.py | Python | bsd-3-clause | 4,636 |
"""Fixer for __nonzero__ -> __bool__ methods."""
# Author: Collin Winter
# Local imports
from .. import fixer_base
from ..fixer_util import Name
class FixNonzero(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
classdef< 'class' any+ ':'
suite< any*
funcdef< 'def'... | yotchang4s/cafebabepy | src/main/python/lib2to3/fixes/fix_nonzero.py | Python | bsd-3-clause | 591 |
from ga_ows.views.wms.base import WMSAdapterBase, WMSCache
from django.contrib.gis.geos import Point
from osgeo import osr
from ga_ows.rendering.cairo_geodjango_renderer import RenderingContext
from ga_ows.utils import create_spatialref
class OGRDatasetCollectionAdapter(WMSAdapterBase):
def __init__(self, collect... | hydroshare/hydroshare_temp | ga_ows/views/wms/ogr.py | Python | bsd-3-clause | 9,221 |
#!/usr/bin/python
#
# Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.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',
... | thaim/ansible | lib/ansible/modules/cloud/azure/azure_rm_iotdevice.py | Python | mit | 17,206 |
import unittest
from gameoflife import *
class GameTest(unittest.TestCase):
def testEmpty(self):
self.game=Board()
self.game.generation()
self.assertEquals({},self.game.points)
def testOneDies(self):
self.game=Board()
self.game.add_cell((1,1))
self... | lordbulb/gameoflife | gameoflife_test.py | Python | gpl-2.0 | 3,418 |
import os
import salt.wheel
from tests.support.mixins import AdaptedConfigurationTestCaseMixin
from tests.support.unit import TestCase
class WheelPillarRootsTest(TestCase, AdaptedConfigurationTestCaseMixin):
def setUp(self):
self.wheel = salt.wheel.Wheel(dict(self.get_config("client_config")))
se... | saltstack/salt | tests/integration/wheel/test_pillar_roots.py | Python | apache-2.0 | 1,827 |
"""Package with general repository related functions"""
import os
from gitdb.exc import BadObject
from git.refs import SymbolicReference
from git.objects import Object
from gitdb.util import (
join,
isdir,
isfile,
... | cool-RR/GitPython | git/repo/fun.py | Python | bsd-3-clause | 9,810 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import ray
from ray.rllib.evaluation.postprocessing import compute_advantages, \
Postprocessing
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.policy.tf_policy import L... | ujvl/ray-ng | rllib/agents/ppo/ppo_policy.py | Python | apache-2.0 | 11,094 |
# -*- coding: utf-8 -*-
# Copyright 2015-2018 Nate Bogdanowicz
"""
Driver for PCO Pixelfly cameras.
"""
from future.utils import PY2
import os.path
import numpy as np
from scipy.interpolate import interp1d
import win32event
from nicelib import NiceLib, Sig, NiceObject, load_lib, RetHandler
from . impor... | mabuchilab/Instrumental | instrumental/drivers/cameras/pixelfly.py | Python | gpl-3.0 | 18,638 |
import httplib2
import requests
from onadata.apps.restservice.RestServiceInterface import RestServiceInterface
class ServiceDefinition(RestServiceInterface):
id = u'f2dhis2'
verbose_name = u'Formhub to DHIS2'
def send(self, url, parsed_instance):
instance = parsed_instance.instance
info ... | ehealthafrica-ci/onadata | onadata/apps/restservice/services/f2dhis2.py | Python | bsd-2-clause | 729 |
# Copyright 2011, 2013-2015 VPAC
# Copyright 2014 The University of Melbourne
#
# This file is part of Karaage.
#
# Karaage 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
#... | monash-merc/karaage | karaage/middleware/saml.py | Python | gpl-3.0 | 3,598 |
import itertools
import re
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
from coalib.settings.Setting import path, url
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
def path_or_url(xml_dtd):
... | coala/coala-bears | bears/xml2/XMLBear.py | Python | agpl-3.0 | 2,834 |
#!/usr/bin/env python
from setuptools import find_packages, setup
from fract import __version__
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='fract',
version=__version__,
author='Daichi Narushima',
author_email='dnarsil+github@gmail.com',
description='Automated T... | dceoy/fract | setup.py | Python | gpl-3.0 | 1,223 |
#! /usr/bin python
# parse output of mc clust, convert to mothurList file
# by gjr; Feb 22, 12
"""
Convert mcclust.clust to mothur.list
% python mcclust2mothur-list-cutoff.py <mcclust.file> <mothur.list> cutoff
"""
import sys
import os
def makeMothurListFile(f,listFile,target_cutoff):
"""
Convert mcclust.c... | jiarong/SSUsearch | scripts/mcclust2mothur-list-cutoff.py | Python | bsd-3-clause | 3,337 |
_marker = object()
def _get_module_function(specification):
# converts foo.bar.baz to ['foo.bar', 'baz']
try:
data = specification.rsplit('.', 1)
except (ValueError, AttributeError):
data = []
if len(data) != 2:
raise ValueError("Invalid import specification: %r" % (
... | anbangr/trusted-juju | juju/lib/loader.py | Python | agpl-3.0 | 1,136 |
# Enter your code here. Read input from STDIN. Print output to STDOUT
english = int(raw_input())
e = set(raw_input().split())
french = int(raw_input())
f = set(raw_input().split())
symm_diff = e.symmetric_difference(f)
print len(symm_diff) | ugaliguy/HackerRank | Python/Sets/set-symmetric-difference.py | Python | mit | 253 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.