blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
6219060617ca65c4877bcbed4b7357ad1079db99 | 43693b4e5bb93c5ba7d3bc2adb23eed0b9ca31ee | anirudhagar13/Textclassifier | /TextClassifier/spacywrapper.py | Python | py | 2,818 | no_license | import spacy
class SWrapper:
'''
A class to encapsulate all functionalities that can be exploited from spacy linguistics
'''
def __init__(self, inp_sent):
'''
Initializing inp sentence inside constructor
'''
self.inp_sent = inp_sent
# Processing sentence
en_nlp = spacy.load('en_core_web_sm')
self.do... |
d66eab166c84bca33f88ce0ed87812856051766b | a08cfb48f9650917ec10c9796cb1bcd0e7dea18f | counterjack/gartner-assignment | /users/migrations/0001_initial.py | Python | py | 3,229 | no_license | # Generated by Django 3.0.4 on 2020-03-21 06:39
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_fsm
import users.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(set... |
ec93bdc7a00d2e7a75311cb506caf0301aee3037 | 358fa9735acb6503df8bb7c0720830017ebf74a4 | justinrsmith/test51 | /cms/migrations/0023_auto_20170208_0955.py | Python | py | 1,318 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-08 15:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cms', '0022_auto_20170208_0845'),
]
operations = [... |
6d0cb53b43f051b5edd42198a10c0bac01927329 | 444dfb70a69a6914f2b498a0ccfcea6248c2414d | westofpluto/django_custom_auth_user | /tests/auth_token/commands/test_create_auth_token_command.py | Python | py | 790 | permissive | # -*- coding: utf-8
# Core
import pytest
from mixer.backend.django import mixer
# Models
from custom_auth_user.models import User
from custom_auth_user.models import AuthToken
# Store
from custom_auth_user.auth_token.store import AuthTokenStore
# Commands
from custom_auth_user.auth_token.commands.create_auth_token_c... |
5e67b1996cbcaf660d3ff22e12bcda8b5a2a15e8 | a4034eb8fba18df7e011295bd02594624f7db465 | pulumi/pulumi-google-native | /sdk/python/pulumi_google_native/beyondcorp/v1alpha/get_connection.py | Python | py | 7,505 | permissive | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _u... |
67c720f7c29644c4027105bf6b0f9c62286117b1 | a387936ef0558650d7163e534d25be78ca1f13f7 | davidhousedev/the_dancing_fools_and_feats | /the_dancing_fools_and_feats/the_dancing_fools_and_feats/base.py | Python | py | 3,511 | no_license | """
Django settings for the_dancing_fools_and_feats project.
Generated by 'django-admin startproject' using Django 1.11.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/sett... |
39a0e09bc3cad3ce769e218d4b1d22f27dfcbf78 | dabf8cf92035020dce28340eb5bc7859cc459ab3 | mluessi/nitime | /doc/examples/multi_taper_coh.py | Python | py | 8,071 | permissive | """
.. _multi-taper-coh:
================================
Multi-taper coherence estimation
================================
Coherence estimation can be done using windowed-spectra. This is the method
used in the example :ref:`resting-state`. In addition, multi-taper spectral
estimation can be used in order to calc... |
d8115ad09ab99741d0d24c7484d0206e5c890993 | eb7f60eb1f31d0fb5801a2f4320c16a200ebc6ef | hattne/cctbx_project | /iotbx/regression/tst_data_manager.py | Python | py | 24,667 | permissive | from __future__ import absolute_import, division, print_function
import os
import iotbx.phil
import libtbx.load_env
import libtbx.phil
import mmtbx.model
from cctbx import crystal
from libtbx.program_template import ProgramTemplate
from libtbx.utils import Sorry
from iotbx.data_manager import DataManager
from six.mo... |
9b673bec4ac8ef42317e73963078a963140d1576 | d8dfc6d1e366a907efbc0b93c251ef01ccb90166 | buchanae/gwftool | /gwftool/engine.py | Python | py | 9,936 | no_license |
import os
import time
import json
import shutil
import threading
import subprocess
from datetime import datetime
def which(program):
for path in os.environ["PATH"].split(":"):
p = os.path.join(path, program)
if os.path.exists(p):
return p
def expand_galaxy_input_dict(val):
"""
... |
376acad1e1bfa68999350ff38c88b09cc1d413c1 | d06a7551b5a323dee97d071bab05144dd5269457 | sethmlarson/urllib3 | /test/with_dummyserver/test_connection.py | Python | py | 3,827 | permissive | from __future__ import annotations
import typing
from http.client import ResponseNotReady
import pytest
from dummyserver.testcase import HTTPDummyServerTestCase as server
from urllib3 import HTTPConnectionPool
from urllib3.response import HTTPResponse
@pytest.fixture()
def pool() -> typing.Generator[HTTPConnection... |
951ef7f750f7f6622c0137559aa9c15a23fd55bb | d65e1af50e01715c24b1ba8227e8373070a24301 | dolekapil/PythonAssignments | /testing.py | Python | py | 398 | no_license | __author__ = 'dolek'
def checkPeriodic(bits, length):
#fact = factors(length)
#for n in fact:
s = bits
i = (s+s).find(s, 1, -1)
if i == -1:
pass
else:
return True
return False
def factors(length):
result = []
for i in range(1, length):
if length % i == 0:
... |
408128b26be688b3498495c87b1882f759a92127 | 4f27c4d30198d9c1d5ca5908edfa834b14cdb15c | AdamZhouSE/pythonHomework | /Code/CodeRecords/2609/60761/248149.py | Python | py | 526 | no_license | def kthInt(numlist,k):
numset=set(numlist)
if(len(numset)<k):
return "-1"
else:
i=k
for num in numlist:
if numlist.count(num)==1:
if num in numset and i>=2:
numset.remove(num)
i=i-1
elif num in numset... |
8ebfe53e945b8bca1207585397d337d392ccd73d | f1990d83657848ce7848b7070e36056309c3c3a7 | Heronalps/GO_AWS_Lambda | /Latency_Experiment/Python/Latency_Dest.py | Python | py | 857 | no_license | import os
import sys
import logging
import rds_config
import pymysql
import time
#rds_settings
rds_host = "latencyexperiment.cxfpxjlukepw.us-west-2.rds.amazonaws.com:3306"
name = rds_config.db_username
password = rds_config.db_password
db_name = rds_config.db_name
logger = logging.getLogger()
logger.setLevel(logging.... |
ba87d62567876a6109d1605c73775f06291773d7 | 0aede009fa1f426964b2b0c2b788689a943b47e6 | Sammadan/Open-Cv-For-SDC | /hough_transform.py | Python | py | 405 | no_license | import cv2
import numpy as np
img = cv2.imread('square.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150)
minLineLength = 100
maxLineGap = 0
lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
for line in lines:
for x1,y1,x2,y2 in line:
cv2.line(img,(x1,y1)... |
94f192fa50ba2da1313ef70458b8896d89506037 | 949ebed2738beaa58b6ec92c024e0e37ba8b01dc | turalyang/ml-in-action | /src/kNN/kNN.py | Python | py | 5,931 | no_license | #!/usr/bin/env python
# coding: utf-8
'''
Created on Sep 16, 2010
Update on 2017-05-18
@author: Peter Harrington/羊三/小瑶
《机器学习实战》更新地址:https://github.com/apachecn/MachineLearning
'''
from numpy import *
# 导入科学计算包numpy和运算符模块operator
import operator
from os import listdir
from collections import Counter
def createDataSet... |
86fb28be8f5090ed825d00fc13c396e14c129158 | e63be0f5c1b86307d28625a3a7eece4cc57c5dca | Afoucaul/docgui | /docopt_gui/application.py | Python | py | 2,571 | no_license | import tkinter as tk
from . import usage_parser
from . import utils
class Application(tk.Tk):
def __init__(self, path):
super().__init__()
self.path = path
self.script = utils.load_module(self.path, 'script')
self.commands = usage_parser.get_commands(self.script.__doc__)
... |
1a0e981d665571a70cf3dee7f1410ad3e3c00f86 | 35e1517fa8ee4020577f90e622f83c713d470d40 | Leu552/51_job_spider | /data_view/plt_0.py | Python | py | 573 | permissive | import matplotlib.pyplot as plt
import numpy as np
import urllib
import matplotlib.dates as mdates
def graph_data(stock):
stock_price_url = 'http://chartapi.finance.yahoo.com/instrument/1.0/'+stock+'/chartdata;type=quote;range=10y/csv'
source_code = urllib.request.urlopen(stock_price_url).read().decode()
... |
25ca9be293235e5bfffd356c8eb1e76b7549fb91 | a7e7a0a211cfc95a470ab0657c2bd69bfc7b82b9 | xh4vm/oracle_shop | /oracle_client/shop/app/database/__init__.py | Python | py | 8,977 | no_license | from app import db, jwt, oracle_schema, views
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
from sqlalchemy.dialects.oracle import RAW, NUMBER, VARCHAR2, TIMESTAMP
import sqlalchemy_views
from sqlalchemy import Table, text, DDL, event
from random import choice
i... |
8e863f5f2d1cff7c37066798bf4b847632d3491c | 7698381137d9d25699cdad46af5f301d6b6d9970 | cxh214917/api_test | /commons/read_write_excel.py | Python | py | 5,098 | no_license | # -*-coding:utf-8-*-
"""
****************************************
author:善待今天
time:2019/07/01 23:10
file:read_write_excel.py
software:PyCharm Community Edition
E-mail:2904504961@qq.com
Motivational motto: Do difficult things and get something
****************************************
"""
import openpyxl
class Case:
... |
3205e1b237807ea785a8bdfc8ce38b28268486bd | c7c9373c9d86682fe82be82d27b2b4d21e8cedd5 | Azure/azure-cli-extensions | /src/connectedmachine/azext_connectedmachine/vendored_sdks/connectedmachine/_configuration.py | Python | py | 3,255 | permissive | # 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 ... |
f34166885b93e2a6f26be675a61dfa2d32a9934a | d080c0375ec561aeacd215b607de9e82a230b93f | znypah777/async_binance | /async_binance/api/sections/public.py | Python | py | 1,744 | no_license | import aiohttp
from typing import Dict, Union, Any
from ..query_helpers.bases import Queryer
from ..query_helpers import get_factory, post_factory, delete_factory
def v1_public(base_url: str=None,
secrets: Dict[str, str]=None,
request_params:Dict[str, Any]=None,
session:aio... |
47bbe43fedb3cc3c4b5351090ef391d5c616faeb | adc91f6a92b0ede325d5780be4159354bba3e4e2 | IvanHornung/IoT-RaspberryPi | /Course 2 - Interfacing with the Raspberry Pi/Module 2 - Socket Interface/Assignments/SimpleWebServer.py | Python | py | 886 | no_license | '''
Use the socket to write a simple web server running on your Raspberry Pi.
When your server receives a request it should print “Got a request!” to the screen of the Raspberry Pi.
Turn in your code and turn in a screen shot of your Raspberry Pi’s screen with “Got a request!”
printed in order to demonstrate that it w... |
593b04c3d68c487c9bd121d4596039382e709366 | 8dd83af7cfbafff2b2e134f205e2543ddd1debcd | jhedfors/Python_7.Django | /9.Survey_Form/manage.py | Python | py | 254 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Survey_Form.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
a928f81964f951e5455052eefaba9db93d137f0d | 88259818f9b969b68e899da5b825ed31502906ba | srsandeep/squad_spider | /squad_spider/middlewares.py | Python | py | 3,607 | no_license | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class SquadSpiderSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scr... |
d50579e85f6aedfce2b7d07d56d1068def7795f6 | ee887235efad964da223b2a393193d40ac1aff61 | danghermang/proiect_ebs | /shared.py | Python | py | 7,670 | no_license | #!/usr/bin/env python3
import datetime
import json
import random
import time
import names
import pika
import os
import logging
if not os.path.exists("./logs/"):
os.makedirs("./logs")
if __name__ == "__main__":
logging.getLogger(__file__)
logging.basicConfig(filename=os.path.join("./logs/", os.path.basename... |
014f56d528d7b6378a6b46ca4bbd08d0a01244aa | 56822a16fe798ed2c3a10f4d7914b989ca6612a5 | zcsxll/cv_bilinear_interpolation | /main.py | Python | py | 2,141 | no_license | import torch
import numpy as np
def bilinear_interpolation(img_in, scale_factor=2):
shape = img_in.shape
assert(len(shape) == 4)
assert(shape[0] == 1)
img_in = img_in[0]
height = shape[2] * scale_factor
width = shape[3] * scale_factor
img_out = np.zeros((shape[1], height, width)).astype(np... |
4765c9c0e10a17d418ed4af8ee6445a96946a826 | 02410dbbfcae7af6f3b8ace1f7a9c6843f23ad16 | dalong12/off_nitrogens | /off_nitrogens/tests/test_perturb.py | Python | py | 1,518 | permissive | from off_nitrogens.calc_improper import *
from off_nitrogens.perturb_angle import *
import numpy as np
def test_move_valence():
"""Test a (changed valence, same improper) move on simple coordinates."""
# atom0 is central, atom3 is being moved
atom0 = np.asarray([0,0,0])
atom1 = np.asarray([0,1,-1])
... |
19d42bc45d24859fef6ee78eb772ab7d8c5fc4d6 | 8fffae791e45a24b0d501c7c0fba1d5f842be332 | arfc/annsa | /examples/source-interdiction/results-notebooks/aux_functions.py | Python | py | 9,200 | permissive | import numpy as np
from glob import glob
from sklearn.metrics import f1_score
import matplotlib.pyplot as plt
import os
from sklearn.preprocessing import LabelBinarizer
import matplotlib.colors
from annsa import read_spectrum
def ensemble_predictions(members, scaler, testX):
# scale inputs
testX_scaled = scale... |
98e42a86d2a0375f2ba3f1a3024fbf75de54c1e2 | 0a267ff099724cd7c45e30781bf7d3b30ac4fc52 | danilobellini/wta2015 | /code/41_dict_missing.py | Python | py | 810 | no_license | # coding: utf-8
from __future__ import unicode_literals
# Vamos remover acentos!
class DictDefaultsToKey(dict):
def __missing__(self, key):
return key
rev_ascii = {
"a": "áàãâāäă", "A": "ÁÀÃÂĀÄĂ",
"e": "éèẽêēëĕ", "E": "ÉÈẼÊĒËĔ",
"i": "íìĩîīïĭ", "I": "ÍÌĨÎĪÏĬ",
"o": "óòõôōöŏ", "O": "ÓÒÕÔŌÖŎ",
"u":... |
97581d32b46c17ade36a1966dc4330019e9d15fb | c102f266b1215a2e3e26ac52c0815751ab0a8206 | sd8917/EduResource | /shop/utils/email_sender.py | Python | py | 893 | no_license | import requests
from digitatShop.settings import EMAIL_SERVICE_ENDPOINT,EMAIL_SENDER_EMAIL,EMAIL_SENDER_NAME,EMAIL_API_KEY
import json
def sendEmail(name,email,subject,htmlContent):
payload = {
"sender": {
"name": EMAIL_SENDER_NAME,
"email": EMAIL_SENDER_EMAIL
},
... |
facea2538cd00c00be6187e98b660000a65bfe6a | c91db1ac1b0d1e07b566a1c93811f86e75780d88 | zephms/Right-Menu-To-Copy-Path | /src/rightClick.py | Python | py | 511 | no_license | import sys
import win32clipboard as w
if len(sys.argv)<3:
quit()
args = sys.argv
fullPathName = args[2][1:-1]
# 当最后一个是斜杠的时候会有问题,但是暂时没出现最后是斜杠的情况
if args[1]=="name":
cp = fullPathName.split("\\")[-1]
elif args[1]=="pathu":
cp = fullPathName
elif args[1]=="pathd":
cp = fullPathName.replace("\\","/")
# ... |
682a8df517d729c0259935e4860d75c1f5d28b1d | 9ac104fca4b7b68251e07d98ecaaf4daa51c2f3d | hma02/pytorch-CycleGAN-and-pix2pix | /datasets/copy_uncrop_staff.py | Python | py | 1,611 | permissive | from glob import glob
# trainA = glob('staff_makeup/trainA/*.jpg')
# trainA = [t.split('/')[-1] for t in trainA]
# print(trainA)
mnt_path_lipstick = '/mnt/Data/Data/lipstick/single_lipstick_staff/lipstick/'
mnt_path_no_lipstick = '/mnt/Data/Data/lipstick/single_lipstick_staff/no_lipstick/'
from shutil import copyf... |
11140f6acb8f92cd5ba523e5ec31a721c834beea | 68b9210ffa755b3765a678b206f72f9ab0bda748 | Lammatian/AdventOfCode | /2017/10/AoC10_2.py | Python | py | 572 | no_license | from functools import reduce
with open("input10.txt", "rb") as f:
ls = list(f.read()) + [17, 31, 73, 47, 23]
code = list(range(256))
current = 0
skip = 0
for _ in range(64):
for l in ls:
selection = [code[(current + i)%len(code)] for i in range(l)]
rev = list(reversed(selection))
for i in range(l):
code[... |
c2f8395794f6b06c17e6a6fae7435783a38dc6d6 | 67320a6a067963c7a0c0ac5debba21bca365bda7 | zbjlala/FirstTDD | /TDD/test/functional_test.py | Python | py | 1,958 | no_license | from selenium import webdriver
import unittest
from selenium.webdriver.common.keys import Keys
class NewVisitorTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Chrome()
self.browser.implicitly_wait(3)
def test_can_start_a_list_and_retrieve_it_later(self):
# 伊迪丝听说有... |
433970ec48152e20874d02d5a20b076459f198c2 | fd023170941bd90f8376625edd94afc6dc3148f5 | sofialevin/Algorithms | /recipe_batches/recipe_batches.py | Python | py | 1,020 | no_license | #!/usr/bin/python
import math
def recipe_batches(recipe, ingredients):
recipe_amounts = [*recipe.values()]
ingredient_amounts = [*ingredients.values()]
max_batches = ingredient_amounts[0] // recipe_amounts[0]
for i in recipe:
if ingredients.get(i):
ratio = ingredients[i] // recipe[i]
if ratio... |
2c74d91cb7b44ca525d8a951579786cd51f9d85a | 3a41bcbebb15c6619c0ee984c5e196a80167a0b5 | Morphnus-IT-Solutions/riba | /scripts/ezone_specifications.py | Python | py | 4,013 | no_license | #!/usr/bin/python
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tinla.nuezonesettings'
ROOT_FOLDER = os.path.realpath(os.path.dirname(__file__))
ROOT_FOLDER = ROOT_FOLDER[:ROOT_FOLDER.rindex('/')]
if ROOT_FOLDER not in sys.path:
sys.path.insert(1, ROOT_FOLDER + '/')
# also add the parent folder
PARENT_... |
85c5ab747fd1ac6e6f03c0e885ea166fe0ee91b3 | dc3d5efaf7017345d308a0fb14bcf46d88443fbc | vivmarshall/django | /testsite/testsite/urls.py | Python | py | 802 | no_license | """testsite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
73be05b6bb7ed695f512816c4a3f8ad56815c7c2 | d650ebcc0f8f0a5519c4c3a5b7d6b41ac4a5bc15 | lukasklein/PyPDF2 | /PyPDF2/generic.py | Python | py | 45,297 | permissive | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 copyrig... |
cc52a50d0c97ac7c2617d9b6fccd595d92916fa1 | 064b2134c568414f757d6c46dcdcf1f06c279e00 | xlong0513/Brain_inspired | /lsnm_in_python/visual_model/subject_tvb/output.RestingState.198_8_0.0642/sim_without_LSNM.8_0.0642.py | Python | py | 18,100 | permissive | # ============================================================================
#
# PUBLIC DOMAIN NOTICE
#
# National Institute on Deafness and Other Communication Disorders
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright ... |
80ce6208823f764f765bfe570bc0aa102ef08fc4 | 978d749ff4a2cf58a9fc1125d3a2b5b8e4eb2e6c | iwasnevergivenaname/monikr | /main_app/migrations/0009_artist_bg_color.py | Python | py | 397 | no_license | # Generated by Django 3.1.1 on 2020-09-27 01:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0008_artist_user'),
]
operations = [
migrations.AddField(
model_name='artist',
name='bg_color',
... |
52570831ee8f1ec29bbbef20385b15b474f8487d | a8222ba5eeec13ce29162a35fe57efd3e8d5c13a | Aasthaengg/IBMdataset | /Python_codes/p02763/s826715438.py | Python | py | 1,111 | no_license | def main():
n = int(input())
a = ord("a")
orda = lambda x: ord(x)-a
s = list(map(orda, list(input())))
q = int(input())
bits = [BIT(n) for _ in range(26)]
for i, si in enumerate(s, 1):
bits[si].add(i, 1)
for _ in range(q):
t, i, c = input().split()
i = int(i)
... |
edd0cbf048dc653c0f3ecd1f2538a891a7d675bd | 04562fe5582bff4a37a90a9d7530763e089daa0a | thisisziihee/djangoCommunity | /board/views.py | Python | py | 1,808 | no_license | from django.shortcuts import render, redirect
from .models import Board
from .forms import BoardForm
from users.models import Users
from django.core.paginator import Paginator
from django.http import Http404
from tag.models import Tag
def board_write(request):
if not request.session.get('user'):
return re... |
a193794891b0921995648108466333b62d7b47ba | 9642bbdd099d7e3064d0697650012f064616ba73 | prateekParab20/Deep-learning-for-checking-performance-with-limited-precision-on-GPU-s | /mnistmodel.py | Python | py | 2,749 | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 27 20:17:57 2017
@author: Quantum
"""
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import ... |
277c0938f35bd7967600c59fa8cc0ea0bb42552e | 4d155f676ffb8f086b198d8eae4fcd1552ca13a0 | Mieussep/striplog | /tests/test_striplog.py | Python | py | 11,970 | permissive | # -*- coding: utf 8 -*-
"""
Define a suite a tests for the Striplog module.
"""
import numpy as np
import pytest
from striplog import Component
from striplog import Interval
from striplog import Legend
from striplog import Lexicon
from striplog import Striplog
from striplog.striplog import StriplogError
las3 = """~Li... |
97e5411bf12127cfc9702a10d1a5e1bbd62cf0e7 | 097f50390ebe9029d21998deb203668093cd91da | Aquaveo/xmsgrid | /_package/tests/unit_tests/ugrid_tests/ugrid_pyt.py | Python | py | 60,492 | permissive | """Test UGrid_py.cpp."""
import unittest
from xms.grid.ugrid import UGrid
class TestUGrid(unittest.TestCase):
"""UGrid tests."""
@staticmethod
def get_simple_quad_ugrid():
"""Returns a simple quad UGrid."""
import numpy as np
points = np.array(((0, 10, 0), (10, 10, 0), (20, 10, 0... |
78567ec3759386858ea9d25903bdcc6f642468f0 | b2b24776c60183113a5f936dd276ff312d6d0079 | snuspl/tensorflow | /tensorflow/contrib/learn/python/learn/monitors_test.py | Python | py | 33,518 | permissive | # 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... |
72392b8e16e62dbb1133831584cff90718838d90 | b5352fa781fa50651697c1a124e805f529bb223d | drpott/trigger35 | /trigger/netdevices/__init__.py | Python | py | 37,849 | no_license | # -*- coding: utf-8 -*-
"""
The heart and soul of Trigger, NetDevices is an abstract interface to network
device metadata and ACL associations.
Parses :setting:`NETDEVICES_SOURCE` and makes available a dictionary of
`~trigger.netdevices.NetDevice` objects, which is keyed by the FQDN of every
network device.
Other in... |
5e5abc4d9ac5dbe54918a029d7290bf6310f7d7b | c76aa4c2e4f3874ff384bfc40faeca3c5bb2e9b5 | kwcooper/congress_analysis | /congress.py | Python | py | 1,543 | no_license |
# this is limited by its need to have the session info etc.
import json
import requests
def proAPI():
key = 'JzeVIAj87jLigjawkeddvpbxi1yDZmnIGHjBsMuV'
#url = "https://api.propublica.org/congress/v1/115/senate/members.json"
# get recent bills
url = "https://api.propublica.org/congress/v1/115/house/bills/introduc... |
bbaa8b780fd85ea145052a09eb3eec959a1cdf20 | c8a9334091725e92010f5c0bf8e40d742e5a807a | VJ-Ivanov/exam_project | /exam_project/accounts/urls.py | Python | py | 609 | no_license | from django.urls import path, include
from exam_project.accounts.views import SignUpView, SignOutView, SignInView, UserProfileView
from exam_project.accounts.receivers import user_created
urlpatterns = (
path('', include('django.contrib.auth.urls')),
path('profile/', UserProfileView.as_view(), name='current u... |
20a6a40f58501c82e99cc18e347f16aef263f784 | e66ba2ad5856db0b3fcb881dd0551854921d52f4 | rynldtbuen/cumulus-vxconfig | /cumulus_vxconfig/gns3.py | Python | py | 2,664 | permissive | import requests
import json
'''
Future project to use GNS3 API to provision a GNS3 project base on the
variable define in 'master.yml'
'''
base_url = "http://10.0.0.254:3080/v2"
class GNS3Project:
def __init__(self, base_url, project_name):
self.base_url = base_url
# self.url = '{}/{}'.format(ba... |
9148a179de1721e2004d184e09ffc3d9b444cfb3 | 5b369713d1806ae36ed831b7a1a1a5014cb22722 | cakenggt/jpass | /urls.py | Python | py | 377 | no_license | from django.conf.urls import url
from rest_framework.authtoken import views as authViews
from . import views
urlpatterns = [
url(r'^api-token-auth/', authViews.obtain_auth_token),
url(r'^get-vault/$', views.GetVaultView.as_view(), name='get-vault'),
url(r'^set-vault/$', views.SetVaultView.as_view(), name=... |
fa2d0048b15a035803d94fa3597c7e87468346cd | 2dfe4f116a88cb1cdcbeaa2b261706eb5b01cb26 | peternara/image-retrieval-nsml | /nets/inception_resnet_v2_se.py | Python | py | 26,338 | no_license | # 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 applicable ... |
fd4eccce603ae0d7c982ce6e91d301a07552fb62 | 08c63e3fd71788bb71a08ded9a8b86cecb288416 | tr37ion/sadm | /python-lib/prologin/mdb/management/commands/ansible.py | Python | py | 1,990 | no_license | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 Rémi Audebert <remi.audebert@prologin.org>
#
# Prologin-SADM is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
9228141de634d9b0b43d22299df82ea6b2111a39 | 38ee1014f8aad683767c6b902b57f2389d742cba | tiansp/NetOpsBase | /app/modeExport.py | Python | py | 4,385 | no_license | # https://pypi.org/project/drf-renderer-xlsx/
# 为了避免流传输的文件没有文件名(浏览器通常将其默认为没有扩展名的 download)
# 需要使用 mixin 覆盖 Content-Disposition标头
# 如果未提供文件名则默认为 data.xlsx。
from app import models, modelSerializers
from drf_renderer_xlsx.mixins import XLSXFileMixin
from drf_renderer_xlsx.renderers import XLSXRenderer
from rest_framework.... |
51f22e4eefa971eb339580ee0f26ebeda7a36867 | 93568825c35f6544e3c78f9666c894b216cb94fe | ikaushikpal/Discord-Bots | /Simple Calculate Bot/my_logger.py | Python | py | 474 | no_license | import logging
def my_logger():
logger = logging.Logger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(levelname)s - %(filename)s - %(process)d - %(asctime)s - %(message)s')
streamFormatter = logging.Formatter('%(levelname)s: %(asctime)s %(message)s')
streamHandler = logging.S... |
d8795d477c1193cdcf764e77ce3bc445d2c55274 | 92490563a7f269fbfd64379e67937e57ec6b52d9 | yogesh050993/banking_system | /common/migrations/0001_initial.py | Python | py | 2,315 | no_license | # Generated by Django 3.1.5 on 2021-01-12 07:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
9f2a577157e20ec8b08a4a725b972e164a01e630 | 12fc9f9e7ae30a643566ab1f8a43f0be1ecd6871 | carrl/rssreader | /apps/conf.py | Python | py | 749 | permissive | #! /usr/bin/env python
#-*- coding: utf-8 -*-
# 將 config 裡的 yaml 檔轉成 json 輸出
import cgi
import os
import yaml
import json
# 將傳入的參數,存成 辭典集
def cgiFieldStorageToDict( fieldStorage ):
params = {}
for key in fieldStorage.keys():
params[ key ] = fieldStorage[ key ].value
return params
params = cgiFiel... |
ef359279d7739f92000565dcac855fa5a4645384 | 5762fbeebc0f72539611767bcb5e0b3f8fd3f194 | LuisCGit/Dissertation_Git | /Disso_git/curvegnn/main_random_features.py | Python | py | 11,281 | no_license | import time,math,datetime,argparse,random,scipy.sparse,csv
import sklearn,sklearn.metrics,sklearn.cluster
import tensorflow as tf
import awesomeml2 as aml
import awesomeml2.utils as aml_utils
import awesomeml2.tensorflow.layers as aml_layers
import awesomeml2.tensorflow.layers_neww_parallel as aml_layers_p
import awes... |
6c12959ce91e5895ae3c8edd6176f5652ce04da9 | afda4d94ce67336a82a74a21e12f6dc3c4bc5b91 | anita86/PDD-EANT | /PDD M-J/Clase 5/csv_nube_mod.py | Python | py | 374 | no_license | import requests
import csv
from io import StringIO
url = 'https://eant.tech/cursos/recursos/peliculas.csv'
respuesta = requests.get(url)
contenido = respuesta.text
file = StringIO(contenido)
objeto_csv = csv.reader(file)
with open('pelis2.csv', 'w') as pelis:
for linea in objeto_csv:
fila = ','.join([linea[0... |
ff39e6538c6e8155cde1afe824cc11447138093c | 012356a8830ff434c8e8b3adaf2977e244599a6a | super0xie/Solution | /Python/ConvertSortedListtoBinarySearchTree.py | Python | py | 616 | no_license | import TreeNode
class Solution:
def sortedListToBST(self, head: ListNode) -> TreeNode:
if head == None:
return None
vals = []
while head != None:
vals.append(head.val)
head = head.next
return self.helper(vals, 0, len(vals)-1)
def helpe... |
4f39dfaf64b7056446884a399a40824ffce8c665 | f62b80a86593b0876b809b790103ef3b29fdbb4a | tharunShiv/unsupervised-Continuous-Learning-From-Time-Series-Using-Multiple-Observer-Method | /py_Shapelet.py | Python | py | 18,116 | no_license | from __future__ import division, print_function
from os.path import expanduser
from sklearn.metrics import confusion_matrix, classification_report
from shapelets_lts.classification import LtsShapeletClassifier
from shapelets_lts.util import ucr_dataset_loader
import pandas as pd
"""
This example uses dataset from t... |
95914383b240a76716fbaa1258cf5e7156021efa | 8e88857b26b75982cc25a96980bee2c2ad028086 | aguinane/typer | /docs_src/parameter_types/bool/tutorial002.py | Python | py | 338 | permissive | from typing import Optional
import typer
def main(accept: Optional[bool] = typer.Option(None, "--accept/--reject")):
if accept is None:
typer.echo("I don't know what you want yet")
elif accept:
typer.echo("Accepting!")
else:
typer.echo("Rejecting!")
if __name__ == "__main__":
... |
85f38c1d18d810981c6769e7bf9a551b46b8ad37 | 6fcd938cd6566803cdaa1ad9fd765dc177e76f70 | maneesh4848/movie_recommendation | /Code/preprocess_and_ratings/percep_train.py | Python | py | 2,302 | no_license | from sklearn import linear_model
import json
from sklearn.externals import joblib
def main():
BATCH_SIZE = 2000
percep = linear_model.Perceptron()
#opening files
train_reviews = None
with open("./final_dataset/train/all_reviews.json",'r') as f:
train_reviews = json.load(f)
print "Train ... |
c60c97f28e09feb13ffbb954f93f341a88c6e0ee | 11f26d182b6988ecb55f4e18615b771bb930e2d7 | edweck278/Sefaria-Data | /research/terms/possible_collective_titles_by_group.py | Python | py | 1,871 | no_license |
#prints out list of word appearances in index titles, along with the second most commonly appearing word per word grouping
indices_by_word = {}
num_by_word = {}
for index in library.all_index_records():
try:
index.collective_title
except AttributeError:
for word in index.get_title().split():
... |
1a73792ffa82023ffdab704c53a7e1960f4c246d | 577bb1ffabb1db9ff5b713446f2e114daf3cabef | kurtzeborn/azure-sdk-for-python | /sdk/recoveryservices/azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/activestamp/operations/_backup_jobs_operations.py | Python | py | 8,612 | permissive | # pylint: disable=too-many-lines
# 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) AutoRe... |
109a5d41f2756aff16e48ced4578e4714bda2b1d | 319990b0f51d42db947d02dce8eb7627d7e7ee2d | herstky/DES | /src/main_window.py | Python | py | 9,392 | no_license | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src/main_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCo... |
95cad5bb109569385307dab270e1eb01a741883b | 7f3eb94c29f54f4e6fcac2c84d1100dd7dda715d | thomasasfk/PlexSearchBot | /src/Telegram.py | Python | py | 705 | no_license | import os
import requests
class Sender:
tg_bot_key = os.environ['telegram_bot_key']
def __init__(self, chat_id):
self.chat_id = chat_id
def send(self, message):
params = (('text', message), ('chat_id', self.chat_id))
return requests.get(
'https://api.telegram.org/bo... |
5605333ee6536f9ae7b322a5c517a8841e4311ca | 3ef6b11d2ae117b2b4ad1430433c0f122bddebcf | thleu-ethz-ch/ngp-dag-layout | /experiments/scripts/multithreading_ordering/multithreading_ordering.py | Python | py | 585 | no_license | from experiments.bench.graphs import *
import experiments.bench.performance.breakdown as bd
layouters = []
for i in range(0, 11, 1):
layouters.append({'name': 'SUG-JS' + str(i), 'layouter': 'sugiyama', 'jointOrder': 'true', 'numShuffles': i, 'webWorkers': 0, 'maxWorkers': 0, 'breakdown': 1})
for i in range(0, 11, ... |
dfa75ac6a9eec7308607331d23a32827e477308f | 899ff8476cfde95a66e23f5a088fc18fc6c63f9f | danielekbom/Python_projekt | /boss2.py | Python | py | 948 | no_license | from graphics import *
import time
import random
import itertools
class Boss2:
eliminated = False
nextImageOrNot = 0
def __init__(self):
self.ball = Image(Point(1400,random.randint(50,580)),"images/boss2/1.gif")
self.currentImage = itertools.cycle('12345678')
def draw(self,window):
self.win=window
self... |
6972ad4197c8ed4563d490cd8be5060522c53924 | 34b0dc027f3618b3a672e98cdb8ac8307c38c2ac | Nirajey-git/E-learn | /educa/courses/api/serializers.py | Python | py | 1,473 | no_license | from rest_framework import serializers
from ..models import Subject
from ..models import Course, Module
from ..models import Content
class SubjectSerializer(serializers.ModelSerializer):
class Meta:
model = Subject
fields = ['id', 'title', 'slug']
class ModuleSerializer(serializers.Model... |
a5091cf474b6cfb3d50e0d98e4941870e25ff252 | 42d4e6439dbddda67a3c7ea68554fa4f2526f431 | annmariase/Music-Plagiarism | /mainprojectbackend/new/DupeScan/signin/migrations/0001_initial.py | Python | py | 616 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2018-02-15 05:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='signin',
... |
0ba4ddadd6dfb575bda9361b7f3e0d20a20e31eb | ef086a4013890a7c763fdbde64b36f9afc0dde4a | elektrischermoench/cryptanalysis | /boxes.py | Python | py | 12,098 | no_license | import numpy as np
########
## Helpers
########
def xor(b1: bytes, b2: bytes) -> bytes:
return bytes([i ^ j for i, j in zip(b1, b2)])
def print_state(bytes) :
np.set_printoptions(formatter={'int':hex})
deserialized_bytes = np.frombuffer(bytes, dtype=np.uint8)
return np.reshape(d... |
3198cd815958fe8f87004847a3316c7f7c399eac | 29fed2bdd054c79d9e8d6e066bd2103c822e2fbe | freedom-is-ours/IonTrap-WIPM | /repository/GUI 2.0.py | Python | py | 39,231 | no_license | from artiq.experiment import *
import numpy as np
from PyQt5 import QtCore, QtGui, QtWidgets
import os
import sys
class GUI2(EnvExperiment, object):
"""GUI 2.0"""
def build(self):
pass
def run(self):
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidge... |
eed41e9471d1134abd7fe6cfd501c905bedfd334 | d7f7a193c7abf00a845eb89edeb0d743441f26d3 | Infinidat/pyvisdk | /pyvisdk/do/not_supported_host_in_ha_cluster.py | Python | py | 1,182 | permissive |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def NotSupportedHostInHACluster(vim, *args, **kwargs):
'''A NotSupportedHostInHACluster f... |
c8be1798715f4faabf68364ddb6ac7226e4a25d3 | 6553c548c0c2ff9f1f6a78cf26907249d7b6a79f | Lariiii/HybridImageSegmentation | /convex_hull/generate_convex_png.py | Python | py | 2,110 | no_license | import pandas as pd
import matplotlib.pyplot as plt
import numpy
from dataPreprocessing import pruning
from PIL import Image
def dataframePreprocessing(dataframe):
min_x = 1000000
max_x = 0
min_y = 1000000
max_y = 0
for i, row in dataframe.iterrows():
dataframe.set_value(i, 'x', row['x'] /... |
cf7640e8810769a41508d322145d3cde50ab9f39 | ce91fce52b95a8ecc9dc428bc5a12c4dcd32fbb8 | hustyangjia/trajectory_tracking | /src/twist.py | Python | py | 400 | permissive | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
publisher = None
def send_computed_control_actions(msg):
publisher.publish(msg)
if __name__ == '__main__':
rospy.init_node('twist')
subscriber = rospy.Subscriber('computed_control_actions', Twist, send_computed_control_actions)
... |
3719325b3f926507b8c026818936cb42c824596f | 14a9150d0a41e80a34d9ff28f5191b5c5100f73a | miparnisari/cfn-python-lint | /src/cfnlint/rules/resources/events/RuleTargetsLimit.py | Python | py | 1,873 | permissive | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class RuleTargetsLimit(CloudFormationLintRule):
"""Check State Machine Definition"""
id = 'E3021'
shortdesc = 'Chec... |
6a229068816912ccb01c1f8ec51bce7322a65fb5 | 1d8be975cd54e3be4549d6973d125ce1708bfad8 | MerEsf/Applied_Machine_Learning | /Module+4.py | Python | py | 15,036 | no_license |
# coding: utf-8
# ---
#
# _You are currently looking at **version 1.0** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-machine-learning/resources/bANLa) course resource._
... |
77958eef84c2975e71d682956462a200085d496f | 7b7d6d64ea603c5c44612f632a8cebc9ba7466e8 | 5alt/ZeroExploit | /httplog.py | Python | py | 3,379 | permissive | import config
from flask import Flask, request, render_template_string, send_from_directory, make_response, render_template
import re
import hashlib
import json
from lib.httphelper import build_request
import urlparse
app = Flask(__name__)
@app.route('/pac')
def pac():
with open('proxy.pac', 'r') as f:
... |
b26b91e6e1fd33f7c0832ed06427a7adb2f9dc76 | 652933c9737e75f5bb7603dc3f9820925f85af3b | satyakrishnagorti/MusicGenreClassification | /code/data_create.py | Python | py | 1,535 | no_license | import os
import sys
from scipy.io import wavfile
import scipy
from pydub import AudioSegment
import matplotlib.pyplot as plt
import pylab
from matplotlib.pyplot import specgram
import cPickle as pickle
import json
INIT_DIR = "/home/krishna/Documents/workspace/MusicGenreDetection/genres/"
DATA_DIR = "/home/krishna/Do... |
f35ee9122db8b9e97f9f0bea6162f868ed56cb76 | d83007985de003d0f4b37565ef54b0f924220cf2 | ajarthurs/mlir-npcomp | /python/npcomp/tracing/emitters.py | Python | py | 9,856 | permissive | # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import numpy as np
from collections import namedtuple
from enum import Enum
from mlir import ir as _ir
from npcomp.... |
3d18c39fbf93f8d47c0c02ff346faeb81a935a61 | c021b73166c11df45ea1ba13b61f062adf549870 | nickkeesG/market_game | /code/agent.py | Python | py | 1,347 | no_license | import custom_math
import parameters
class Agent:
def __init__(self, endowment, error_rate, prior = parameters.PRIOR):
self.error_rate = error_rate
self.belief = prior
self.endowment = endowment
self.strategy = None #strategy will be set by the function game.... |
2f85e302c869ac03a5744416f82820b0f8fbddc5 | 96b583fae3346ec3259a8d86f0468f64e1393427 | mtpajula/MySolarSystem | /universe/collision.py | Python | py | 1,208 | no_license | import copy
class CollisionManager(object):
'''
Class f0r recording collisions
'''
def __init__(self, maths):
self.maths = maths
self.collision_list = []
def record(self, uni_obj1, uni_obj2, time):
collision = Collision(uni_obj1, uni_obj2, time)
... |
ed4ffb04de862a8a1b3dc49c2f01eb0f34d7fbc3 | a10a8149fbf4ec3bed6fb3c97013023f8266f0c9 | JoeltonLP/person-record-django | /personrecord/wsgi.py | Python | py | 401 | no_license | """
WSGI config for personrecord project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... |
48bfae099a083794034c5cd04d93b54a0f7f810f | c2ab968e31f0be87d863c1ec9ab4fbd9cfb8094f | Audiopolis/IoTConnect | /connect/views.py | Python | py | 3,715 | permissive | import urllib.parse
from django.contrib.sessions.models import Session
from django.shortcuts import redirect
from rest_framework import status
from rest_framework.views import APIView
from connect.classes.adapter import HiveManagerAdapter
from connect.classes.authenticator import FeideAuthenticator
from connect.excep... |
e9cfc85d6aee2746b838b8d39cab990b93943f4b | 47927bc1b5328ee78f243202c3e86a72aa0abb02 | Tehnorobot/sql2_api_3 | /data/category.py | Python | py | 656 | no_license | import sqlalchemy
from .db_session import SqlAlchemyBase
association_table = sqlalchemy.Table(
'association',
SqlAlchemyBase.metadata,
sqlalchemy.Column('jobs', sqlalchemy.Integer,
sqlalchemy.ForeignKey('jobs.id')),
sqlalchemy.Column('category', sqlalchemy.Integer,
... |
de5a345f5a8834e8931a1989171961107a393484 | fa453e03f4b620fd8de96ba3636491001a644c66 | neveryoungzz/qbgbdt | /tree_bak_2_5/tree.py | Python | py | 34,961 | no_license | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... |
1e4b0560a2a2269783f38c908d6fc12290fcbeba | a49b67d87d62c915a90f19e17be901783ec08037 | CallMeFoxie/spaconfs | /docker/spamumble/spamumble/dbdict.py | Python | py | 3,013 | no_license | ''' from http://code.activestate.com/recipes/576642-dbm-with-dict-speed-accesses-and-multiple-standard/
Alternate DB based on a dict subclass
Runs like gdbm's fast mode (all writes all delayed until close).
While open, the whole dict is kept in memory. Start-up and
close time's are potentially long because the... |
793d199bdbf561c19160d37bd935825062d51810 | fd8f97b5825c1029ba711e231af202b1339a23a1 | piapro/MiRo | /miro_ros_client_gui.py | Python | py | 56,787 | permissive | #!/usr/bin/env python
# @file
# @section COPYRIGHT
# Copyright (C) 2018 Consequential Robotics (CqR)
#
# @section AUTHOR
# Consequential Robotics http://consequentialrobotics.com
#
# @section LICENSE
# For a full copy of the license agreement, see LICENSE.MDK in
# the MDK root directory.
#
# Subject to the terms of ... |
436c1d95e1d8c29c3063a86f9fbacbb4df9e31ab | 9f8c0180c5da3966c3a8a34ed852e910677a38fd | yangdy-buji/sofa-bolt-python | /anthunder/protocol/constants.py | Python | py | 1,637 | permissive | # coding=utf-8
"""
Copyright (c) 2018-present, Ant Financial Service Group
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
Un... |
3a5320b0cc1425335a10ba62fa1215cf8b98404e | 307d561ca8c04d41cd0e8208746d46d734823804 | shalei120/AutoInsert | /Transformer_layer_for_MT.py | Python | py | 11,228 | permissive | import functools
print = functools.partial(print, flush=True)
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.nn.parameter import Parameter
from torch import Tensor
import numpy as np
from typing import Optional,Any, Callable, D... |
d4bdbfa9c2d7d4a8a640f338b7e89d2f3fabdbb1 | 7d7b177084401806d995ce4c6a182b0ad99da210 | grantbachman/chartflux2 | /app/models.py | Python | py | 31,689 | no_license | from pandas.io.data import DataReader
import pandas as pd
import datetime as dt
from app import db
import logging
from sqlalchemy import func
from sqlalchemy.sql.expression import asc, desc
from sqlalchemy.ext.orderinglist import ordering_list
def today():
''' datetime is implemented in C, which you can't patch.
... |
de902e8664b8d64c101eacb3e3c9b95159f6fbfe | aa5994d435c92f85986b3d7b1d6456066adf9463 | SumMuk/data-struct-algo | /longest_common_prefix.py | Python | py | 384 | no_license | def longest_prefix(strs):
longest_pre = ""
if not strs: return longest_pre
shortest_str = min(strs, key=len)
for i in range(len(shortest_str)):
if all([x.startswith(shortest_str[:i+1]) for x in strs]):
longest_pre = shortest_str[:i+1]
else:
break
return longes... |
20146d3708d2bffacd8a8793a80b69cca2249c72 | d6268d6ec3590953db5d8bde3b618cf950a80d17 | Aasthaengg/IBMdataset | /Python_codes/p03379/s789202029.py | Python | py | 1,194 | no_license | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mu... |
e729e1fe2f19d67bd47a9e5a1c6cdd85b2441cf7 | 560b40feaa5c1a01ea2d61c13f3bf4165f356372 | yolviguerrero/boto3-demo | /lambda_instanceIds.py | Python | py | 424 | no_license | import json
import boto3
ec2client = boto3.client('ec2',region_name='us-east-1')
def lambda_handler(event, context):
allInstances = ec2client.describe_instances()
instanceIdList=[]
for i in allInstances['Reservations']:
for j in i['Instances']:
print (j['InstanceId'])
in... |
572b97e3725652ff41ed66ef6a74f46e312255c9 | f57c73e7d161193ec7792019d44873ed6a6d93b8 | cnheider/Shapely | /shapely/geometry/multipoint.py | Python | py | 5,321 | permissive | """Collections of points and related utilities
"""
from ctypes import byref, c_double, c_void_p, cast
import warnings
from shapely.errors import ShapelyDeprecationWarning
from shapely.geos import lgeos
from shapely.geometry.base import (
BaseMultipartGeometry, exceptNull, geos_geom_from_py)
from shapely.geometry ... |
7c62ed59a917e3621781f8eafa83e02b7cb8ee0e | aa89cec3cecb7843f630c320ef8f02a6bfd76c43 | cash2one/xai | /xai/brain/wordbase/otherforms/_whiffed.py | Python | py | 220 | permissive |
#calss header
class _WHIFFED():
def __init__(self,):
self.name = "WHIFFED"
self.definitions = whiff
self.parents = []
self.childen = []
self.properties = []
self.jsondata = {}
self.basic = ['whiff']
|
ba75f4af6cb39b3d6e84d93e877d576ea5135a08 | 56a8f09e116e4afc61cc72fa3a624d3c0fff6393 | daniel-cortez-stevenson/crypto-predict | /crypr/transformers.py | Python | py | 2,472 | permissive | """Proprocesser classes modeled after SciKit-Learn"""
import numpy as np
import pywt
from sklearn.base import BaseEstimator, TransformerMixin
class BaseTransformer(BaseEstimator, TransformerMixin):
def __init__(self):
self.feature_names = None
def fit(self, X, y=None):
self.fit_feature_names(... |
4197d797c189c8b6a78dd561d5778d2d48e91899 | 7d8f9efccd6179b2efbc9fcd7353848162a6cb8d | tasier/doubanspider | /login/login_session.py | Python | py | 333 | no_license | # -*- coding: UTF-8 -*-
import login
class SessionManager(object):
session = None
@classmethod
def getSession(cls):
session = SessionManager.session
if session is None:
SessionManager.session = login.getSession()
print '获取session成功'
return SessionManager.se... |
0ba2aa9124a38332e4d2ffd42ecefe449ba4fe2d | 59c781cc463e2f3a657565dd393f9756d8942abc | Fabricourt/plotx | /classes/migrations/0018_auto_20200622_1958.py | Python | py | 450 | no_license | # Generated by Django 2.2.9 on 2020-06-22 16:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('classes', '0017_auto_20200621_2223'),
]
operations = [
migrations.AlterModelOptions(
name='class',
options={'verbose_name': ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.