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 |
|---|---|---|---|---|---|---|---|---|
5c0ee8d46f406cb9f29652dc040be169141e05de | edde987798c57f13ba367500123e292f62c1679d | shawalahmad123/Learning_Odoo_Development | /salon_market_place_portal_configuration/controllers/main.py | Python | py | 104,957 | no_license | # -*- coding: utf-8 -*-
from odoo import http, fields
import ast
from odoo.http import request
from math import ceil
import requests
import json
import base64
import re
from datetime import datetime, timedelta
import pytz
import difflib
from exponent_server_sdk import DeviceNotRegisteredError
from exponent_server_s... |
7a774539f5ee6fbad8bf13e790837ed25cec0b44 | 11d9852f68c8e088ecfb4b0626392d04ba485a76 | Azure-Samples/azure-intelligent-edge-patterns | /factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/general/tests/test_special_strings.py | Python | py | 844 | permissive | """Special string/char that may cause error.
"""
# Special Chars
special_strings = [
"",
"!",
"@",
"#",
"$",
"%",
"^",
"&",
"*",
":",
"_",
"$",
"^",
"`",
"&",
"?",
".",
",",
"'",
'"',
"#",
";",
"\\",
"/",
"|",
]
special... |
3ed5de996a52058dcf49421e0bf0d4a44c7c2699 | a4305a1e2001ce545434d09bf5ce482b3218ebc2 | yxjsolid/Diablo-III-Protocol-Simulator | /Utils.py | Python | py | 2,642 | permissive | #! /usr/bin/env python
import sys, os
from ByteStream import ByteStream
def MessageType(message):
return message.DESCRIPTOR.full_name
def BytesToHtml(bytes):
result = ''
for byte in bytes:
result += '%02x ' % byte
return result
def LoadRequest(request, packet):
if packet.HasPayload():
request.Par... |
bbc46dba444a51c5f094d60ff97b9540bfb91225 | 859eb438612db54083e776b29d2cea15c7abec49 | jfsubrini/project3_mmg | /mmg_game.py | Python | py | 6,810 | no_license | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#################### MACGYVER MAZE GAME ####################
# #
# MacGyver needs to get out of jail and find his way out #
# of the maze reaching the place where Murdoc stands, #
# the prison guard. ... |
6ac2b218e1208f29adf08a77883354d50f0a3edd | 3878511f4b270d9d23bffa20cc61aadd5b1b646c | BrentLittle/100DaysOfPython | /Day045 - Web Scraping with Beautiful Soup/liveWebsite.py | Python | py | 769 | no_license | from bs4 import BeautifulSoup
import requests
response = requests.get("https://news.ycombinator.com/news")
webpage = response.text
soup = BeautifulSoup(webpage,"html.parser")
articles = soup.find_all(name="a", class_="storylink")
articleTexts, articleLinks = [], []
for articleTag in articles:
articleTexts.appe... |
48d38a7fb6754edeebf4531310d0d9a8c4caee10 | f0f88f11a4016543e388c39337235ebbb39eaec2 | vizance/Python_Data_Analysis | /第二章_CSV檔案處理/pandas_select_contiguous_rows.py | Python | py | 660 | no_license | # -*- coding: utf-8 -*-
#!usr/bin/env python3
#(pandas)選取特定連續「資料列」
"""
Created on Thu Sep 21 10:39:42 2017
@author: vizance
"""
import pandas as pd
import sys
input_file = sys.argv[1]
output_file = sys.argv[2]
data_frame = pd.read_csv(input_file,header=None)#不要將header算在index中
data_frame = data_frame.drop([0,1,2,16,17,... |
2f577254e2ec16bcfbe821dedd5af80b99fc738c | f56b8b6004acb814ea3f44b4689ffae7ad952610 | ykmc/contest | /atcoder-old/2017/1230_abc084/b.py | Python | py | 503 | no_license | # python 3.4.3
import sys
input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
# -------------------------------------------------------------
# main
# ---------------------------------------------------... |
6ae0796e8376cf405f7cdef8170ec92cf19c2cca | 1b889ff519358fdde588ffc4e113429580be703c | yorek/azure-cli-extensions | /src/dataprotection/azext_dataprotection/tests/latest/example_steps.py | Python | py | 22,655 | permissive | # --------------------------------------------------------------------------
# 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 cause... |
a395a3ef9b7723fc89e7adc400702777f2e421d9 | ee6b29eff13eca1b8de0f81e884e2127f1a346be | Goular/PythonModule | /02.天善-Python数据分析与挖掘实战/01.Python语法基础/12.乘法口诀表.py | Python | py | 368 | no_license | # 乘法口诀表顺序
for i in range(1, 10):
for j in range(1, i + 1):
print(str(i) + "*" + str(j) + "=" + str(i * j) + " ", end='')
print()
# 添加分行内容
print()
print()
print()
# 乘法口诀表倒序
for i in range(9, 0, -1):
for j in range(i, 0, -1):
print(str(i) + "*" + str(j) + "=" + str(i * j) + " ", end='')
... |
8b2a828862d8de43887e1ede5ff7ffaa7a866f2e | c979abb22c2ba2057ad6ffe30a903cba82726def | sskopek/OLX-Web-Scrapper | /main.py | Python | py | 1,062 | no_license | import requests
import re
from bs4 import BeautifulSoup
url='https://www.olx.pl/nieruchomosci/mieszkania/sprzedaz/gdansk/'
polaczenie = requests.get(url)
if polaczenie:
print('Połączono z serwerem')
else:
print('Brak połączenia z serwerem')
soup = BeautifulSoup(polaczenie.content, 'html.parser')
lista_cen=... |
6062ece81666e73e23dc92ee5dcc52cd6da7f754 | b9765be0de6a1c333a237a0fa72384b565ac925c | 1480c1/vmaf | /python/vmaf/core/mixin.py | Python | py | 2,991 | permissive | from abc import abstractmethod, ABCMeta
import os
import uuid
import re
from vmaf.tools.misc import get_dir_without_last_slash
__copyright__ = "Copyright 2016-2020, Netflix, Inc."
__license__ = "BSD+Patent"
class WorkdirEnabled(object):
"""
Facilitate objects in its derived class to be executed in parallel
... |
9c33b53013dbe079444db6beab1d697dd04e425b | b1fecef8f7277e28313416f580151fce0c1f334c | maciopelo/project-sdsz | /src/InterfaceStuff.py | Python | py | 2,788 | no_license | import pygame
import json
from datetime import datetime
def pause(clock):
paused = True
while paused:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
if event.type == pygame.KEYDOWN:
if event... |
24d06cc5e40a7b6f0b39863b3eaa243d727727fa | adad67f00639def031d94114b0b6bacee77a9a8b | medsmb/ProjetStageM1 | /scrape/dataville/Dataville.py | Python | py | 5,491 | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
© 2018 Mohammed BENAOU & Mohammed RASFA ALL RIGHTS RESERVED
Sous l'encadrement de Mr.Sylvian dejean
"""
from bs4 import BeautifulSoup
from bs4 import NavigableString
import requests
import os, os.path, csv
import time
import sys
reload(sys)
sys.setdefaultencoding('utf8')
... |
8adb5124787ea62586436580ebad11c702583bfe | bd61a631361ff4e769cf95926abb735a113bcafa | rejahrehim/SecureTea-Project | /test/test_server_utils.py | Python | py | 2,507 | permissive | # -*- coding: utf-8 -*-
import unittest
from securetea.lib.log_monitor.server_log import utils
try:
# if python 3.x.x
from unittest.mock import patch
except ImportError: # python 2.x.x
from mock import patch
class TestServerUtils(unittest.TestCase):
"""
Test class for ServerUtils.
"""
@... |
bbf3c91d9b764d92b1655a722b815507b2b7f4bf | f5cdf23838ef2308ceab6ce64bbac15fc837b8c6 | ZSerhii/Beetroot.Academy | /Homeworks/HW2.py | Python | py | 1,679 | no_license | cur_day = 'sunday'
my_name = 'Serhii'
greeting = 'Good day {}! {} is a perfect day to learn some python.'
print('Task 1: The greeting program.\n')
print('''Make a program that has your name and the current day of the week stored
as separate variables and then prints a message like this:
Good day <name>! <day> is a per... |
f76128e84b4349865bf6cf1e77ed707b3afcedd2 | dd59baae289fe7d7c2918c9ee00d3f58353d2399 | rosoareslv/SED99 | /python/mopidy/2015/12/icy.py | Python | py | 1,839 | no_license | from __future__ import absolute_import, unicode_literals
import gobject
import pygst
pygst.require('0.10')
import gst # noqa
class IcySrc(gst.Bin, gst.URIHandler):
__gstdetails__ = ('IcySrc',
'Src',
'HTTP src wrapper for icy:// support.',
'Mopid... |
e25985eeea602e488b7cdbd70ec7f996f04eeb8f | 1e072ef1e1c89b0235c3cf856b317c8bb5493460 | ftk-ntq/vpp | /src/tools/vppapigen/generate_go.py | Python | py | 6,290 | permissive | #!/usr/bin/env python3
import argparse
import os
import pathlib
import subprocess
import tarfile
import requests
import sys
#
# GoVPP API generator generates Go bindings compatible with the local VPP
#
parser = argparse.ArgumentParser()
parser.add_argument("-govpp-commit", help="GoVPP commit or branch (defaults to ... |
316900c158cb2e6f868a1a4f5cc285e15625a5d1 | 2b05208749d4781906f68bddb9ab2bb1a9b048e3 | mrsrinivas/diec | /day1/kapua-python-client/swagger_client/models/endpoint_usage.py | Python | py | 3,038 | permissive | # coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
i... |
9e14b3ca0bcab4f71f79145dd6d9380776d8a8ea | 81b3cc8470c279aa159ee4ea0449dbd0157d5691 | gabriellaec/desoft-analise-exercicios | /backup/user_277/ch149_2020_04_13_20_11_34_410362.py | Python | py | 945 | no_license | salario=float(input("Qual o salario bruto?"))
numero=int(input('Qual o número de dependentes do usuário?'))
#INSS
if salario<=1045:
imposto=0.075*salario
elif salario>1045.01 and salario<=2089.6:
imposto=0.09*salario
elif salario>2089.61 and salario<=3134.4:
imposto=0.12*salario
elif salario>3134.41 and sa... |
2e66cfced6bbf80b94cccb93287d8e507f3243f4 | 9a1da0842c51b3a1db12e2343eb23714d8780625 | Srinivas-byte498/webservices-new | /customer/views.py | Python | py | 357 | no_license | from django.shortcuts import render
import logging
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from rest_framework.decorators import api_view
from metadata.functions.metadata import getConfig, configureLogging
from metadata.functions.service import validateCookieService
imp... |
c49a265b0e6a23ca9dc7d3606d47cb077793f17a | 778158ea0cc236a67954bf15d52b36fa8a3d0581 | physics-sec/Linear-Cryptanalysis | /Python3/basic_SPN.py | Python | py | 4,601 | no_license | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# A basic Substitution-Permutation Network cipher, implemented by following
# 'A Tutorial on Linear and Differential Cryptanalysis'
# by Howard M. Heys
#
# 02/12/16 Chris Hicks
#
# Basic SPN cipher which takes as input a 16-bit input block and has 4 rounds.
# Each roun... |
42cb26c8078c6635b546fc3743f8b414d9a07017 | 3585a08eee1e80ce49a7f31b3f2541e3f16478ca | molliegoforth818/tandem_code_challenge | /tandemproject/scores.py | Python | py | 265 | no_license |
def correct():
print("THATS RIGHT!")
input("Press Enter to go to next question.")
def incorrect(question_object):
print("WRONG!")
print(question_object['correct'], 'is the correct answer.\n\n')
input("Press Enter to go to next question.")
|
65e89be6fa22feb6d6f95a85de9044add18c89cb | 2e90aec5da793688437b38f99fb4c7a2d38dd984 | josepato/bias_trunk_v6 | /bias_fiscal_statements/report/fiscal_statements.py | Python | py | 3,776 | no_license | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
4bc78e3b58f39cd63b3677b4137446138b88bea8 | 9f32ef500b1b704933a6f29bd9d332ff755ba91d | MingboPeng/queenbee | /tests/conftest.py | Python | py | 594 | permissive | import pytest
import os
import shutil
from urllib import request, parse
@pytest.fixture(autouse=True)
def temp_folder():
os.mkdir('tests/assets/temp/')
yield
shutil.rmtree('tests/assets/temp')
@pytest.fixture(autouse=True)
def mock_repository_url(monkeypatch):
repo_base_bath = 'tests/assets/rep... |
4dd7f3288b2d2367950e0cd8350bcfb72b8d252a | ed3eae7c7295fd1e66856bd48fb4e1597e890ca3 | mayararysia/livro-python | /cap13/decorador2.py | Python | py | 245 | no_license | class trace_call:
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
print("Function executed: {} args: {}".format(self.f.__name__, args))
self.f(*args, **kwargs)
@trace_call
def add(a, b):
return a + b
add(1, 3)
|
200e5c87046577673d7884934d29196425627851 | 4214d3619268d8730df22a3c0a496b8daa49b5c0 | yakazimir/allennlp | /allennlp/models/encoder_decoders/simple_seq2seq.py | Python | py | 23,674 | permissive | from typing import Dict, List, Tuple, Iterable
import numpy
from overrides import overrides
import torch
import torch.nn.functional as F
from torch.nn.modules.linear import Linear
from torch.nn.modules.rnn import LSTMCell
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import START_SYM... |
cf63b117e6fd3e73b20a22a346ac7b65bbe64391 | dcc348a5bc0fc684424680c4d27f8713401aa90c | Neal0408/LeetCode | /剑指 Offer/#Offer_11.py | Python | py | 948 | no_license | # 剑指 Offer 11.旋转数组的最小数字
# 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。给你一个可能存在重复元素
# 值的数组 numbers,它原来是一个升序排列的数组,并按上述情形进行了一次旋转。请返回旋转数组
# 的最小元素。
# 解题思路
# 1.自己没做出来,甚至最开始都没太懂题意。看了官方题解,意思就是数组做过旋转找旋转点。题解用
# 的方法是用二分法找到左升序组合右升序组交界的元素就是旋转点。
class Solution:
def minArray(self, numbers: [int]) -> int:
i, j = 0, len(numbers) - ... |
437915f52dcdc5b77c88bcaa14fee7e27a637676 | dea3b834e11dc4df22fe3c9ad500098cbb3eebc4 | panjunjun/marclib | /src/mplib/common/base_class.py | Python | py | 425 | no_license | # coding: utf-8
# __author__: u"John"
from __future__ import unicode_literals
# region 属性访问定义——字典后接'.' + key名,即可得到字典中key对应的内容
class AttributeDict(dict):
"""
能够把dict的key当作class的attribute
"""
def __getattr__(self, attr):
return self[attr]
def __setattr__(self, attr, value):
... |
dca53558dfe5512f1468da8c08d60bd715301ff5 | 2dd08597f351bd900522f458de4202da7c2f45d3 | sedrof/yelp-scraper | /bdmscraper/middlewares.py | Python | py | 3,605 | 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 BdmscraperSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scra... |
3bb75c5713aa1914618890a20f2d3e5850743557 | 1b291c23dd34632fdbde3202e4355709f747d0b8 | richard-lane/dk3pi | /lhcbMonteCarlo/tools/requestScript.py | Python | py | 953 | no_license | import os
# If the directory where I will be storing my local copy of DaVinci already exists, raise
if os.path.exists("./DaVinciDev_v45r1/"):
raise Exception("rm the davnci dir before running")
# Create a local copy of DaVinci v45r1
j = Job(name='2018 WS MC')
myApp = prepareGaudiExec('DaVinci','v45r1', myPath='.'... |
92a12bd0a949462a84d9a9119e905fd7ac9aa7c8 | 934ee94e65df3ba6f7939720d2267b5518b261a9 | koenvanderlinden/home-assistant | /homeassistant/components/samsungtv/media_player.py | Python | py | 9,716 | permissive | """Support for interface with an Samsung TV."""
import asyncio
from datetime import timedelta
import logging
import socket
import voluptuous as vol
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL,
... |
eb5704b09509c778af59aec83156ad425d443ec0 | f5f5e43fb8d20a37f2ceefa9a899f005bb998c63 | hjhjw1991/leetcode | /python/87_Scramble_String.py | Python | py | 715 | no_license | class Solution:
# @param {string} s1
# @param {string} s2
# @return {boolean}
def isScramble(self, s1, s2):
return self.find(s1,s2,{})
def find(self, s1, s2, dic):
if (s1,s2) in dic:
return dic[(s1,s2)]
elif sorted(s1)!=sorted(s2):
return Fals... |
d0e0c1598779bee439a6f18f1dccf96ff8410ff6 | 148efd82c746fbeba6aa7cafc0f689130631716e | rotheconrad/00_Annotation_Pipeline | /03a_BlastTab_BestHit_Filter.py | Python | py | 4,455 | no_license | #!/usr/bin/env python
'''Best Hit Filter for Tabular Blast Output.
This script filters tabular blast output for best hit based on bitscore,
as well as user defined percent match length, and percent identity.
This tool takes the following input parameters:
* tabular blast input file that includes query and subje... |
00390da0d0407842686ec0343236f11a73cee283 | a30cd3036e9e959d6d2bf7bed748ba1fa8122403 | stephweissm/pyodesys | /pyodesys/plotting.py | Python | py | 6,684 | permissive | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import numpy as np
def plot_result(x, y, params=(), indices=None, plot=None, plot_kwargs_cb=None,
ls=('-', '--', ':', '-.'),
c=('k', 'r', 'g', 'b', 'c', 'm', 'y'),
m=('o', 'v',... |
b1c41f8e1acb405b1a0d29e7822f5115cb177306 | 365bb165630513267bf774aa425efccf82eede3b | azimxxm/KinderSchool-website | /KinderSchool/urls.py | Python | py | 385 | no_license | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('website.urls'))
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns +=... |
39ce03432fffc741f7c50452fb8d1bf67dafb77f | 95cebdff80403820f1e27ad4a6fdafc901efb4b4 | vloison/Projet_de_departement | /moviegenre/get_data.py | Python | py | 4,288 | no_license | # -*- coding: utf-8 -*-
from pathlib import Path
import argparse
import yaml
from preprocessing.database import clean_database, download_database
from preprocessing.sets import preprocess_data
from utils.misc import triplet_to_str
import numpy as np
import pandas as pd
def main(args):
config = yaml.safe_load(open... |
1285ebc256232aab2c9c305201a887258dbfa111 | b2b04f5287f0f4b4d57bd21af4e48bb70a8d7346 | xavierchermain/importance_sampling_glint | /command_convergencecomparisons/allconvergencecomparisons.py | Python | py | 801 | permissive | import math
import numpy as np
import subprocess
# 5 tests
#thetas_o = ["1.5"]
#alphas = ["0.6"]
#widths = ["0.0001", "0.0003", "0.0012", "0.005", "0.01"]
# In the paper:
# 45 tests
thetas_o = ["0.", "1.", "1.5"]
alphas = ["0.1", "0.25", "0.6"]
widths = ["0.0001","0.0003","0.0012","0.005","0.01"]
# n_runs = 8
# In ... |
409df6f7367490a0e7a171796559603906a398f2 | 8e493d8ceda28244fb4d192997a92702359ef61b | timbo-rafa/version | /version/helpers.py | Python | py | 364 | permissive | from .version import Version
def compare(v1, v2):
"""Compares version v1 with version v2
:param v1: Version 1 as a string.
:param v2: Version 2 as a string.
:return: 1 if v1 > v2, -1 if v1 < v2, 0 otherwise.
"""
v1 = Version(v1)
v2 = Version(v2)
if v1 > v2:
return 1
... |
ef5f7122bcc4e0ac37b7f44389b5a654558fa0d5 | 3afa84ec1ddef42060d123d82f8db3a1cee3a98f | glemelleii-brandeis/Assignment_3_ROS | /rbot250_A3_ws/build/turtlesim/ament_cmake_python/turtlesim/setup.py | Python | py | 204 | no_license | import os
from setuptools import find_packages
from setuptools import setup
setup(
name='turtlesim',
version='1.3.3',
packages=find_packages(
include=('turtlesim', 'turtlesim.*')),
)
|
f00a3413a794923976f193dc04d60f4e3c851578 | 8ed062c186f9710f550f41a534ccdc0cc6bdd488 | MACmidiDEV/BikeStore | /products/migrations/0002_auto_20191216_0338.py | Python | py | 454 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-12-16 03:38
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
67a091e573c37bc32d4b7e4a96893f6cfdbcdc35 | e84f784bc3a75fa1efd3daf8d83030b07c98d7ee | FinalAngel/django-hvad | /nani/manager.py | Python | py | 27,888 | permissive | from django.conf import settings
from collections import defaultdict
from django.db import models
from django.db.models.query import (QuerySet, ValuesQuerySet, DateQuerySet,
CHUNK_SIZE)
from django.db.models.query_utils import Q
from django.utils.translation import get_language
from nani.fieldtranslator import tra... |
ce605661a4021e63288ee2895e534714317c3262 | 3c05fff55ca2f2dabcbf7606ddfbb4ef427f62e3 | mackzheng/webkit | /Tools/Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py | Python | py | 1,927 | no_license | # Copyright (C) 2017 Igalia S.L.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.... |
34f7a3ff2126008b23a334ce3a97afb8607d6f12 | d1d84edd6b0aa4f848c971613b5ac6929b4b8395 | zixk/pyBasics | /modules/PyPDF2/info_extractor.py | Python | py | 724 | no_license | import os
from PyPDF2 import PdfFileReader
def extract_information(pdf_path):
with open(pdf_path,'rb') as f:
pdf = PdfFileReader(f)
information = pdf.getDocumentInfo()
number_of_pages = pdf.getNumPages()
metadata = pdf.getXmpMetadata()
txt = f"""
Information about {pdf_... |
d5595ee14b57624b23e86ac13bad30507721101d | bf195a5921f5b2e2e3c8c424cc8cbaf857a7e4bb | jhonatang1988/holbertonschool-higher_level_programming | /0x05-python-exceptions/2-safe_print_list_integers.py | Python | py | 390 | no_license | #!/usr/bin/python3
def safe_print_list_integers(my_list=[], x=0):
i = 0
j = 0
while i < x:
try:
print("{:d}".format(my_list[i]), end="")
i += 1
except TypeError:
j += 1
i += 1
pass
except ValueError:
j +=... |
3a68b5f576ecf1b41a17d0eef26c1c83cfe2317c | 4b3072e85f937a42b4329d4e555673eed5a55b42 | foglamp/FogLAMP | /tests/unit/python/foglamp/common/test_configuration_cache.py | Python | py | 4,248 | permissive | # -*- coding: utf-8 -*-
import pytest
from foglamp.common.configuration_manager import ConfigurationCache
__author__ = "Ashish Jabble"
__copyright__ = "Copyright (c) 2018 OSIsoft, LLC"
__license__ = "Apache 2.0"
__version__ = "${VERSION}"
@pytest.allure.feature("unit")
@pytest.allure.story("common", "configuration_... |
cdd495cfe6419a370f2b6b7b2fb747cc70470482 | a71df3293b63f3a1a52bc50babb9e534ca6b20a2 | gishikawa3/my-nnabla-examples | /mnist-collection/translete.py | Python | py | 2,584 | permissive | import nnabla as nn
import numpy as np
import os
import shutil
import zipfile
import glob
import argparse
def remove_glob(pathname, recursive=True):
for p in glob.glob(pathname, recursive=recursive):
if os.path.isfile(p):
os.remove(p)
def decompress_from_nnp(nnp_path):
with zipfile.ZipFil... |
e9ba9c13996f82b8b8e329f6f521e5534c1045e2 | 0ea528dc2917f61a04f10c669e5ff2b98f5efb12 | karateviktor/flask-restful | /tests/__init__.py | Python | py | 357 | no_license | #!/usr/bin/env python
import functools
from nose import SkipTest
def expected_failure(test):
@functools.wraps(test)
def inner(*args, **kwargs):
try:
test(*args, **kwargs)
except Exception:
raise SkipTest
else:
raise AssertionError('F... |
3e7297eb16238fc23bbcd3ebcc045884cbdd8645 | e4fdbb6d9ea297f8b33d873b977ae770955084b9 | novakale/openvino | /src/frontends/tensorflow/tests/test_models/gen_wrapper.py | Python | py | 1,086 | permissive | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import sys
print(sys.argv)
if len(sys.argv) < 4:
print("Script[model in pbtxt format], output folder and mark file must be specified as arguments")
exit(1)
gen_script = sys.argv[1]
out_folder = sys.a... |
e8e7cde01398cd17fb665f31dd32791d9df757b6 | e37011653f2a13320e559addc73a111e76eefae2 | DanielSoaresFranco/Interacao-com-SO | /Aula03.py | Python | py | 594 | permissive | import os
# Para pegar o diretório atual usar os.getcwd()
print('Diretório atual: ', os.getcwd())
# Para ver o diretório do arquivo usar os.path()
# Para referenciar o arquivo atual, usar __file__ na função
print('Arquivo Atual:', __file__)
#para nome do arquivo usar os.path.basename()
print('Nome do arquivo atual: ... |
fb94cae9eba13d50084ca524f781655c23d177a1 | 2ca6790e014fb239c684454b4427aaf24d9f4fa9 | splogamurugan/readable_password | /readable_password/readable_password.py | Python | py | 1,556 | permissive | from string import ascii_lowercase
from string import punctuation
from string import digits
from random import sample
from random import choice
from functools import partial
from math import ceil
def readable_string(n:int):
vow = ['a', 'e', 'i', 'o', 'u']
cons = list(set(ascii_lowercase).difference(set(vow)))
... |
144e301d31084a718a0d939602b77ffa56916558 | 78428988c274952bd25997606b031224bf317f94 | tjacek/toy_lisp | /python/mat.py | Python | py | 4,437 | no_license | import re
from collections import namedtuple
Token=namedtuple('Token',['type','value'])
class Tokens(list):
def __init__(self, arg=[]):
super(Tokens, self).__init__(arg)
self.current=0
def peek(self):
return self[self.current]
def shift(self):
if(self.current<len(self)-1)... |
72ad537137fa57ad62eb5317f77035c8d1140a13 | 32dfeea34783bba57e087ce6fbb8c0a3efba3edc | liaoweixia/SimpleChinese2 | /simplechinese/conversion.py | Python | py | 346 | permissive | import chinese_converter
def to_simplified(s):
res = list(chinese_converter.to_simplified(s))
for i in range(len(s)):
if s[i]=='泡' and res[i]!='泡':
res[i]='泡'
res = "".join(res)
return res
def to_traditional(s):
res = list(chinese_converter.to_traditional(s))
res = "".join(... |
41983863b0f6214fd80aa2fd909fbe7e8bba27b7 | f93c0771fd5bef714d77d381f2a7aef102a7fcf4 | zleizzo/datadeletion | /runtime_experiment_final.py | Python | py | 4,307 | no_license | """
Timing experiment
"""
import numpy as np
import random
from data.data import *
from retraining import *
from timeit import timeit
import csv
from scipy.stats import sem
np.random.seed(0)
d_vals = [1000, 1500, 2000, 2500, 3000]
k_vals = [1, 2, 3, 4, 5, 10, 25, 50, 75, 100, 125, 150]
noise = 1
R =... |
3d31ca750f48f0bc590f1cda284edb4b44354102 | 717bd5ca4b0b90cdd97bc136a432c0beedff3a35 | johnathanachen/Daily_Coding_Challenges | /Hacker Rank/Algorithms/ Implementation/migratory_bird.py | Python | py | 857 | no_license | # def migratoryBirds(n, ar):
# count = []
# arry_of_highest_num_index = []
# biggest = []
#
# for i in ar:
# count.append(ar.count(i))
#
# max_num = max(count)
#
# for index, i in enumerate(count):
# if i == max_num:
# arry_of_highest_num_index.append(i... |
3f6ebf98667ee54d738faa07e6741532d1ce7b64 | dc13a4701d8b4e5753c86204c2341c011a553da4 | arjonatorres/alarma | /home/pa0.py | Python | py | 239 | no_license | import os
import sys
import time
import string
from jose.per import *
funcion = pa0
hilo1(funcion,tpa0)
for i in range(intentos):
comprobararriba()
if (comprobararriba()!=0):
hilo1(funcion,tr)
else:
break
hilo2()
ser.close()
|
f374624d81ddd12b89c4e4344d92c6bb96d69a7b | 58d03dda3f12d44680237df481141a84d5d1903e | ursaplus/octopus | /octopus/core/edge.py | Python | py | 1,068 | permissive | EDGE_UNCONDITIONAL = 'unconditional'
EDGE_CONDITIONAL_TRUE = 'conditional_true'
EDGE_CONDITIONAL_FALSE = 'conditional_false'
EDGE_FALLTHROUGH = 'fallthrough'
EDGE_CALL = 'call'
class Edge:
def __init__(self, node_from, node_to, edge_type=EDGE_UNCONDITIONAL,
condition=None):
self.node_fr... |
1b8722e70a078d0093b73dab29bdf69d557d0ffa | 3b79e9b03369a7c3ab0130e42ac49de76dce39cd | ronniegeiger/Abaqus_scripts-10 | /FEM_Coursework/FEM5_heat_transfer.py | Python | py | 12,580 | no_license | # FE analyses of a plate with a hole
# The first three lines are required to import the required ABAQUS modules and create references to the objects that are
# defined by the module. The second line means that you are importing the symbolic constants (variables with a constant
# value) that have been defined by th... |
2721d075ce5317426b1309802f2109a22e7bed78 | 5ae6325b3f224f7c098c71b0795ce8fa4d5504b3 | danyoungday/whats-cookin-good-lookin | /Ingredient_Parser.py | Python | py | 661 | no_license | def parser():
with open("scrape.txt", "r", encoding="utf-8") as src_text_document:
src_text = src_text_document.read()
recipes = src_text.split("😀")
for recipe in recipes:
ingredients = find_ingredients(recipe)
print(ingredients)
def find_ingredients(r... |
5d930f0e573c1e619fd7faf98650d577cb6bdcc9 | 83ad600506acb3d2f766540456fc16916ea2d758 | l0kihardt/BkScanner | /DomainAnalysis/plugins/subdomain/fofa.py | Python | py | 3,845 | no_license | #!/usr/bin/python
#-*- coding:utf-8 -*-
__author__ = 'BlackYe'
import sys
import urllib
import urllib2
import cookielib
import re
from bs4 import BeautifulSoup
from os import path
from DomainAnalysis.utils.common import is_vaild_ip
from DomainAnalysis.utils.common import getCrangeIP
class FofaDomain()... |
f6f939f6a5d0b8b50de7aac308a69564d2bc1d8b | ac20635444ced7c2efb06ba360db6e25703cfd97 | cpearson1/et-demands | /et-demands/cropET/bin/grow_root.py | Python | py | 1,873 | no_license | import logging
import math
def grow_root(crop, foo, debug_flag=False):
"""Determine depth of root zone"""
# dlk - 10/31/2011 - added zero value tests
fractime = 0
if crop.curve_type == 1 and crop.end_of_root_growth_fraction_time != 0.0:
fractime = foo.n_cgdd / crop.end_of_root_growth_fraction... |
385c992955dc93fa5b0d7d6be7040e599a5c5b5c | 446b5125b8a7d3d33ecd2d184e844e7cdf30e297 | SHI-development/DB-Microservice | /db_micro/test/test_yogi_controller.py | Python | py | 2,338 | no_license | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from db_micro.models.server_error import ServerError # noqa: E501
from db_micro.models.yogi import Yogi # noqa: E501
from db_micro.test import BaseTestCase
class TestYogiController(BaseTestCase):
"""YogiCont... |
79975f7277eed021bcdd50fe8b0d7d88a72bd132 | 3c65119cb2ce85828d5735c3d196ab2d108d030c | JashimMj/ump | /ump/project/migrations/0012_alter_mrcreate_total_amount.py | Python | py | 427 | no_license | # Generated by Django 3.2.1 on 2021-05-11 07:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project', '0011_alter_mrcreate_total_amount'),
]
operations = [
migrations.AlterField(
model_name='mrcreate',
name='... |
743c6bfa9f02316568666951d8c83f550afa7b88 | c85fc2bfd27354cd119278018ae288bb6275b4de | CarlKT/summerJob2020 | /ref_files/VAE_learning_tools/VAE_v2.py | Python | py | 4,315 | no_license | import tensorflow as tf
from tensorflow.keras.layers import Dense, Input, Conv2D, Flatten, Reshape, Conv2DTranspose
class Encoder(tf.keras.Model):
def __init__(self, latent_dim):
super(Encoder, self).__init__()
self.conv2da = Conv2D(32,
3,
... |
91360213116d57f4f3cf37d043f64b6ea6662bdb | bb744596bcc63ab7be531bec8461b364bad13ce8 | phemmz/djangopostit | /postitboard/models.py | Python | py | 1,153 | no_license | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# Group model containing groupname and description
class Group(models.Model):
groupname = models.CharField(max_length=50, unique=True)
description = models.TextField(null=True, blank=True)
group_creator = mo... |
1973909ec817895ca9e05f10afd4d6600d41335e | d89d3d9eafadd43810237298239c37152cf957a2 | IntAlgambra/RavenMessenger | /client_tui.py | Python | py | 7,577 | no_license | import npyscreen
import client_backend
import rsa
#Кастомизируем класс Title text
class CustomTitleText(npyscreen.TitleText):
_entry_type = npyscreen.Textfield
def __init__(self, *args, **kwargs):
super(CustomTitleText, self).__init__(*args, **kwargs)
self.allow_override_begin_entry_at = True
... |
5250bc8f805bf4262af91afae8bff3b737491ea7 | bc07642c7d73723c085140ae6eabf564d5738904 | qcoudert/tr54_ev3lego | /pilot.py | Python | py | 5,974 | no_license | from pybricks.ev3devices import Motor
from pybricks.parameters import (Port, Stop)
import math
MAX_ANGLE_SPEED = 350
MAX_SPEED = 800
class Pilot:
"""Pilot class allowing user to drive the robot"""
def __init__(self):
self.speed = 0 # speed of the robot in deg/s
self.d... |
ba4660b90da87e87c65784cfebd429abdfd6d642 | a34da4ded5509b661bb5a57b3b959ff42e29e054 | paolotof/python | /p4erCoursera/assn_3_1.py | Python | py | 674 | no_license |
# 3.1 Write a program to prompt the user for hours and rate per hour using # raw_input to compute gross pay. Pay the hourly rate for the hours up to # 40 and 1.5 times the hourly rate for all hours worked above 40 hours.
# Use 45 hours and a rate of 10.50 per hour to test the program (the pay
# should be 498.75). Yo... |
b28dfae2b278208ccc776d0071044e2e21ad64a3 | 2506bdf12dae26801e6845a0eb2de2e06589adb0 | Cokthemhok/mobile-AGV-optimization | /python/results/old/delay_random_10x1_worse_performance/plot_results0.py | Python | py | 5,703 | permissive | import csv
import logging
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import random
import statistics as stat
import glob
import os
import yaml
logger = logging.getLogger(__name__)
def set_size(w,h, ax=None):
""" w, h: width, height in inches """
if not ax: ax=plt.gca()
l =... |
d05a919be58ef0416cb718f7661128fe18782c49 | c00f373fb87669a442a8af456479f208e01b643b | abhimanyu96/Pong-Actor-Critic | /Pong_AC.py | Python | py | 8,355 | no_license | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 16:40:14 2018
@author: Abhimanyu
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 29 15:01:41 2017
@author: Abhimanyu
"""
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import pickle
import gym
import tensor... |
2e2b35265b9be214edd62d25baaeae8edca42ac6 | 508707b68b81c14078d69a1e61ef67c96d50bcb3 | gilson27/nmos-discovery-registration-ri | /nmos-common/nmoscommon/query.py | Python | py | 5,960 | permissive | # Copyright 2017 British Broadcasting 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 a... |
39357ce4627932e5793b4f6db4265ca30f64dbac | eae3504c81e84bd5d538c77d41102bef2d61f17a | caige88/Externals | /ServerPackages/dirac-make.py | Python | py | 1,149 | no_license | #!/usr/bin/env python
import imp
import os
import sys
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s')
here = os.path.dirname( os.path.abspath( __file__ ) )
chFilePath = os.path.join( os.path.dirname( here ) , "common", "CompileHelper.py" )
try:
with open( chFilePath ) as fd:
c... |
2888b05b32f8bd201fb63181bb0beace6954be16 | f5522c9ac4c52dc4382c59de6e649a8810ae77cc | kar10tik/Elementary_DSA | /Python/stack_linked.py | Python | py | 1,875 | no_license | #Program to implement stacks using linked lists
class Node:
def __init__(self, data):
self.data = data
self.next = None
class Stack_LL:
def __init__(self):
self.head = None
def isempty(self):
if self.head == None:
return True
else: return False
... |
7bda44ab53ee982e32dcfbe9c2a11f33b596ac9c | e2396196d534601ccdea9380255e66e6cb9d7b0d | agalitsyn/dockerfiles | /webmock/webmock/app.py | Python | py | 1,480 | no_license | #!/usr/bin/env python2 -tt
from __future__ import print_function
import argparse
import json
import logging
import time
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from os import environ
logging.basicConfig(level=environ.get('LOG_LEVEL', logging.INFO))
LOG = logging.getLogger('{}:{}'.format(__file__... |
91e93f6e621e9279caa8f6cdd9c634ebae6119ed | 12e7b3e77bb12bc998cf53f83aebbf53d260b508 | bottae/aiProjectSample | /logisticRegression.py | Python | py | 997 | no_license | import numpy as np
#%%matplotlib inline
import matplotlib.pyplot as plt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import optimizers
X = np.array([-50, -40, -30, -20, -10, -5, 0, 5, 10, 20, 30, 40, 50])
y = np.array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1... |
4b6dde5ded4f02fbfa38907e66a9b34b5c486b0b | 73289a67a5f8ed474bff583dbdd7e74a1d2e1a5d | sergfreeman/djangoApp | /FriendsList/friends_list/models.py | Python | py | 266 | no_license | from django.db import models
class MyDB(models.Model):
name = models.CharField('Ім`я', max_length=50)
age = models.IntegerField('Вік')
def __str__(self):
result = f'Ім`я: {self.name} - {self.age}: років.'
return result
|
3306dfd04b560bbb40f67fd9bbefa49f40deebe1 | 95342d78347f820e7a8511b76df316e91de29095 | tttpeng/sxh-py | /gogo.py | Python | py | 10,552 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Required
- requests (必须)
- pillow (可选)
Info
- author : "xchaoinfo"
- email : "xchaoinfo@qq.com"
- date : "2016.2.4"
Update
- name : "wangmengcn"
- email : "eclipse_sv@163.com"
- date : "2016.4.21"
'''
import requests
import openpyxl
from bs4 import BeautifulSou... |
87dc197777654f6c87d9a8e80f7a3364529e0c3f | fa022e4bc5167eddbd6aee225e018381ece94867 | noite-m/nlp2020 | /chart1/practice07.py | Python | py | 413 | no_license | # -*- coding: utf-8 -*-
'''
引数x, y, zを受け取り「x時のyはz」という文字列を返す関数を実装せよ.
さらに,x=12, y=”気温”, z=22.4として,実行結果を確認せよ.
'''
def sendText(x,y,z):
print(str(x) + "時の" + y + "は" + str(z))
sendText(12,"気温",22.4)
#書き方2
def getText(x,y,z):
return f'{x}時の{y}は{z}'
print(getText(12,"気温",22.4))
|
6a759ff911edd2b3cb273183a7a9f222f7a15cf8 | 2339a75a51329bde943f6fe3190242288daf3399 | john9088/Pizzaria | /pizzariaapp/migrations/0002_customerorder.py | Python | py | 765 | no_license | # Generated by Django 3.0.7 on 2020-06-29 11:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pizzariaapp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CustomerOrder',
fields=[
... |
65645a7ed010ccea81331cac004c16391948fda9 | 193b12551b241355d9647d8113e1d3914f385851 | two-man-army/deadline | /deadline_/challenges/migrations/0039_auto_20170727_1643.py | Python | py | 550 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-07-27 16:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('challenges', '0038_auto_20170605_0809'),
]
operati... |
fdf1ea85a71377510557d09745b6d13aeb4a3899 | fc0d7e1a3aad7d7b67aa860c65733bd1a8cb8f7e | sapcc/cinder | /cinder/tests/unit/api/contrib/test_volume_image_metadata.py | Python | py | 17,783 | permissive | # Copyright 2012 OpenStack Foundation
#
# 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 a... |
b8891a2a34210b39419a83001af7d7a2de16ecc1 | bf40c24ad2da9d49be330fc232eb8448273d2694 | florinpapa/PerfKitBenchmarker | /perfkitbenchmarker/linux_benchmarks/hpcc_benchmark.py | Python | py | 10,094 | permissive | # Copyright 2014 PerfKitBenchmarker 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 appli... |
7268cc3172542e8a41174eb98b7943e836d9f3e8 | 0dd2948637f8635566cc03afc539709faeaa87a1 | JayZhou5299/search_engine | /VideoSpider/crawl_baidu_class_demo.py | Python | py | 1,528 | no_license | import requests
import time
def get_json():
payload = {"activityId": 0,
"pageIndex": 1,
"pageSize": 50,
"relativeOffset": 0,
"frontCategoryId": 480000003129019,
"searchTimeType": -1,
"orderType": 50,
"priceTyp... |
65fb3b593c3f01258a3cef575c10a3d6ce381486 | 0b297a1760b5e85a3e3e9ae114903fcc065c5b44 | robotsorcerer/OptimalControlSummers | /lecture07/distribution_propagation_convergence_ex1.py | Python | py | 675 | permissive | import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
n = 4
T = 100
P = np.array([[0.5, 0.5, 0.0, 0.0],
[0.3, 0.4, 0.3, 0.0],
[0.0, 0.3, 0.4, 0.3],
[0.0, 0.0, 0.5, 0.5]])
d0_list = [np.array([1, 0, 0, 0]),
np.array([0, 1, 0, 0]),
... |
f0ddc59d6577c01823888c289151c4bef6965ca7 | f0073cde2408ae099e79894d48fece776c96fb01 | markomamic22/PSU_LV | /LV7/skripta_7_1.py | Python | py | 2,458 | no_license | import numpy as np
import os
from tensorflow import keras
import tensorflow as tf
import seaborn as sns
from tensorflow.keras import layers
from matplotlib import pyplot as plt
from sklearn.metrics import confusion_matrix
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tens... |
54b06c72de48ebf525f12ddc407597ada677bd59 | 6530a2e3e8bf1f697b46c2c82a154a49a75c79d3 | brendan-donegan/waas | /waas/tests/test_location.py | Python | py | 521 | no_license | import unittest
from ..location import (
get_coords_from_ip,
degrees_to_cardinal,
)
class LocationTestCase(unittest.TestCase):
def test_get_coords_from_ip(self):
coords = get_coords_from_ip('1.1.1.1')
self.assertEqual(type(coords), tuple)
def test_get_coords_from_ip(self):
c... |
223c1819e7a77f5bda02744165250ff4826f2764 | 1d7d750a85138259a95eaf020160e617f177f90a | cloi1994/session1 | /Uber/202.py | Python | py | 480 | no_license | class Solution(object):
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
hm = {}
n = str(n)
while n not in hm:
hm[n] = 1
digits = []
summ = 0
for c in n:
digits.append(c)
for d ... |
3393f9719828ebad6aff775beccaa802c0ce6898 | 87ac74c2920584f96340bdc31aa21781a1321c5d | aklap/python-crash-course | /ch-9/car.py | Python | py | 1,370 | no_license | """A module to create instances of class Car, to represent a car."""
class Car():
"""Base Car class."""
def __init__(self, make, model, year):
"""Initialize instance of class Car."""
self.make = make
self.model = model
self.year = year
class ElectricCar(Car):
"""Child cla... |
50556e818bd7ebae94ec074dea905fa1cd5139ad | 93ac0537d8cd1120855d23709ef061999382487e | alintulu/yadage | /tests/conftest.py | Python | py | 5,140 | permissive | import pytest
import os
import yadage.workflow_loader
from packtivity.statecontexts.posixfs_context import LocalFSState
import packtivity.utils
from yadage.state_providers.localposix import LocalFSProvider
from yadage.utils import setupbackend_fromstring
from yadage.wflow import YadageWorkflow
@pytest.fixture()
def l... |
d90816b2c0e5705010d2657780782df7efc672c1 | 1a3e4182df29ed7685c095a7894cc6d229db7110 | tusharkumar99/e-commerce | /ecommerce/settings.py | Python | py | 3,352 | no_license | """
Django settings for ecommerce project.
Generated by 'django-admin startproject' using Django 3.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
... |
110e1ff24ae56b1015e6ad70bd9bb42bd114bb4f | ef4c946c5cf1aa9dcfac658c2c6a36da96438e2f | EIEIOMEISR/MEISR-Web | /docs/updatedb.py | Python | py | 1,948 | no_license | import csv
from survey.models import *
import sys
Routine(description='Waking Up', number=1, code='W').save()
Routine(description='Meal Time', number=2, code='MT').save()
Routine(description='Getting Dressed', number=3, code='D').save()
Routine(description='Toileting/Diaper', number=4, code='TD').save()
Routine(descri... |
9cd605ebfaccc8565d8bc93bb8d9ed51fe39ec89 | b6a5c8db958524e8325fe43d6a2a8afc28873205 | coghex/gamefren | /main.py | Python | py | 7,481 | no_license | import os
from time import time
from kivy.app import App
from os.path import dirname, join
from kivy.lang import Builder
from kivy.properties import NumericProperty, StringProperty, BooleanProperty,\
ListProperty
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.animation import Animation
f... |
19be149a9dab73097420741896a512dec28eefc7 | d102f4beb85976b336f97bb216d35985cb849c2e | vivienzou1/Hackerrank-10 | /Data Structures/Linkedlist/Print in Reverse.py | Python | py | 273 | no_license | def ReversePrint(head):
prev=None
current=head
while(current is not None):
next=current.next
current.next=prev
prev=current
current=next
head=prev
temp=head
while(temp):
print temp.data
temp=temp.next
|
e3492856a1941204e62c359c197b66686f50d176 | 110524df7dbb20730a795c296dc32e219132a448 | tatitati/algorithms | /data_structures/binary_tree/inorder_postorder_preorder.py | Python | py | 957 | no_license | from collections import deque
class Node:
def __init__(self,data):
self.left = None
self.right = None
self.data = data
root = Node(52)
root.left = Node(40)
root.left.left = Node(24)
root.left.left.right = Node(32)
root.right = Node(62)
root.right.left = Node(58)
root.right.right = Node(69)
# ... |
3122d9cda64c0adba8b35da9d213263287c05c78 | 1c207cf69af1d8fa1ef5a79bc655e10abc42499e | quentin-auge/hilbertpiet | /hilbertpiet/run.py | Python | py | 4,798 | no_license | import logging
from dataclasses import dataclass
from typing import Dict, List, Tuple
from PIL import Image, ImageDraw
from hilbertpiet.color import Color
from hilbertpiet.context import Context
from hilbertpiet.macros import Macro
from hilbertpiet.ops import Init, Op
LOGGER = logging.getLogger(__name__)
# (x, y) p... |
4fd037185a024d70ad67e830facf6333d9232e66 | 55a3f255b190ad2046360b361dcd14e3750f17e0 | pexip/os-python-infi-pyvisdk | /pyvisdk/do/drs_recovered_from_failure_event.py | Python | py | 1,243 | no_license |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def DrsRecoveredFromFailureEvent(vim, *args, **kwargs):
'''This event records that DRS ha... |
b011ca1e250e2e84e99305290fa60e30490d611a | 298b35fca79dfca571cad06b7277055b3074912c | jobiaj/Employee-Company-Interaction | /company/relation/models/basics.py | Python | py | 2,774 | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
# def get_image_path(instance, filename):
# return os.path.join('photos', str(instance.id), filename)
class Employee(models.Model):
DOCUBE, JIF... |
bccae2f036773e24f382d0db56848ad0c299aaeb | d62cb512b2ab861c1f693ff53e044d4b2040d892 | kjohna/Intro-Python-I | /src/comprehensions.py | Python | py | 1,240 | no_license | """
List comprehensions are one cool and unique feature of Python.
They essentially act as a terse and concise way of initializing
and populating a list given some expression that specifies how
the list should be populated.
Take a look at https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions
for ... |
f8866d61eb8ab06c3e796e25f109bba92643d63b | 05693a2d3755f7c9ec96fa4b11ee3b49b159439a | rahul-ramadas/leetcode | /contains-duplicate-iii/Solution.37069971.py | Python | py | 1,054 | permissive | class Solution(object):
def containsNearbyAlmostDuplicate(self, nums, k, t):
if len(nums) < 2 or k < 1 or t < 0:
return False
bucket_size = t + 1
buckets = {}
for i, n in enumerate(nums):
normal_n = n + sys.maxsize + 1
... |
c54009de6d0e33b9db435fe6ae115eff515e8660 | dd4c0f0603d192f07a612b6f00172203aaeb6655 | henryk/python-sepaxml | /tests/transfer/test_no_date.py | Python | py | 3,254 | permissive | # encoding: utf-8
import datetime
import pytest
from sepaxml import SepaTransfer
from tests.utils import clean_ids, validate_xml
@pytest.fixture
def strf():
return SepaTransfer({
"name": "Miller & Son Ltd",
"IBAN": "NL50BANK1234567890",
"BIC": "BANKNL2A",
"batch": True,
... |
02975c336a4bcc00bef3fcee5b692642719f5693 | e6008b4234d0fbcee32248c3aa65daf6c2d1722d | cyrilvincent/python | /demo_tuple.py | Python | py | 495 | no_license | from typing import Tuple, List
import tp6
def my_function_tuple() -> Tuple[int ,int]:
return 0, 10
x, y = my_function_tuple()
print(x, y)
def min_max_avg(l: List[float]) -> Tuple[float, float, float]:
min = l[0]
max = l[0]
sum = 0
for val in l:
sum += val
if val < min:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.