hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
962cf635fac3598f4409ebb5ea8fd2466c35cd97 | 2,993 | py | Python | tikz/dijkstra/dijkstra.py | keithmannock/LaTeX-examples | 6829f6cf9710b314a4bf0b64abdae5bcf6997fd0 | [
"MIT"
] | 2 | 2017-11-02T10:09:12.000Z | 2017-11-24T22:16:18.000Z | tikz/dijkstra/dijkstra.py | david-matheson/LaTeX-examples | a8ab55d4b3f5e8503885e4064473958538c4444a | [
"MIT"
] | null | null | null | tikz/dijkstra/dijkstra.py | david-matheson/LaTeX-examples | a8ab55d4b3f5e8503885e4064473958538c4444a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
class Node(object):
""" A node. """
def __init__(self, x, y, data):
self._data = data # data connected to the node
self._x = x # x-position
self._y = y # y-position
data = property(fget=lambda self: self._data)
x ... | 31.840426 | 89 | 0.575342 |
fb42e0c4d250dd83fe26c734b5103f2c73f73d0e | 979 | py | Python | ___Python/Thomas/pycurs_180625/p010_excel/m01_x1_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p010_excel/m01_x1_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p010_excel/m01_x1_excel_read.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
#import xlrd
#'from p01_kennenlernen import my_pycurse_utilities
from p01_kennenlernen.my_pycurse_utilities import alter
excel_file = "O:/___python/thomas/personen_t.xlsx"
personen = pd.read_excel(excel_file)
excel_dict_liste = {}
excel_namen = []
excel_df = pd.read_excel(excel_file)
... | 29.666667 | 94 | 0.690501 |
83a52fee45f782362299d9faddc8c2448fe6311f | 1,098 | py | Python | generator/generator/utils/auxiliary.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 29 | 2017-06-21T19:29:07.000Z | 2022-02-17T12:26:24.000Z | generator/generator/utils/auxiliary.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 34 | 2017-06-26T14:31:02.000Z | 2022-02-03T16:40:41.000Z | generator/generator/utils/auxiliary.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 22 | 2017-06-29T11:08:42.000Z | 2022-02-03T16:16:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Auxiliary Functions."""
import argparse
import copy
def check_positive(value):
"""Positive int check for argparse."""
ivalue = int(value)
if ivalue <= 0:
raise argparse.ArgumentTypeError("%s is not a positive int value!" % value)
return ivalue
c... | 32.294118 | 93 | 0.697632 |
49c378facfa13bf9064c2a8e8df78903aca88838 | 96 | py | Python | Scripts/rio.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 8 | 2020-10-26T06:51:06.000Z | 2021-04-02T13:01:27.000Z | Scripts/rio.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 71 | 2020-10-25T22:46:02.000Z | 2021-10-14T06:47:39.000Z | Scripts/rio.py | kenanchristian/hacktoberfest | b55750bf4facb77abd532b66ed37101e2895c4d7 | [
"MIT"
] | 77 | 2020-10-24T01:53:46.000Z | 2021-10-01T06:25:27.000Z | print("Hello, Jin!")
print("Hello, Kim D!")
print("Hello, Kim B!")
print("Hello, Bubacarr!")
| 12 | 25 | 0.614583 |
49e5e0eb42d0e1168611b92485d790c97569cead | 1,496 | py | Python | qmk_firmware/lib/python/qmk/constants.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/constants.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/constants.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Information that should be available to the python library.
"""
from os import environ
from pathlib import Path
# The root of the qmk_firmware tree.
QMK_FIRMWARE = Path.cwd()
# This is the number of directories under `qmk_firmware/keyboards` that will be traversed. This is currently a limitation of our make system... | 41.555556 | 267 | 0.748663 |
4d42eb72b4ba307026c1fb0481d60da50def8812 | 1,576 | py | Python | tests/onegov/town/test_initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/town/test_initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/town/test_initial_content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
import os
from onegov.core.utils import module_path, rchop
from onegov.event import EventCollection, OccurrenceCollection
from onegov.form import FormCollection
from onegov.reservation import ResourceCollection
from onegov.page import PageCollection
def test_initial_content(town_app):
pages = PageCollection(tow... | 34.26087 | 76 | 0.687183 |
12e2ab921bb0e396b4d8bcca173e60a8133a6e6d | 2,439 | py | Python | Python/Sonstige_Uebungen/object_based_addition.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/object_based_addition.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/object_based_addition.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
####
# File: object_based_addition.py
# Project: Sonstige_Uebungen
#-----
# Created Date: Saturday 16.01.2021, 13:45
# Author: Apop85
#-----
# Last Modified: Saturday 16.01.2021, 16:30
#-----
# Copyright (c) 2021 Apop85
# This software is published under the MIT license... | 30.111111 | 120 | 0.612956 |
67e62f2e3077d24b4407eed3cdb050c3bc434fea | 4,515 | py | Python | frappe-bench/apps/erpnext/erpnext/tests/test_woocommerce.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/tests/test_woocommerce.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/tests/test_woocommerce.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import unittest, frappe, requests, os, time, erpnext
class TestWoocommerce(unittest.TestCase):
def setUp(self):
# Set Secret in Woocommerce Settings
company = frappe.new_doc("Company")
company.company_name = "Woocommerce"
company.abbr = "W"
company.default_currency = "INR"
company.save()
frappe.db.comm... | 49.615385 | 1,797 | 0.726246 |
2252a9d5933fe43e4fd08617bcd1eafabd474a25 | 56,303 | py | Python | Packs/GoogleCloudSCC/Integrations/GoogleCloudSCC/GoogleCloudSCC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GoogleCloudSCC/Integrations/GoogleCloudSCC/GoogleCloudSCC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GoogleCloudSCC/Integrations/GoogleCloudSCC/GoogleCloudSCC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
""" IMPORTS """
import json
from typing import Any, Dict, List, Optional, Tuple, Callable, Union
import urllib.parse
import dateparser
import httplib2
import traceback
from copy import deepcopy
from google.auth import exceptions
from google.oauth2 import service_account
from googleapi... | 40.888163 | 119 | 0.672877 |
22736d14a461fd6f956c8b1ff1e8d52ce45cf988 | 517 | py | Python | PyBottle/main.py | putridparrot/blog-projects | 14ebba5ef194329ed6f1ae4b9ce262dcb50445d0 | [
"MIT"
] | 6 | 2017-12-07T06:20:29.000Z | 2021-06-12T03:47:09.000Z | PyBottle/main.py | putridparrot/blog-projects | 14ebba5ef194329ed6f1ae4b9ce262dcb50445d0 | [
"MIT"
] | 49 | 2020-09-05T04:13:30.000Z | 2022-03-31T18:36:05.000Z | PyBottle/main.py | putridparrot/blog-projects | 14ebba5ef194329ed6f1ae4b9ce262dcb50445d0 | [
"MIT"
] | 11 | 2019-05-04T18:25:13.000Z | 2021-05-10T15:48:45.000Z | from bottle import route, run, get, post, error, request
import jsonpickle
class Person:
def __init__(self):
self.firstName = "Eddie"
self.lastName = "Van Halen"
# http://localhost:8080/putridparrot
@route('/<name>')
def index(name):
return f"Hello {name}"
# http://localhost:8080/person
@g... | 19.148148 | 56 | 0.67118 |
97e376661c4441ace3c82acb032bb68568d9063c | 2,254 | py | Python | Liter_Server/ser.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Server/ser.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Server/ser.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | import socket
import command
import concurrent.futures as futures
class LiterServer(object):
def __init__(self, host='', port=7233):
self.HOST = host
self.PORT = port
self.BUFSIZ = 10240000
self.ADDRESS = (self.HOST, self.PORT)
self.ex = futures.ThreadPoolExecutor(max_worke... | 37.566667 | 107 | 0.517746 |
3f6aea8654478f254bea2ece3901b6db8fb49ca9 | 21,577 | py | Python | scripts/fetch/fetch.py | big-tuwien/big.tuwien.ac.at | 73aa8acc9e53e2354844c9bc21a950563bb6c4e7 | [
"MIT"
] | null | null | null | scripts/fetch/fetch.py | big-tuwien/big.tuwien.ac.at | 73aa8acc9e53e2354844c9bc21a950563bb6c4e7 | [
"MIT"
] | null | null | null | scripts/fetch/fetch.py | big-tuwien/big.tuwien.ac.at | 73aa8acc9e53e2354844c9bc21a950563bb6c4e7 | [
"MIT"
] | 1 | 2020-06-02T12:08:39.000Z | 2020-06-02T12:08:39.000Z | import argparse
import json
import os
import re
from os.path import basename, normpath
import bibtexparser
import requests
import frontmatter
import urllib.request
import shutil
import yaml
import xmltodict
import datetime
BIG_TID = 4760
BIG_OID = 18460477
TISS_BASE = 'https://tiss.tuwien.ac.at'
PUBLIK_BASE = 'https... | 40.180633 | 116 | 0.595634 |
833b29b0b5f5dfef8a16ee25fb95b2a242523332 | 259 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 70/70.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 70/70.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 70/70.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Print out the text of this file www.pythonhow.com/data/universe.txt. Please don't manually download the file. Let Python do all the work.
import requests
response = requests.get("http://www.pythonhow.com/data/universe.txt")
text = response.text
print(text)
| 37 | 138 | 0.776062 |
55e88c3cdd7a45fdd8652a28e92b1c2f95a18268 | 2,529 | py | Python | test_steiner.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | 1 | 2019-11-14T09:50:58.000Z | 2019-11-14T09:50:58.000Z | test_steiner.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | null | null | null | test_steiner.py | AlbertMukhammadiev/SteinerProblem | 71d86a86626e093ff20e7018b7c0147a18a4b165 | [
"MIT"
] | null | null | null | from unittest import TestCase, main
from sympy.geometry import Point
import networkx as nx
import matplotlib.pyplot as plt
from steiner import build_Steiner_tree, inv_replace, replace
class SteinerTestCase(TestCase):
def setUp(self):
"""initial set up"""
self.G = nx.Graph()
self.G.add_node... | 40.142857 | 89 | 0.611704 |
36bfc86e6add8d03cf98ce6221d1bafd68aca9a3 | 299 | py | Python | Organisation/Recherche/Pillow/Teil1/main.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | Organisation/Recherche/Pillow/Teil1/main.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | Organisation/Recherche/Pillow/Teil1/main.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | from wand.drawing import Drawing
from wand.image import Image
with Drawing() as draw:
with Image(filename='bild.png') as image:
draw.font_size = 80
draw.text(int(image.width / 1.71), int(image.height / 1.174), "544")
draw(image)
image.save(filename='bild2.jpg')
| 29.9 | 76 | 0.648829 |
3d1122d937b1f5821cb6b19f67f45a5eb0663c47 | 3,940 | py | Python | tests/books/booksoperationsuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | tests/books/booksoperationsuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | 5 | 2019-03-19T22:21:28.000Z | 2020-09-16T03:08:56.000Z | tests/books/booksoperationsuite.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timezone
from google.cloud import datastore
from tests.books import AbstractTestBook, Book
class BooksOperationSuite(AbstractTestBook):
def setUp(self):
self._entities = {
'978-0618968633': {
'title': 'The Hobbit',
'language': 'English',
'pages': 320,
... | 34.26087 | 80 | 0.657614 |
18071c1656e980f6443fb82e5b65daa53f1db93a | 6,731 | py | Python | dokuGenerator.py | sebastian-philipp/schmidt-doku-generator | 2e3c3c0f756439b3d5490ba9642a529972861dda | [
"MIT"
] | null | null | null | dokuGenerator.py | sebastian-philipp/schmidt-doku-generator | 2e3c3c0f756439b3d5490ba9642a529972861dda | [
"MIT"
] | null | null | null | dokuGenerator.py | sebastian-philipp/schmidt-doku-generator | 2e3c3c0f756439b3d5490ba9642a529972861dda | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.dom.minidom
from xml.sax.saxutils import escape
def prettyPrint(xmlString):
x = xml.dom.minidom.parseString(xmlString)
return x.toprettyxml()
def elem(e, t, attr = {}):
attr = " ".join(['%s="%s"'%(k, v) for (k,v) in attr.items()])
return "<%s %s>%s</%s>\n"... | 24.92963 | 155 | 0.630218 |
a11564721ecf27e4550a11727cb5daaac93332fd | 2,609 | py | Python | pk/data/cluster/dbscan/dbscanner.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/dbscan/dbscanner.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | pk/data/cluster/dbscan/dbscanner.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | '''
Created on Feb 13, 2014
@author: sushant
'''
from pylab import *
from cluster import cluster
class dbscanner:
dataSet = []
count = 0
visited = []
member = []
Clusters = []
def dbscan(self,D,eps,MinPts):
self.dataSet = D
title(r'dbscan_demo Algorithm', ... | 25.330097 | 74 | 0.391338 |
62f6886361621ed8e9d3d3b02408cbf7167d1f1e | 2,797 | py | Python | research/cv/CycleGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/CycleGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/CycleGAN/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 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 to... | 39.394366 | 80 | 0.671791 |
c54671d8b6a33d0e3ef20e19ecfb1f15932367b1 | 2,294 | py | Python | spark/hive/hive-example1.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | spark/hive/hive-example1.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | spark/hive/hive-example1.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | #
# 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... | 33.735294 | 149 | 0.688317 |
b17bd1cc45b3d517d701845fa8f3b53766736857 | 7,359 | py | Python | code/01_phenotype_engineering/CCU013_05_demographics.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/01_phenotype_engineering/CCU013_05_demographics.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | code/01_phenotype_engineering/CCU013_05_demographics.py | BHFDSC/CCU013_01_ENG-COVID-19_event_phenotyping | 83afef23f96c7b31fef64c6f735737d1afa3082d | [
"Apache-2.0"
] | null | null | null | # Databricks notebook source
# MAGIC %md
# MAGIC # COVID-19 Events - Demographics
# MAGIC
# MAGIC **Description**
# MAGIC
# MAGIC This notebook runs a list of `SQL` queries to:
# MAGIC
# MAGIC <br>
# MAGIC
# MAGIC 1. Join demographics created in [`CCU013/0_shared_resources/1_demographics`](https://db.core.dat... | 32.561947 | 301 | 0.725642 |
b8ff59dd012e7ee1f291e12e87ac1577722c5697 | 637 | py | Python | ListenUp/test.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/test.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | ListenUp/test.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from core.listen_up_db import ListenUpDatabase, ListenUpDatabaseException
from core.questions import Question
if __name__ == '__main__':
db = ListenUpDatabase()
with db:
db.clear()
try:
db.add_user(u'Khyber', u'Sen')
except db.exception... | 28.954545 | 91 | 0.610675 |
62648a876ac2e63bb2d0b09fefa96812387281dc | 3,319 | py | Python | research/cv/wgan/src/dcgan_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/wgan/src/dcgan_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/wgan/src/dcgan_model.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 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 to... | 33.525253 | 92 | 0.575173 |
ac65491e5a5fdda3feb5743e256e91d9c70a883e | 346 | py | Python | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/23.00-Bubble Sort.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/23.00-Bubble Sort.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/02.Miscellaneous/23.00-Bubble Sort.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def bubble_sort(nums):
ln = len(nums)
for i in range(len(nums)-1):
for j in range(1, ln):
if nums[j-1] > nums[j]:
nums[j-1], nums[j] = nums[j], nums[j-1]
ln -= 1
return nums
if __name__ == "__main__":
nus = [5, 3, 8, 6, 7, 2]
print(nus)
nus = bubble... | 20.352941 | 55 | 0.485549 |
cea380224cedf2209f2183eec28ed1fe0eb5c674 | 1,540 | py | Python | research/cv/Auto-DeepLab/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Auto-DeepLab/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Auto-DeepLab/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 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 to... | 36.666667 | 97 | 0.725325 |
0b746244bc3e22baa254dfe32914949d925ba30d | 5,440 | py | Python | rbac/providers/common/provider_transforms.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | rbac/providers/common/provider_transforms.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | rbac/providers/common/provider_transforms.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 52.307692 | 87 | 0.612132 |
0b963ef6fdf29ee35feaa3fff4894cc7f6233bd1 | 337 | py | Python | custom_user/permissions.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/permissions.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/permissions.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission
class IsOwner(BasePermission):
def has_object_permission(self, request, view, obj):
""" czy tu nie brakuje:
if request.user.is_superuser:
return True
"""
if request.method == "DELETE":
return False
... | 21.0625 | 56 | 0.620178 |
f03420507bed0c4fbe3fd5bd5c80121588db6511 | 920 | py | Python | Projeto/labels.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | Projeto/labels.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | Projeto/labels.py | joaoantonio17/Space-war | e348164698df56dd89665410734516fc69f4c8ac | [
"MIT"
] | null | null | null | import pygame, sys
class Label_vida():
def __init__(self, janela):
self.C = 3 # Número de vidas
self.janela = janela
self.janela_rect = self.janela.get_rect()
self.label_vida = pygame.image.load("image/barravidas3.png")
self.label_vida_rect = self.label_vida.get_rect()
... | 35.384615 | 72 | 0.616304 |
f05adfac1ac2fa3b680a01e6edac77c14f5442cb | 322 | py | Python | tos/out_sys.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | tos/out_sys.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | tos/out_sys.py | Bodia2cat/ToS | 1b8c19fd4ab5f8458f5dc1832b764430ac6e02d9 | [
"Unlicense"
] | null | null | null | import os
import sys
import subprocess
subprocess.call("clear")
i = 1
os.system("toilet {[?]} ")
command = input("? ")
while i:
command = input("? ")
os.system(command)
if command == "m":
os.system("python3 main.py -s")
if command == "m --help":
print("m - load system ")
if command == "exit":
exit()
... | 11.925926 | 33 | 0.596273 |
0be4320e82dcc763987b15b1f0ec6771a7dd0091 | 1,194 | py | Python | project/api/event_reference/schemas.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/event_reference/schemas.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/event_reference/schemas.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from marshmallow import fields
from project.api import marshmallow
from project.api.event.schemas import EventRefSchema
from project.api.organization.schemas import OrganizationRefSchema
from project.api.schemas import PaginationRequestSchema, PaginationResponseSchema
from project.models import EventReference
class ... | 29.121951 | 81 | 0.798995 |
f0e6d9b470d6c2965355641ec069b9cbfb481be6 | 2,354 | py | Python | tests/test_hausse.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | tests/test_hausse.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | tests/test_hausse.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | import os
from pathlib import Path
from hausse import Hausse
from hausse.lib.plugin import Plugin
def test_init_defaults():
h = Hausse()
assert isinstance(h._plugins, list)
assert isinstance(h.elements, list)
assert isinstance(h.settings, dict)
assert isinstance(h.metadata, dict)
assert Pat... | 20.649123 | 77 | 0.619796 |
ac93cb7b47236817e63feff7d0b50bddcea1a450 | 1,966 | py | Python | 2-resources/python-data-generation/generate-csv-dataset-transactions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/python-data-generation/generate-csv-dataset-transactions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/python-data-generation/generate-csv-dataset-transactions.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import random
method = ["credit", "debit", "credit", "credit", "debit", "credit", "credit", "cash", "credit"]
shop_dict = {
'Edgars': 'Clothing',
'CNA': 'Stationary',
'Sportmans Warehouse': 'Sports Equipment',
'Pick n Pay': 'Groceries',
'Rage Shoes': 'Shoes',
'BT Games': 'Games',
'Dions Wi... | 29.343284 | 135 | 0.572737 |
4a1899f900f5f1acf415fb1945bb8a8884a3da3b | 2,307 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/examples/rock_paper_scissors.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 71 | 2019-03-05T04:44:48.000Z | 2022-03-24T09:47:48.000Z | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/examples/rock_paper_scissors.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/01_intro_python/Intro-Python-II/examples/rock_paper_scissors.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 37 | 2019-03-07T05:08:03.000Z | 2022-01-05T11:32:51.000Z | #import module we need
import random
#file i/o functions for historical results
def load_results():
text_file = open("history.txt", "r")
history = text_file.read().split(",")
text_file.close()
return history
def save_results( w, t, l):
text_file = open("history.txt", "w")
text_file.write( str(... | 29.202532 | 73 | 0.563069 |
c5cddb15a01e038de73be126c9eba4a7695cb8a6 | 7,339 | py | Python | src/lecture2/test_softmax/train_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture2/test_softmax/train_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture2/test_softmax/train_softmax.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import numpy as np
# local dep
import sys
sys.path.append("..")
from test_softmax import test_softmax_classifier
from load_data import load_data
from ROC_plot.draw_plot import draw_roc_plot
class exp_train():
def __init__(self, n_classes, penalty="l2", fit_intercept=False):
self.n_features = 0
... | 39.88587 | 107 | 0.586865 |
76c30b478cc223206e6ed64881a82e088819dd58 | 3,267 | py | Python | project/api/organization_relation/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/organization_relation/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/organization_relation/resources.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask import abort
from flask.helpers import make_response
from flask_apispec import doc, marshal_with
from flask_apispec.annotations import use_kwargs
from project import db
from project.access import access_or_401, has_access, login_api_user_or_401
from project.api import add_api_resource
from project.api.organ... | 32.67 | 86 | 0.700337 |
8c4e708c90a0be466dd6d09fb54caa22efad2e0b | 2,333 | py | Python | newPageHelper.py | BNUZ-China/iGem-Wiki | 18216737bbd1d5316e5302ff7202a9fa139ad033 | [
"MIT"
] | 1 | 2021-08-28T15:06:10.000Z | 2021-08-28T15:06:10.000Z | newPageHelper.py | BNUZ-China/iGem-Wiki | 18216737bbd1d5316e5302ff7202a9fa139ad033 | [
"MIT"
] | null | null | null | newPageHelper.py | BNUZ-China/iGem-Wiki | 18216737bbd1d5316e5302ff7202a9fa139ad033 | [
"MIT"
] | null | null | null | import os
from shutil import copy
class newPageHelper():
def __init__(self) -> None:
self.new_page_conf_string = ''
def newHTML(self, name):
copy('public/sample.html', f'public/{self.model_name}/{name}.html')
def newTemplate(self, name):
copy('src/App.vue', f'src/pages/{self.mode... | 29.531646 | 104 | 0.585512 |
8c8defe03048dda833366a919017dbe4ed948dd7 | 543 | py | Python | PINp/2014/Valkovskey_M_A/task_5_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Valkovskey_M_A/task_5_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Valkovskey_M_A/task_5_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 5. Вариант 49.
#Напишите программу, которая бы при запуске случайным образом отображала название одного из девяти действующих вокзалов Москвы.
#Valkovskey M.A.
import random
x=random.choice(["Белорусский вокзал", "Казанский вокзал", "Киевский вокзал", "Курский вокзал" , "Ленинградский вокзал", "Павелецкий вок... | 54.3 | 204 | 0.780847 |
506c824678b9f0a9281819245cbae87238b5ea50 | 3,850 | py | Python | .github/scripts/service-validator/predefined-service-validator.py | Splines/compose-generator | f2929ed373f19ad66506a29e191463d1500f709b | [
"Apache-2.0"
] | 50 | 2021-02-25T21:01:31.000Z | 2022-03-28T16:30:23.000Z | .github/scripts/service-validator/predefined-service-validator.py | Splines/compose-generator | f2929ed373f19ad66506a29e191463d1500f709b | [
"Apache-2.0"
] | 63 | 2021-03-26T18:06:14.000Z | 2022-01-14T08:08:59.000Z | .github/scripts/service-validator/predefined-service-validator.py | Splines/compose-generator | f2929ed373f19ad66506a29e191463d1500f709b | [
"Apache-2.0"
] | 3 | 2021-05-06T19:38:55.000Z | 2021-11-01T23:16:12.000Z | """Script to validate the files of all predefined service templates"""
from os.path import isfile, isdir, join
from os import listdir
import sys
import json
from cerberus import Validator
import yaml
def check_file_existence():
"""Checks if all required files exist"""
print('Checking file existence ...', end=... | 40.104167 | 97 | 0.632468 |
0ff7bb46fc13be9af43bb49ecb2d7e3bdf360c7d | 623 | py | Python | exercises/zh/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/test_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert len(doc1.ents) == 2, "第一个例子中应该有两个实体"
assert (
doc1.ents[0].label_ == "WEBSITE" and doc1.ents[0].text == "哔哩哔哩"
), "请检查第一个例子中的第一个实体"
assert (
doc1.ents[1].label_ == "WEBSITE" and doc1.ents[1].text == "阿里巴巴"
), "请检查第一个例子中的第二个实体"
assert len(doc2.ents) == 1, "第二个例子... | 32.789474 | 75 | 0.582665 |
2cde4089599da421010f8f3571eb1c37e307c3a7 | 22,742 | py | Python | tests/seeder.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | tests/seeder.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | tests/seeder.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | null | null | null | class Seeder(object):
def __init__(self, app, db, utils):
self._app = app
self._db = db
self._utils = utils
def setup_base(
self,
admin=False,
log_in=True,
admin_unit_verified=True,
email="test@test.de",
name="Meine Crew",
):
u... | 38.415541 | 1,205 | 0.657682 |
fa59be5dba2801355c0de0eb7699034a366064f1 | 2,800 | py | Python | python_experiments/data_analysis/vldbj_data_parsing/varying_rmax_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/vldbj_data_parsing/varying_rmax_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/vldbj_data_parsing/varying_rmax_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os, json, decimal
flpmc_tag = 'flpmc'
bflpmc_tag = 'bflpmc'
flp_tag = "full local push"
rmax_lst = [0.01 * (i + 1) for i in range(30)]
def format_str(float_num):
return str(decimal.Decimal.from_float(float_num).quantize(decimal.Decimal('0.000')))
def get_file_path(rmax, algorithm):
root_path = '/ho... | 33.73494 | 96 | 0.671786 |
7e498f76eed1cb803c244d772bab232abe452283 | 2,430 | py | Python | build_domain.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-05T20:42:48.000Z | 2020-02-09T15:39:07.000Z | build_domain.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 7 | 2020-02-04T17:26:35.000Z | 2020-02-04T17:27:45.000Z | build_domain.py | Ameer004/zimsec-results-bot | c469bf400b2e0d5262f9be8203f21ad81781adf2 | [
"MIT"
] | 1 | 2021-09-30T13:56:26.000Z | 2021-09-30T13:56:26.000Z | # automatically build the domain.yml file
import glob
import os
import ast
from os import path
from os.path import join
root_dir = path.dirname(__file__)
domain = join(root_dir, "domain")
utters = join(domain, "utterances")
action = join(domain, "actions")
def writeSubFile(outfile, subfileName, spacer):
wit... | 32.4 | 102 | 0.61358 |
0e9f500b9415903eebdaa696307d178e1e24f945 | 7,828 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/utils.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe import _
import json
from frappe.utils import flt, cstr, nowdate, nowtime
from six import string_types
class Invali... | 34.637168 | 109 | 0.729944 |
7d4244651f7d04af3fa0510effded321b0b2d0c9 | 2,450 | py | Python | codeit/oop/interface_segregation_principle/imessage_role_interface.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/interface_segregation_principle/imessage_role_interface.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | codeit/oop/interface_segregation_principle/imessage_role_interface.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
class IText(ABC):
@property
@abstractmethod
def content(self):
"""추상 getter 메소드"""
pass
@abstractmethod
def edit_content(self, new_content: str) -> None:
"""작성한 메시지를 수정하는 메소드"""
pass
class ISendable(ABC):
@abstractmethod
... | 23.113208 | 94 | 0.604082 |
cb09b5cbbcd2cf7d87506b20607557cf6434d6f0 | 5,921 | py | Python | weibo/test/testWeiboCont.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testWeiboCont.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testWeiboCont.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | # coding:utf8
'''
Created on 2016年4月14日
@author: wb-zhaohaibo
'''
import re
# import urllib
from bs4 import BeautifulSoup
# import chardet
link = open("user.html").read().decode("utf8")
# <div class=\"WB_text W_f14\" node-type=\"feed_list_content\" >\n ... | 55.858491 | 755 | 0.556325 |
1de90186732ee4b91a97504992bff5d673d35c4a | 354 | py | Python | models/user.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | models/user.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | models/user.py | HerbLee/sanicweb | f5177ca715ed704ebceffdd59710406b2659c514 | [
"Apache-2.0"
] | null | null | null | # @time : 2020/7/12 17:45
# @author : HerbLee
# @file : user.py.py
from tortoise.models import Model
from tortoise import fields
class User(Model):
id = fields.IntField(pk=True)
name = fields.TextField()
text = fields.TextField()
created = fields.DatetimeField(auto_now_add=True)
def __str... | 23.6 | 53 | 0.669492 |
69bd2553a06d704cb4e27a80c1b2f5c254ad1b62 | 1,504 | py | Python | torba/torba/coin/bitcoincash.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4,076 | 2018-06-01T05:54:24.000Z | 2022-03-07T21:05:52.000Z | torba/torba/coin/bitcoincash.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 80 | 2018-06-14T01:02:03.000Z | 2019-06-19T10:45:39.000Z | torba/torba/coin/bitcoincash.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | 20 | 2018-06-27T21:52:22.000Z | 2022-03-08T11:25:23.000Z | __node_daemon__ = 'bitcoind'
__node_cli__ = 'bitcoin-cli'
__node_bin__ = 'bitcoin-abc-0.17.2/bin'
__node_url__ = (
'https://download.bitcoinabc.org/0.17.2/linux/bitcoin-abc-0.17.2-x86_64-linux-gnu.tar.gz'
)
__spvserver__ = 'torba.server.coins.BitcoinCashRegtest'
from binascii import unhexlify
from torba.client.bas... | 30.08 | 93 | 0.769282 |
2a3847792bbef96a5133c28764e58b8af3930229 | 3,896 | py | Python | Trees/prefix_trees/trie.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Trees/prefix_trees/trie.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | null | null | null | Trees/prefix_trees/trie.py | CandleStein/VAlg | 43aecdd351954d316f132793cf069b70bf2e5cc2 | [
"MIT"
] | 1 | 2020-09-25T18:31:34.000Z | 2020-09-25T18:31:34.000Z | # Module for prefix trees
import pickle
import re
import dict
import copy
def isWord(word):
for ch in word:
if not ("a" <= ch.lower() <= "z"):
return False
return dict.check(word)
class node(object):
def __init__(self, val):
self.val = val
self.children = []
s... | 27.631206 | 80 | 0.527977 |
e20a477e0156e328dc1a694e525dc256ba4f8ea4 | 358 | py | Python | utest/widgets_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | utest/widgets_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | utest/widgets_test.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding:utf-8
import unittest
import zencad
#from PyQt5.QtWidgets import *
#from PyQt5.QtCore import *
#from PyQt5.QtGui import *
#from zencad.gui.settingswdg import SettingsWidget
#qapp = QApplication([])
class WidgetsTest(unittest.TestCase):
def test_segment_probe(self):
pass... | 17.9 | 50 | 0.726257 |
35de862c189f9d661df2078d7dfd64924ffb39ca | 753 | py | Python | Packs/OnboardingIntegration/Integrations/OnboardingIntegration/OnboardingIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/OnboardingIntegration/Integrations/OnboardingIntegration/OnboardingIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/OnboardingIntegration/Integrations/OnboardingIntegration/OnboardingIntegration_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import OnboardingIntegration
def test_frequency(mocker):
mocker.patch.object(demisto, 'params',
return_value={'frequency': '1'})
mocker.patch.object(demisto, 'command',
return_value='fetch-incidents')
mocker.patch.object(demisto... | 32.73913 | 56 | 0.652058 |
ea9597c4f7b7f7007a9820dc2569e09bf4503155 | 1,186 | py | Python | AP_SS16/703/python_custom_scripts/error_calculation.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/406/python_custom_scripts/error_calculation.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | latex-template/python_custom_scripts/error_calculation.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import numpy as np
from uncertainties import unumpy as unp
from uncertainties.unumpy import (
nominal_values as noms,
std_devs as stds,
)
import scipy.stats
#Fehler des Mittelwertes
def MeanError (Data):
assert isinstance(Data, (np.ndarray, np.generic) ) , "You need to give a numpy array for calculation of... | 39.533333 | 131 | 0.682125 |
3507a714320d3ff535e34a10a0a8cc1b81da6f76 | 797 | py | Python | deep_sleep.py | cgawron/schuelerlabor | 4a91b4fa006047e13a8e50017c2646b2bb89a675 | [
"MIT"
] | null | null | null | deep_sleep.py | cgawron/schuelerlabor | 4a91b4fa006047e13a8e50017c2646b2bb89a675 | [
"MIT"
] | null | null | null | deep_sleep.py | cgawron/schuelerlabor | 4a91b4fa006047e13a8e50017c2646b2bb89a675 | [
"MIT"
] | null | null | null | import machine
led = machine.Pin(2, machine.Pin.OUT)
from time import sleep
def deep_sleep_ms(msecs):
# configure RTC.ALARM0 to be able to wake the device
rtc = machine.RTC()
rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP)
# set RTC.ALARM0 to fire after X milliseconds (waking the device)
rtc.alarm(rtc.A... | 26.566667 | 94 | 0.730238 |
105d9458eaa5645a3174599b9d4238066a4c1e97 | 2,764 | py | Python | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/models.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/models.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | CodeStatistics/files/c54f7e2c-0728-439d-aa48-93e29cbac5c0/django_rbac/rbac/models.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | from django.db import models
class UserInfo(models.Model):
"""
用户表
"""
username = models.CharField(max_length=32)
password = models.CharField(max_length=64)
#m = models.ManyToManyField('Role')
class Meta:
verbose_name_plural='用户表'
def __str__(self):
return self.userna... | 22.112 | 119 | 0.632417 |
5e322712a97ece5c1a1cf6265acacad1d7b20ef7 | 1,992 | py | Python | LINE/2021/crypto/babycrypto2/babycrypto2.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LINE/2021/crypto/babycrypto2/babycrypto2.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LINE/2021/crypto/babycrypto2/babycrypto2.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python
from base64 import b64decode
from base64 import b64encode
import socket
import multiprocessing
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
import hashlib
import sys
class AESCipher:
def __init__(self, key):
self.... | 31.619048 | 96 | 0.65512 |
dc80029f1ea3b4630bdab886048a2edad6980f50 | 542 | py | Python | source/pkgsrc/games/pysolfc/patches/patch-pysollib_settings.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/games/pysolfc/patches/patch-pysollib_settings.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/games/pysolfc/patches/patch-pysollib_settings.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-pysollib_settings.py,v 1.1 2019/06/06 21:53:44 adam Exp $
Use custom data dir.
--- pysollib/settings.py.orig 2008-11-15 13:04:30.000000000 -0800
+++ pysollib/settings.py 2008-11-15 13:05:05.000000000 -0800
@@ -61,10 +61,7 @@ DATA_DIRS = []
# you can add your extra directories here
if os.name == 'posi... | 28.526316 | 72 | 0.601476 |
dc866ec0b23169a9599ca2f8f123b93fedbb9a37 | 1,836 | py | Python | 2018/quals/re-basics/src/genvalues.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/quals/re-basics/src/genvalues.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/quals/re-basics/src/genvalues.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/python
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 28.246154 | 74 | 0.622004 |
f4b84b424fdcc4eb76907ae3efa848069b70747b | 502 | py | Python | Git2020/tests/Aufgabe4_test.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Git2020/tests/Aufgabe4_test.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | Git2020/tests/Aufgabe4_test.py | Zeyecx/HPI-Potsdam | ed45ca471cee204dde74dd2c3efae3877ee71036 | [
"MIT"
] | null | null | null | import os
import sys
import re
from os.path import dirname
cwd = dirname(os.getcwd())
directory = './index.md'
def check_if_string_in_file(file_name, string_to_search):
f = open(file_name, 'r')
Lines = f.readlines()
regEx = string_to_search + '\s?([A-Z]|[a-z]|[\u00c4-\u02AF]|[0-9])+'
for line in Lines:
if re.f... | 20.08 | 69 | 0.651394 |
8743fe86d1e04909ff6551159be0e2105dd0e85b | 372 | py | Python | ___Python/Jonas/Python/p06_persistance/m01_pickle.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Jonas/Python/p06_persistance/m01_pickle.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Jonas/Python/p06_persistance/m01_pickle.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import pickle
from p01_kennenlernen.m01_kennenlernen import teilnehmerListe
# pickling / serialization / marshalling / flattening
with open("teilnehmer.pickle", "wb") as datei:
pickle.dump(teilnehmerListe, datei)
# unpickling / deserialization / unmarshalling
with open("teilnehmer.pickle", "rb") as da... | 26.571429 | 62 | 0.739247 |
5e5d828e1c7df8bc684ba8fafc68d7ee2f23dcb6 | 2,032 | py | Python | Code/golden_ratio_sequence.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/golden_ratio_sequence.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/golden_ratio_sequence.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | from matplotlib.pyplot import errorbar, sca
import numpy as np
import random as rnd
GOLDEN_RATIO_MIN_1 = 0.618033988749894
'''
Returns a pseudo-random variable in [0.0, 1.0)
'''
def rand01():
r = 1
while r == 1:
r = rnd.uniform(0, 1)
return r
'''
Returns the next bigger fibonacci number,... | 20.948454 | 69 | 0.525591 |
df405857b0e6e371fb34d1e6f2c39b369d994b38 | 39 | py | Python | UNFAEDAH-main/src/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | UNFAEDAH-main/src/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | UNFAEDAH-main/src/login.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | print("\nMau Recode Ya Awokawok :v\n")
| 19.5 | 38 | 0.692308 |
10e914a05c99bd845fcc6207c670194ccb7b805c | 2,374 | py | Python | solutions/MFA/webserver/src/service/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-04-06T06:13:20.000Z | 2021-04-06T06:13:20.000Z | solutions/MFA/webserver/src/service/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | solutions/MFA/webserver/src/service/insert.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import logging
from common.const import default_cache_dir
from common.config import PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE, PG_TABLE, IMG_TABLE, VOC_TABLE
from indexer.index import milvus_client, create_table, insert_vectors, delete_table, search_vectors, create_index, has_table
import datetime
from deep_s... | 31.653333 | 124 | 0.66765 |
1d65e3e1f7b42c0933a710d7e707e23589f2502d | 14,926 | py | Python | src/Sephrasto/CharakterEditor.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/CharakterEditor.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/CharakterEditor.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 26 22:36:35 2017
@author: Aeolitus
"""
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt
import CharakterBeschreibungWrapper
import CharakterBeschreibungDetailsWrapper
import Ch... | 41.118457 | 175 | 0.648533 |
d6368cf7b829b7a406d3bddd87adb218976339a3 | 4,034 | py | Python | tests/test_tarif.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_tarif.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_tarif.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
import pytest # type:ignore[import]
from bo4e.bo.tarif import Tarif, TarifSchema
from bo4e.enum.kundentyp import Kundentyp
from bo4e.enum.sparte import Sparte
from bo4e.enum.tarifart import Tarifart
from bo4e.enum.tarifmerkmal import Tarifmerkmal
from bo4e.enum.tariftyp import... | 49.195122 | 110 | 0.654933 |
c397b0f6bfffe6efc25c6995bd51dd765619eccd | 859 | py | Python | copy_files.py | EmanuelDms/automation | 25a0f370f40aa955225d7c3a1e28c2d8cc988689 | [
"MIT"
] | null | null | null | copy_files.py | EmanuelDms/automation | 25a0f370f40aa955225d7c3a1e28c2d8cc988689 | [
"MIT"
] | null | null | null | copy_files.py | EmanuelDms/automation | 25a0f370f40aa955225d7c3a1e28c2d8cc988689 | [
"MIT"
] | null | null | null | import sys
import os
check_exit = False
def checkExit(exit):
return exit() or None
if len(sys.argv) < 3:
print('Missing params!')
print('Help: python copy_files.py <source file> <target file>')
check_exit = True
checkExit(check_exit)
source_file_name = sys.argv[1]
dest_file_name = sys.argv[2]
if s... | 21.475 | 67 | 0.719441 |
c3fe8f3222ec02878a87d4cb3bbfa2014a096118 | 298 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/material_request/material_request_dashboard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/material_request/material_request_dashboard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/material_request/material_request_dashboard.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from frappe import _
def get_data():
return {
'fieldname': 'material_request',
'transactions': [
{
'label': _('Related'),
'items': ['Request for Quotation', 'Supplier Quotation', 'Purchase Order']
},
{
'label': _('Manufacturing'),
'items': ['Work Order']
}
]
} | 17.529412 | 78 | 0.573826 |
f67db60f5a70995332e87f6a25e51979d1fb0289 | 6,159 | py | Python | kts/feature_selection/importance_estimators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/feature_selection/importance_estimators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/feature_selection/importance_estimators.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import time
from abc import ABC
from contextlib import redirect_stdout
import numpy as np
import pandas as pd
from IPython.display import display
from kts.settings import cfg
from kts.ui.feature_importances import FeatureImportances, ImportanceComputingReport
class ImportanceEstimator(ABC):
verbose = False
... | 30.339901 | 122 | 0.597175 |
9cfe6b059d161168cd6bc94c44a41dc2f9db2865 | 1,435 | py | Python | Packs/CommonScripts/Scripts/CheckContextValue/CheckContextValue.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/CheckContextValue/CheckContextValue.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/CheckContextValue/CheckContextValue.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Dict
from CommonServerPython import *
def check_key(field_value, regex=None):
if regex:
if re.search(regex, field_value):
return True
else:
if field_value:
return True
return False
def poll_field(args: Dict[str, Any]) -> CommandResults:
key... | 25.625 | 91 | 0.643902 |
0d544d42200ad2ff5495348f718b0fecfe050dc9 | 914 | py | Python | manage.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | 1 | 2020-12-07T13:30:59.000Z | 2020-12-07T13:30:59.000Z | manage.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | null | null | null | manage.py | marwanad/music_bot | c7a9c704f510d455fc6d1d7c057d5cfa31dcd7cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from app import create_app
from flask.ext.script import Manager, Server
import requests
import json
from setup import bot_config
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command("runserver", Server(use_reloader=False))
@manager.comman... | 25.388889 | 62 | 0.608315 |
b493877b9e201d1a20d5071b65e45b525ddd91d5 | 219 | py | Python | config.py | wdr-data/1live-plays | 68ed22a659ea1540550bc9f5e70fdb83f362fa06 | [
"MIT"
] | 3 | 2020-07-31T11:22:04.000Z | 2020-07-31T19:59:18.000Z | config.py | wdr-data/1live-plays | 68ed22a659ea1540550bc9f5e70fdb83f362fa06 | [
"MIT"
] | null | null | null | config.py | wdr-data/1live-plays | 68ed22a659ea1540550bc9f5e70fdb83f362fa06 | [
"MIT"
] | null | null | null | import json
import sys
import logging
try:
with open("config.json", "r") as fp:
config = json.load(fp)
except FileNotFoundError:
logging.critical('Config file "config.json" not found.')
sys.exit(1)
| 19.909091 | 60 | 0.675799 |
25972e8dd446354b7ca75fda332df1533724037c | 1,715 | py | Python | S7/CS431-CDL/pgm-01&02/new_lex.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S7/CS431-CDL/pgm-01&02/new_lex.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S7/CS431-CDL/pgm-01&02/new_lex.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | def gen_tokens(inp_file):
with open(inp_file, 'r') as f_inp, open('inter.txt', 'w') as f_itr:
content = f_inp.read()
for character in content:
if character.isalnum() or (character in ['[', ']', '.']):
f_itr.write(character)
else:
f_itr.write('\... | 35.729167 | 104 | 0.488047 |
25a29cc1f1490ce6e2f599e40fd177da04dc5042 | 673 | py | Python | KnowledgeQuizTool/MillionHeroAssistant/core/utils.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | KnowledgeQuizTool/MillionHeroAssistant/core/utils.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | KnowledgeQuizTool/MillionHeroAssistant/core/utils.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
def save_question_answers_to_file(question, answers, directory=".", filename="QA.txt"):
"""
bake the question and answers
:param directory:
:param filename:
:return:
"""
with open(os.path.join(directory, filename), "at") as baker:
baker.write(";".... | 23.206897 | 87 | 0.624071 |
4cf29f31c6bdac3b60365cac7ec5704ccbcacde4 | 9,087 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_user_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_user_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/ocscli/ocs_user_action.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# -*- codi... | 38.180672 | 167 | 0.578299 |
98057810c88bee82f067e5f385788436ec6f2c02 | 3,895 | py | Python | TRAINING/tools/nornir-push-config.py | ksator/VXLAN-EVPN | 624e2aa8d1acf7b9e307e18d8a47eaa163529693 | [
"Apache-2.0"
] | 7 | 2021-12-17T08:48:36.000Z | 2021-12-19T23:53:36.000Z | TRAINING/tools/nornir-push-config.py | ksator/VXLAN-EVPN | 624e2aa8d1acf7b9e307e18d8a47eaa163529693 | [
"Apache-2.0"
] | null | null | null | TRAINING/tools/nornir-push-config.py | ksator/VXLAN-EVPN | 624e2aa8d1acf7b9e307e18d8a47eaa163529693 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
import argparse
from nornir import InitNornir
from nornir.plugins.tasks import networking, text
from nornir.plugins.functions.text import print_title, print_result
from nornir.plugins.tasks.files import write_file
def device_get_facts(task):
# Save the co... | 39.343434 | 137 | 0.677022 |
2c7d6bbf7d2a23eaa78c971e077f696de6373cdd | 2,838 | py | Python | Packs/Cherwell/Scripts/CherwellUpdateIncident/CherwellUpdateIncident.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Cherwell/Scripts/CherwellUpdateIncident/CherwellUpdateIncident.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Cherwell/Scripts/CherwellUpdateIncident/CherwellUpdateIncident.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
args = demisto.args()
# ####################################################################################
# ############################## CONFIGURATION PART ##################################
# ####################... | 45.047619 | 120 | 0.609584 |
e2c9c6f318a391e21a502a8a297ca303d6dc505f | 887 | py | Python | weeman-master/core/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | weeman-master/core/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | weeman-master/core/config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | ##
## config.py - config variables
##
## Written by @Hypsurus
##
import os
import sys
__author__ = "Hypsurus <hypsurus@mail.ru>"
__version__ = "1.3"
__codename__ = "ArmWork"
def history_getkey(key):
try:
history = open("history.log", "r").readlines()
except Exception as e:
return 0
if hi... | 25.342857 | 150 | 0.630214 |
80b3723ac558503d6328bc1fa4074aea39b4108e | 2,301 | py | Python | src/ztc/java/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/jmx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
"""
JMX Check class for ZTC. Licensed under the same terms as ZTC.
Copyright (c) 2011 Wrike, Inc. [http://www.wrike.com]
Copyright (c) 2011-2012 Vladimir Rusinov <vladimir@greenmice.info>
Usage example to jmxterm-*.jar:
java -Djava.endorsed.dirs=/opt/ztc/lib/ -jar \
/opt/ztc/lib/jmxterm-1.0... | 33.347826 | 73 | 0.611908 |
80d30a1e9602af5a9a845c68b081b7d2b9a2eeca | 207 | py | Python | Hackerrank_problems/Arithmetic Operators/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Arithmetic Operators/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Arithmetic Operators/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | if __name__ == '__main__':
a = int(raw_input()) #take in first input
b = int(raw_input()) #take in second input
print (a+b) #addition
print (a-b) #subtraction
print (a*b) #multiplication
| 29.571429 | 46 | 0.63285 |
80f2636ee95a47f2af889dbb832b48bb07d068d5 | 525 | py | Python | server/apps/movie/migrations/0003_auto_20190428_1615.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/movie/migrations/0003_auto_20190428_1615.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/movie/migrations/0003_auto_20190428_1615.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | # Generated by Django 2.1.4 on 2019-04-28 16:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movie', '0002_genre_doubanids'),
]
operations = [
migrations.RemoveField(
model_name='movie',
name='title',
... | 22.826087 | 95 | 0.577143 |
643c9b3941fb486389e5be31bb435629c2425273 | 1,227 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/count_trees.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/count_trees.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-ds-master/data_structures/graphs/count_trees.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | """
Count the number of trees in a forest
A forest is a collection of trees. Do a DFS. If any vertex if not reachable
from any other, then it means it is not a part of that subgraph (tree). Hence
it is a different tree, so increment the count
"""
from collections import defaultdict
class Graph:
def __init__(sel... | 24.058824 | 77 | 0.508557 |
ff50cce4a7e5516a76eb9a1483bc0bbdb5f0b171 | 3,491 | py | Python | Striker-master/core/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Striker-master/core/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Striker-master/core/utils.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import re
import glob
import json
from urllib.parse import urlparse
import core.config
def loader():
path = var('path')
for each in glob.glob(path + '/db/*'):
name = re.search(r'/([^/]*?)\.\w+$', each).group(1)
if each.endswith('.json'):
updateVar(name, json.loads(reader(each, mod... | 25.481752 | 93 | 0.538241 |
441c6bf40c8559d391d42fd9e85a0e80b157f851 | 3,212 | py | Python | elm.py | yangkailun/ELM_GIT | 4093a861e412acd3d10eda68706ed6f92eb664d3 | [
"Apache-2.0"
] | null | null | null | elm.py | yangkailun/ELM_GIT | 4093a861e412acd3d10eda68706ed6f92eb664d3 | [
"Apache-2.0"
] | null | null | null | elm.py | yangkailun/ELM_GIT | 4093a861e412acd3d10eda68706ed6f92eb664d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# 0123456789012345678901234567890123456789012345678901234567890123456789012345678
# 上边一行用来对比一行代码是否超过80个字符,超过换行
import tkinter as tk
import random
import codecs
root = tk.Tk(className = '范例循环模型')
root.geometry('800x400')
count = 0 # 因为点击两次show按钮才完成一个完整的英译汉或者汉译英过程,这里通过count为0或1来判断
e_or_c = 0 ... | 28.175439 | 81 | 0.651619 |
444b85eb9f2152f7da7970a475de43c83f34c716 | 34,749 | py | Python | Packs/FortiManager/Integrations/FortiManager/FortiManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FortiManager/Integrations/FortiManager/FortiManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FortiManager/Integrations/FortiManager/FortiManager.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import urllib3
import traceback
from typing import Dict
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
GLOBAL_VAR = 'global'
''' CLIENT CLASS '''
class Client(BaseClient):
def __init... | 45.782609 | 120 | 0.603039 |
9292a1be1b9e616f158d3903f84e2e113bcc7a50 | 1,299 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_mode_of_payment_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_mode_of_payment_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/update_mode_of_payment_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
from frappe.utils import flt
def execute():
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
frappe.db.sql(""" update `tabMode of Payment` set type = 'Cash' where (type is null or type = '') and name = 'Cash'""")
for data in frappe.db.sql("""select ... | 44.793103 | 122 | 0.712856 |
5b7e7d40e34b71e3fe93aedfecd99379153ad933 | 908 | py | Python | grab_hessen.py | schneebonus/Covid19Compare | 7a9259376250ffa8200b5230c39ca1b7b12a70aa | [
"MIT"
] | null | null | null | grab_hessen.py | schneebonus/Covid19Compare | 7a9259376250ffa8200b5230c39ca1b7b12a70aa | [
"MIT"
] | null | null | null | grab_hessen.py | schneebonus/Covid19Compare | 7a9259376250ffa8200b5230c39ca1b7b12a70aa | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
# default bs4 stuff
url = "https://soziales.hessen.de/gesundheit/infektionsschutz/coronavirus-sars-cov-2/taegliche-uebersicht-der-bestaetigten-sars-cov-2-faelle-hessen"
r = requests.get(url)
r.encoding = r.apparent_encoding
soup = BeautifulSoup(r.text, 'lxml')
# navigate ... | 27.515152 | 148 | 0.723568 |
752fb9f1c1c84391d105c1acf70e6c17caeaeaea | 26,282 | py | Python | raw_py/you_tube_downloader_v1.0.0.py | trh0ly/youtube_downloader_converter | 662eaa894ee2bdafe1d4763238b5b9dee2a0d7dd | [
"MIT"
] | null | null | null | raw_py/you_tube_downloader_v1.0.0.py | trh0ly/youtube_downloader_converter | 662eaa894ee2bdafe1d4763238b5b9dee2a0d7dd | [
"MIT"
] | null | null | null | raw_py/you_tube_downloader_v1.0.0.py | trh0ly/youtube_downloader_converter | 662eaa894ee2bdafe1d4763238b5b9dee2a0d7dd | [
"MIT"
] | null | null | null | # -------------------------------------------
# module import
from moviepy.video.io.VideoFileClip import VideoFileClip
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.chrome import ChromeDriverManager
from multiprocessing import cpu_count
from bs4 import BeautifulSoup as bs
from o... | 44.470389 | 192 | 0.647972 |
cab5366ec938879adadada97379cfe60fb8ab6ea | 948 | py | Python | 1015 KMP/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | 1015 KMP/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | 1015 KMP/main.py | SLAPaper/hihoCoder | 3f64d678c5dd46db36345736eb56880fb2d2c5fe | [
"MIT"
] | null | null | null | from __future__ import print_function
def _get_next(pattern):
# type (str) -> List[int]
next_ = [-1]
i = 0
j = -1
m = len(pattern)
while i < m - 1:
if j == -1 or pattern[i] == pattern[j]:
i += 1
j += 1
next_.append(j)
else:
j = ne... | 17.236364 | 47 | 0.414557 |
1b29d53fb2bcbd6fab1b221e64dab9a5791f7c55 | 579 | py | Python | exam_recipes/exam_recipes/web/models.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | exam_recipes/exam_recipes/web/models.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | exam_recipes/exam_recipes/web/models.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.db import models
from exam_recipes.web.validators import validate_time_value
class Recipe(models.Model):
TITLE_MAX_LENGTH = 30
INGREDIENTS_MAX_LENGTH = 250
title = models.CharField(
max_length=TITLE_MAX_LENGTH,
)
image_url = models.URLField()
description = models.TextFi... | 19.3 | 59 | 0.66494 |
84befacdde5d715826b199ec6ade1894ada7cb1a | 4,063 | py | Python | research/cv/ivpf/ivpf/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ivpf/ivpf/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ivpf/ivpf/loss.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 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 to... | 34.432203 | 78 | 0.624662 |
04f2370f0837f700f86611f2812a3895fc7bfaa0 | 7,162 | py | Python | test/test_npu/test_network_ops/test_clamp_min.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_clamp_min.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_clamp_min.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 36.35533 | 81 | 0.632924 |
b6763afd6b55b471ecf140852737285915629857 | 785 | py | Python | 328-odd-even-linked-list/328-odd-even-linked-list.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 328-odd-even-linked-list/328-odd-even-linked-list.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 328-odd-even-linked-list/328-odd-even-linked-list.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def oddEvenList(self, head: Optional[ListNode]) -> Optional[ListNode]:
dummy = cur = ListNode(0)
head2 = head
if head2:
... | 29.074074 | 74 | 0.480255 |
781382b51be6838db1ac9a3b29178cb58ed5971f | 813 | py | Python | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_structure/fee_structure.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_structure/fee_structure.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/fee_structure/fee_structure.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
class FeeStructure(Document):
def valid... | 23.911765 | 58 | 0.712177 |
78652ea6688acea0abe2c8ea938ef8b244d5fc3f | 1,377 | py | Python | rating/no_script_errors.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/no_script_errors.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/no_script_errors.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
If all URLs could be loaded without JavaScript errors, this rater gives a score.
"""
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
default_value = False
depends_on_checks = ['load_in_browser']
max_score = 1
def __init__(self, check_result... | 29.934783 | 80 | 0.562818 |
78acd270efb089e41b76bd304445c788c3696074 | 745 | py | Python | algorithm/change_counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/change_counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | algorithm/change_counter.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # 1센트, 5센트, 10센트, 25센트, 50센트 동전이 있고
# 동전을 무한정 확보할 수 있다고 하면
# 이들의 조합으로 특정 금액 m을 만들 수 있는 경우의 수는?
class ChangeCounter:
def __init__(self, coins):
self._coins = coins
@property
def coins(self):
return self._coins
def _count_recursive(self, amount, index):
if amount == 0:
... | 26.607143 | 78 | 0.589262 |
1786f43cc5a3809903c9602cb4afe33ca8d3bfcd | 864 | py | Python | my_music_app/my_music_app/web/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | my_music_app/my_music_app/web/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | my_music_app/my_music_app/web/migrations/0001_initial.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-27 07:41
import django.core.validators
from django.db import migrations, models
import my_music_app.web.validators
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Profil... | 33.230769 | 179 | 0.653935 |
bdae4e22e50336e89ef10bc02e4834a2079e7058 | 9,834 | py | Python | Externals/twitter.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Externals/twitter.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Externals/twitter.py | jonaes/ds100bot | 79a646114400c5c8d21ff21376276a8d380b031f | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | """Twitter API including Command line argumentation"""
import configparser
import time
import tweepy
from Externals.Measure import Measure
import Persistence.log as log
log_ = log.getLogger(__name__)
tweet_log_ = log.getLogger('tweet', '{message}')
def set_arguments(ap):
group = ap.add_argument_group('Twitter AP... | 38.116279 | 100 | 0.540065 |
bde299c82e4d89daeb83b002a16c402e2fe033f2 | 641 | py | Python | SoftwareEngineering/testPyBullet.py | kingkope/simulation2020 | 3e48e3344e54eab6dd4ac5ddb75184556503b5a2 | [
"Apache-2.0"
] | null | null | null | SoftwareEngineering/testPyBullet.py | kingkope/simulation2020 | 3e48e3344e54eab6dd4ac5ddb75184556503b5a2 | [
"Apache-2.0"
] | null | null | null | SoftwareEngineering/testPyBullet.py | kingkope/simulation2020 | 3e48e3344e54eab6dd4ac5ddb75184556503b5a2 | [
"Apache-2.0"
] | null | null | null | '''
Created on 5 Mar 2020
@author: jacob
'''
import pybullet as p
import time
import pybullet_data
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,-10)
planeId = p.loadURDF("plane.urdf")
cubeStartPos ... | 30.52381 | 94 | 0.74571 |
bdf61a70405986e3f1f98dbdac60f546aaa51889 | 1,242 | py | Python | config.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | config.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | 4 | 2020-08-29T16:11:12.000Z | 2022-03-12T00:47:03.000Z | config.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | # coding: utf-8
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config():
#邮件设置
MAIL_SERVER = 'smtpdm.aliyun.com'
MAIL_PORT = 25
MAIL_USE_TLS = False
MAIL_USERNAME = 'notice@iotserv.com'
MAIL_PASSWORD = '*'
MAIL_SUBJECT_PREFIX = u'WebSite'
MAIL_SENDER = u'驾考租车网 <no... | 25.346939 | 72 | 0.672303 |
da03d59b4102d0b4bbe3272b6eef9b3d9faeaeb7 | 7,569 | py | Python | Packs/Censys/Integrations/CensysV2/CensysV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Censys/Integrations/CensysV2/CensysV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Censys/Integrations/CensysV2/CensysV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
import requests
import traceback
from typing import Dict, Any
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-memb... | 35.369159 | 118 | 0.602457 |
da0fd1380cc265194348a24c3e7d274f07173875 | 1,510 | py | Python | src/onegov/wtfs/views/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/views/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/wtfs/views/principal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from morepath import Response
from onegov.core.security import Public
from onegov.core.templates import render_macro
from onegov.wtfs import WtfsApp
from onegov.wtfs.forms import MunicipalityIdSelectionForm
from onegov.wtfs.layouts import DefaultLayout
from onegov.wtfs.models import PickupDate... | 27.454545 | 71 | 0.684768 |
007bba0fb2593f660d08c49d987b314f0b86704d | 477 | py | Python | svd_rev.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | svd_rev.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | svd_rev.py | sivadax/NJLabs | 0273e363f6b3d1da8dbe51c1e78824b77b12eb8c | [
"MIT"
] | null | null | null | # Reconstruct SVD
from numpy import array
from numpy import diag
from numpy import dot
from numpy import zeros
from scipy.linalg import svd
# define a matrix
A = array([[1, 2], [3, 4], [5, 6]])
print(A)
# Singular-value decomposition
U, s, VT = svd(A)
# create m x n Sigma matrix
Sigma = zeros((A.shape[0], A... | 26.5 | 44 | 0.67086 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.