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
96d77d1ea92d92b11306eb7454f97f4dbbf43116
7c8ae71a42b5ece0c98faf95647f38f7610730c3
nitesh251/Transformer-Failure-Prediction
/tanspys.py
Python
py
1,415
no_license
# -*- coding: utf-8 -*- """ Created on Tue Feb 19 12:06:44 2019 @author: 687338 """ from pyspark.sql import SparkSession spark=SparkSession.builder.appName('trnsformerfpy').getOrCreate() trns_df=spark.read.csv('C:\\Users\\687338\\Desktop\\Datasets\\trns1cs.csv',header='TRUE', inferSchema='TRUE') trns_df.print...
7207c809a10f297bede542387a068c4ebc7a6d3e
10e369052862c36532d251e43928c1f68cef9abc
YinWuli/instagram-downloader
/instagramspider/spider.py
Python
py
4,899
no_license
import atexit import json import re from typing import Union import requestium from bs4 import BeautifulSoup as Soup from spiderutil.connector import Database, MongoDB from spiderutil.path import PathGenerator, StoreByUserName from spiderutil.log import Log from spiderutil.typing import MediaType class InstagramSpi...
357bf040152b6434b1204fac3401c1a15163474e
206c6d163f8add77fc149c8f7e358dd5d7cf04ff
miladrux/plotly.py
/plotly/validators/cone/colorbar/_showticksuffix.py
Python
py
531
permissive
import _plotly_utils.basevalidators class ShowticksuffixValidator( _plotly_utils.basevalidators.EnumeratedValidator ): def __init__( self, plotly_name='showticksuffix', parent_name='cone.colorbar', **kwargs ): super(ShowticksuffixValidator, self).__init__( ...
08fc8277571b630fedab16ac2b8f654af0c77adb
656460682e37fcdbe0875dbadc17dfe15eae4e53
manuel-project/MyFirstProyect
/miprmerproyeto/wsgi.py
Python
py
403
no_license
""" WSGI config for miprmerproyeto 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/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "miprmerproyeto.settings") from...
7a3f46264b6d74f89044fc504875047d3f1efbd9
9d2826129110b81449341f1becb93bb69509567b
datawaveteam/DataWavePy
/examples/decoding_test.py
Python
py
250
permissive
import os import sys sys.path.append('..') import DataWave f = os.getcwd() + "\output.wav" ## Decode while listening to audio data = DataWave.decode(f, True) #Decode without listening to audio (A lot faster) #data = DataWave.decode(f) print data
5ffeaa4393292184c92daa18a096720d0ddd62d6
b6a1f3c13a5fdaa4eb1eb38bd164cc01e0cb78d9
code4yang/python-practice
/_008_htmlP.py
Python
py
671
no_license
""" 获取html文件的正文,p标签内容 """ from bs4 import BeautifulSoup def get_p_tag_content(filename): """ 通过文件名打开html文件,获取其中p标签的内容并返回 :param filename: html文件的文件名 :return: """ if not (filename.endswith('.html') or filename.endswith('.mhtml')): return None file = open(filename, encoding='utf-8') ...
e6dabeec0020d3cfba4a8e0d10dd74f9f947e14d
10ee8794f731ea14a399e202966f9d713ae61621
akaanirban/cuml
/python/cuml/test/test_train_test_split.py
Python
py
16,090
permissive
# Copyright (c) 2019-2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
743c90c31a7cb37df669f1bc6d7c72d14a2f50d2
34a27e7c3b6ac16ca6f803e73fc08b13cd1cc573
inteljack/EL6183-Digital-Signal-Processing-Lab-2015-Fall
/project/Examples/Examples/PP2E/Dstruct/Classics/sort2.py
Python
py
600
no_license
def sort(seq, func=(lambda x,y: x <= y)): # default: ascending res = seq[:0] # return seq's type for j in range(len(seq)): i = 0 for y in res: if func(seq[j], y): break i = i+1 res = res[:i] + seq[j:j+1] + res[i:] ...
29936724f9a4d2b864553d0ecebfc71d2cb067bf
b851e16ba7bea14f88a86c1d4e6a41b8dee282e0
npv2k1/CTDLvaGT
/tool/code.py
Python
py
940
no_license
import os import time import subprocess import compare compileTimeout = 5 runTimeout = 5 compare.formatInput('input.txt') compare.formatInput('dest.txt') compileProc = subprocess.run( ['g++', 'code.cpp', '-o', 'tmp.exe'], timeout=compileTimeout, capture_output=True) err = compileProc.stderr if err != b'': pri...
17f8ac827783ee6e29a436d2b0ae07b19093ea37
3da2096bbc3514ce3f6f0e3127d0e07fdc69d6e4
kunyuan/DiagMCfRG
/polar_freq.py
Python
py
5,436
no_license
import numpy as np import matplotlib.pyplot as plt import matplotlib as mat import sys import glob import os import re mat.rcParams.update({'font.size': 16}) mat.rcParams["font.family"] = "Times New Roman" size = 12 rs = 1.0 Lambda = 2 Beta = 10 ############## 3D ################################## # kF = (9.0*np...
0efd3e4f4443845c8428d5189e384c94389951fd
f7fb5be32144fa75c99705a27a898f52f78a27f3
payiz-asj/Gis
/GPS卫星位置的计算/venv/Lib/site-packages/pandas/tests/series/apply/test_series_apply.py
Python
py
31,247
permissive
from collections import Counter, defaultdict from itertools import chain import numpy as np import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series, isna import pandas._testing as tm from pandas.core.base import SpecificationError class TestSeriesApply: def test_ap...
c392a5947b5f99097f74b3f480dd1f3f7ed7c1b2
81dd8bc7ef91adbfdba4abdb39686cee573c30c1
gdmanandamohon/leetcode
/819.py
Python
py
543
permissive
''' @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt ''' #O(M+N) class Solution: def mostCommonWord(self, P: str, B: List[str]) -> str: B= set(B) P = P.lower() P= re.split('\W+', P) mp = collections.defaultdict(int) mx...
c818aa7cb97231de3c788dd07600f80f3a441b8a
ae047c48d8baa68cdda071acf0e0b5a0d464b539
karan/Euler
/10.py
Python
py
327
no_license
# summation of primes def is_prime(x): if x == 2: return True else: for i in range(2, int((x ** 0.5)) + 1): if x % i == 0: return False return True sum_2_mil = 0 for i in range(2, 2000000): if is_prime(i): sum_2_mil += i print sum_...
679e26748abd102cdb895c206f8469c89f7be03b
52db989c521601d871d096992e08961642c7560f
alex1192/demo
/pars.py
Python
py
771
no_license
from bs4 import BeautifulSoup import lxml, requests,time import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS def plot_cloud(x): plt.figure(figsize = (40,30)) plt.imshow(x) plt.savefig('gg.png') plt.show() plt.axis('off') plt.close('num') def pars_google(): url = requests.ge...
9ff3b623217e36f9aae62f3b90403a8df1437d16
aa9f643b9ace8498319c1a5d0b40b80c5744d9c0
Sakada-Sao/hr_extension
/__openerp__.py
Python
py
1,117
no_license
# -*- coding: utf-8 -*- { 'name': "hr_extension", 'summary': """ Short (1 phrase/line) summary of the module's purpose, used as subtitle on modules listing or apps.openerp.com""", 'description': """ Long description of module's purpose """, 'author': "My Company", 'web...
b3e3b7df3de940e9905d4337d952e71d84a7f6f1
0f961fc5581a32c4cbac6178285dc58881d77c83
schintomby/NYriskyfood
/foodviolations/restaurants/migrations/0002_facility_county.py
Python
py
492
no_license
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-09-22 05:42 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('restaurants', '0001_initial'), ] operations = [ migrations.AddField( ...
f980b1040cb512dcba2df3b08c2b62f73f9d4bbf
bc0d75bc5ee393e4e1b26f9c04be3c3f8302fbf1
WilsonLiCode/Barter
/postman/views.py
Python
py
17,045
no_license
from __future__ import unicode_literals from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required try: from django.contrib.auth import get_user_model # Django 1.5 except ImportError: from postman.future_1_5 import get_user_model from django....
56d1b0310fb62604bc88053a6bac9b5ea6a4d50b
a66d9c91371bd93a2c16d8b4adddacaf41602e9b
mcuntz/pyjams
/src/pyjams/jams/distributions/distributions.py
Python
py
35,847
permissive
#!/usr/bin/env python """ License ------- This file is part of the JAMS Python package, distributed under the MIT License. Copyright (c) 2016-2017 Matthias Cuntz - mc (at) macu (dot) de Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated...
6b6ee28285a3865f5076309e0c3327873b4b66dd
3ad004b7fd8ec8e09878ea53cea2eea4d95ddddb
Slave1488/xmldoc2html
/layout/map/description.py
Python
py
1,271
no_license
import layout class Map: def __init__(self): self._attr_names = set() self._tag_maps = {} def __getitem__(self, tag_name): return self._tag_maps[tag_name] def __setitem__(self, tag_name, tag_map): self._tag_maps[tag_name] = tag_map def add_attr_points(self, *attr_nam...
32bde2330e15e9ea51d108b30cb8f303de233960
e9aa9d9ac25837180dab1ef65eca23ab4477a4a0
bloomberg/apache-spark-on-k8s
/examples/src/main/python/sql/datasource.py
Python
py
6,763
permissive
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
4fd331d7406d7d972e655fd5390ecd089c11f371
b5d341965c8ce8ce0a1a60a330edb4f2b31576f0
Ushravan/Programming-Foundations-With-Python
/Nested- Conditions/Lucky Number - 2.py
Python
py
1,251
no_license
#Lucky Number - 2 #Write a program to print if the given number is divisible by any of the lucky numbers 6, 3, 2 in decreasing order of priority(6 is luckier than 3 and 3 is luckier than 2). #Print "Number is divisible by" followed by the luckiest number among the above 3 which can divide the number. #Print "Number is ...
c9745493a94532d9f16e448c8fbca21c52abec3a
96f18f0b3b36b3b2e2af83adbe262957fbcd2c2e
Nidhogglin/Python
/study/GUI/坦克大战/tank09.py
Python
py
12,644
no_license
# coding: utf-8 """ 坦克大战GUI 新增功能 敌方坦克随机发射子弹 """ import pygame import time import random WIN_WIDTH = 1000 WIN_HEIGHT = 600 BG_COLOR = pygame.Color(0, 0, 0) TEXT_COLOR = pygame.Color(255, 0, 0) class MainGame(object): window = None myTank = None # 创建敌方坦克列表 enemyTankList = [] # 设置敌方坦克数量 ...
0fb76c0f0ab823c069d53ee9468c7a310da744a9
50f638f77f3885f9292f6f81dad815afa93fe329
feng-crazy/learn_python
/step1/python_zmq/rep_req/zmq_req.py
Python
py
1,705
no_license
# _*_ coding: utf-8 _*_ """ python_class.py by hdf """ import sys import zmq REQUEST_TIMEOUT = 2500 REQUEST_RETRIES = 3 SERVER_ENDPOINT = "tcp://localhost:5555" context = zmq.Context(1) print("I: Connecting to server…") client = context.socket(zmq.REQ) client.connect(SERVER_ENDPOINT) poll = zmq.Poller() poll.regi...
ebddd4b10ae668317dd4e1ad48eba0d828bf3d8e
1818b40da0b25e870bfc91031cc71f04104ff575
jls47/holam
/holam/exscrape.py
Python
py
8,147
no_license
from bs4 import BeautifulSoup, Tag import csv from urllib.request import urlopen import pandas as pd from selenium import webdriver import time from langdetect import detect import os class exScrape(object): def __init__(self, lang, region): self.lang = lang self.region = region self.details = {} def visit(s...
3f283f3dacdaf00283249dbf3b8aa34e5f972a59
585045752ac31a7d3de65a1225c8e64b30abcc4a
Jacky-odoo/Ecobank
/custom/asset/account_asset_management_asset_categorization/models/account_asset.py
Python
py
1,052
no_license
# -*- coding: utf-8 -*- from odoo import fields, models, api class AccountAsset(models.Model): _inherit = 'account.asset' asset_unit_id = fields.Many2one('asset.unit', 'Unit', readonly=True, ondelete='restrict', ...
d4bfb46c92a8010a9852d565fa5cf4ccfc80f000
3153e2a96ff7f4d8ac02b7b6c91023d3bc65e448
sakshiudeshi/MLFinalProject
/Code Rob/content filtering.py
Python
py
423
no_license
import pandas as pd import numpy as np DATA_DIR = "data" filename = "train.csv" file = DATA_DIR + "/" + filename df = pd.read_csv(file) num_users = max(df.User) num_tracks = max(df.Track) ratings = np.zeros((num_users, num_tracks)) TB = np.matrix(df) for i in range(len(TB)): user = TB[i, 0] track = TB[i, ...
d725273aa35e1d08a68dc315e9ff0b20b73c07c3
f9a4fc4388918fff84c891bcc4794629bcd18cc2
DistrictDataLabs/yellowbrick
/tests/test_model_selection/conftest.py
Python
py
1,811
permissive
# tests.test_model_selection.conftest # Provides fixtures for the model selection tests module. # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Fri Mar 30 14:35:39 2018 -0400 # # ID: conftest.py [c5355ee] benjamin@bengfort.com $ """ Provides fixtures for the classification tests module. """ ########...
005223b2b26932d485e324e2e997d4cc4da5dc92
82cb7e035859058f23b234e389e302c98daf0dfa
morrell/pulumi-azure-native
/sdk/python/pulumi_azure_native/datalakestore/v20161101/_enums.py
Python
py
2,030
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! *** from enum import Enum __all__ = [ 'EncryptionConfigType', 'EncryptionIdentityType', 'EncryptionState', 'FirewallAllowAzureIpsState', ...
c66c506bad3260269e1bfacf2aef0b017bd40551
197aac66d39fc84267c5484fce4f0fdd4d719f55
AbdulAhadSiddiqui11/PyHub
/Miscellaneous/Case Swapper.py
Python
py
881
permissive
import pyperclip """ Program description : Takes a string as input and creates an alternating upper and lower case pattern of the string. Eg : Hello becomes hELlO. Note : The output is copied to clipboard. To do this, first => `pip install pyperclip` """ def caseswapper(value, choice): if(choice == "uppercase" or...
c1deb089ee1423f1d80a3361d243b669a6cda890
ef765db8bdb872b61c870db58827c8d15675bdbe
piojanu/Planning-in-Imagination
/src/alphazero/run.py
Python
py
14,283
permissive
#!/usr/bin/env python3 import click import humblerl as hrl import logging as log import numpy as np import utils from algos.alphazero import Planner from algos.board_games import AdversarialMinds, BoardRender, BoardStorage, BoardVision, ELOScoreboard from algos.human import HumanPlayer from coach import Coach from com...
914eb88c940a5a99d11f7082c3fdd39fa2f2882a
fedec97ae07497450d28081538386b6802ce7796
00agata/PythonLearning
/Lesson1/AppleSharing.py
Python
py
502
no_license
''' N students take K apples and distribute them among each other evenly. he remaining (the undivisible) part remains in the basket. How many apples will each single student get? How many apples will remain in the basket? ''' students = int(input('Please provide number of students: ')) apples = int(input('Please prov...
9add5eddfdfa1c2a700e2c7eb038d55733ada5dd
0c91e4bdbd9b3286bc5c4725866c03ae98ed222f
matheusRichter/Trabalho04_IA
/Testes.py
Python
py
4,304
no_license
from Imports import* class RouteProblem(Problem): """A problem to find a route between locations on a `Map`. Create a problem with RouteProblem(start, goal, map=Map(...)}). States are the vertexes in the Map graph; actions are destination states.""" def actions(self, state): """The places...
3090c05b7b36779acf2f17392fa39a37d2eea6c1
7a91a84adc21954115caa40fa7ed284ff5ab0e32
SinisaG/Website
/webapp/hncweb/lib/subscribers.py
Python
py
452
no_license
def add_renderer_variables(event): if event['renderer_name'] != 'json': request = event['request'] app_globals = request.globals event.update({"g" : app_globals , 'vctxt' : request.root , 'STATIC_URL' : request.root.static_prefix , 'R...
4027e0ebcc64d7b5cd616c95f690f6d168906c35
309a93d5b73d808f1e92f38c5f0498056cc6a7ec
AlessandroPozzi/CERN_prediction_thesis
/src/itemsetsgeneration/expandDevice.py
Python
py
4,681
no_license
''' QUESTO FILE e' lo script originale expandDevice.py ripulito dalle parti per noi inutili e con l'aggiunta di una condizione sulla lista "markedEvents" per far si' che uno stesso evento NON venga considerato piu' volte per via dei problemi della DOPPIA QUERY. Inoltre, viene anche usato per aggiungere lo stato, la de...
7a2ce741db753f6e9e3987eaa484a5c12b4dee73
b78ef9667bf4cd5701b94ee6a5f688661ea4d7a9
AndrewAct/DataCamp_Python
/Introduction to DL in Python /1 Basics of Deep Learning and Neural Networks/03_Applying_the_Network_to_Many_Observation_of_Data.py
Python
py
1,272
no_license
# # 8/3/2020 # You'll now define a function called predict_with_network() which will generate predictions for multiple data observations, which are pre-loaded as input_data. As before, weights are also pre-loaded. In addition, the relu() function you defined in the previous exercise has been pre-loaded. # Define predi...
470f1a50eaf0dfc4f87705ddf3ae88a760ec5f3a
dde3a66c8337c5e06ffad7c729522809f0638fd8
djdtimit/Python
/design_patterns/Object-Orientated/6-property-decorator/oop.py
Python
py
910
no_license
class Employee: def __init__(self, first, last): self.first = first self.last = last # if first is changed email is not changed # self.email = first + '.' + last + '@email.com' # allows to use methods as normal attributs # without calling ...() @property def email(...
18e5305ab145d237bdb7edfedfb6e9143b2c2cac
b94d4f5e2ebe8064565498469cfa8e7c1c1320fe
evacys/MAPOBS
/app/migrations/0005_auto_20180731_0444.py
Python
py
509
no_license
# Generated by Django 2.0.5 on 2018-07-31 04:44 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app', '0004_auto_20180730_1324'), ] operations = [ migrations.AlterField( model_name='flow', ...
2b23b113606c15562ffb53a591eaba2f21a57c14
7a4f4f93470dd0c400f70739f0f838d29950b78f
zenghao-hub/Program
/深度学习/猫狗二分类/feature_extraction.py
Python
py
2,620
no_license
__author__ = 'zenghao' import os from tqdm import tqdm import h5py import numpy as np import argparse import torch from torchvision import datasets, models, transforms from torch import optim, nn from torch.autograd import Variable from torchvision.datasets import ImageFolder from torch.utils.data import DataLoader f...
1ef239e70c271252624b736ddfe75568e2e73753
3936c73967397ad15debdd2710f998d528df93d5
guerler/galaxy
/test/integration/test_remote_files_posix.py
Python
py
4,535
permissive
# Before running this test, start nginx+webdav in Docker using following command: # docker run -v `pwd`/test/integration/webdav/data:/media -e WEBDAV_USERNAME=alice -e WEBDAV_PASSWORD=secret1234 -p 7083:7083 jmchilton/webdavdev # Apache Docker host (shown next) doesn't work because displayname not set in response. # d...
9f4d68aebe25610f02b2014e45d47fd11e95112a
79f37e86419818be8a38cb2fd065051a7b8a0b08
p3t3r67x0/ansible_crashcourse
/backend/wsgi.py
Python
py
977
permissive
#!/usr/bin/env python3 import mariadb from flask import Flask, jsonify app = Flask(__name__) app.config.from_json('config.json') config = { 'port': 3306, 'user': 'awendelk', 'host': app.config['MARIADB_HOST'], 'password': app.config['MARIADB_PASSSWORD'], 'database': 'demo' } @app.route('/', m...
474bddb6f08c692fde2e4a65a023b41a27e40fdc
239545a040ef997d1c9ed1eb1ac4882a552d1fc5
grodzik/ownSync
/ownSync.py
Python
py
2,344
permissive
#!/usr/bin/env python if __name__ == "__main__": from ownSyncUtils import * import argparse import sys import getpass from argparse import RawTextHelpFormatter if len(sys.argv) <= 1: sys.argv.append("--help") else: sys.argv.pop(0) t = """type of sync to do. (Default: both) The options are: \tto...
e3c0ac53fedd5e943e62809f294fe0abce7f3719
124ea5f030e822284713a5dedfcaba1de8e7afc9
Leonardofreua/castero
/tests/test_perspective_primary.py
Python
py
7,440
permissive
import os from unittest import mock from castero.config import Config from castero.episode import Episode from castero.feed import Feed my_dir = os.path.dirname(os.path.realpath(__file__)) def get_primary_perspective(display): """Retrieve the Primary perspective. Args: display: the display containi...
0d683b3c9d90463a03e1652af836b00fa7fcff45
1ee15a498c4965c38f8872c34109dda19ec37c8e
jihunparkme/Problem-Solving
/PS_Study/BOJ/16956_teach.py
Python
py
589
no_license
R, C = map(int, input().split()) map = [list(input()) for _ in range(R)] dx, dy = [0, 1, 0, -1], [1, 0, -1, 0] ck = False for i in range(R): for j in range(C): if map[i][j] == 'W': for w in range(4): ii, jj = i + dx[w], j + dy[w] if ii < 0 or ii == R or jj < 0 ...
2b8828c9f348a9ed3e5f8eb8a0b5ec561b783663
5bda39fe485c276a91eefd4b4c0addaff6de787c
vincent-tvincent/class-homeworks-
/guess_number_game/guess_number.py
Python
py
373
no_license
import random class guess_number: def guess_number(self): number = int(input("what's your guess?: ")) print("guess number: " + str(number)) return number def random_guess_number(self, minimum, maximum): number = random.randint(minimum, maximum) print("gues...
f177c2e64497e0b3688c358dbb3f80ba1e97abdf
f3ff3009316009769f66a19d674dabc37680d605
0zhongying0/FEAD
/Semi-FEAD/MNSM/PLS.py
Python
py
4,098
no_license
import numpy as np # 偏最小二乘法回归 class PLS: def __init__(self): # X , Y 的第一维 self.N = 0 # X 的 第二维, 也就是X的特征向量大小 self.Mx = 0 # Y 的 第二维, Y的特征向量大小 self.My = 0 # # 训练集 X 的 均值 # self.X_mean = None # # 训练集 Y 的 均值 # self.Y_mean = None #...
4798e05ae1fba31eb8660bcf3bda4913cc3b1de0
67c23a1375dbd681126424a3ab512e3ce7eae103
harvard-acc/ALADDIN
/gem5/HybridDatapath.py
Python
py
6,244
permissive
from m5.params import * from m5.objects import CommMonitor, Cache, MemTraceProbe from MemObject import MemObject from m5.proxy import * from Cache import * from XBar import * class AcpCache(Cache): """ A small L1 cache that handles coherency logic on ACP's behalf. Since this is just to get coherency functionality...
ee30f7d64e1fc90ce9aa2eaa19ed5570ec518291
c0d5844a172211ce40b9ab63d2825ceba0a1c47e
sophiemathias/dark-matter
/test/test_summarize.py
Python
py
3,391
permissive
from unittest import TestCase from cStringIO import StringIO from dark.summarize import summarize_reads class TestSummarizeReads(TestCase): """ Test the summarize_reads function. """ def testReadNumberEmptyInput(self): result = summarize_reads(StringIO(), 'fasta') self.assertEqual(re...
3b5c2c597cee9405200f0123a07bb168e759afb8
f87831191be0d304e02c0327b914d7627244c8a6
Justin-chi/compass-core
/compass/actions/util.py
Python
py
9,637
permissive
# Copyright 2014 Huawei Technologies Co. Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
5def539a8d2a49ed5d4ee5737c86b787c228b9b8
21bc6f1bad2defdc7f55f8849aa443013575f58e
uppsala-makerspace/IoT-Station
/GPIO_dummy.py
Python
py
587
no_license
import logging log = logging.getLogger("GPIO_dummy") LOW = 0 HIGH = 1 OUT = 2 IN = 3 PUD_OFF = 4 PUD_DOWN = 5 PUD_UP = 6 BCM = 7 RISING = 8 FALLING = 9 def setmode(mode): log.debug("set mode: " + str(mode)) def setup(channel, state, initial=-1, pull_up_down=-1): log.debug("setup: " + str(channel) + " " + s...
e6a74a83c9431c0239f27d9900ec2cf4f77adbba
bdedfd0555c9ffc0c74c81eb3efa16fd6c5178c5
daniyalsyed/python_gui_algo
/gui_with_num.py
Python
py
2,208
no_license
from random import randrange from time import sleep from Tkinter import * root = Tk() canvas = Canvas(root, bg='white', width='800', height='400') label1 = Label( root, text="Enter length of array : ") E1 = Entry(root, bd =5) iterations = 0 iter_text = canvas.create_text(100, 350, text=str("Iterations : "+str(iter...
244da6157dfd19315e23c2abffbf98d79c35b65c
69325d28247c332e0397d8e43b71ba23dbb66214
noval90/finance2
/backtester/backtester.py
Python
py
480
no_license
"""Module to backtest a given strategy based on intermittent outputs. General strategy is: 1) Accept a list of dated allocations, and dated stock prices. 2) Step through days in order, adjusting previous allocations based on price changes, and rebalancing when new allocations are encountered. 3) Fr...
523c2f1d6262706d07348a6b3b099d3b98766552
dd2c26319591613f823405584361cbb277733165
akshastry/AutoBebop
/src/Gate_detect/gate_marker.py
Python
py
4,854
no_license
#!/usr/bin/env python import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import Quaternion, Pose, Point, Vector3 from std_msgs.msg import Header, ColorRGBA from nav_msgs.msg import Odometry from math import atan2, sin, cos, sqrt, asin, acos, atan x=y=z=q0=q1=q2=q3=yaw=0.0 #skeleton source:...
dc0bcd1796b84538f0e9182569e69576d34d9194
c0a0571c08979eae1eb388c86bb0c2d0c36201d3
edu-athensoft/ceit4101python
/evaluate/evaluate_1_exercise/m6_string/num_comma.py
Python
py
1,094
no_license
""" 1. Write a Python program to display a number with a comma separator. Basic idea: cutting the string of number into groups by 3-digits if the first group has less than 3 digits (like 1 or 2), then filling it with leading zero Join all substring with comma Remove the leading zero and return """ import math # ...
533d855c6e86fc560854e35250ab9b2cb119fd11
b0780c5167ce6e934ffa3ecf3c940afadec099ea
zhoushufan1997/gym-auv
/gym-auv/gym_auv/objects/rewarder.py
Python
py
12,166
no_license
import numpy as np from abc import ABC, abstractmethod from gym_auv.objects.vessel import Vessel deg2rad = np.pi/180 rad2deg = 180/np.pi def _sample_lambda(scale): log = -np.random.gamma(1, scale) y = np.power(10, log) return y def _sample_eta(): y = np.random.gamma(shape=1.9, scale=0.6) return y...
73520505a641f2647878c5cafc734955db5391f2
9e1b7a035584c5ed50374c9bd72ad9c93d8fccb8
AndrewILWilliams/ECS_bump
/submit_pyrads_scripts/run_pyrads_imbalance-1e3plevs.py
Python
py
5,583
permissive
import xarray as xr import numpy as np import climlab import scipy.integrate as sp #Gives access to the ODE integration package import pyrads import argparse parser = argparse.ArgumentParser() parser.add_argument( '--temp', type=int, nargs='+', help='Target temperature for CO2 optimization', r...
cc26b476414a464718dcb2e180a8982626d99790
e9fe6c6829e5ef879ad9af9b01df44ff9232346d
Doers-ADC1/Doers_ADC1_meroSathi
/questionPlatform/models.py
Python
py
839
no_license
from django.db import models from django.conf import settings # creating question class to post the question and store the posted questions in the database class Question(models.Model): author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) question = models.CharField(max_length=300) ...
6f4b7f76e3d50dc917ad07aeb17e8e06444a7e9e
c16a8ceb1681770421663be83993b00614b2e158
indexa-git/pos-addons
/wechat/models/wechat_micropay.py
Python
py
3,631
permissive
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev> # License MIT (https://opensource.org/licenses/MIT). import json import logging from odoo import api, fields, models _logger = logging.getLogger(__name__) class Micropay(models.Model): _name = "wechat.micropay" _description = "WeCh...
497384120a283e7c33915d1f4b4adf8ed9445fcf
bad285d91b3b4601f2f76c6e471f0b74b01a994a
jdpeck90/python_practice
/projects/projectFive/script.py
Python
py
382
no_license
from tkinter import * window = Tk() def km_to_miles(): miles = float(el_value.get())*1.6 tl.insert(END, miles) b1 = Button(window, text="Execute", command=km_to_miles,) b1.grid(row=0, column=0) el_value = StringVar() el = Entry(window, textvariable=el_value) el.grid(row=0, column=1) tl = Text(window, h...
139fb6ce57bb447da5ab240d18311dd321341184
d586428165c9a5446de4422634343b0a15924010
mariasykpotter/Algorithms
/closest_pair_and_minimum_perimeter_task/min_max_heap.py
Python
py
7,611
no_license
import math class Heap: @staticmethod def parent(i): return math.floor((i + 1) // 2) - 1 @staticmethod def left(i): return 2 * (i + 1) - 1 @staticmethod def right(i): return 2 * (i + 1) class MaxHeap: @staticmethod def maxheapify(A, i): p = Heap.left...
bf9752788dd39bc938fbb0badb466584bb6c7654
3cae2346913d6f9d131474068688627b62bfc7a8
namelles/DevmanBitly
/main.py
Python
py
1,884
no_license
import os import requests import argparse from dotenv import load_dotenv from urllib.parse import urlparse def get_shortened_link(user_url, headers): url = 'https://api-ssl.bitly.com/v4/shorten' payload = { 'long_url': user_url } response = requests.post(url, headers=headers, json=payload) ...
44b76571f9d4cca639d6d0f89c35bcdc0ecdcad5
7359d075db8e97b4bf1ffbbe8e9ec6ab7d820b34
saimani5/sidpy
/sidpy/hdf/hdf_utils.py
Python
py
29,345
permissive
# -*- coding: utf-8 -*- """ Simple yet handy HDF5 utilities, independent of the data model Created on Tue Nov 3 21:14:25 2015 @author: Suhas Somnath, Chris Smith """ from __future__ import division, print_function, absolute_import, unicode_literals import socket import sys from warnings import warn from platform im...
d21d192addbe008d778c3fa26309a48c76dbd2e8
8a8074cdd2de429f61c9616625bb4429a2c26bc5
perfectswpuboy1/torrent_to_mongodb
/pymongo_imp.py
Python
py
3,907
no_license
# -*- coding: utf-8 -*- #!/usr/bin/env python # 《Torrent magnet存入数据库思路》 ''' # 1.利用python字符串处理函数获取唯一✅标识,(先尝试是否可以手动增加_id进去) # 2.每次保存数据之前,先搜索数据库,确保没有重复,然后再保存。 # 3.保存字段有:【文件名、文件大小、链接、时间、关键标识】 # 4.file_name0 filesize0 magnet0 datetime0 keywords0 # 5. ''' import pymongo #导入pymongo模块 ...
53285b4ee5415bfb3f89501e14fb84397dbe17bb
637a078f34b986f22d8c1adebec3956bf13351b4
tejaswiniatla/big_cities
/user_app/migrations/0001_initial.py
Python
py
1,733
no_license
# Generated by Django 2.0.2 on 2018-05-10 19:06 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Article', fields=[ ('id', models.AutoField(...
c73b9a0e5b8c681458cb1d195e232382272e3c23
f70ed5c15b7f87292674faa7d3b343edfc476ec2
DongHuaLu/mdcom
/mdcom/MHLogin/utils/test_runner.py
Python
py
4,124
no_license
import sys from coverage import coverage from django.conf import settings, global_settings from django.test.simple import DjangoTestSuiteRunner from django.utils.unittest import TextTestRunner from django.utils.unittest.runner import TextTestResult from MHLogin.utils.management.commands import test # custom test r...
3edf3b72579c167618e85264d1b151126a85643c
cddb0087f91eb4245458fc24bbe4306b8e64624d
Krishna2709/ObjectClassification-Localization
/localization.py
Python
py
1,148
no_license
# Import required modules import tensorflow.keras as K from data import ds # Load the base model base_model = K.applications.MobileNetV2(input_shape=(224,224,3), include_top=False) # convolutional layers hyperparams conv_opts = dict( activation='relu', padding='same', kernel_regularizer="l2" ) # fine tun...
f9a1e14ec7d972c771bda89b018cc9db4ce1a626
5eedd63f08fc9e6c01a8292455e538f1d4146676
danilo-bc/uri-online-judge-studies
/2517_desafio_pogro/pogro.py
Python
py
542
no_license
from math import sqrt def solve(a, b, c, xc, yc, xf): x_vals = range(0, 100*xf) distances = [] for x in x_vals: xi = x/100 f_x = -xi**2/a -xi/b + c dist = sqrt((xi - xc)**2 + (f_x - yc)**2) distances.append(dist) print(f"{min(distances):.2f}") while(True): a, b, c...
bdcd30f1a47cf46800a57763995bfc0375ac965c
332ec4abbc6c879d122f9e5c595c1756b598516a
603lzy/LeetCode
/111. Minimum Depth of Binary Tree/111. Minimum Depth of Binary Tree.py
Python
py
590
no_license
# 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 minDepth(self, root): """ :type root: TreeNode :rtype: int :https://discuss.leetcode....
70a41ce442ea8ca3c0c8ad483cdef36a11964b08
0f3466d73b5ee986cbf3311c82a9587b0409fde0
clementetienam/autoencoders
/utils/layers.py
Python
py
7,567
no_license
''' ------------------------------------ Author : SAHLI Mohammed Date : 2019-11-09 Company: Alphaya (www.alphaya.com) Email : nihon.sahli@gmail.com ------------------------------------ ''' import numpy as np import tensorflow as tf from tensorflow.python.training import moving_averages # fl...
6dfda2ba99c287a470663befbc5642b0f0440cd4
d0c422ce0eb8d0e7ed0d5eb51b1cf2186816e60c
dfiliuk/d
/l.py
Python
py
586
no_license
from gpiozero import Robot, LineSensor from signal import pause from time import sleep robot = Robot(left=(7, 8), right=(9, 10)) left_sensor = LineSensor(17) right_sensor= LineSensor(27) left_sensor.when_line = function_name_to_call left_sensor.when_no_line = other_function_name_to_call #from gpiozero import Robot,...
6c7b6cce553c3d927ba52c34623fd840188bb7ba
85c9ddc2ed56bfef1d31b041d7288c4d4e16c2df
yash820/TIC-TAC-TOE-GAME
/main.py
Python
py
7,374
no_license
from time import * from math import * from random import * from playsound import * from pygame import * from os import * print("<----<---- w e l c o m e to TIC-TAC-TOE w o r l d ---->---->") print("****************************#**********************************") print("heeeyyyy! aliens ...you are feeling bor...
0b3869e91ae0a7b118cf63d200ed4da3c10c37ab
b3a8c820427caa911447cb5aa2cc2ec3539cd314
Telefonica/toolium
/toolium/test/utils/test_path_utils.py
Python
py
3,157
permissive
# -*- coding: utf-8 -*- """ Copyright 2018 Telefónica Investigación y Desarrollo, S.A.U. This file is part of Toolium. 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/lice...
204284cba33261df27fcecafccc42ae3e500f8f3
1218ea8d574ec6da15f5d856456b4187635f37bc
jsparmani/TeekaSchedule
/parent/migrations/0001_initial.py
Python
py
741
no_license
# Generated by Django 2.1.7 on 2019-08-30 19:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('account', '0001_initial'), ] operations = [ migrations.CreateModel( name='C...
bab5596ce5c03bf0bfcfca99e7f6d1d7210163b1
e64fe6c38c2c8abe3caf9fc6eba34d82f5e5ef36
Yin-black/djt21
/apps/news/templatetags/my_time.py
Python
py
636
no_license
from django import template from django.utils.timezone import now from datetime import datetime register = template.Library() @register.filter def data_format(val): if not isinstance(val,datetime): return val time_now = now() sec = (time_now-val).total_seconds() if sec<60: return ...
bb65c14d7bdc193d94f66efce3675269b62eac2d
5852d47c49e470d5ab530d2b1eaac478443fdc00
baryonyx5/click-keyring
/setup.py
Python
py
1,019
no_license
#!/usr/bin/env python import io import re from setuptools import setup, find_packages _version_rgx = re.compile(r'__version__\s+=\s+"(.*)"') with io.open("./click_keyring/__init__.py", "rt", encoding="utf8") as fh: version = _version_rgx.search(fh.read()).group(1) setup( name='click-keyring', version=ve...
cbcefc300fc6310c163ad6531ec8fb28879c7b9d
203ae157878bfa1755235ca1a3e1e2d94400be8c
zmy-farmer/python_snake
/qiubai/qiubai_2.py
Python
py
4,259
no_license
# -*- coding:utf-8 -*- import urllib import urllib2 import re import thread import time #糗事百科爬虫类 class QSBK: # 初始化方法,定义一些变量 def __init__(self): self.pageIndex = 1 self.user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' # 初始化headers self.headers = {"User-Agent":self.u...
b9cf8250813ee0cb2d9133329b12d21bea7eabe1
28b576f60108fc0151feeb866498945e216ac6d6
dougvanhorn/bots-grammars
/x12/6030/891006030.py
Python
py
633
no_license
from bots.botsconfig import * from records006030 import recorddefs syntax = { 'version': '00603', 'functionalgroup': 'UD', } structure = [ {ID: 'ST', MIN: 1, MAX: 1, LEVEL: [ {ID: 'BGN', MIN: 1, MAX: 1}, {ID: 'N1', MIN: 1, MAX: 2}, {ID: 'PER', MIN: 0, MAX: 3}, {ID: 'ENT', MIN: 1, MAX: 100,...
9eb66256315a936cf451f9475b47961bc5934d58
b93f48d016366a4d367e921772b1811270587b02
Spencerx/experiments
/pox_broken_floyd_mcs/interreplay_6_l_3/interactive_replay_config.py
Python
py
1,307
no_license
from config.experiment_config_lib import ControllerConfig from sts.topology import * from sts.control_flow import InteractiveReplayer from sts.simulation_state import SimulationConfig from sts.input_traces.input_logger import InputLogger simulation_config = SimulationConfig(controller_configs=[ControllerConfig(start_...
8af4e8d9750ac34b11ba13441fec866e67faa6fd
3b66120b3709330a0866c79ba2618023b5568f93
NicolasNin/sc2stalk
/web/starcraftstalk/starcraftstalk/settings-example.py
Python
py
3,258
no_license
""" Django settings for sc2Stalk project. Generated by 'django-admin startproject' using Django 1.10.5. 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 o...
eb42d2440cb12f7be894389db21fda132c576a91
7328f7510eb5604ec4edf1315a803ee87d09cb2a
MaryanneNjeri/pythonModules
/.history/selfDividing_20200730195555.py
Python
py
612
no_license
import json def dividing(upper,lower): newArr = [] numbers = range(upper,lower+1) for i in numbers: if i > 0 and i < 10: newArr.append(i) else: newStr = json.dumps(i) if len(newStr) > 1: j = 0 while j ...
f5bb5bbb580eacd5701e99c576221c02951c7aa6
7456d17f2f33b2c9a8839518f003758ce1d6e975
d3scmps/minet
/minet/cli/youtube/comments.py
Python
py
3,498
no_license
# ============================================================================= # Minet Youtube Comments CLI Action # ============================================================================= # # From a video id, action getting all commments' data using Google's APIs. # import time import csv from tqdm import tqdm ...
8d770ecd6a129f40b81a9242af51f8a58e37b869
2aa538e8ce6cabfed344cc7f7b19fe2034e57833
KimSoungRyoul/pytest-tipsi-django
/test_django_plugin/wsgi.py
Python
py
414
permissive
""" WSGI config for test_django_plugin 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/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("...
f7d19800af7ab4c016130b8abacd73cd3ed51608
5d3a2ee4e0d1885a506b7304d572e9f54176650d
FinleyLi/109-TSH_Python_3.8.3
/20201211_ChromeDriver/GettingStarted.py
Python
py
1,419
no_license
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ #pip install selenium import time import random # 隨機數 from selenium import webdriver from selenium.webdriver.common.keys import Keys # 隨機數 def dice(): return random.randint(1, 120) # 至多延遲120秒 # 開啟校務系統差勤 Browser = webdriver.Chrome() Log...
4ad6bf78b34815075db1d96f0a9acf5620b58847
446b17addfeb826da0ef58f222a80a6515fc853f
qaqgame/movRec
/movRec/views.py
Python
py
419
no_license
from django.http import HttpResponse from django.shortcuts import render def hello(request): return HttpResponse("Hello world!") def haha(request): context = {} context['haha'] = 'Hello World!!!!!' return render(request, 'helloWorld.html', context) def dake(request): name = request.methodw ...
cb0198eb2b6e0a60f03de86479befa5a2df34064
e6fef55a2cf59a0c4753fd94dc391b1a2cc0dc40
rwlink3z8/hpp2
/old_files/ccmo_outlier_removal.py
Python
py
511
no_license
import pandas as pd import numpy as np from ccmo_outlier_src20210219 import * ''' This takes in the cleaned dataset, preps it for modelling and sends it to a csv, after pca and eda we are still left with 96% of the houses ''' mod_data = pd.read_csv('20200217_mls_clean1.csv') mod_data = (mod_data.pipe(pca_floor_p...
0e452dd2e4026daefee6f798ba6631046c0dbf09
49dc17e6c3df297ba08167b7aff19bed39a66165
broesamle/svgpipe
/docs/source/conf.py
Python
py
2,409
permissive
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
f83be26620f455f3f39e4f535f59da63a1907f9e
d7e28e3a33cf05246dd33a3379df24f53c3f2708
lufeirider/c--
/shellcode/整理获取shellcode.py
Python
py
9,541
no_license
#coding=utf-8 import re text = """ 00401028 FC cld 7: push 0x1e380a6a //MessageBoxA的hash值 00401029 68 6A 0A 38 1E push 1E380A6Ah 8: push 0x4fd18963 //ExitProcess的hash值 0040102E 68 63 89 D1 4F push 4FD18963h 9: ...
36270aa27fab41206fd844a668632195fa1a3ad9
2590f50bc8caab760591c0d7ad86fd8471dc24d6
burakbayramli/books
/PHY_604_Computational_Methods_in_Physics_and_Astrophysics_II_Zingale/code1/linear-algebra/tridiagonal/cubic-spline-tri.py
Python
py
2,510
no_license
# a simple cubic spline example. # # generate some random data in 10 intervals -- note the data changes # each time this is run. # # Our form of the spline polynomial comes from Pang, Ch. 2 # # solve the matrix system for the splines # # plot the splines # # M. Zingale (2013-02-10) from __future__ import print_functio...
d71aab5f55dd09d36ccaece40532937bebd2f21a
27a8083277424b1e0f0e78e8a96450f4ef637566
katetushkan/MPP_Part_2
/Lab3/manager/migrations/0001_initial 2.py
Python
py
853
no_license
# Generated by Django 3.0.3 on 2020-02-12 13:20 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Task', fields=[ ...
e493f26d851436c7a079d0ea90cde10d594a39f1
be4fb4bd13d2497f79b773a29ba3eeed8b050475
reconstruir/bes
/lib/bes/files/metadata_factories/bf_metadata_with_factories.py
Python
py
680
permissive
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from bes.system.check import check from bes.system.log import logger from ..metadata.bf_metadata import bf_metadata from ..metadata.bf_metadata_factory_registry import bf_metadata_factory_registry from .bf_metadata_factory_che...
4140905b3a2f437e9b3b430736463b13ad19f3c2
3fd713edceba4576a173bb109906e4b8aded2d38
xit4/alphaTO
/src/utility/FilterCreator.py
Python
py
1,947
no_license
import json import os import pandas as pd import argparse # explore jsons to generate two filters splitting the samples in two based on information contained in them parser = argparse.ArgumentParser() parser.add_argument('-i', '--inputdir', required=True, help='directory containing json files (/ at the end)') parser....
ffbd8356fa71e6026d6745890fbf2a0acbcb4d35
9ff7e06eaed00d3d3f3d5d374b1f64a066db6ddc
yueyedeai/lingvo
/lingvo/core/tokenizers.py
Python
py
11,977
permissive
# Copyright 2018 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...
a1348c3b461d60e722e5318f1b60234aa2c2b405
d4cd9c46614e03fcacfa2b12022e18bf54dddacc
SylvesterDuah/Django_Full_Rest_API_project
/Django_Full_Rest_API_project/urls.py
Python
py
820
no_license
"""Django_Full_Rest_API_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, nam...
c2043abb8b3bf56481850496bf9c2ab6e7807412
f8f77959861d37670b431fc00cf343e71602dd14
project-koku/koku
/koku/sources/storage.py
Python
py
16,402
permissive
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """Database accessors for Sources database table.""" import logging from django.db import InterfaceError from django.db import OperationalError from api.provider.models import Provider from api.provider.models import Sources LOG = logging.getLo...
68c033269d2d86fafcf97654ac6d5d33669dc1a8
33e67b2bae469c2fc63c3ee0d432402223446a75
tmullaney/azure-up-or-down
/WebRole1/WebRole1/urls.py
Python
py
609
permissive
""" Definition of urls for WebRole1. """ from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'WebRole1.views.home', name='home'), # url(r'^WebR...
cf28bef52f12faccd80e7a134588dfe1eef05527
30586294da179a714da4f4bc4c96905637cf8fb8
GitHub-ZC/W_PlatformMusicApi
/util/qq_request.py
Python
py
1,902
permissive
import requests # cookie = 'pgv_pvi=1986420736; pgv_pvid=2513132609; ts_uid=2001149360; RK=EPhAYJFjb2; ptcz=cea81665485ca84f2ae2cc148b6b4a118d7f74121a01f436e9255f50bceddc59; tmeLoginType=2; euin=NK4s7Kc57ioq; o_cookie=956581739; pac_uid=1_56581739; tvfe_boss_uuid=e29ed385dc7d68f4; yq_index=6; ts_refer=ADTAGmyqq; ptui_...
5f59ca602c3a5b4840f08be186f221a1321e7a53
c2af2c2f4d33bc23ca3734a3db9e10fa6690e913
V14dik/PyLabs
/serializer/my_pickle.py
Python
py
1,546
no_license
from serialize import dumps as _dumps from serialize import loads as _loads def encode(data): data = data.replace("\n", "").replace(" ", "") result = [hex(ord(i)) for i in data] str_result = "".join(result).replace("0x", " ").upper() str_result = str_result[1:] return str_result def decode(data)...
dccbaf5fba7f5bab0fc6a5d34d3cb735751a75b6
3558d227ca20206c1e1db95ee013b756cac024c4
Qing8/Assignments-for-Data-Structure
/8/Assignment 8 files/Assignment 8 files/LinkedBinaryTree.py
Python
py
13,423
no_license
class LinkedBinaryTree(): """Linked representation of a binary tree structure.""" #-------------------------- nested _Node class -------------------------- class _Node: """Lightweight, nonpublic class for storing a node.""" __slots__ = '_element', '_parent', '_left', '_right' # streamline m...
307260a6b61faa2e48c6546942e2ec21275efe85
8cca395f41bc54e28681bd7e5094d8a969196070
KKomorowski1/pytthonproj
/phoneBase/migrations/0001_initial.py
Python
py
1,377
no_license
# Generated by Django 2.1.7 on 2019-05-17 14:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Details', fields=[ ...
b92c9e447314b9104cd314ba144a60f17664e4e6
10b2026a7e2eb966f9ddc8c559c9674ac83e6ebe
zhanssays/anamyn
/apps/account/models.py
Python
py
2,222
no_license
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) email_confirmed = model...
9f5496c4072f3b404f0f2fd205b9befc2de3dbca
c5513321261fa2df6af1d20537e9a2c386b2c0a8
albertoudenijhuis/zephyros0.4
/func/func.py
Python
py
3,604
no_license
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_im...