code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
#!/home/ilovejsp/project/ad3/django-allauth/example/env/bin/python # # The Python Imaging Library # $Id$ # # convert sequence format to GIF animation # # history: # 97-01-03 fl created # # Copyright (c) Secret Labs AB 1997. All rights reserved. # Copyright (c) Fredrik Lundh 1997. # # See the README file for ...
okwow123/djangol2
example/env/bin/gifmaker.py
Python
mit
689
from django.db import models class Sortable(models.Model): # Make instances reorderable position = models.IntegerField(default=0) def save(self, *args, **kwargs): model = self.__class__ if self.position is None: try: last = model.objects.order_by('-position')[0...
ff0000/django-sortable
sortable/models.py
Python
mit
554
#!/usr/bin/env python # Source: https://gist.github.com/jtriley/1108174 import os import shlex import struct import platform import subprocess class TerminalSize: def get_terminal_size(self): """ getTerminalSize() - get width and height of console - works on linux,os x,windows,cygwin(wind...
DigitalArtsNetworkMelbourne/huemovie
lib/terminalsize.py
Python
mit
2,958
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from sqlalchemy import Column, Integer, SmallInteger, VARCHAR, or_, and_ from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class User(Base): __tablename__ = 'users' id = Column(Integer,primary_key=True,autoincrem...
kkstu/DNStack
model/models.py
Python
mit
3,358
import turtle import random # Let's create our turtle and call him Simon! simon = turtle.Turtle() # We'll set the background to black turtle.bgcolor("black") # This is our list of colours colors = ["red", "green", "blue"] # We need to ask the user their name name = turtle.textinput("Name", "What is your name?") si...
SimonDevon/simple-python-shapes
name-draw1.py
Python
mit
605
#!/usr/bin/env python # -*- coding: utf-8 -*- import latin_noun import latin_pronoun import latin_adj import latin_conj import latin_prep import latin_verb_reg import latin_verb_irreg import util class LatinDic: dic = {} auto_macron_mode = False def flatten(text): return text.replace(u'ā',u'a').replac...
naoyat/latin
latin/latindic.py
Python
mit
1,985
## Open a serial connection with Arduino. import time import serial ser = serial.Serial("COM9", 9600) # Open serial port that Arduino is using time.sleep(3) # Wait 3 seconds for Arduino to reset print ser # Print serial config print "Sending serial command to OPEN the...
kellogg76/ArduinoTelescopeDustCover
open.py
Python
mit
507
from .random_agent import *
renatopp/marioai
agents/__init__.py
Python
mit
27
# -*- coding: utf-8 -*- ''' This module presents a little code to deal with battery status using DBUS and UPower on Linux @author: pkremer ''' import sys import logging from six.moves import filter from functools import partial import six import tdbus # 'constants' UPOWER_NAME = 'org.freedesktop.UPower' UPOWER_DEV...
infothrill/flask-socketio-dbus-demo
sensors/tdbus_upower.py
Python
mit
7,190
import base64 import csv import io import multiprocessing import numpy as np import sys from collections import defaultdict from io import StringIO from pathlib import Path # Import matplotlib ourselves and make it use agg (not any GUI anything) # before the analyze module pulls it in. import matplotlib matplotlib.use...
liffiton/ATLeS
src/web/controller_analyze.py
Python
mit
6,534
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.models import AbstractUser from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import Count from django.dispatch import receiver from django.template.loader import render_to_string fro...
donkawechico/arguman.org
web/profiles/models.py
Python
mit
5,320
#!/usr/bin/python import os import socket import subprocess import time import ledconfig #----- Definitionen ------------------------------- UDP_PORT = 8002 # UDP-Port fuer Broadcasts BROADCAST_IP = "10.0.0.255" MSG = "<iamledc:raspi01>" #---- Hauptprogramm ----------------- s = socket.socket(socket.AF_INET, so...
silmunc1916/WIFI-LED-Christmas-tree-installation
raspi-python-scripts/ledudp.py
Python
mit
1,434
import socket from heapq import heappush, heappop, heapify from collections import defaultdict ##defbig def encode(symb2freq): """Huffman encode the given dict mapping symbols to weights""" heap = [[wt, [sym, ""]] for sym, wt in symb2freq.items()] heapify(heap) while len(heap) > 1: lo = heappop(...
CSE-SOE-CUSAT/NOSLab
CSA/unsorted/username/client.py
Python
mit
1,125
import mechanize url = "http://www.webscantest.com/crosstraining/aboutyou.php" browser = mechanize.Browser() attackNumber = 1 with open('XSS-vectors.txt') as f: for line in f: browser.open(url) browser.select_form(nr=0) browser["fname"] = line res = browser.submit() content = res.read() # check ...
nwiizo/workspace_2017
pen_test_code/XSS-injection.py
Python
mit
571
import unittest import cv2 as cv import numpy as np import detection from test_utils import * class StartTest(unittest.TestCase): def setUp(self): self.detector = detection.BeginRace(masks_dir='./masks/start/', freq=1, ...
kartyboyz/n64-img-processing
testing/test_start.py
Python
mit
1,854
# -*- coding: utf-8 -*- """ @brief test log(time=92s) """ import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import get_temp_folder, add_missing_development_version import ensae_teaching_cs class TestNotebookRunner1a_soft_sql(unittest.TestCase): def setUp(self): add_m...
sdpython/ensae_teaching_cs
_unittests/ut_dnotebooks/test_1A_notebook_soft_sql.py
Python
mit
1,241
# grovepi.py # v1.2.2 # This file provides the basic functions for using the GrovePi # # Karan Nayan # Initial Date: 13 Feb 2014 # Last Updated: 22 Jan 2015 # http://www.dexterindustries.com/ # # These files have been made available online through # a Creative Commons Attribution-ShareAlike 3.0 license. # (...
martinschaef/grovepi
grovepi.py
Python
mit
13,742
#!/usr/bin/env python3 import argparse import datetime import os import re import urllib.request from dataclasses import dataclass from typing import Set, List, Optional, Dict, TextIO # https://github.com/PyGithub/PyGithub from github import Github from github.Milestone import Milestone from github.Repository import R...
intellij-rust/intellij-rust.github.io
changelog.py
Python
mit
9,091
#!/usr/bin/python # -*- coding: utf-8 -*- # # 1D_intrusion.py # # This script plots the cooling of a 1D intrusion with time # # dwhipp 09.13 #--- User-defined input values ------------------------------------------------# Ti=700. # Intrusion tempe...
HUGG/NGWM2016-modelling-course
Lessons/02-Physics-of-heat-transfer/scripts/1D_intrusion.py
Python
mit
3,951
class ReportParser: """ Parser with generic functionality for all Report Types (Tabular, Summary, Matrix) Parameters ---------- report: dict, return value of Connection.get_report() """ def __init__(self, report): self.data = report self.type = self.data["reportMetadata"]["r...
cghall/salesforce-reporting
salesforce_reporting/parsers.py
Python
mit
10,296
# Licensed under the MIT License - https://opensource.org/licenses/MIT import unittest import pytest import numpy as np from pycobra.cobra import Cobra from pycobra.ewa import Ewa from pycobra.diagnostics import Diagnostics import logging class TestOptimal(unittest.TestCase): def setUp(self): # setting ...
bhargavvader/pycobra
tests/test_diagnostics.py
Python
mit
3,735
# # This example measures the performance of encrypted storage # access through an SSH client using the Secure File # Transfer Protocol (SFTP). # # In order to run this example, you must provide a host # (server) address along with valid login credentials # import os import random import time import pyoram from pyora...
ghackebeil/PyORAM
examples/encrypted_storage_sftp.py
Python
mit
3,559
#!/usr/bin/env python3 import sys from Bio import SeqIO from argparse import ArgumentParser, RawDescriptionHelpFormatter usage = "Chromosome surgery: Splice something into and/or out of a chromosome." # Main Parsers parser = ArgumentParser(description=usage, formatter_class=RawDescriptionHelpFormatter) parser.add_arg...
fruce-ki/utility_scripts
chromosome_surgery.py
Python
mit
3,387
import numpy as np from vanilla_neural_nets.neural_network.training_batch_generator import MiniBatchGenerator from vanilla_neural_nets.neural_network.optimization_algorithm import GradientDescent from vanilla_neural_nets.neural_network.loss_function import MeanSquaredError from vanilla_neural_nets.neural_network.activ...
cavaunpeu/vanilla-neural-nets
vanilla_neural_nets/neural_network/network.py
Python
mit
3,546
"""Index muted_until column for use in filters Revision ID: 52d93745fa71 Revises: dc0db050f230 Create Date: 2018-12-13 13:53:58.895770 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '52d93745fa71' down_revision = 'dc0db050f230' branch_labels = None depends_on ...
FallenWarrior2k/cardinal.py
src/cardinal/db/migrations/versions/52d93745fa71_index_muted_until_column_for_use_in_.py
Python
mit
743
import _plotly_utils.basevalidators class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="symbol", parent_name="scatter3d.marker", **kwargs): super(SymbolValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
plotly/python-api
packages/python/plotly/plotly/validators/scatter3d/marker/_symbol.py
Python
mit
863
# -*- coding: utf-8 -*- from __future__ import print_function # Standard library imports import os from fnmatch import fnmatch # Local imports from . import res from .. import api, lib, utils # Third party imports from .Qt import QtCore, QtGui, QtWidgets class WindowHeader(QtWidgets.QWidget): def __init__(sel...
danbradham/shadeset
shadeset/ui/widgets.py
Python
mit
15,611
from django.utils.translation import ugettext_lazy as _ class PersonGender(): NOT_SPECIFIED = 0 MALE = 1 FEMALE = 2 GENDER_OPTIONS = ( (NOT_SPECIFIED, _('Not specified')), (MALE, _('Male')), (FEMALE, _('Female')), ) class PersonReligion(): NOT_SPECIFIED = 0 CHRIS...
BontaVlad/ExpirationDate
expirationDate/persons/constants.py
Python
mit
599
from __future__ import unicode_literals from django.conf import settings from drf_authentication.serializers.drf_auth_login_serializer \ import DrfAuthLoginSerializer from drf_authentication.serializers.drf_auth_logout_serializer \ import DrfAuthLogoutSerializer from drf_authentication.serializers.drf_auth_us...
cenkbircanoglu/drf_authentication
drf_authentication/app_settings.py
Python
mit
2,084
from shrubbery.authentication.contexts import AuthenticationContext, ModelAuthenticationContext from shrubbery.authentication.exceptions import AuthenticationError, Http403
emulbreh/shrubbery
shrubbery/authentication/__init__.py
Python
mit
172
from aiida.orm.calculation.job import JobCalculation from aiida.orm.data.parameter import ParameterData from aiida.orm.data.structure import StructureData from aiida.common.exceptions import InputValidationError from aiida.common.datastructures import CalcInfo, CodeInfo from aiida.common.utils import classproperty fro...
abelcarreras/aiida_extensions
plugins/jobs/lammps/md.py
Python
mit
9,997
class Register: @property def value(self): raise NotImplementedError @value.setter def value(self, value): raise NotImplementedError
Hexadorsimal/pynes
nes/processors/registers/register.py
Python
mit
166
import sys import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.ticker import numpy as np #import pandas as pd import astropy from astropy.table import Table from scipy import stats, interpolate, special from scipy.stats import gaussian_kde infile = 'candels_restframe_phot_weight...
vrooje/gzcandels_datapaper
plotting/plot_mags_z_thresholds.py
Python
mit
11,858
import logging from pyvisdk.exceptions import InvalidArgumentError # This module is NOT auto-generated # Inspired by decompiled Java classes from vCenter's internalvim25stubs.jar # Unless states otherside, the methods and attributes were not used by esxcli, # and thus not tested log = logging.getLogger(__name__) de...
xuru/pyvisdk
pyvisdk/do/vim_esx_cl_iiscsiadaptertargetlist_target.py
Python
mit
1,164
from unittest.mock import patch import pytest import responses from pythonanywhere.api.base import AuthenticationError, call_api, get_api_endpoint class TestGetAPIEndpoint: def test_defaults_to_pythonanywhere_dot_com_if_no_environment_variables(self): assert get_api_endpoint() == "https://www.pythonany...
pythonanywhere/helper_scripts
tests/test_api_base.py
Python
mit
1,981
''' Author: Blair Gemmer Purpose: Runs the main game loop, creates characters, upgrades characters ''' from GameEngine import * #Game variables: GameRunning = True height = 500 width = 500 #Create survivors: w = Gun() w.range = width s1 = Survivor(w) x = 50 y = 100 p = Point(x,y) s1.position = p s1.name = 'Fred' s2...
blairg23/Apocalypse-Defense
src/apocalypsedefense/python-prototype/driver.py
Python
mit
2,354
class Node(object): """Find if two nodes in a directed graph are connected. Based on http://www.codewars.com/kata/53897d3187c26d42ac00040d For example: a -+-> b -> c -> e | +-> d a.connected_to(a) == true a.connected_to(b) == true a.connected_to(c) == true b.connected_to(d...
intenthq/code-challenges
python/connected_graph/connected_graph.py
Python
mit
637
# # Basic Statistics on the Twitter Accounts # # In this section, some basic statistics for the Twitter Accounts of the given groups of libraries (i.e. National libraries, University libraries, Public libraries) will be collected. # # The functions will return a list of dictionaries and save it as a CSV to the cwd. ...
glaserti/LibraryTwitter
Python/4 - BaseStats.py
Python
mit
16,267
__author__ = 'aarongary' from app import PubMed from app import elastic_search_uri from collections import Counter from elasticsearch import Elasticsearch es = Elasticsearch([elastic_search_uri],send_get_body_as='POST',timeout=300) #============================ #============================ # DRUG SEARCH #=====...
ucsd-ccbb/Oncolist
src/restLayer/app/SearchDrugsTab.py
Python
mit
15,395
#! /usr/bin/env python # -*- coding: utf-8 -*- # from rpython.rlib import jit def print_help(argv): print """Welcome to Pycket. %s [<option> ...] <argument> ... File and expression options: -e <exprs>, --eval <exprs> : Evaluate <exprs>, prints results -f <file>, --load <file> : Like -e '(loa...
cderici/pycket
pycket/option_helper.py
Python
mit
13,785
# -*- coding: UTF-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals __author__ = "d01" __email__ = "jungflor@gmail.com" __copyright__ = "Copyright (C) 2015-16, Florian JUNG" __license__ = "MIT" __version__ = "0.1.0...
the01/python-paps
paps/crowd/controller.py
Python
mit
5,482
""" Django settings for SciMs project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
BdTNLM/SciMS
SciMs/settings.py
Python
mit
3,325
import collections import requests MovieResult = collections.namedtuple( 'MovieResult', "imdb_code,title,duration,director,year,rating,imdb_score,keywords,genres") def find_movies(search_text): if not search_text or not search_text.strip(): raise ValueError("Search text is required") # This...
mikeckennedy/python-jumpstart-course-demos
apps/10_movie_search/final/movie_svc.py
Python
mit
715
from cdo_api_py import Client import pandas as pd from datetime import datetime from pprint import pprint # initialize a client with a developer token , # note 5 calls per second and 1000 calls per day limit for each token token = "my token here!" my_client = Client(token, default_units=None, default_limit=1000) # the...
Jwely/cdo-api-py
docs/example/dc_weather_data.py
Python
mit
2,346
from django import forms from django.utils.translation import ugettext_lazy as _ from .models import Invitation class InvitationForm(forms.ModelForm): class Meta: model = Invitation fields = ('email', 'text') def __init__(self, *args, **kwargs): self.user = kwargs.pop('user', None) ...
thoas/django-fairepart
fairepart/forms.py
Python
mit
787
""" Tests for module recommendation. """
hypermindr/barbante
barbante/recommendation/tests/__init__.py
Python
mit
41
#!/usr/bin/env python """ Copyright (c) 2014-2015 Miroslav Stampar (@stamparm) See the file 'LICENSE' for copying permission """ from core.common import retrieve_content __url__ = "https://www.badips.com/get/list/any/2?age=7d" __check__ = ".1" __info__ = "attacker" __reference__ = "badips.com" def fetch(): retv...
hxp2k6/https-github.com-stamparm-maltrail
trails/feeds/badips.py
Python
mit
636
import requests import pafy from bs4 import BeautifulSoup def trade_spider(max_video_number): video_number = 1 url = 'https://www.youtube.com' source_code = requests.get(url) plain_text = source_code.text soup = BeautifulSoup(plain_text, "lxml") for link in soup.findAll('a', {'class': 'yt-uix-s...
thedespicableknight/web_crawlers
youtube/youtube_videos_2.py
Python
mit
766
import os import signal import fooster.web import fooster.web.query import mcp.error import mcp.common.http import mcp.model.server class Index(mcp.common.http.AuthHandler): group = 0 def do_get(self): return 200, [dict(server) for server in mcp.model.server.items() if server.server in self.auth....
fkmclane/MCP
mcp/api/server.py
Python
mit
10,415
from util.enums import Color class Location: """ Location on a chessboard """ ROWS = [1, 2, 3, 4, 5, 6, 7, 8] # RANKS COLS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] # FILES def __init__(self, row, col): """ initializer :param row: integer :param col: str :r...
zackee12/command-line-chess
board/location.py
Python
mit
4,278
# coding=utf-8 import abc import logging import tempfile from bireus.client.download_service import AbstractDownloadService from bireus.client.notification_service import NotificationService from bireus.shared import * from bireus.shared.diff_head import DiffHead from bireus.shared.diff_item import DiffItem from bireu...
Brutus5000/BiReUS
bireus/client/patch_tasks/base.py
Python
mit
3,803
import boto from amslib.core.manager import BaseManager from amslib.instance.instance import InstanceManager import argparse from errors import * import pprint import time pp = pprint.PrettyPrinter(indent=4) # Custom HealthCheck object to add support for failure threshold...seems to have been missed in boto class He...
ThisLife/aws-management-suite
amslib/network/route53.py
Python
mit
46,031
from RGT.XML.SVG.basicSvgNode import BasicSvgNode from RGT.XML.SVG.Attribs.transferFunctionElementAttributes import TransferFunctionElementAttributes class BaseComponentTransferNode(BasicSvgNode, TransferFunctionElementAttributes): def __init__(self, ownerDoc, tagName): BasicSvgNode.__init__(self, o...
danrg/RGT-tool
src/RGT/XML/SVG/Filters/baseComponentTransferNode.py
Python
mit
502
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from pusher import Pusher import unittest import httpretty class TestRequestsBackend(unittest.TestCase): def setUp(self): self.pusher = Pusher.from_url(u'http://key:secret@api.pusherapp.com/apps/4') @httpretty.activate...
hkjallbring/pusher-http-python
pusher_tests/test_requests_adapter.py
Python
mit
702
import unittest import tempfile import shutil from groundstation.objects.root_object import RootObject from groundstation.objects.update_object import UpdateObject def random_path(): return tempfile.mkdtemp() class StoreTestCase(unittest.TestCase): storeClass = None def setUp(self): self.path...
richo/groundstation
test/support/store_fixture.py
Python
mit
783
# 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 may ...
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_06_01/operations/_service_endpoint_policy_definitions_operations.py
Python
mit
24,235
# -*- coding: utf-8 -*- # # libxmlquery documentation build configuration file, created by # sphinx-quickstart on Fri Nov 5 15:13:45 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
nullable/libxmlquery
documentation/conf.py
Python
mit
8,376
"""RoleRequest message tests.""" from pyof.v0x04.controller2switch.role_request import RoleRequest from tests.test_struct import TestStruct class TestRoleRequest(TestStruct): """Test the RoleRequest message.""" @classmethod def setUpClass(cls): """Configure raw file and its object in parent class...
cemsbr/python-openflow
tests/v0x04/test_controller2switch/test_role_request.py
Python
mit
583
from setuptools import setup version = '0.4' setup( name = 'django-cache-decorator', packages = ['django_cache_decorator'], license = 'MIT', version = version, description = 'Easily add caching to functions within a django project.', long_description=open('README.md').read(), author = 'Ric...
rchrd2/django-cache-decorator
setup.py
Python
mit
596
from rest_framework import generics from api import * from serializers import StudentDiscussionSerializer, CourseDiscussionSerializer from rest_framework.permissions import IsAdminUser from django.http import Http404 from rest_framework.authentication import BasicAuthentication, SessionAuthentication from oauth2_provid...
jaygoswami2303/course_dashboard_api
v2/DiscussionAPI/views.py
Python
mit
5,468
#--------------------------------------------------------------------------------------------------- # Python Module File to describe a cleaner # # Author: C.Paus (Jun 16, 2016) #------------------------------------------------------------------------...
cpausmit/Kraken
python/cleaner.py
Python
mit
12,891
#!/usr/bin/python # -*- coding: utf-8 -*- u""" Script to welcome new users. This script works out of the box for Wikis that have been defined in the script. It is currently used on the Dutch, Norwegian, Albanian, Italian Wikipedia, Wikimedia Commons and English Wikiquote. Ensure you have community support before runn...
npdoty/pywikibot
scripts/welcome.py
Python
mit
41,884
""" Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 = "aabcc", s2 = "dbbca", When s3 = "aadbbcbcac", return true. When s3 = "aadbbbaccc", return false. """ __author__ = 'Danyang' class Solution(object): def isInterleave(self, s1, s2, s3): ...
algorhythms/LeetCode
097 Interleaving String.py
Python
mit
2,718
from pyfancy import pyfancy pyfancy().red("Hello").raw(", ").blue("world!").output() pyfancy().multi("Multicolored text").output() pyfancy().rainbow("Rainbow text").output() pyfancy("{red foo {bold bar} baz}").output() pyfancy().black_bg("Black background").output() pyfancy().green_bg("Green background").output() pyfa...
ilovecode1/Pyfancy-2
pyfancy/demo.py
Python
mit
787
# -*- coding: utf-8 -*- """ Update the secrets in a Wordpress configuration file. MIT License Copyright (c) 2016 Martin Bo Kristensen Grønholdt 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 w...
deadbok/wp-passwd-reset-vestacp
change-wp-conf-secrets.py
Python
mit
4,552
""" Summary: Factory class for building the AUnits from an ISIS data file. This is used to read and build the parts of the ISIS dat file. Author: Duncan Runnacles Created: 01 Apr 2016 Copyright: Duncan Runnacles 2016 TODO: There are a few functions in here that should be made prote...
duncan-r/SHIP
ship/utils/fileloaders/datloader.py
Python
mit
9,666
# -- encoding: utf-8 -- from __future__ import with_statement from stackspy.detection.utils import find_in_html_by_substring SIMPLE_SUBSTRINGS = { ".google-analytics.com/ga.js": "Google Analytics", "js/chartbeat.js": "Chartbeat", ".snoobi.com/snoop": "Snoobi", ".quantserve.com/quant.js": "QuantServe", ".addthi...
akx/stackspy
stackspy/detectors/js/__init__.py
Python
mit
668
import argparse import time import subprocess import logging from deep_architect import search_logging as sl from deep_architect import utils as ut from deep_architect.contrib.communicators.mongo_communicator import MongoCommunicator from search_space_factory import name_to_search_space_factory_fn from searcher impor...
negrinho/deep_architect
examples/contrib/kubernetes/master.py
Python
mit
9,581
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.core.doctype.data_import.data_import import export_csv import unittest import os class TestDataImportFixtures(unittest.TestCase):...
saurabh6790/frappe
frappe/tests/test_exporter_fixtures.py
Python
mit
8,665
""" https://leetcode.com/problems/add-binary/ https://leetcode.com/submissions/detail/106524947/ """ class Solution(object): def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str """ length = max(len(a), len(b)) remaining = 0 index = ...
vivaxy/algorithms
python/problems/add_binary.py
Python
mit
1,091
# -*- coding: utf-8 -*- """ chemdataextractor.doc.table ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Table document elements. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from collections import defaultdict fro...
mcs07/ChemDataExtractor
chemdataextractor/doc/table.py
Python
mit
13,370
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict __all__ = ['DPN', 'dpn92', 'dpn98', 'dpn131', 'dpn107', 'dpns'] def dpn92(num_classes=1000): return DPN(num_init_features=64, k_R=96, G=32, k_sec=(3,4,20,3), inc_sec=(16,32,24,128), num_classes=num_classes) d...
oyam/pytorch-DPNs
dpn.py
Python
mit
5,042
import pytest from django.contrib.auth import get_user_model from django.urls import reverse from rest_framework.status import HTTP_200_OK, HTTP_302_FOUND, HTTP_403_FORBIDDEN from organizations.views.tests import setup, user_permissions_test_create, login from projects.tests.factories import ProjectFactory User = get...
bgroff/kala-app
django_kala/projects/views/projects/tests/test_new_project.py
Python
mit
2,542
import numpy as np LARGE = 200. SMALL = 1. / LARGE def _find_contpix_given_cuts(f_cut, sig_cut, wl, fluxes, ivars): """ Find and return continuum pixels given the flux and sigma cut Parameters ---------- f_cut: float the upper limit imposed on the quantity (fbar-1) sig_cut: float ...
annayqho/TheCannon
TheCannon/find_continuum_pixels.py
Python
mit
3,465
from django.conf.urls import url from . import views app_name = 'repo' urlpatterns = [ url(r'^$', views.home, name='home'), url(r'^home/$', views.home, name='home'), url(r'^library/$', views.library, name='library'), url(r'^login/$', views.login, name='login'), url(r'^register/$', views.register, name='register')...
giantas/elibrary
repo/urls.py
Python
mit
535
"""Test Home Assistant location util methods.""" # pylint: disable=too-many-public-methods import unittest import blumate.util.location as location_util # Paris COORDINATES_PARIS = (48.864716, 2.349014) # New York COORDINATES_NEW_YORK = (40.730610, -73.935242) # Results for the assertion (vincenty algorithm): # ...
bdfoster/blumate
tests/util/test_location.py
Python
mit
1,684
import CommonGraphDiffer as cgd import argparse def parseArgs(): parser = argparse.ArgumentParser() parser.add_argument("cg1", help="This is the first .CGX (CommonGraph) file") parser.add_argument("cg2", help="This is the second .CGX (CommonGraph) file") parser.add_argument("ds", help="This is the outp...
oderby/VVD
diffgraph.py
Python
mit
602
from django.conf.urls import url, include from server.rides.views import RidesList, RideDetails, RideRidersList, RideRiderDetails, RideRiderCharge, RideRiderFundraiser urlpatterns = [ url(r'^(?P<id>\d+)/riders/(?P<rider_id>\d+)/fundraiser', RideRiderFundraiser.as_view(), name='ride-rider-fundraiser'), url(r'^...
Techbikers/techbikers
server/rides/urls.py
Python
mit
732
from flask import Flask, url_for, redirect, request, render_template, send_from_directory from flask.ext.sqlalchemy import SQLAlchemy from model import * from werkzeug import secure_filename import os ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'mp4']) if not os.path.exists('data/media'): ...
Alshootfa/I.K.R.A
app.py
Python
mit
3,051
from django.contrib import admin from .models import BookingState, Booking, BookingItem, TrackingEvent, TrackingValue, Agreement, Payment @admin.register(BookingState) class BookingStateAdmin(admin.ModelAdmin): list_display = ('title', 'color', 'income') @admin.register(Agreement) class AgreementAdmin(admin.Mod...
eedf/jeito
booking/admin.py
Python
mit
1,743
#! /usr/bin/env python """Example of how to send text messages using Twilio """ import struct from twilio.rest import TwilioRestClient # Find these values at https://twilio.com/user/account account_sid = "xxxx" auth_token = "xxxx" client = TwilioRestClient(account_sid, auth_token) message = client.messages.create(to=...
eugenekolo/kololib
python/twilio_example.py
Python
mit
541
class Config(object): DEBUG = False TESTING = False class DevConfig(Config): DEBUG = False
sudoes/UTEM-Vote
config.py
Python
mit
105
from setuptools import setup import ast import os import io def version(): """Return version string.""" with open(os.path.join('remixcast', '__init__.py')) as input_file: for line in input_file: if line.startswith('__version__'): return ast.parse(line).body[0].value.s def...
thomasballinger/remixcast
setup.py
Python
mit
2,203
from sklearn.tree import DecisionTreeClassifier # weak classifier # decision tree (max depth = 2) using scikit-learn class WeakClassifier: # initialize def __init__(self): self.clf = DecisionTreeClassifier(max_depth = 2) # train on dataset (X, y) with distribution weight w def fit(self, X, y, w): se...
huangshenno1/algo
ml/iris/ada_MO/weakclassifier.py
Python
mit
425
# 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 may ...
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/operations/_private_endpoint_connections_operations.py
Python
mit
21,872
#!/usr/bin/env python """Print the path of the local Nengo/SpiNNaker installation.""" if __name__=="__main__": # pragma: no cover import nengo_spinnaker import os.path print(os.path.dirname(nengo_spinnaker.__file__))
project-rig/nengo_spinnaker
utils/nengo_spinnaker_path.py
Python
mit
232
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import functools import json import flask import werkzeug.exceptions import werkzeug.http from flask im...
kxepal/replipy
replipy/peer.py
Python
mit
7,259
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from sqlalchemy.orm import joinedload, subqueryload from indico....
mic4ael/indico
indico/modules/attachments/clone.py
Python
mit
4,790
from rpython.rtyper.llannotation import ( SomePtr, SomeInteriorPtr, SomeLLADTMeth, lltype_to_annotation) from rpython.flowspace import model as flowmodel from rpython.rlib.rarithmetic import r_uint from rpython.rtyper.error import TyperError from rpython.rtyper.lltypesystem import lltype from rpython.rtyper.rmodel ...
oblique-labs/pyVM
rpython/rtyper/rptr.py
Python
mit
13,576
from .utils.process import to_http from .consts import BASIC_SERIALIZATION def serialization(basic=BASIC_SERIALIZATION): def decorator(view): def wrapper(request, *args, **kwargs): response = view(request, *args, **kwargs) return to_http(request, response, basic_serialization=basic)...
laginha/django-easy-response
src/easy_response/decorators.py
Python
mit
366
import os from verifier import Verifier import verifier import unittest # Verification tests import json import codecs TASK_FILE = '201606231548.json' with codecs.open(TASK_FILE, mode='r', encoding='utf-8') as file: run_info = json.load(file) v = Verifier() class TestVerifer(unittest.TestCase): def test_han...
zamattiac/ROSIEBot
tests_verifier.py
Python
mit
895
from django.db import models from django.template.defaultfilters import slugify from tagging.fields import TagField from tagging.utils import parse_tag_input from django.contrib.auth.models import User from django.conf import settings import uuid,os import datetime # Create your models here. def slugify_uniquely(value...
trove/trove-superalbums
superalbums/models.py
Python
mit
5,090
import time import threading from ..utils.abstract_pub_sub_trans import EventTranslator class FacialEventTranslator(EventTranslator): msg_keys_handled = ['OSC_jaw_clench', 'OSC_touching_forehead', 'OSC_blink'] # Facial event params blink_event_time = 2 seek_multiplyer = 5 def __init__(self, msg...
prydom/MuseIC-EventServer
MuseEventServer/translators/facial_event_translator.py
Python
mit
3,977
import sys import unittest from unittest import mock import luigi import luigi_slack.api from luigi_slack.api import SlackBot from luigi_slack.api import notify from luigi_slack.events import * class TestSlackBot(unittest.TestCase): def setUp(self): self.patcher = mock.patch('luigi_slack.api.SlackAPI') ...
bonzanini/luigi-slack
tests/test_api.py
Python
mit
5,897
import pymongo from flask import g from flask import current_app as app def get_db(): if not hasattr(g, 'conn'): print(app.config) g.conn = pymongo.MongoClient( app.config['MONGODB_HOST'], int(app.config['MONGODB_PORT']) ) if not hasattr(g, 'db'): g.db...
patrykomiotek/seo-monitor-api
app/db.py
Python
mit
524
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone from django.urls import reverse_lazy from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.decorators import login_required fro...
nathanhnew/NLNF
blog/views.py
Python
mit
3,373
#!/usr/bin/env python # -*- coding: utf-8 -*- # import ## batteries import os import sys import pytest ## 3rd party import pandas as pd ## package from pyTecanFluent import Utils # data dir test_dir = os.path.join(os.path.dirname(__file__)) data_dir = os.path.join(test_dir, 'data') # tests def test_make_range(): ...
leylabmpi/pyTecanFluent
tests/test_Utils.py
Python
mit
1,127
""" Print data for table `componentsoverlaps.tex` in the paper Numbers of members Ages, crossing time """ import numpy as np from astropy.table import Table, unique ############################################ # Some things are the same for all the plotting scripts and we put # this into a single library to avoid c...
mikeireland/chronostar
projects/scocen/print_components_overlaps_table_for_paper.py
Python
mit
1,817
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, Http404, HttpResponseRedirect from django.core.urlresolvers import reverse from django.views import generic from django.utils import timezone from .models import Question, Choice # Create your views here. class IndexView(gene...
bmcguirk/djangoprojectapp
polls/views.py
Python
mit
1,962
""" Contains low level wrapper around the chipmunk_ffi methods exported by chipmunk_ffi.h as those methods are not automatically generated by the wrapper generator. You usually dont need to use this module directly, instead use the high level binding in pymunk """ from ctypes import * from .vec2d import Vec2...
cfobel/python___pymunk
pymunk/_chipmunk_ffi.py
Python
mit
2,348