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 |
|---|---|---|---|---|---|
import uuid
import abc
from .lammps_particles import LammpsParticles
class ABCDataManager(object):
""" Class managing Lammps data information
The class performs communicating the data to and from lammps. The
class manages data existing in Lammps and allows this data to be
queried and to be changed.... | simphony/simphony-lammps-md | simlammps/abc_data_manager.py | Python | bsd-2-clause | 6,973 |
def main(request, response):
response.headers.set("Content-Type", "text/html")
response.headers.set("Custom", "\0")
return "<!doctype html><b>This is a document.</b>"
| UK992/servo | tests/wpt/web-platform-tests/fetch/h1-parsing/resources/document-with-0x00-in-header.py | Python | mpl-2.0 | 179 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | flumotion-mirror/flumotion | flumotion/component/bouncers/multibouncer.py | Python | lgpl-2.1 | 8,965 |
# 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 required by applicable law or agreed ... | googledatalab/pydatalab | tests/stackdriver/monitoring/metric_tests.py | Python | apache-2.0 | 7,203 |
# Setup file for package macro_pie
from setuptools import setup
setup(name="macro_pie",
version="0.0.1",
install_requires=["quark==0.0.1"],
py_modules=['macro_pie'],
packages=['macro_pie', 'macro_pie_md'])
| bozzzzo/quark | quarkc/test/emit/expected/py/macro_pie/setup.py | Python | apache-2.0 | 232 |
# Generated by Django 2.0.8 on 2018-10-28 04:50
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | jeromecc/doctoctocbot | src/conversation/migrations/0001_initial.py | Python | mpl-2.0 | 1,819 |
from classes.LinkedList import *
# Iterative approch
def isPalindrome_iter(linkedlist):
if linkedlist.head == None:
return None
fast = linkedlist.head
slow = linkedlist.head
firsthalf = []
while fast != None and fast.next != None:
firsthalf.append(slow.value)
slow = slow.nex... | aattaran/Machine-Learning-with-Python | CTCI/Chapter 2/Question2_7.py | Python | bsd-3-clause | 2,591 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import SimpleTestCase
from django.utils import translation
from ...utils import setup
class GetLanguageInfoListTests(SimpleTestCase):
libraries = {
'custom': 'template_tests.templatetags.custom',
'i18n': 'django.tem... | kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/template_tests/syntax_tests/i18n/test_get_language_info_list.py | Python | apache-2.0 | 2,093 |
"""Regresssion tests for urllib"""
import collections
import urllib
import httplib
import io
import unittest
import os
import sys
import mimetools
import tempfile
from test import test_support
from base64 import b64encode
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))... | wang1352083/pythontool | python-2.7.12-lib/test/test_urllib.py | Python | mit | 44,628 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# 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.or... | cidadania/e-cidadania | src/helpers/cache.py | Python | apache-2.0 | 1,903 |
# Copyright (c) 2016 AT&T
# 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 agr... | openstack/murano | murano/tests/unit/engine/system/test_workflowclient.py | Python | apache-2.0 | 6,285 |
from client import clib
from engine import character
from client import serialize
mario = character.Character(10, 20)
pseudo = input("What's your name?")
characters = {pseudo: mario}
ip = "localhost"#input("Server's IP: ")
port = 9876#int(input("Server's port: "))
clib = clib.Clib(ip, port)
clib.sendMessage(serializ... | Getkey/mario-kombat | tests/micro-client.py | Python | mpl-2.0 | 541 |
import socket
import re
import config
def get_word(data):
word = None
word_regexp = re.compile(r'[^Score:\s\d{1,}]([a-zA-Z0-9]+)')
found = word_regexp.search(data)
if found:
word = found.group(1)
else:
pass
return word
def get_score(data):
score = None
score_regexp = ... | Plummy-Panda/python-magictype | auto_typing_game.py | Python | mit | 1,905 |
from datetime import datetime, timedelta
import logging
import traceback
try:
from django.contrib.gis.utils import GeoIP, GeoIPException
HAS_GEOIP = True
except ImportError:
HAS_GEOIP = False
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from dja... | MontmereLimited/django-tracking | tracking/models.py | Python | mit | 4,243 |
# -*- coding: utf-8 -*-
from datetime import datetime
from django.test import TestCase, RequestFactory
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.timezone import utc
from oioioi.base.tests import fake_time
from oioioi.contests.models import Contest
from ... | papedaniel/oioioi | oioioi/statistics/tests.py | Python | gpl-3.0 | 7,040 |
"""
Support for particulate matter sensors connected to a serial port.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.serial_pm/
"""
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME
from homeassistant.helpers.ent... | jamespcole/home-assistant | homeassistant/components/serial_pm/sensor.py | Python | apache-2.0 | 2,805 |
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible # only if you need to support Python 2
class Post(models.Model):
author = models.ForeignKey('auth.User')
title = models.CharField(max_length=200)
text ... | filipok/django-transverbis-blog | djtransverbisblog/models.py | Python | mit | 1,821 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/mtx1_models/SHH_WT_models10306.py | Python | gpl-3.0 | 17,587 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import brew, core, scope, workspace
from caffe2.python.modeling.parameter_info import ParameterTags
from caffe2.python.model_helper import ModelHelper
... | ryfeus/lambda-packs | pytorch/source/caffe2/python/brew_test.py | Python | mit | 11,884 |
# coding: utf-8
from django.core.paginator import Paginator
from django.forms.models import model_to_dict
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.template.response import Templat... | libchaos/erya | posts/views.py | Python | gpl-3.0 | 5,491 |
# -*- coding: utf-8 -*-
from data_type.classes.static.staticclass3 import Pool
def print_connection():
print(Pool.conn) | xmnlab/minilab | data_type/classes/static/staticclass2.py | Python | gpl-3.0 | 124 |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ... | leighpauls/k2cro4 | third_party/WebKit/Tools/Scripts/webkitpy/common/version_check.py | Python | bsd-3-clause | 1,767 |
#!/usr/bin/env python
""" Tests for pycazy module
test_getfamily.py
(c) The James Hutton Institute 2014
Author: Leighton Pritchard
Contact:
leighton.pritchard@hutton.ac.uk
Leighton Pritchard,
Information and Computing Sciences,
James Hutton Institute,
Errol Road,
Invergowrie,
Dundee,
DD6 9LH,
Scotland,
UK
This pro... | widdowquinn/pycazy | tests/test_getfamily.py | Python | mit | 1,614 |
"""
Methods for exporting course data to XML
"""
import logging
from abc import abstractmethod
from six import text_type
import lxml.etree
from xblock.fields import Scope, Reference, ReferenceList, ReferenceValueDict
from xmodule.contentstore.content import StaticContent
from xmodule.exceptions import NotFoundError
fr... | ahmedaljazzar/edx-platform | common/lib/xmodule/xmodule/modulestore/xml_exporter.py | Python | agpl-3.0 | 17,842 |
"""
MolML
=====
An interface between molecules and machine learning
MolML is a python module to use to map molecules into representations that
are usable with machine learning. This is done using an API similar to
scikit-learn to keep things simple and straightforward. For documentation,
look at the docstrings.
"""
__... | crcollins/molml | molml/__init__.py | Python | mit | 340 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | zouppen/simulavr | regress/test_opcodes/test_LD_X.py | Python | gpl-2.0 | 2,530 |
import socket
from src.nlp import NLP
from src.channel import Channel
class PyIRC:
def __init__(self, hostname, port, channel, nick):
self.hostname = hostname
self.port = port
self.channel = channel
self.nick = nick
self.nlp = NLP()
"""
Sends a message.
"""
def send(self, message):
print("SEND: %s" %... | SkylarKelty/pyirc | src/bot.py | Python | mit | 2,178 |
"""
Helper functions and classes for discussion tests.
"""
from uuid import uuid4
import json
from ...fixtures import LMS_BASE_URL
from ...fixtures.course import CourseFixture
from ...fixtures.discussion import (
SingleThreadViewFixture,
Thread,
Response,
)
from ...pages.lms.discussion import DiscussionTa... | sameetb-cuelogic/edx-platform-test | common/test/acceptance/tests/discussion/helpers.py | Python | agpl-3.0 | 3,825 |
# Copyright 2016 Google LLC. 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 ag... | google/ctfscoreboard | scoreboard/views.py | Python | apache-2.0 | 2,965 |
#!/usr/bin/env python
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# Stop a running glideinFactory
#
# Arguments:
# $1 = glidein submit_dir (i.e. factory dir)
#
# Author:
# Igor Sfiligoi May 6th 2008
#
import signal
import sys
import os
import os.path
import fcntl
import string
import time
im... | holzman/glideinwms-old | factory/stopFactory.py | Python | bsd-3-clause | 2,678 |
# -*- coding: utf-8 -*-
"""
.. _tut-filter-resample:
=============================
Filtering and resampling data
=============================
This tutorial covers filtering and resampling, and gives examples of how
filtering can be used for artifact repair.
We begin as always by importing the necessary Python modul... | mne-tools/mne-python | tutorials/preprocessing/30_filtering_resampling.py | Python | bsd-3-clause | 13,159 |
sorteados = []
sorteados = [73,84,49,97,24]
print(sorteados[1])
| ronas/PythonGNF | Fabulao/Array.py | Python | gpl-3.0 | 67 |
from chatterbot.logic import LogicAdapter
from chatterbot.conversation import Statement
from chatterbot import languages
from chatterbot import parsing
from mathparse import mathparse
import re
class UnitConversion(LogicAdapter):
"""
The UnitConversion logic adapter parse inputs to convert values
between ... | vkosuri/ChatterBot | chatterbot/logic/unit_conversion.py | Python | bsd-3-clause | 5,449 |
# -*- coding: utf-8 -*-
# Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2015 Jairo Llopis <jairo.llopis@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResPartnerTurnoverRange(models.Model):
_name = 'res.part... | sergiocorato/partner-contact | partner_capital/models/res_partner_turnover_range.py | Python | agpl-3.0 | 431 |
try:
from shutil import which # Python >= 3.3
except ImportError:
import os, sys
# This is copied from Python 3.4.1
def which(cmd, mode=os.F_OK | os.X_OK, path=None):
"""Given a command, mode, and a PATH string, return the path which
conforms to the given mode on the PATH, or None ... | endlessm/chromium-browser | third_party/llvm/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/util.py | Python | bsd-3-clause | 2,785 |
from rabbitcredentials_SECRET import PREFIX, RABBIT_EXCHANGE
import esgfpid
import time
import datetime
today = datetime.datetime.now().strftime('%Y-%m-%d')
filename_for_logging_handles = 'handles_created_during_tests_%s.txt' % today
def init_connector(list_of_nodes, exch=RABBIT_EXCHANGE):
print('Init connector... | IS-ENES-Data/esgf-pid | tests/integration_tests/helpers_esgfpid.py | Python | apache-2.0 | 1,530 |
# 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... | Stavitsky/neutron | neutron/callbacks/resources.py | Python | apache-2.0 | 754 |
from lampost.di.resource import Injected, module_inject
from lampost.event.zone import Attachable
from lampost.gameops.action import obj_action, ActionProvider
from lampost.gameops.target import TargetKeys
from lampost.server.channel import Channel
from lampmud.model.item import ItemAspect
from lampmud.mud.action impo... | genzgd/Lampost-Mud | lampmud/mud/group.py | Python | mit | 4,728 |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | UManPychron/pychron | pychron/processing/bayesian_modeler.py | Python | apache-2.0 | 4,221 |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | sid-kap/pants | src/python/pants/option/custom_types.py | Python | apache-2.0 | 2,669 |
# -*- coding: utf-8 -*-
import os
# example from Pang, Ch. 4
#
# Solve a Poisson equation via shooting
#
# u'' = -0.25*pi**2 (u + 1)
#
# with u(0) = 0, u(1) = 1
#
# this has the analytic solution: u(x) = cos(pi x/2) + 2 sin(pi x/2) - 1
#
# M. Zingale (2013-02-18)
import numpy
import math
import pylab
# for plottin... | NicovincX2/Python-3.5 | Analyse (mathématiques)/Analyse à plusieurs variables/Équation aux dérivées partielles/Équation de Poisson/solve_poisson_(shooting).py | Python | gpl-3.0 | 3,652 |
#!/usr/bin/env python
import fdpexpect, pexpect
import unittest
import PexpectTestCase
import sys
import os
class ExpectTestCase(PexpectTestCase.PexpectTestCase):
def setUp(self):
print self.id()
PexpectTestCase.PexpectTestCase.setUp(self)
def test_fd (self):
fd = os.open ('TESTDATA.tx... | elitak/pexpect | tests/test_filedescriptor.py | Python | mit | 1,881 |
from __future__ import unicode_literals
from setuptools import setup, find_packages
import os
def read(filename):
return open(os.path.join(os.path.dirname(__file__), filename)).read()
required = ['Twisted', 'zope.interface']
setup(
name = 'twistedinput',
version = '0.0.1',
... | buben19/twistedinput | setup.py | Python | unlicense | 1,197 |
#==============================================================================
# purpose: bivariate normal distribution simulation using PyMC
# author: tirthankar chakravarty
# created: 1/7/15
# revised:
# comments:
# 1. install PyMC
# 2. not clear on why we are helping the sampler along. We want to sample from the
#... | tchakravarty/PythonExamples | Code/kirk2015/chapter3/bivariate_normal.py | Python | apache-2.0 | 582 |
#!/usr/bin/python2
#
# Yapps 2 - yet another python parser system
# Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu>
#
# This version of Yapps 2 can be distributed under the
# terms of the MIT open source license, either found in the LICENSE file
# included with the Yapps distribution
# <http://theory.stan... | strahlex/machinekit | src/hal/utils/yapps.py | Python | lgpl-2.1 | 4,265 |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Sebek: kernel module for data collection on honeypots.
"""
# scapy.contrib.description = Sebek
# scapy.contrib.statu... | CodeNameGhost/shiva | thirdparty/scapy/contrib/sebek.py | Python | mit | 4,668 |
""" Rtorrent Output Plugin.
Copyright (c) 2011 The PyroScope Project <pyroscope.project@gmail.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
# ... | Rudde/pyroscope | pyrocore/src/pyrocore/flexget/output.py | Python | gpl-2.0 | 4,035 |
from django.apps import AppConfig
class RoomConfig(AppConfig):
name = 'room'
| godspeedcorporation/clinic | room/apps.py | Python | mit | 83 |
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Q
from django.forms import ModelForm
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic import View, Templa... | Alaxe/judgeSystem | judge/views/testgroup.py | Python | gpl-2.0 | 4,074 |
import sha, uuid, hmac, json
from datetime import datetime, timedelta
from base64 import b64encode
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import user_passes_test
from django.views.decorators.http impo... | Vostopia/clickjogoshost | apps/s3direct/views.py | Python | mit | 1,654 |
"""
Module with views for slidelint site.
"""
from pyramid.view import view_config
from pyramid.renderers import render
from pyramid.response import Response
from .validators import validate_rule, validate_upload_file
from pyramid_mailer.message import Message
from pyramid_mailer import get_mailer
import transaction
i... | enkidulan/slidelint_site | slidelint_site/views.py | Python | apache-2.0 | 3,629 |
__author__ = 'Tom Schaul, tom@idsia.ch'
from gomokutask import GomokuTask
from pybrain.rl.environments.twoplayergames.gomokuplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames import GomokuGame
from pybrain.rl.environments.twoplayergames.gomokuplayers.gomokuplayer import GomokuPlayer
from p... | iut-ibk/Calimero | site-packages/pybrain/rl/environments/twoplayergames/tasks/relativegomokutask.py | Python | gpl-2.0 | 4,395 |
size(600, 600)
# Use a grid to generate a bubble-like composition.
# This example shows that a grid doesn't have to be rigid at all.
# It's very easy to breake loose from the coordinates NodeBox
# passes you, as is shown here. The trick is to add or subtract
# something from the x and y values NodeBox passes on. Here,
... | karstenw/nodebox-pyobjc | examples/Grid/Balls.py | Python | mit | 1,089 |
#!/usr/bin/env python3
# Copyright 2017 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... | t1m0thyj/aiyprojects-raspbian | checkpoints/check_wifi.py | Python | apache-2.0 | 2,436 |
#-*- coding: utf-8 -*-
import class_db
import time
import sys
import logger
import registroVenta
import threading
import select
import os
import InhibirMDB
from libErrores import registroError
import socket
import libVenta
IP_UDP = "127.0.0.1"
PUERTO_UDP = 8000
MESSAGE = "...."
POOL_TIME = 0.1
tarifaActual = 0 # T... | the-adrian/KernotekV2.0 | libSocket.py | Python | gpl-3.0 | 6,853 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | aricchen/openHR | openerp/addons/account/project/report/account_journal.py | Python | agpl-3.0 | 2,142 |
# -*- coding: UTF-8 -*-
# Created by mcxiaoke on 2015/7/6 22:20.
__author__ = 'mcxiaoke'
import sys, os
from os import path
from datetime import datetime
print 'curren dir is', os.getcwd()
print 'command line args is', sys.argv
if len(sys.argv) < 2:
sys.exit(1)
# 批量重命名照片文件
# 根据文件修改日期重命名文件,然后移动到目标文件夹
FILE_NAME_... | mcxiaoke/python-labs | labs/photos_walker_00.py | Python | apache-2.0 | 1,959 |
# -*- coding: utf-8 -*-
from os import path
import io
import yaml
PROJ_PATH = path.sep.join(__file__.split(path.sep)[:-2])
DATA_PATH = path.join(
PROJ_PATH, 'hebrew-special-numbers-default.yml')
specialnumbers = yaml.safe_load(io.open(DATA_PATH, encoding='utf8'))
MAP = (
(1, u'א'),
(2, u'ב'),
(3, u'ג... | OriHoch/python-hebrew-numbers | hebrew_numbers/__init__.py | Python | mit | 2,084 |
from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest
skltest.test_reg_dataset_and_model("RandomReg_500" , "SVR_poly_8")
| antoinecarme/sklearn_explain | tests/skl_datasets_reg/RandomReg_500/skl_dataset_RandomReg_500_SVR_poly_8_code_gen.py | Python | bsd-3-clause | 149 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""Generate various plots using IAPWS."""
from math import pi, atan, log
import matplotlib.pyplot as plt
import numpy as np
import iapws
from iapws._iapws import Pt, Pc, Tc
from iapws.iapws97 import _PSat_T, _P23_T
##########################################################... | jjgomera/iapws | plots.py | Python | gpl-3.0 | 12,849 |
# -*- coding: utf-8 -*-
# Copyright 2009-2016 Jason Stitt
#
# 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... | cloudera/hue | desktop/core/ext-py/pytidylib-0.3.2/tests/test_init.py | Python | apache-2.0 | 1,380 |
'''
Created on Mar 25, 2013
@author: dmitchell
'''
import datetime
import subprocess
import unittest
import uuid
from importlib import import_module
from xblock.fields import Scope
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.exceptions import InsufficientSpecificationError, ItemNotFoun... | abo-abo/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py | Python | agpl-3.0 | 55,767 |
# Copyright 2016 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... | ghchinoy/tensorflow | tensorflow/python/ops/nn_fused_batchnorm_test.py | Python | apache-2.0 | 24,929 |
'''
Copyright (c) OS-Networks, http://os-networks.net
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | Knygar/hwios | services/web_ui/models/statics.py | Python | bsd-3-clause | 1,735 |
#! /usr/bin/env python
import sys
import os
import time
import numpy
from scipy.io.wavfile import read,write
import MySQLdb
#fp = "/home/pi/dr.wav"
fp = '/home/pi/Recordings/log.wav'
duration = 10 # seconds
shell_cmd = 'arecord -D plughw:0 --duration=' + str(duration) + ' -f cd -vv ' + fp # plughw:0 set to whatever ... | austingayler/pythia | scripts/record.py | Python | apache-2.0 | 945 |
from collections import Counter
from typing import List, Iterable
import numpy as np
import tensorflow as tf
from docqa.configurable import Configurable
from docqa.nn.layers import Encoder
from docqa.utils import ResourceLoader
"""
Classes for embedding words/chars
"""
class WordEmbedder(Configurable):
"""
... | allenai/document-qa | docqa/nn/embedder.py | Python | apache-2.0 | 17,154 |
from pyspark.sql import Row
#import boto_emr.parse_marc as parse_marc
from pyspark import SparkContext
import datetime
def process_by_fields(l):
host = None
date = None
text = None
ip_address = None
warc_type = None
for line in l[1]:
fields = line.split(':', 1)
if fields and le... | paulhtremblay/boto_emr | examples/process_crawl_text1.py | Python | mit | 1,482 |
#!/usr/bin/env python3
"""
Convert result text files into a csv.
"""
from typing import List
from itertools import chain
import csv
import re
IN_FILE = 'results.txt'
OUT_FILE = 'results.csv'
def parse_learner_run(class_type: str,
class_param: str,
params: List[bool],
... | bmassman/fake_news | fake_news/results/text_to_csv.py | Python | mit | 2,317 |
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# https://aws.amazon.com/apache2.0/
#
# or in the "license" file accomp... | boto/boto3 | tests/integration/test_dynamodb.py | Python | apache-2.0 | 8,255 |
# coding: utf-8
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views import generic
from djutils.views.generic import TitleMixin, SortMixin
from ..generic import FuncAccessMixin
from .. import models
from .. import consts
class List(SortMixin, TitleMixin, FuncAccessMixin, LoginRequiredMixin, ge... | telminov/sw-django-division-perm | division_perm/views/func.py | Python | mit | 719 |
#!/usr/bin/env python
# Copyright 2018 The Kubernetes 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 appli... | lavalamp/test-infra | experiment/maintenance/recreate_configmaps.py | Python | apache-2.0 | 4,541 |
from fnmatch import fnmatch
from time import sleep
import subprocess
import random as rand
from utils import *
import utils
name = "admin"
cmds = ["join", "part", "nick", "quit", "raw", ">>", ">", "op", "deop",
"voice", "devoice", "ban", "kban", "unban", "sop", "sdeop",
"svoice", "sdevoice", "squiet",... | devzero-xyz/Andromeda | plugins/admin.py | Python | mit | 32,853 |
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
verts = [
(0., 0.), # left, bottom
(0., 1.), # left, top
(1., 1.), # right, top
(1., 0.), # right, bottom
(0., 0.), # ignored
]
codes = [Path.MOVETO,
Path.LINETO,
Path.LINETO... | leesavide/pythonista-docs | Documentation/matplotlib/users/path_tutorial-1.py | Python | apache-2.0 | 577 |
# -*- coding: iso-8859-15 -*-
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <tzotsos@gmail.com>
#
# Copyright (c) 2010 Tom Kralidis
# Copyright (c) 2014 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to... | PublicaMundi/pycsw | pycsw/fes.py | Python | mit | 18,085 |
from django.db import models
from types import Secret
class SecretiveModel(models.Model):
class Meta:
# Don't create a separate db table for this superclass model
abstract = True
def __setattr__(self, name, value):
"""Register self with all Secret attributes."""
result = super(... | mypetyak/django-citadel | citadel/models.py | Python | mit | 1,242 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_jsonhumanize
----------------------------------
Tests for `jsonhumanize` module.
"""
import unittest
from jsonhumanize import JsonHuman
class TestJsonhumanize(unittest.TestCase):
"""
Test class for jsonhumanize module.
"""
def setUp(self):
... | magarcia/jsonhumanize | tests/test_jsonhumanize.py | Python | mit | 6,088 |
# Generated by Django 2.2 on 2020-07-06 12:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("djangocms_page_meta", "0011_auto_20190218_1010"),
]
operations = [
migrations.RemoveField(
model_name="pagemeta",
name... | nephila/djangocms-page-meta | djangocms_page_meta/migrations/0012_auto_20200706_1230.py | Python | bsd-3-clause | 858 |
from .circumcision_model_mixin import CircumcisionModelMixin
from .crf_model_mixin import CrfModelManager, CrfModelMixin
# CrfModelMixinNonUniqueVisit
from .detailed_sexual_history_mixin import DetailedSexualHistoryMixin
from .hiv_testing_supplemental_mixin import HivTestingSupplementalMixin
from .mobile_test_model_mix... | botswana-harvard/bcpp-subject | bcpp_subject/models/model_mixins/__init__.py | Python | gpl-3.0 | 523 |
from __future__ import absolute_import
from pex.http.tracer import *
| abel-von/commons | src/python/twitter/common/python/http/tracer.py | Python | apache-2.0 | 69 |
# 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.
# --------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2-beta/async_samples/sample_analyze_custom_documents_async.py | Python | mit | 5,565 |
from __future__ import absolute_import
from datetime import datetime, timedelta
from httplib import NOT_FOUND, OK, CREATED, INTERNAL_SERVER_ERROR
from flask import jsonify, Blueprint, current_app
from flask_restful import Api, Resource, reqparse, inputs
import pytz
from werkzeug.exceptions import NotFound
from . impo... | Scan-o-Matic/scanomatic | scanomatic/ui_server/scanners_api.py | Python | gpl-3.0 | 3,003 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# OpenModes - An eigenmode solver for open electromagnetic resonantors
# Copyright (C) 2013 David Powell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | DavidPowell/OpenModes | openmodes/integration.py | Python | gpl-3.0 | 13,770 |
#!/usr/bin/python
## ----------------------------------------------------------------------------
## GMM Training using Multiprocessing on Large Datasets
## Copyright (C) 2014, D S Pavan Kumar (Email: dspavankumar[at]gmail.com)
##
## This program is free software; you can redistribute it and/or modify
## ... | dspavankumar/gmm | gmm.py | Python | gpl-2.0 | 6,632 |
# -*- coding: utf-8 -*-
"""
Membership Management
"""
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# =============================================================================
def index():
""" Dashboard """
return s3db.cms_index(c, alt_function="index_alt")
# --... | flavour/eden | controllers/member.py | Python | mit | 7,976 |
from .contact import *
from .users import *
from .user_functions import *
| Sult/evetool | users/models/__init__.py | Python | mit | 74 |
# -*- coding: utf-8 -*-
import codecs
from module.plugins.Container import Container
from module.utils import fs_encode
class LinkList(Container):
__name__ = "LinkList"
__version__ = "0.12"
__pattern__ = r'.+\.txt'
__config__ = [("clear", "bool", "Clear Linklist after adding", False),
... | estaban/pyload | module/plugins/container/LinkList.py | Python | gpl-3.0 | 1,951 |
from pytldr.summarize.lsa import LsaOzsoy, LsaSteinberger
from pytldr.summarize.relevance import RelevanceSummarizer
from pytldr.summarize.textrank import TextRankSummarizer
if __name__ == "__main__":
txt = """
(Reuters) - Talks between Greece and euro zone finance ministers over the country's debt crisis brok... | jaijuneja/PyTLDR | example.py | Python | gpl-3.0 | 7,755 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2020 OSMC (KodeKarnage)
This file is part of script.module.osmcsetting.updates
SPDX-License-Identifier: GPL-2.0-or-later
See LICENSES/GPL-2.0-or-later for more information.
"""
__all__ = ['osmcupdates', 'service']
| osmc/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.updates/resources/lib/__init__.py | Python | gpl-2.0 | 280 |
import os
# ***********************************
# Settings common to all environments
# ***********************************
# Application settings
APP_NAME = "INcDbUser"
APP_SYSTEM_ERROR_SUBJECT_LINE = APP_NAME + " system error"
# Flask settings
CSRF_ENABLED = True
# Flask-User settings
USER_APP_NAME = APP_NAME
USE... | UCL-CS35/incdb-user | app/startup/common_settings.py | Python | bsd-2-clause | 953 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0011_auto_20150924_1340'),
]
operations = [
migrations.AlterModelOptions(
name='business',
o... | multivoxmuse/highlands-square.com | hisquare/home/migrations/0012_auto_20151021_2027.py | Python | gpl-2.0 | 723 |
import pathlib
from ...helpers import article
from .._helpers import _read, register
source = article(
authors=["D.P. Laurie"],
title="Algorithm 584: CUBTRI: Automatic Cubature over a Triangle",
journal="ACM Trans. Math. Softw.",
month="jun",
year="1982",
url="https://doi.org/10.1145/355993.35... | nschloe/quadpy | src/quadpy/t2/_cubtri/__init__.py | Python | mit | 594 |
#!/usr/bin/env python
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | eharney/cinder | cinder/cmd/manage.py | Python | apache-2.0 | 29,824 |
from __future__ import unicode_literals
import os
import os.path
from cached_property import cached_property
import pre_commit.constants as C
from pre_commit import git
from pre_commit.clientlib.validate_config import load_config
from pre_commit.repository import Repository
from pre_commit.store import Store
class... | Teino1978-Corp/pre-commit | pre_commit/runner.py | Python | mit | 1,796 |
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
import catnap
import yaml
def parse_yaml(f):
"""Parses a YAML-based test file"""
return catnap.Test.parse(yaml.load(f))
| dailymuse/catnap | catnap/yaml_parser.py | Python | bsd-3-clause | 229 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | yugangw-msft/azure-cli | src/azure-cli/azure/cli/command_modules/cosmosdb/_format.py | Python | mit | 1,901 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | thonkify/thonkify | src/lib/telegram/utils/helpers.py | Python | mit | 1,181 |
# -*- coding: utf-8 -*-
#
# cross_check_mip_corrdet.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | terhorstd/nest-simulator | pynest/examples/cross_check_mip_corrdet.py | Python | gpl-2.0 | 3,691 |
# Copyright 2014 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.
from telemetry.internal.actions import page_action
from telemetry.page import action_runner as action_runner_module
from telemetry.unittest_util import tab_t... | SaschaMester/delicium | tools/telemetry/telemetry/internal/actions/pinch_unittest.py | Python | bsd-3-clause | 1,647 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy import signals
import json
import codecs
import MySQLdb
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
cla... | hitlinxiang/work | message/message/pipelines.py | Python | mit | 2,048 |
from django.contrib import admin
from alimentos.models import *
admin.site.register(Food)
| mricharleon/HatosGanaderos | alimentos/admin.py | Python | gpl-2.0 | 91 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.