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
import math """ The Purpose of this Program is to automate the task of Ventilation Surveying in Underground Mining Engineering. This program can accept input of tabulated values (in csv file) for Leapfrogging and Roving-Base Altimeter Indirect Method Surveys and provide data analysis and calculation output to a c...
Roibal/Geotechnical_Engineering_Python_Code
Ventilation-Mining-Engineering/Ventilation_Mining_Python_Toolbox.py
Python
mit
17,670
""" the flask extension """ import warnings from functools import wraps import logging from flask import request, current_app, g, Blueprint from werkzeug.http import http_date from limits.errors import ConfigurationError from limits.storage import storage_from_string, MemoryStorage from limits.strategies import STRAT...
duyet-website/api.duyet.net
lib/flask_limiter/extension.py
Python
mit
20,800
import os import matplotlib.pyplot as plt import numpy as np from plotting_styles import onecolumn_figure, default_figure from paths import paper1_figures_path ''' Make a UV plot of the 1000th HI channel. ''' uvw = np.load("/mnt/MyRAID/M33/VLA/14B-088/HI/" "14B-088_HI_LSRK.ms.contsub_channel_1000.uvw....
e-koch/VLA_Lband
14B-088/HI/analysis/uv_plots/channel_1000_uvplot.py
Python
mit
813
#! /usr/bin/python #encoding=UTF-8 ''' Created on 2014-5-15 @author: XIAO Zhen ''' '''哈哈''' import Tkinter as tk import time import random class Application(tk.Frame): def __init__(self, master=None): tk.Frame.__init__(self, master) self.winfo_toplevel().rowconfigure(0,minsize = 1) self.w...
eriwoon/2048
main.py
Python
mit
9,629
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def levelOrderBottom(self, root): list = [] self.helper(list, root, 0) return list[::-1] d...
Jspsun/LEETCodePractice
Python/BinaryTreeLevelOrderTraversal2.py
Python
mit
687
import pytest import cv2 from plantcv.plantcv import auto_crop @pytest.mark.parametrize('padx,pady,expected', [[20, 20, (98, 56, 4)], [(400, 400), (400, 400), (58, 16, 4)]]) def test_auto_crop(padx, pady, expected, test_data): """Test for PlantCV.""" # Read in test data img = cv2.imread(test_data.small_rg...
danforthcenter/plantcv
tests/plantcv/test_auto_crop.py
Python
mit
1,737
"""Support for Netgear LTE notifications.""" import logging import attr import eternalegypt from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService from . import CONF_NOTIFY, CONF_RECIPIENT, DATA_KEY _LOGGER = logging.getLogger(__name__) async def async_get_service(hass, config, discovery...
rohitranjan1991/home-assistant
homeassistant/components/netgear_lte/notify.py
Python
mit
1,330
""" UNIT 2: Logic Puzzle You will write code to solve the following logic puzzle: 1. The person who arrived on Wednesday bought the laptop. 2. The programmer is not Wilkes. 3. Of the programmer and the person who bought the droid, one is Wilkes and the other is Hamming. 4. The writer is not Minsky. 5. Neither Knu...
feredean/cs313
notes/7_puzzle.py
Python
mit
2,458
# run some tests # # author: sganis # date: 05/16/2015 import unittest class TestVersions(unittest.TestCase): def test_python(self): import platform self.assertEqual(platform.python_version(), "2.7.10rc1") def test_numpy(self): import numpy self.assertEqual(numpy.version.version, "1.9.2") if __name__ =...
sganis/pyportable
test.py
Python
mit
352
import theano import theano.tensor as T import numpy as np import matplotlib.pyplot as plt from lasagne.layers import InputLayer, DenseLayer, ReshapeLayer import lasagne.layers import lasagne.nonlinearities import lasagne.updates import lasagne.objectives import lasagne.init from ntm.layers import NTMLayer from ntm.m...
snipsco/ntm-lasagne
examples/associative-recall-task.py
Python
mit
4,480
# Generated by YCM Generator at 2019-06-21 11:57:11.711058 # This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publis...
PysKa-Ratzinger/personal_project_euler_solutions
solutions/076-100/77/.ycm_extra_conf.py
Python
mit
4,697
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-25 11:53 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('consent', '0013_auto_20170217_1606'), ] operations = [ migrations.AlterFiel...
aakashrana1995/svnit-tnp
tnp/consent/migrations/0014_auto_20170325_1723.py
Python
mit
523
import os, sys import json import copy import numpy as np import random from multiprocessing import Pool import ipdb ################################################################################################ utils_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),'nlp scripts') source_vh_dir = '/ho...
ronaldahmed/labor-market-demand-analysis
rule based major_extractor/count_custom_vhs.py
Python
mit
4,738
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vgid.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Guest007/vgid
manage.py
Python
mit
247
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) 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. # # This program is distributed in the hope that it will b...
jumoconnect/openjumo
jumodjango/lib/suds/sax/parser.py
Python
mit
4,435
"""The www.cartoonmad.com analyzer. [Entry examples] - http://www.cartoonmad.com/comic/5640.html - https://www.cartoonmad.com/comic/5640.html """ import re from urllib.parse import parse_qsl from cmdlr.analyzer import BaseAnalyzer from cmdlr.autil import fetch class Analyzer(BaseAnalyzer): """The www....
civalin/cmdlr
src/cmdlr/analyzers/cartoonmad.py
Python
mit
3,587
from __future__ import print_function import sys, time import requests, urllib import demjson, shelve import os.path class Archiver: def __init__(self): """ A class for archiving URLS into the wayback machine """ self._machine = "http://archive.org/wa...
saberman888/Archiver
archive.py
Python
mit
5,894
# script.py import argparse import pyexcel as pe import configparser import os import sys import sqlite3 import my_connection_grp_desg as connection from insert import sanction_grp as insert_sanc DB_URL = None global conn conn = None sheet = None desg_ls=None unit_ls=None sect_ls=None def load_tables(): # conn.ro...
venkat299/mpBudget
insert_grp_desg.py
Python
mit
4,685
#!/usr/bin/python -u """ This script replaces underscores with spaces (%20) Project: https://github.com/LagrangianPoint/Apache-Rewrite-Maps-Python/ http://httpd.apache.org/docs/current/rewrite/rewritemap.html http://fragmentsofcode.wordpress.com/2009/02/04/python-script-for-apache-rewritemap/ http://codeblow.com/que...
LagrangianPoint/Apache-Rewrite-Maps-Python
under2space.py
Python
mit
754
# -*- coding: utf-8 -*- """ kintone上のデータを、バックアップを取ってから一括アップデートするスクリプト オプション指定なし→ローカルキャッシュを用いてDry Run -r(--real) →最新のデータを取得してバックアップし、更新 -f(--from-backup) →-rで問題が起きたとき用。バックアップを指定して、そのデータを元に更新する。 """ from cache import get_all, get_app import time import argparse from render import pretty def concat_lines(x, y): if...
mitou/meikan
updater.py
Python
mit
3,661
import xml.etree.ElementTree as ET class Definition(object): def __init__(self, definition_root): self._definition_root = definition_root def type_name(self): type_id = self._definition_root.find('Id').find('TypeId') subtype_id = self._definition_root.find('Id').find('SubtypeId') ...
vmrob/sbsmanip
sbsmanip/cubeblocks.py
Python
mit
1,449
""" The MIT License (MIT) Copyright (c) 2015-2021 Kim Blomqvist 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, ...
kblomqvist/yasha
yasha/parsers.py
Python
mit
3,274
# coding: utf-8 from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response from collections import defaultdict from django.contrib.auth.decorators import login_required from django.core.context_processors impo...
vadosl/photorganizer
photorganizer/photo/views__.py
Python
mit
8,479
import logging import boto3 import io from slovar import slovar from prf import fs log = logging.getLogger(__name__) def includeme(config): Settings = slovar(config.registry.settings) S3.setup(Settings) class S3(fs.FS): def __init__(self, ds, create=False): path = ds.ns.split('/') bucke...
vahana/prf
prf/s3.py
Python
mit
954
import unittest from ai_graph_color import line, problem_generator class TestProblemGenerator(unittest.TestCase): def test_generate_file_path(self): """ Tests create file """ file_names = ['test.json', ''] for file_name in file_names: file_path = problem_genera...
sagersmith8/ai_graph_coloring
tests/test_problem_generator.py
Python
mit
5,335
import struct import time from dataclasses import dataclass from typing import Iterator, Literal, Optional, Tuple from OpenSSL import SSL from mitmproxy import certs, connection from mitmproxy.net import tls as net_tls from mitmproxy.proxy import commands, events, layer, tunnel from mitmproxy.proxy import context from...
mhils/mitmproxy
mitmproxy/proxy/layers/tls.py
Python
mit
18,080
""" Illustration of the heat equation Solve the heat equation using finite differences and Forward Euler. Based on: https://commons.wikimedia.org/wiki/File:Heat_eqn.gif """ from __future__ import division, print_function import numpy as np from mayavi import mlab def step_function(N, scale, X, Y, shape="crescent")...
nicoguaro/AdvancedMath
examples/heat_iterations.py
Python
mit
3,191
''' Created on Mar 8, 2013 @author: Gary ''' import unittest from housemonitor.outputs.zigbee.zigbeecontrol import ZigBeeControl from housemonitor.outputs.zigbee.zigbeeoutputstep import ZigBeeOutputStep from housemonitor.outputs.zigbee.zigbeeoutputthread import ZigBeeOutputThread from housemonitor.lib.hmqueue import H...
gary-pickens/HouseMonitor
housemonitor/outputs/zigbee/test/zigbeeoutputstep_test.py
Python
mit
1,738
#! /usr/bin/env python3 # Suggest name to z3 binary based on it its sha import sys import words import subprocess import argparse import os.path import shutil from pathlib import Path import yaml class Bencher(object): def __init__(self): self._name = 'bencher' self._help = 'Make benchmark di...
agurfinkel/brunch
exp/bencher.py
Python
mit
2,706
# Create your views here. from django.http import HttpResponse, HttpResponseRedirect from django.template import RequestContext, loader from django.core.urlresolvers import reverse from django.shortcuts import render, get_object_or_404 from django.utils import timezone from django.views import generic from polls.mode...
Drhealsgood/learning_django
polls/views.py
Python
mit
1,526
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2018-03-05 05:39 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsors', '0012_sponsor_level_smallint'), ] operations = [ migrations.Alte...
pycontw/pycontw2016
src/sponsors/migrations/0013_auto_20180305_1339.py
Python
mit
624
######## Script to convert IRS spectra into pseudophotometric ######## datapoints for modeling the TDs import asciitable import numpy as np import matplotlib.pyplot as plt import pyfits from scipy import interpolate def remove_duplicates_func(seq): """ This function takes a list and returns the same without d...
alvaroribas/modeling_TDs
data_converter.py
Python
mit
7,982
""" ===================================== Include On-leveling into Cape Cod ===================================== This example demonstrates how to incorporate on-leveling into the `CapeCod` estimator. The on-level approach emulates the approach taken by Friedland in "Estimating Unpaid Claims Using Basic Techniques" C...
jbogaardt/chainladder-python
examples/plot_capecod_onlevel.py
Python
mit
2,182
from __future__ import absolute_import, division, print_function from builtins import * # @UnusedWildImport from mcculw import ul from mcculw.ul import ULError from mcculw.enums import (BoardInfo, InfoType, ErrorCode, EventType, ExpansionInfo) from .ai_info import AiInfo from .ao_info import...
mccdaq/mcculw
mcculw/device_info/daq_device_info.py
Python
mit
4,437
import inspect import re import sys import traceback from inspect import CO_VARARGS from inspect import CO_VARKEYWORDS from traceback import format_exception_only from types import TracebackType from typing import Generic from typing import Optional from typing import Pattern from typing import Tuple from typing import...
tomviner/pytest
src/_pytest/_code/code.py
Python
mit
36,328
# remove duplicates of linked list class Node(object): # define constructor def __init__(self, data): self.data = data self.next = None class LinkedList(object): def __init__(self, head=None): self.head = head def add(self, new_node): current_node = self.head if self.head: while current_node.next: ...
derekmpham/interview-prep
linked-list/remove-dups.py
Python
mit
2,214
#Ensure there is an exceptional edge from the following case def f2(): b, d = Base, Derived try: class MyNewClass(b, d): pass except: e2 def f3(): sequence_of_four = a_global try: a, b, c = sequence_of_four except: e3 #Always treat locals as no...
github/codeql
python/ql/test/library-tests/ControlFlow/except/test.py
Python
mit
1,251
# Python3 from solution1 import urlSimilarity as f qa = [ ('https://codesignal.com/home/test?param1=42&param3=testing&login=admin', 'https://codesignal.com/home/secret/test?param3=fish&param1=42&password=admin', 19), ('https://codesignal.com/home/test?param1=42&param3=testing&login=admin', 'htt...
RevansChen/online-judge
Codefights/arcade/python-arcade/level-13/90.Url-Similarity/Python/test.py
Python
mit
1,205
"""Main module.""" import os import pygame import signal import logging import argparse from threading import Event from multiprocessing import Value from injector import Injector, singleton from ballercfg import ConfigurationManager from .locals import * # noqa from .events import EventManager, TickEvent from .mo...
multatronic/akurra
akurra/__init__.py
Python
mit
5,555
from __future__ import absolute_import class ConfigNotFound(LookupError): """Raise this exception to signal that a requested config item was not found in the config.""" pass
inklesspen/montague
src/montague/exceptions.py
Python
mit
191
from rest_framework import permissions class IsOwnerOrReadOnly(permissions.BasePermission): """ Custom permission to only allow owners of an object to edit it. """ def has_object_permissions(self, request, view, obj): # Read permissions are allowed to any request, # so we'll always all...
dfurtado/generator-djangospa
generators/app/templates/root/main/permissions.py
Python
mit
438
import storage from representation import Representation from patch import Patch
ChrisTimperley/EvoAnalyser.py
src/representation/__init__.py
Python
mit
81
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: yuchou @time: 2017/8/7 10:28 """
yuchou/xblog
blog/templatetags/__init__.py
Python
mit
91
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : Libs/IOST_WAboutDialog/IOST_AboutDialog.py # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT Licen...
HPPTECH/hpp_IOSTressTest
IOST_0.23/Libs/IOST_AboutDialog/IOST_AboutDialog.py
Python
mit
3,089
"""add follow table Revision ID: f045592adab0 Revises: 56a3d184ac27 Create Date: 2017-10-06 00:38:24.001488 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f045592adab0' down_revision = '56a3d184ac27' branch_labels = None depends_on = None def upgrade(): ...
mikkylok/mikky.lu
migrations/versions/f045592adab0_add_follow_table.py
Python
mit
964
import datetime import uuid from flask import current_app as app from flask import url_for from database import db from sqlalchemy import Column, DateTime, String, Text from sqlalchemy.dialects.postgresql import UUID class Poster(db.Model): __tablename__ = 'posters' id = Column(UUID(as_uuid=True), primary_...
TailorDev/pauling
api/models.py
Python
mit
2,935
import sublime, sublime_plugin import webbrowser class OpenWikiOnString(sublime_plugin.TextCommand): def run(self, edit): query = self.view.substr(self.view.sel()[0]) webbrowser.open_new("http://wiki.sa-mp.com/wiki/" + query)
ziggi/pawn-sublime-language
OpenWikiOnString.py
Python
mit
233
import etcd import logging import os import signal import time import unittest import patroni.config as config from mock import Mock, PropertyMock, patch from patroni.api import RestApiServer from patroni.async_executor import AsyncExecutor from patroni.dcs.etcd import AbstractEtcdClientWithFailover from patroni.excep...
zalando/patroni
tests/test_patroni.py
Python
mit
7,937
# -*- coding: utf-8 -*- """ This is the Windows backend for keyboard events, and is implemented by invoking the Win32 API through the ctypes module. This is error prone and can introduce very unpythonic failure modes, such as segfaults and low level memory leaks. But it is also dependency-free, very performant well doc...
glitchassassin/keyboard
keyboard/_winkeyboard.py
Python
mit
20,607
# Module: docs # Date: 03rd April 2013 # Author: James Mills, j dot mills at griffith dot edu dot au """Documentation Tasks""" from fabric.api import lcd, local, task from .utils import pip, requires PACKAGE = "mio" @task() @requires("make", "sphinx-apidoc") def clean(): """Delete Generated Documenta...
prologic/mio
fabfile/docs.py
Python
mit
828
from unittest import TestCase from pydigmips import instructions, loaders class HexaLoaderTestCase(TestCase): def testAdd(self): i = ['1510', # 000 101 010 001 0000 '1C60', '2C60'] # 001 011 000 110 0000 o = [instructions.Add(5, 2, 1), instructions.Add(7, 0, 6), ...
ProgVal/pydigmips
tests/test_loaders.py
Python
mit
1,378
import json from pprint import pprint json_data=open('jsonFormated') #json_data=open('jsonFile') data = json.load(json_data) pprint(data) json_data.close()
krthkj/learningPython
readjson.py
Python
mit
157
#!/usr/bin/env python3 # Copyright (c) 2019-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPC misc output.""" import xml.etree.ElementTree as ET from test_framework.test_framework import ...
syscoin/syscoin
test/functional/rpc_misc.py
Python
mit
4,423
from io import BytesIO import json import os import urllib.parse import six import sys from ftptool import FTPHost import xlsxwriter # from https://docs.djangoproject.com/en/1.10/_modules/django/utils/encoding/ def smart_text(s, encoding="utf-8", strings_only=False, errors="strict"): """ Returns a text objec...
shapiromatron/tblBuilder
src/private/scripts/ftpScraper.py
Python
mit
3,966
from holmium.core import ( Page, Element, Locators, Elements, ElementMap, Section, Sections ) from holmium.core.cucumber import init_steps init_steps() class TestSection(Section): el = Element(Locators.NAME, "el") els = Elements(Locators.NAME, "els") elmap = ElementMap(Locators.NAME, "elmap") class ...
alisaifee/holmium.core
tests/support/cucumber/steps.py
Python
mit
823
#!/usr/bin/env python2.6 ''' Test docx module ''' import os import lxml from docx import * TEST_FILE = 'ShortTest.docx' IMAGE1_FILE = 'image1.png' # --- Setup & Support Functions --- def setup_module(): '''Set up test fixtures''' import shutil if IMAGE1_FILE not in os.listdir('.'): shutil.copyfile...
tomchipchase/python-docx
tests/test_docx.py
Python
mit
4,253
# Generated by Django 2.2.19 on 2021-04-28 09:12 from django.db import migrations, models import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ('markets', '0065_auto_20190426_1255'), ] operations = [ migrations.AlterField( model_name="logo", ...
uktrade/navigator
app/markets/migrations/0066_auto_20210428_0912.py
Python
mit
1,397
#encoding:utf-8 subreddit = 'technology' t_channel = '@r_technology' def send_post(submission, r2t): return r2t.send_simple(submission)
Fillll/reddit2telegram
reddit2telegram/channels/~inactive/r_technology/app.py
Python
mit
143
# # Copyright (C) 2021 Satoru SATOH <satoru.satoh@gmail.com> # License: MIT # # pylint: disable=missing-docstring, relative-beyond-top-level from ..multi_load import test_multi_types as multi from ..single_load import test_multi_types as single from . import common class SingleTestCase(common.SingleBase, single.TestC...
ssato/python-anyconfig
tests/api/load/test_multi_types.py
Python
mit
423
# -*- coding: utf-8 -*- import os import oss2 from oss2.models import (ConditionInlcudeHeader, Condition, Redirect, RedirectMirrorHeaders, MirrorHeadersSet, RoutingRule, ...
aliyun/aliyun-oss-python-sdk
examples/bucket_website.py
Python
mit
6,202
# flake8: noqa from .config import INFER_HOST from .main import run_app, runserver, serve_static
samuelcolvin/aiohttp-devtools
aiohttp_devtools/runserver/__init__.py
Python
mit
97
from textwrap import dedent import inspect from collections import OrderedDict from clusterjob import JobScript import pytest import logging try: from ConfigParser import Error as ConfigParserError except ImportError: from configparser import Error as ConfigParserError # built-in fixtures: tmpdir # pytest-captu...
goerz/clusterjob
tests/test_inifile.py
Python
mit
10,660
# MIT license # # Copyright (C) 2015 by XESS Corp. # # 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, modi...
xesscorp/xess_fp_wizard
xess_fp_wizard.py
Python
mit
18,484
# ghostAgents.py # -------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley.e...
DominikDitoIvosevic/Uni
AI/lab2/ghostAgents.py
Python
mit
3,390
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import errno import json import logging import threading import time import websocket import parlai.chat_service.utils.lo...
facebookresearch/ParlAI
parlai/chat_service/core/socket.py
Python
mit
5,922
from os import path from .taskqueue import TaskQueueClient __all__ = ['TaskQueueClient'] with open(path.join(path.dirname(__file__), 'version.txt')) as fp: __version__ = fp.read().strip()
guokr/asynx
asynx/asynx/__init__.py
Python
mit
194
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('finance', '0003_auto_20140929_0130'), ] operations = [ migrations.RemoveField( model_name='extract', ...
junqueira/balance
finance/migrations/0004_remove_extract_provider.py
Python
mit
355
import re from django.core.urlresolvers import reverse def test_view_with_scss_file(client, precompiled): """ Test view that renders *SCSS file* that *imports SCSS file from another Django app*. :param client: ``pytest-django`` fixture: Django test client :param precompiled: custom fixture that asse...
kottenator/django-compressor-toolkit
tests/integration_tests/test_views.py
Python
mit
3,738
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('studygroups', '0004_studygroupsignup_mobile'), ] operations = [ migrations.AddField( model_name='course', name='image', field=m...
p2pu/learning-circles
studygroups/migrations/0005_course_image.py
Python
mit
418
from django.core.management.base import BaseCommand from django_brfied.models import UnidadeFederativa, Municipio from ...migrations import UNIDADE_FEDERATIVA_ROWS, MUNICIPIO_ROWS class Command(BaseCommand): help = "Importa as UFs e os Municípios para a base" # requires_system_checks = False # def __init...
kelsoncm/django_brfied
django_brfied/management/commands/importar_uf_municipio.py
Python
mit
1,647
""" Author: Sam Ginzburg Description: This script reads in a blast2go sequence table output of GO Term mappings, and calculates frequencies of GO Terms at specific GO Levels Example run: python generate_pie_charts.py [blast2go_file.txt] [GO Level] """ import sys from GeneOntologyLibrary import obo_parser from GeneOnt...
SamGinzburg/GeneOntologyTools
generate_pie_charts.py
Python
mit
8,151
from DemoFramework import DemoFramework from LUIVerticalLayout import LUIVerticalLayout from LUIFrame import LUIFrame from LUILabel import LUILabel from LUIButton import LUIButton from LUIObject import LUIObject import random f = DemoFramework() f.prepare_demo("LUIFrame") # Constructor f.add_constructor_parameter(...
tobspr/LUI
Demos/B_Frame.py
Python
mit
1,147
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ meza.io ~~~~~~~ Provides methods for reading/writing/processing tabular formatted files Examples: basic usage:: >>> from meza.io import read_csv >>> >>> path = p.join(DATA_DIR, 'test.csv') >>> csv_record...
reubano/tabutils
meza/io.py
Python
mit
52,280
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-29 22:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('almoxarifado', '0001_initial'), ] operations = [ migrations.A...
rvmoura96/projeto-almoxarifado
almoxarifado/migrations/0002_auto_20170929_1929.py
Python
mit
1,726
from numpy import * from cmlib import showMatr A = matrix([[1, 2, 0], [0, 2, 2]]) B = matrix([[3, -1], [-1, 3], [1, 0]]) res = (A * B).T showMatr(array(res))
FeodorM/amm_code
cm/lab_3/2_.py
Python
mit
205
import os from setuptools import setup, find_packages from pip.req import parse_requirements #REQUIREMENTS_FILE = os.path.join( os.path.dirname(__file__), 'requirements.openshift.txt') PROJECT_NAME = '<your-project-name>' AUTHOR_NAME = '<your-name>' AUTHOR_EMAIL = '<your-email-address>' PROJECT_URL = '' DESCRIPTION =...
appsembler/symposion-openshift-quickstart
setup.py
Python
mit
618
from distutils.core import setup setup( name='stompy', version='0.1', packages=['stompy', 'stompy.grid', 'stompy.io', 'stompy.io.local', 'stompy.model', 'stompy.model.delft', 'stompy.model.fvcom', 'stompy.model.pypart', 'stompy.model.suntans', 'stompy.plot', 'stomp...
rustychris/stompy
setup.py
Python
mit
603
""" Copyright (C) 2014 Maruf Maniruzzaman Website: http://cosmosframework.com Author: Maruf Maniruzzaman License :: OSI Approved :: MIT License """
kuasha/cosmos
cosmos/schema/object.py
Python
mit
154
from django.contrib import admin from holidays.models import (Holiday, StaticHoliday, NthXDayHoliday, NthXDayAfterHoliday, CustomHoliday) class HolidayAdmin(admin.ModelAdmin): pass class StaticHolidayAdmin(admin.ModelAdmin): pass class NthXDayHolidayAdmin(admin.ModelAdmin): pass cl...
dannybrowne86/django-holidays
holidays/holidays/admin.py
Python
mit
720
""" gof.py gof stands for Graph Optimization Framework The gof submodule of theano implements a framework for manipulating programs described as graphs. The gof module defines basic theano graph concepts: -Apply nodes, which represent the application of an Op to Variables. Together these make up a graph. -The...
nke001/attention-lvcsr
libs/Theano/theano/gof/__init__.py
Python
mit
2,704
def validate(hand): if hand < 0 or hand > 2: return False return True def print_hand(hand, name='ゲスト'): hands = ['グー', 'チョキ', 'パー'] print(name + 'は' + hands[hand] + 'を出しました') def judge(player, computer): if player == computer: return '引き分け' elif player == 0 and comp...
hellomichiyabu/Practice
Python/じゃんけんゲーム/utils.py
Python
mit
567
# -*- coding: ISO-8859-1 -*- """ Form Widget classes specific to the geoSite admin site. """ # A class that corresponds to an HTML form widget, # e.g. <input type="text"> or <textarea>. # This handles rendering of the widget as HTML. import json from django.template.loader import render_to_string from .conf import ...
ivandm/django-geopositionmap
geopositionmap/geoWidgets.py
Python
mit
2,620
#!/usr/bin/env python3 #!/usr/bin/python # https://en.wikipedia.org/wiki/Matplotlib import numpy import matplotlib.pyplot as plt from numpy.random import rand a = rand(100) b = rand(100) plt.scatter(a, b) plt.show()
jtraver/dev
python3/matplotlib/plot1.py
Python
mit
220
#!/bin/python import sys import vlc import os import re from tempfile import * from gtts import gTTS from remote2text import RGBRemote2Text parser = RGBRemote2Text(verbose=True) while True: ir_out = input() response = parser.process(ir_out) if response: tts = gTTS(text=response, lang='pt') ...
Macmod/rgb-remote-tts
remote-gtts/remote2gtts.py
Python
mit
507
from .apps.page import views as page assert page
andreif/heroku_django
project/views.py
Python
mit
49
#!/usr/bin/python simulation = "L500_NR_tracers" dirs = {"sim_root_dir" : "/home/fas/nagai/kln26/group_scratch/L500_NR_tracers", "db_dir" : "..", "halo_catalog_dir" : "HC.500", "profiles_dir" : "profiles", "logs_dir" : "logs" } hc_radius = "500c" halo_list_radii = ["200m", "500c", "20...
cavestruz/L500analysis
caps/migration/config.py
Python
mit
663
# Django settings for flexy project. import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django_mongodb_engine', 'NAME': 'sheesh', ...
sheeshmohsin/venturesity
flexy/flexy/settings.py
Python
mit
5,241
import gdsfactory as gf import gdsfactory.simulation.gtidy3d as gt from gdsfactory.config import CONFIG from gdsfactory.simulation.gtidy3d.get_results import get_results # def test_results_run(data_regression) -> None: # """Run simulations and checks local results.""" # component = gf.components.straight(leng...
gdsfactory/gdsfactory
gdsfactory/simulation/gtidy3d/tests/test_results.py
Python
mit
855
#!/usr/bin/env python3 # # # copyright Kevin Walchko # # Basically a rostopic from __future__ import print_function import argparse import time # from pygecko import TopicSub from pygecko.transport import zmqTCP, GeckoCore from pygecko.multiprocessing import GeckoPy from pygecko.test import GeckoSimpleProcess # from ...
walchko/pygecko
dev/services/test.py
Python
mit
1,384
from shutil import copy from tkinter import * from tkinter import filedialog from tkinter import ttk from .GetStaticData import * from .SetStaticData import * # The following handles everything to do with the gui. (main) # variables starting with var are default values; when the user changes the value of a ui elemen...
sirNoolas/PA-Save-editor
gui.py
Python
mit
19,373
import logging import traceback import sys from celery import Celery from .callbacks import STATUS_LOADING_DATA from .config import get_engine, _set_connection_string from .loader import FDPLoader from .callbacks import do_request, STATUS_INITIALIZING, STATUS_FAIL, STATUS_DONE app = Celery('fdp_loader') app.config_f...
openspending/babbage.fiscal-data-package
babbage_fiscal/tasks.py
Python
mit
2,046
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-05 13:59 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('marketplace', '0012_auto_20170604_1335'), ] operation...
MOOCworkbench/MOOCworkbench
marketplace/migrations/0013_auto_20170605_1359.py
Python
mit
601
import _plotly_utils.basevalidators class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="thicknessmode", parent_name="densitymapbox.colorbar", **kwargs ): super(ThicknessmodeValidator, self).__init__( ...
plotly/python-api
packages/python/plotly/plotly/validators/densitymapbox/colorbar/_thicknessmode.py
Python
mit
587
#Camera App #copyright (c) 2015 Tyler Spadgenske # MIT License import sys import pygame import picamera import io import yuv2rgb import os import time from subprocess import Popen class Stream(): def __init__(self): self.mode = 'capture' self.deleted = False self.uploading = False ...
spadgenske/TYOS
apps/camera/app.py
Python
mit
8,419
from django.conf import settings from django.contrib.auth.models import User from django.contrib.postgres.search import SearchVector, SearchQuery, SearchRank from django.core.urlresolvers import reverse from django.db import models from github import UnknownObjectException from social.apps.django_app.default.models imp...
ZeroCater/Eyrie
interface/models.py
Python
mit
4,056
# Explore some possibilities for optimizing the grid. from __future__ import print_function from . import (paver,trigrid,orthomaker) from ..spatial import field import sys import numpy as np # from numpy import * from scipy.linalg import norm # from pylab import * import matplotlib.pyplot as plt class OptimizeGui(...
rustychris/stompy
stompy/grid/optimize_grid.py
Python
mit
18,033
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "quotoxic.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
benjsto/ronquixote
manage.py
Python
mit
252
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "quickly.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
wearespindle/quickly.press
manage.py
Python
mit
276
import pymysql from flask_restful import Resource from flask import abort ALLOWED_SHOW = ('processlist', 'databases', 'plugins', 'privileges') class Mysql(Resource): def __init__(self): self.connection = pymysql.connect(user='root') self.cursor = self.connection.cursor() def _execute(self, s...
natict/roomservice
roomservice/mysql.py
Python
mit
1,306
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/application_gateway_web_application_firewall_configuration.py
Python
mit
2,579