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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dc0de0408e24dc68d8f7c33a3ec5e7b2853b7f56 | 2,927 | py | Python | Packs/CommonScripts/Scripts/GetIndicatorDBotScore/GetIndicatorDBotScore.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | Packs/CommonScripts/Scripts/GetIndicatorDBotScore/GetIndicatorDBotScore.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-26T07:34:37.000Z | 2021-12-26T07:49:34.000Z | Packs/CommonScripts/Scripts/GetIndicatorDBotScore/GetIndicatorDBotScore.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
CONTEXT_PATH = 'DBotScore'
DEFAULT_SOURCE = 'Cortex XSOAR'
INDICATOR_TYPES = {
'IP': DBotScoreType.IP,
'File SHA1': DBotScoreType.FILE,
'File SHA-1': DBotScoreType.FILE,
'File MD5': DBotScoreType.FILE,
... | 37.050633 | 110 | 0.65972 |
dc18c41218a9798d69e444561b6d8dd7ce262d69 | 277 | py | Python | exercises/ja/exc_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/exc_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/exc_01_03_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # spacyをインポートして、日本語のnlpオブジェクトを作成
import spacy
nlp = ____
# テキストを処理
doc = ____("私はツリーカンガルーとイルカが好きです。")
# 「ツリーカンガルー」のスライスを選択
tree_kangaroos = ____
print(tree_kangaroos.text)
# 「ツリーカンガルーとイッカク」のスライスを選択
tree_kangaroos_and_narwhals = ____
print(tree_kangaroos_and_narwhals.text)
| 17.3125 | 39 | 0.812274 |
90a5b712ec372af4cafe966e9fbeb4bb467453ff | 687 | pyde | Python | sketches/metzler/metzler.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/metzler/metzler.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/metzler/metzler.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | h = .684
FPS = 900
def setup():
global x, y
size(400, 400)
this.surface.setTitle("Tour Eiffel de Cassel")
background(235, 215, 182)
frameRate(FPS)
x = .1
y = .8
def draw():
global x, y
strokeWeight(1)
x1 = x + h*(x - x*x + y)
y = y + h*(y - y*y + x)
x = x1
if frame... | 21.46875 | 72 | 0.508006 |
4642dde9617bfb9ce3b9c41fb6f65149f794fd6f | 398 | py | Python | INBa/2015/Ruditch_A_C/task_1_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ruditch_A_C/task_1_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ruditch_A_C/task_1_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 1. Вариант 22
#Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Михаил Ефимович Фридлянд. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
#Rudich A.C.
#09.02.2016
print("Михаил Ефимович Фридлянд более известена, как ру... | 56.857143 | 216 | 0.819095 |
31026e6af2814052a3953b4041a38d37c92e4009 | 16,638 | py | Python | pdfannots/__init__.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | pdfannots/__init__.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | pdfannots/__init__.py | EnginKarahan/pdfannots | 745e1636df077e895ad1c116306df0e764c05e0f | [
"MIT"
] | null | null | null | """
Tool to extract and pretty-print PDF annotations for reviewing.
"""
__version__ = '0.3'
import bisect
import collections
import itertools
import logging
import typing
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpage import PDFPage
from pdfminer.layout import (LAParams, ... | 39.995192 | 101 | 0.641363 |
9ed46f73ad969bfc49424f07601a7fba529ef06e | 1,891 | py | Python | cogs/anime.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | cogs/anime.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | cogs/anime.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
import requests
import urllib.parse
class Anime(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(name="anime")
async def anime_command(self, ctx):
base_url = "https://trace.moe/api/search?url="
attach... | 35.679245 | 107 | 0.604971 |
7dfe80a9aa24979cdf83e34d2d4bc2eaf593438e | 153,366 | py | Python | frds/data/wrds/comp/funda.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/data/wrds/comp/funda.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/data/wrds/comp/funda.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | from dataclasses import dataclass
import numpy as np
import pandas as pd
from frds.data.wrds import WRDSDataset
@dataclass
class Funda(WRDSDataset):
"""Fundamentals Annual"""
data: pd.DataFrame
library = "comp"
table = "funda"
index_col = ["gvkey", "datadate"]
date_cols = ["datadate"]
de... | 31.133983 | 110 | 0.581752 |
b42a1429bc9e0bec00a737c0ba38cb5e91e29734 | 4,795 | py | Python | test/test_npu/test_ceil.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_ceil.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_ceil.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.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/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 38.36 | 74 | 0.557456 |
b4313a854fb71daf4e7a1f853b1eef6b31563f36 | 601 | py | Python | gdp1/assignment_1/mean_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_1/mean_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_1/mean_calculator.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from gdp1.common.input_helpers import *
def main():
print("Application for calculating means of two real values")
print()
x = float_input("Please enter the first real value: ")
y = float_input("Please enter the second real value: ")
# The harmonic mean is defined as zero iff one or both of the v... | 27.318182 | 82 | 0.645591 |
c33aea8a9633d956e43a3a1e1697902c1b2a448b | 2,256 | py | Python | src/bo4e/bo/geschaeftsobjekt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/bo/geschaeftsobjekt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/bo/geschaeftsobjekt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains base class for all business objects
and corresponding marshmallow schema for de-/serialization
"""
# pylint: disable=unused-argument, too-few-public-methods
from typing import List, Optional, Type
import attr
from marshmallow import Schema, fields, post_load
from marshmallow_enum import EnumField # type:... | 34.707692 | 117 | 0.733599 |
828e673196870aae9698500fea8196a7c3548953 | 1,743 | py | Python | examples/FreqGen.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | examples/FreqGen.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | examples/FreqGen.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | #!/usr/bin/python
"""Frequency generator
uses pulse width modulation for signal periods < 0.013 s
optional Arguments:
$1: GPIO pin
$2: signal period
$3: duty cycle of signal
"""
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import ... | 24.9 | 83 | 0.641997 |
7db49a7b5fcbbdd066c5aaa12e4d14f2fe711b39 | 14,709 | py | Python | testpatchs/zhuzhewang.py | zhuweiDark/fangzi | 2011dff33d40b43889b5784e509b876380ab3ed3 | [
"BSD-2-Clause"
] | null | null | null | testpatchs/zhuzhewang.py | zhuweiDark/fangzi | 2011dff33d40b43889b5784e509b876380ab3ed3 | [
"BSD-2-Clause"
] | null | null | null | testpatchs/zhuzhewang.py | zhuweiDark/fangzi | 2011dff33d40b43889b5784e509b876380ab3ed3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import urllib
import urllib2
import re
import requests
from lxml import etree
#from bs4 import BeautifulSoup
import chardet
import xlwt
#from xlwt import *
import sys
import os
import traceback
import requests
import Queue
import time
import threading
myQueue = Queue.Queue... | 36.864662 | 167 | 0.645999 |
4843e62f8b8e31ad6d6678cb9b1bb24c2e23e718 | 12,988 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/tools/paddlevideo_clas.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 883 | 2020-11-12T11:46:46.000Z | 2022-03-31T18:27:10.000Z | tools/paddlevideo_clas.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 233 | 2020-12-09T06:04:59.000Z | 2022-03-28T08:16:51.000Z | tools/paddlevideo_clas.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 225 | 2020-11-13T06:21:55.000Z | 2022-03-31T05:36:11.000Z | # Copyright (c) 2020 PaddlePaddle 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... | 38.886228 | 134 | 0.617647 |
b502476bce68e5f5d6d11f7e8c61bd052e75e2b2 | 3,397 | py | Python | python/fastcampus/chapter06_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter06_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/fastcampus/chapter06_02.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """파이썬 심화
흐름제어, 병행처리(Concurrency)
yield
코루틴 (Coroutine)
"""
# yield : 메인루틴 <-> 서브루틴
# 코루틴 제어, 코루틴 상태, 양방향값 제어
# yield from
# 서브루틴 : 메인루틴에서 -> 리턴에 의해 호출부분으로 돌아와 다시 프로세스
# 코루틴 : 루틴 실행 중 멈춤 가능 -> 특정 위치로 돌아갔다가 -> 다시 원래 위치로 돌아가 수행가능 -> 동시성 프로그래밍 가능
# 코루틴 : 코루틴 스케쥴링 오버헤드 매우 적다
# 스레드 : 싱글 스레드 -> 멀티스레드 -> 복잡 -> 공유되는 자원 -> 교... | 16.651961 | 86 | 0.605534 |
b50b4d4a670a776ef2f3a91275d3f854e965bd5b | 260 | py | Python | Problems/Two Pointers/easy/ReverseVowelsOfString/test_reverse_vowels_of_string.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Two Pointers/easy/ReverseVowelsOfString/test_reverse_vowels_of_string.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Two Pointers/easy/ReverseVowelsOfString/test_reverse_vowels_of_string.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from unittest import TestCase
from reverse_vowels_of_string import reverseVowels
class Test(TestCase):
def test_reverse_vowels(self):
self.assertEqual(reverseVowels("hello"), "holle")
self.assertEqual(reverseVowels("leetcode"), "leotcede") | 37.142857 | 63 | 0.761538 |
d2093ec8bae0518ec920195a9d89b8d271fa405f | 3,852 | py | Python | research/hpc/pinns/src/NavierStokes/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pinns/src/NavierStokes/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pinns/src/NavierStokes/dataset.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... | 35.018182 | 104 | 0.582295 |
d2510bba2b685b4a067a7f2c0aaf4d9affcd54e1 | 6,744 | py | Python | generate.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null | generate.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null | generate.py | codekulturbonn/webgen | 38cb7f5f382a05b65ef0886fc05814ed2e0e55ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
Einfacher Generator für statische Websites
- Seiten in Markdown-Dateien mit Frontmatter
- Vorlagen im Mustache-Format
- Bilder werden in verschiedene Größen verkleinert
'''
import chevron
import frontmatter
import functools
import http.server
import markdown
import os
from PIL import Image... | 31.661972 | 96 | 0.512011 |
73ba6bc3d15fb2c2059f276af43f9af616dc6e74 | 291 | py | Python | python/deep_learning/Socratica/String.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/deep_learning/Socratica/String.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/deep_learning/Socratica/String.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
message = "Meet me tonight."
print(message)
message2 = 'The clock strikes at midnight'
print(message2)
msg2 = 'I\'m '
print(msg2)
#New type of String using """ docstring """
msg = """ Hey this is just a docstring. I'm using single quotes as well as "double quotes" """
print(msg)
| 13.857143 | 94 | 0.670103 |
73de2291f5a41f7c80b04ea17ebde2c8399ccb89 | 2,150 | py | Python | research/cv/FaceRecognition/src/lrsche_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/FaceRecognition/src/lrsche_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/FaceRecognition/src/lrsche_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 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... | 38.392857 | 78 | 0.669767 |
73e8b25a3aefc5143efabc9ffc512831ef859be5 | 1,014 | py | Python | frappe-bench/apps/erpnext/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.accounts.report.non_billed_report import get_ordered_to_be_billed_data
def execute(filters=None):
columns = ge... | 39 | 109 | 0.684418 |
fb8b1305f6656d3af2005987b0f69c4283dad875 | 12,542 | py | Python | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Cybereason/Integrations/Cybereason/Cybereason_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import json
import io
import demistomock as demisto
""" API RAW RESULTS """
MACHINE_OUTPUTS = {
"status": "SUCCESS",
"message": "",
"data": {
"evidenceMap": {
"reportedByAntiMalwareEvidence": 1
},
"resultIdToElementDataMap": {
... | 37.438806 | 204 | 0.448573 |
fba98980921f132a5fef2ac6291cb7cc71f31a77 | 379 | py | Python | exercises/zh/solution_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_04_12_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.tokens import Span
nlp = spacy.blank("zh")
doc1 = nlp("哔哩哔哩与阿里巴巴合作为博主们建立社群")
doc1.ents = [
Span(doc1, 0, 4, label="WEBSITE"),
Span(doc1, 5, 9, label="WEBSITE"),
]
doc2 = nlp("李子柒打破了Youtube的记录")
doc2.ents = [Span(doc2, 6, 13, label="WEBSITE")]
doc3 = nlp("阿里巴巴的创始人马云提供了一千万购物优惠券")
doc3.... | 19.947368 | 48 | 0.654354 |
f79bc4ee6ab7da78f4b31b1547035b51437e76a0 | 506 | py | Python | exercises/pt/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_03_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Defina o componente customizado
def length_component(doc):
# Calcule o tamanho do doc
doc_length = len(doc)
print(f"This document is {doc_length} tokens long.")
# Retorne o doc
return doc
# Carregue o modelo pequeno do idioma inglês
nlp = spacy.load("en_core_web_sm")
# Adicione o ... | 24.095238 | 79 | 0.73913 |
e38c8f46b9b895466808e1c9d8e1dfddd4628ce8 | 477 | py | Python | euler-5.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-5.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-5.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def zmozi_sez(sez):
stevilo = 1
for x in sez:
stevilo *= x
return stevilo
def najmajši_zmonzek(n=20):
stevila = [2]
for x in range(3,n+1):
stevilo = x
trenuta_stevila = stevila
for y in trenuta_stevila:
if stevilo % y == 0:
... | 15.387097 | 43 | 0.492662 |
e3cf9f03cca56d40d69244b2349ab9138f49a64f | 6,617 | py | Python | tests/onegov/ballot/models/test_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/models/test_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ballot/models/test_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.ballot import List
from onegov.ballot import ListResult
from onegov.ballot import ProporzElection
from onegov.ballot import ElectionResult
def test_list_percentages(session):
election = ProporzElection(
title='Election',
domain='federation',
date=date(... | 29.941176 | 76 | 0.54632 |
54171d841a1bbc0f1be06de4df02757ff06a2ee8 | 29,182 | py | Python | crm/views.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | crm/views.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | crm/views.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.utils import timezone
from .decoraters import nicht_authentifizierter_user, genehmigte_user
from .filter i... | 39.435135 | 122 | 0.573847 |
54727366c520da7a149956fe3fe60cc368354468 | 731 | py | Python | examples/react-webapp/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | examples/react-webapp/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | examples/react-webapp/build.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | from universal_build import build_utils
args = build_utils.parse_arguments()
build_utils.log("Install essentials")
build_utils.run("yarn install", exit_on_error=False)
if args.get(build_utils.FLAG_CHECK):
build_utils.log("Run prettier:")
build_utils.run("yarn run prettier src/", exit_on_error=True)
buil... | 31.782609 | 65 | 0.751026 |
54ab93554dae60d6602fdb1cc2fb7833eb2b5892 | 553 | py | Python | ML/cnn - cat or dog/loadModelToPredict.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | ML/cnn - cat or dog/loadModelToPredict.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | ML/cnn - cat or dog/loadModelToPredict.py | DorianBul/UE_US_Projekt_ML | 6065b1fa0069163dced0b3cdede9a2a822829694 | [
"MIT"
] | null | null | null | import tensorflow as tf
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
cnn = tf.keras.models.load_model('./checkpoints/my_checkpoint')
# Part 4 - Making a single prediction
from keras.preprocessing import image
test_image = image.load_img('dataset/single_prediction/michal.jpg', target_siz... | 30.722222 | 91 | 0.768535 |
49fff5a9293ca31a898ea9e893889be9ef152898 | 351 | py | Python | oldp/apps/cases/processing/processing_steps/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/processing/processing_steps/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/processing/processing_steps/__init__.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | from oldp.apps.cases.models import Case
class CaseProcessingStep(object):
description = 'Case processing step without description'
def __init__(self):
super(CaseProcessingStep, self).__init__()
def process(self, case: Case) -> Case:
raise NotImplementedError('Abstract processing step nee... | 29.25 | 93 | 0.732194 |
4db8bb03bd9993818854616b2515a8fde7cf8438 | 4,547 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/tests/AllTests.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/AllTests.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/tests/AllTests.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | 40.963964 | 80 | 0.572026 |
6701b76138455dca398d5409d8afe795591d3919 | 3,621 | py | Python | quchong.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 5 | 2020-08-17T08:37:16.000Z | 2021-06-07T05:02:05.000Z | quchong.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | null | null | null | quchong.py | sambabypapapa/CralwerSet | a76e0660c42ce7aac20b8d07ccc454b6636a8a2a | [
"Apache-2.0"
] | 1 | 2021-06-07T05:02:10.000Z | 2021-06-07T05:02:10.000Z | import Levenshtein
import CralwerSet.connect_mysql as connect_mysql
import datetime
import copy
import traceback
def diff(string, List):
for each in List:
if Levenshtein.ratio(string, each[1]) > 0.8:
return False
return True
# conn = connect_mysql.w_shark_erp()
# cur = conn.cursor()
#
# ... | 31.215517 | 173 | 0.553162 |
6712bc40dffb8b7f814b7c7503938373a4a0d9e6 | 5,232 | py | Python | tarefas-poo/lista-02/processa-numeros/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável pela interação com o usuário
#
from view.menu import Menu
from view.paineis.painel_soma import PainelSoma
from view.paineis.painel_em_posicoes_impares import PainelEmPosicoesImpares... | 47.135135 | 95 | 0.676797 |
c01b8fa5725d7fc3d50f6b16fd30d02b81cf3e13 | 297 | py | Python | docker/linux/build_scripts/python-tag-abi-tag.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | docker/linux/build_scripts/python-tag-abi-tag.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | docker/linux/build_scripts/python-tag-abi-tag.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | # Utility script to print the python tag + the abi tag for a Python
# See PEP 425 for exactly what these are, but an example would be:
# cp27-cp27mu
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
print("{0}{1}-{2}".format(get_abbr_impl(), get_impl_ver(), get_abi_tag())) | 42.428571 | 74 | 0.747475 |
58aa78fbe018ce773e6782b42072e4d8c7ac54bf | 2,797 | py | Python | tests/onegov/user/test_oauth_msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_oauth_msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/user/test_oauth_msal.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import textwrap
import morepath
import pytest
import yaml
from onegov.core import Framework
from onegov.core.utils import scan_morepath_modules
from onegov.user import UserApp
# App url set in our AzureAD test tenant
MSAL_TEST_FQGN = os.environ.get('MSAL_TEST_FQGN')
# We only hardcode our tenant here for ... | 27.421569 | 73 | 0.652485 |
188e8d39e7fe0c89993e0fa8681f9a5b411224cf | 199 | py | Python | panzee/weapon.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 5 | 2015-07-16T20:44:58.000Z | 2016-04-19T03:47:46.000Z | panzee/weapon.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | 6 | 2015-12-23T07:05:06.000Z | 2016-07-03T22:29:03.000Z | panzee/weapon.py | DangerOnTheRanger/project-panzee | 9392a3d8c4a0acbac80905e164dca91b691022ab | [
"BSD-2-Clause"
] | null | null | null |
class Weapon(object):
def __init__(self, name, range_, ammo, base_damage):
self.name = name
self.range = range_
self.ammo = ammo
self.base_damage = base_damage
| 19.9 | 56 | 0.613065 |
e1343ab06af94d8ff77f92b208917bd0030094d7 | 295 | py | Python | run/wsgi.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | run/wsgi.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | run/wsgi.py | matthewmuccio/FlaskBase | b2d7288a33b20badee1f4667526cfc528599a9ef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# WSGI: Web service gateway interface
from core import omnibus as app
if __name__ == "__main__":
# Local
app.run(host="127.0.0.1", port=5000)
# Staging
#app.run(host="0.0.0.0", port=5000)
# Production
#app.run(host="0.0.0.0", port=5000, debug=False) | 21.071429 | 49 | 0.644068 |
e1cfb425a65edf758f233c890d0a4c6265ca32fa | 2,633 | py | Python | bot/actions/action_default_fallback.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | bot/actions/action_default_fallback.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | bot/actions/action_default_fallback.py | cosibot/cosibot-germany-german | ed8917e0da7ebb1ce2140674cc63bc7f82628408 | [
"MIT"
] | null | null | null | from typing import Any, Text, Dict, List
import requests
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.events import SlotSet
fallback_config = {
"search_URL": "https://www.googleapis.com/customsearch/v1?",
"params": {
"cx": "01251646610890260622... | 35.106667 | 104 | 0.582605 |
beff8a47cb6d3149782b05d469e0d26384fcf9ab | 18,409 | py | Python | tests/test_components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/test_components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | tests/test_components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from io import BytesIO
from json import dumps, loads
from unittest import TestCase
import requests
from minio.error import BucketAlreadyOwnedByYou
from projects.api.main import app
from projects.controllers.components import get_components_by_tag
from projects.controllers.utils import uuid_alp... | 41.183445 | 513 | 0.55299 |
3667d16281d64efbf39bc7bd99e248d765a0b39c | 1,827 | py | Python | imwievaluation/base.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/base.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/base.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
engine = create_engine('mysql+pymysql://imwi:@localhost/IMWI_Evaluation') # connect with DB
Session = scoped_session(sessionmaker(bind=engine))
Base = declarative_base... | 27.268657 | 92 | 0.59387 |
3d56f0b7971c74c2b2db354d27bb12375e674a47 | 940 | py | Python | catcher.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | catcher.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | catcher.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import inspect
import logging
import sys
def GetWrapper(obj, f):
def wrapper(*args, **kwargs):
try:
ret=f(obj, *args, **kwargs)
return ret
except:
(E, e, trace) = sys.exc_info()
logging.warning('exception caught: '+str(e))
logging.warning(str(trace))
return wrapper
def AttachCatcher(obj, function... | 20 | 47 | 0.67766 |
e9e3fbb8be0fe60d0f6814282f827b64d3d4446a | 400 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 4/4.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 4/4.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 4/4.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #The script generates an error. Please add the appropriate code that adds variables a and b without an error.
#A: The script generates an error saying that an integer object cannot convert to string implicitly.
#Please try to convert the integer to a string explicitly then or the string to an integer.
a = "1"
b = 2
pri... | 44.444444 | 109 | 0.7425 |
a1b2da1a13de7a8c26ad5761775dfaf68e2ac153 | 3,977 | py | Python | Kaggle-Competitions/Home Insurance/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/Home Insurance/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/Home Insurance/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | from sklearn.base import BaseEstimator
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction import DictVectorizer
import pandas as pd
import numpy as np
class FeatureTransformer(BaseEstimator):
"""
Generate features
"""
def __init__(self, train, test):
self.X = train
s... | 29.242647 | 111 | 0.73397 |
a1d6c7119edbbb46e8963d80e7edd5d257f3b535 | 15,512 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/aw/python/distributed/common/drivers.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/aw/python/distributed/common/drivers.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/aw/python/distributed/common/drivers.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2021 Huawei Device 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
#
# Unle... | 35.174603 | 79 | 0.574072 |
62c25b3746586829fb562137c0898bc808e10c01 | 6,330 | py | Python | frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/erpnext_integrations/connectors/woocommerce_connection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null |
from __future__ import unicode_literals
import frappe, base64, hashlib, hmac, json
import datetime
from frappe import _
def verify_request():
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
sig = base64.b64encode(
hmac.new(
woocommerce_settings.secret.encode('utf8'),
frappe.request.data,
h... | 30.728155 | 110 | 0.743444 |
c5195b3cb819f3d0fd894af1a1e5ea8dfd70799d | 1,951 | py | Python | globals.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | globals.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | globals.py | AuxiliumCDNG/MET-Bot | 7e00d878c92ad4f68b0b2920235019e14c9ea2fa | [
"MIT"
] | null | null | null | import os
import discord as discord_bot
import mysql.connector
import mysql.connector.cursor
import pymysql
from dbutils.pooled_db import PooledDB
from flask import Flask
from flask_discord import DiscordOAuth2Session
from statics import config
app = Flask("MET_Bot", static_folder='web/public/', static_url_path='', ... | 30.968254 | 117 | 0.662225 |
b1950a668d22c5c0d323b470943ffd57cd51b2dc | 3,296 | py | Python | official/cv/yolov3_resnet18/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/yolov3_resnet18/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/yolov3_resnet18/ascend310_quant_infer/export_bin.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... | 40.691358 | 96 | 0.657464 |
49393a9a060d8858e8facde03df3e4c684e11fc7 | 1,336 | py | Python | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/ForescoutEyeInspect/Scripts/ForescoutEyeInspectButtonGetVulnerabilityInfo/ForescoutEyeInspectButtonGetVulnerabilityInfo_test.py | henry-sue-pa/content | 043c6badfb4f9c80673cad9242fdea72efe301f7 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | from pytest_mock.plugin import MockerFixture
import demistomock as demisto
import ForescoutEyeInspectButtonGetVulnerabilityInfo
from ForescoutEyeInspectButtonGetVulnerabilityInfo import get_cve, main
def test_get_cve(mocker: MockerFixture):
cve_id = 'CVE-2020-0305'
mock_cve = {
'id': cve_id,
... | 32.585366 | 97 | 0.68488 |
497e04dead28db974da739f7f54927fddaf6d9ed | 3,331 | py | Python | pythonlib/flask_misaka.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2015-10-26T10:38:32.000Z | 2015-10-26T10:38:32.000Z | pythonlib/flask_misaka.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | pythonlib/flask_misaka.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import misaka
from flask import Markup
from copy import copy
# import constants for compatibility
from misaka import (EXT_AUTOLINK, EXT_FENCED_CODE, # pyflakes.ignore
EXT_LAX_HTML_BLOCKS, EXT_NO_INTRA_EMPHASIS, EXT_SPACE_HEADERS,
EXT_STRIKETHROUGH, EXT... | 30.842593 | 76 | 0.659862 |
6285720fc01bed28473a6ab4fe7dea1d0c6d2389 | 1,054 | py | Python | year_3/comppi_1/puborgs/modelschoices/locations.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/comppi_1/puborgs/modelschoices/locations.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/comppi_1/puborgs/modelschoices/locations.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | LOCATIONSREGIONCHOICES = (
("NONE", 'Не встановлено'),
("CRIMEA", 'Автономна Республіка Крим'),
("WINN", 'Вінницька обл.'),
("VOLIN", 'Волинська обл.'),
("DNIPRO", 'Дніпропетровська обл.'),
("DONETSK", 'Донецька обл.'),
("ZHIT", 'Житомирська обл.'),
("ZAKARPAT", 'Закарпатська обл.'),
... | 32.9375 | 44 | 0.564516 |
b2312583b31286734cd837d894ac0700b5a31ed3 | 3,105 | py | Python | research/cv/dcgan/src/cell.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/dcgan/src/cell.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/dcgan/src/cell.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... | 31.05 | 78 | 0.648953 |
b2499a643a0a2e73cc402a89ae8412393941a523 | 244 | py | Python | python/arguments parsing/with sys-argv.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/arguments parsing/with sys-argv.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/arguments parsing/with sys-argv.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import sys
args = sys.argv[1:] # sys.argv[0] gives usually the name of the python script
print(f"there are {len(args)} arguments given")
for item in args:
print(item)
# or:
print(f"arguments given: {str(args)}")
| 17.428571 | 78 | 0.680328 |
b272118c2732f165a13a4fcd05671e0d21357c58 | 2,071 | py | Python | sketches/tile_based_movement/orc.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/tile_based_movement/orc.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/tile_based_movement/orc.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
import time
TILESIZE = 32
class Orc():
def __init__(self, x, y):
self.x = x
self.y = y
self.from_x = 0
self.from_y = 0
self.offset_x = 0
self.offset_y = 0
self.dir = "right"
self.frame = 0
self.sz = TILESIZE
self.image... | 32.873016 | 92 | 0.507484 |
a24a79badbe1912711ab4f505d8007970a93b0e6 | 370 | py | Python | Chapter2_Python/TypeAnnotations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/TypeAnnotations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/TypeAnnotations.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | import tensorflow as tf
def my_adder(a, b):
return a + b
def my_adder2(a: int, b: int) -> int:
return a + b
def print_model(model: tf.keras.models.Sequential) -> None:
model.summary()
result = my_adder2(2, 55)
print(result)
my_adder(2, 3)
model = tf.keras.models.Sequential()
model.add(tf.keras.lay... | 14.8 | 59 | 0.681081 |
a2d060328cc3c6416eb9a627a624162638efedf6 | 304 | py | Python | python/pytest.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/pytest.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | python/pytest.py | eucalypto/potato | 9df3eada95956daf344eb49900d2ed79dc418817 | [
"Unlicense"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import fileinput
# fileinput is used to read the input. It can be stdin or a file.
# The for loop goes through the lines of the input. Here it just
# prints them to stdout
for edge_list_raw in fileinput.input():
print(edge_list_raw.strip())
| 20.266667 | 65 | 0.710526 |
ce06d7e5a877fc0c684326cbeafe212d2fb244fc | 564 | py | Python | addition_module/face_lightning/KDF/loss/ft.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | addition_module/face_lightning/KDF/loss/ft.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | addition_module/face_lightning/KDF/loss/ft.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class FT(nn.Module):
'''
araphrasing Complex Network: Network Compression via Factor Transfer
http://papers.nips.cc/paper/7541-paraphrasing-complex-network-network-compression-via-factor-transfer.pdf
'''
def __init__(self):
super(FT, self).__ini... | 28.2 | 106 | 0.758865 |
ce136ca28252fe3ba4ebcf7db97d1def6e54782d | 1,266 | py | Python | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/keyword_spotting/train.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-06-22T15:34:37.000Z | 2022-03-29T06:12:03.000Z | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/keyword_spotting/train.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | null | null | null | closed/PengChengLaboratory/code/ad/tiny/v0.1/training/keyword_spotting/train.py | AidanYok/tiny_results_v0.5 | 3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2 | [
"Apache-2.0"
] | 5 | 2021-08-02T16:39:02.000Z | 2022-03-29T06:12:04.000Z | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import os
import argparse
from tensorflow import keras
import keras_model as models
import get_dataset as aww_data
import aww_util
num_classes = 12 # should probably draw this directly from the dataset.
# FLAGS = None
if __name__ == '__main__'... | 29.44186 | 100 | 0.751185 |
65f12a105aa1fe686eaca92caa24f20ba7d3bd26 | 1,457 | py | Python | src/bo4e/com/zustaendigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/zustaendigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/zustaendigkeit.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Zustaendigkeit class
and corresponding marshmallow schema for de-/serialization
"""
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.enum.themengebiet import Themengebiet
# pylint: disable=too-few-... | 30.354167 | 183 | 0.748113 |
65f300c104155b04aa3a2250a7baaeb36b4e0cc3 | 2,353 | py | Python | frappe-bench/env/lib/python2.7/site-packages/stdnum/se/orgnr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/se/orgnr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/se/orgnr.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # orgnr.py - functions for handling Swedish organisation numbers
# coding: utf-8
#
# Copyright (C) 2012-2015 Arthur de Jong
# Copyright (C) 2014 Tomas Thor Jonsson
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the... | 32.232877 | 74 | 0.723757 |
5a53e037f26c3afb4df7fb9369a54c8b99b5cd60 | 408 | py | Python | leetcode/219-Contains-Duplicate-II/ContainDupII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/219-Contains-Duplicate-II/ContainDupII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/219-Contains-Duplicate-II/ContainDupII_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer[]} nums
# @param {integer} k
# @return {boolean}
def containsNearbyDuplicate(self, nums, k):
tb = {}
for i in range(len(nums)):
num = nums[i]
if num not in tb:
tb[num] = i
elif i - tb[num] <= k:
... | 25.5 | 47 | 0.436275 |
b2ff6e86a2e7890e7e27e18b98349504c864f6cc | 5,925 | py | Python | src/test/tests/queries/conncomp.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/queries/conncomp.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/queries/conncomp.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: conncomp.py
# Tests: queries - connected components related
#
# Programmer: Cyrus Harrison
# Date: February 22, 2006
#
# Modifications:
# Cyrus Harrison, Thu Aug 23 09:42:43 PDT 200... | 24.6875 | 78 | 0.764726 |
654d90fa82251aa109e641c247eaf1ec877d0007 | 1,346 | py | Python | src/onegov/pdf/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/cli.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import click
from onegov.core.cli import command_group
from onegov.pdf import LexworkSigner
cli = command_group()
@cli.command('lexwork-signing-reasons')
@click.option('--host')
@click.option('--login')
@click.option('--password')
def lexwork_signing_reasons(host, login, password):
""" Lists the reasons usable... | 26.392157 | 77 | 0.589153 |
3307a6cd8444e54762d60276825efae95347955f | 99 | py | Python | listings/chapter05/equation.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter05/equation.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter05/equation.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | from genetic import Chromosome, Genetic
class EquationChromosome(Chromosome):
def __init__(x
| 16.5 | 39 | 0.79798 |
0b11ef3f6917b4e2f0b6af103677945441dd0fba | 31 | py | Python | lib/python3.5/imp.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/imp.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/imp.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/imp.py | 31 | 31 | 0.774194 |
c5dd38c55f35775167d2a09013e29359abeed3ef | 4,612 | py | Python | app/nlptw.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | app/nlptw.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | app/nlptw.py | jpcrespo/twanalysis | 16047f22796983464dd6367aab110947e18b1670 | [
"MIT"
] | null | null | null | import stanza, re, operator, os
import pandas as pd
import numpy as np
from collections import Counter,OrderedDict
from PIL import Image
from wordcloud import WordCloud
import warnings
import random
warnings.filterwarnings('ignore')
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm, rcParams
... | 34.939394 | 224 | 0.636167 |
6819197b64329cc26186aaf59282e19448df93a6 | 19,135 | py | Python | Packs/PANOSPolicyOptimizer/Integrations/PANOSPolicyOptimizer/PANOSPolicyOptimizer.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | Packs/PANOSPolicyOptimizer/Integrations/PANOSPolicyOptimizer/PANOSPolicyOptimizer.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | 2 | 2021-12-26T07:34:37.000Z | 2021-12-26T07:49:34.000Z | Packs/PANOSPolicyOptimizer/Integrations/PANOSPolicyOptimizer/PANOSPolicyOptimizer.py | PAM360/content | 928aac9c586c6e593b2a452c402a37cb5df28dac | [
"MIT"
] | null | null | null | import hashlib
from CommonServerPython import *
class Client:
"""
Client to use in the APN-OS Policy Optimizer integration.
"""
def __init__(self, url: str, username: str, password: str, vsys: str, device_group: str, verify: bool, tid: int):
# The TID is used to track individual commands send... | 42.147577 | 122 | 0.573713 |
a8d812d9dc3bb8ba9eefda57a2a8f5cf56b0794a | 255 | py | Python | regex.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | regex.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | regex.py | StanislavVolodarskiy/trie | fd3c462a0338f9cfdca45d7ddeb6647a9b6b5a57 | [
"MIT"
] | null | null | null | import re
with open('patterns.txt') as f:
patterns = re.compile('|'.join(re.escape(line.replace('\n','')) for line in f))
with open('corpus.txt') as f:
for line in f:
if patterns.search(line) is not None:
print(line, end='')
| 25.5 | 83 | 0.596078 |
764a7914fd24705281fb512b2f7b7128b950adf2 | 5,682 | py | Python | tests/transformers/test_tokenizer.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/transformers/test_tokenizer.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/transformers/test_tokenizer.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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... | 38.391892 | 87 | 0.724217 |
4f2a3b4d960cc1264e0033da474a320c79280d90 | 1,085 | py | Python | Packs/ML/Scripts/ExportMLModel/ExportMLModel_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ML/Scripts/ExportMLModel/ExportMLModel_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ML/Scripts/ExportMLModel/ExportMLModel_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from ExportMLModel import main
from CommonServerPython import *
dummy_data = [i for i in range(10)]
def test_main(mocker):
mocker.patch.object(demisto, 'args', return_value={"modelName": 'model'})
def get_file_path(entry_id):
return {'path': './TestData/entry_file'}
def execute_command(command... | 32.878788 | 100 | 0.657143 |
4fbbf25e8e79b7e7408d54252fdc3aaa86be5c38 | 1,288 | py | Python | src/labtest/serializers.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/labtest/serializers.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/labtest/serializers.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User, Group
from rest_framework import serializers
from .models import LabTest, Location
from django.utils import timezone
from datetime import timedelta
class LocationSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Location
fields = [... | 31.414634 | 83 | 0.657609 |
50b4b0d71de5bb5d56ac01088779e934851646d0 | 3,727 | py | Python | python_experiments/paper_figures/vldbj/draw_index_update_del_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/paper_figures/vldbj/draw_index_update_del_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/paper_figures/vldbj/draw_index_update_del_time.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import matplotlib.pyplot as plt
import numpy as np
from data_analysis.vldbj_data_parsing.generate_index_markdown import *
def get_name_dict():
with open('data_names.json') as ifs:
return eval(''.join(ifs.readlines()))
# data set abbreviation dictionary
data_names = get_name_dict()
# figure parameters
... | 34.831776 | 120 | 0.622216 |
50be56df6e1da432ba286e4dd2dd4835902c290f | 3,413 | py | Python | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee_advance/employee_advance.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee_advance/employee_advance.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/employee_advance/employee_advance.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import flt, nowdate
class EmployeeAdvan... | 32.817308 | 104 | 0.739525 |
ba1057b9d145af2dedd1c389f7c58157c096889f | 358 | py | Python | top/clearlight/reptile/bilibili/fish_c/reptile/proxy_eg_demo04.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/reptile/bilibili/fish_c/reptile/proxy_eg_demo04.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/reptile/bilibili/fish_c/reptile/proxy_eg_demo04.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import urllib.request
# url = 'http://45.32.164.128/ip.php'
url = 'http://ip.myhostadmin.net/'
proxy_support = urllib.request.ProxyHandler({'http': '177.71.77.202:20183'})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)
response = urllib.request.urlopen(url)
html = respons... | 22.375 | 76 | 0.73743 |
ad6e7113f078c690956fa13340d4ccddc3bd64fd | 3,215 | py | Python | src/onegov/town/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
import textwrap
from onegov.core.upgrade import upgrade_task
from onegov.org.models import Organisation
@upgrade_task('Install the default homepage structure')
def in... | 25.72 | 74 | 0.427994 |
0f79d336a774103ff4fe2d013a456cd17c821227 | 6,705 | py | Python | DataProcess/net/resnet.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | 3 | 2021-12-24T04:52:03.000Z | 2021-12-27T02:14:49.000Z | DataProcess/net/resnet.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | DataProcess/net/resnet.py | ZhangQiHang-98/RFID_Scirpt | 0f74087add4cf16e2d201ad4f31cc1abd287db7e | [
"MIT"
] | null | null | null | import keras
import numpy as np
import sklearn
from utils.utils import save_logs
class Classifier_RESNET:
def __init__(self, output_directory, input_shape, nb_classes, nb_prototypes, classes,
verbose=False, load_init_weights=False):
self.output_directory = output_directory
self.m... | 44.111842 | 117 | 0.672782 |
0e9226fee893c66516f325a90adebfb7d060c244 | 924 | py | Python | code/3/birthday.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/3/birthday.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/3/birthday.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
import sys
import random
def has_duplicates(list) :
"""Returns True if there are duplicate in list, false otherwise"""
copy = list[:]
copy.sort()
for item in range(len(list)-1):
if copy[item] == copy[item + 1]:
return True;
return False;
def gen_birthdays(n):
"""returns a list ... | 23.692308 | 80 | 0.692641 |
7d43bf85d740d7e3197354077deeecd292685a70 | 10,731 | py | Python | src/onegov/gazette/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from datetime import datetime
from onegov.core.layout import ChameleonLayout
from onegov.core.static import StaticFile
from onegov.gazette import _
from onegov.gazette.collections import CategoryCollection
from onegov.gazette.collections import GazetteNoticeCollection
from on... | 32.128743 | 79 | 0.556798 |
cb63c008973f458fbec88e65c4723e032b3bac4f | 1,275 | py | Python | Algorithms/2_Implementation/42.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/42.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/42.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/queens-attack-2/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'queensAttack' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER n
# 2. INTEGER k
# 3.... | 23.181818 | 74 | 0.618824 |
381c7f8f667d49b46889718ff4e8b05ce16f0b2a | 1,946 | py | Python | SBTK_League_Helper/src/interfacing/servers.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/servers.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/interfacing/servers.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | from src.tools.dictionaries import PostLoadedDict
# Utility class
################################################
class ServerImplementationDict(PostLoadedDict):
def __missing__(self, key):
try:
return super().__missing__(key)
except KeyError:
return NotImplemented
########... | 27.027778 | 81 | 0.594553 |
2af44f2c41c331bbaaf1b1188224fbd2a7b38950 | 2,853 | py | Python | code/motor/head.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/head.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/motor/head.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | import time # import the time library for the sleep function
import brickpi3 # import the BrickPi3 drivers
import math
#TODO WORK IN PROGRESS
class Head:
def __init__(self):
self.MAX_RANGE = 80
self.BP = brickpi3.BrickPi3()
self.PORT = self.BP.PORT_C
self.BP.set_motor_power(self... | 33.564706 | 93 | 0.606379 |
2d5dcaf2b044aa7fc535d7c742afd393f1263cfc | 666 | py | Python | bds_setup/migrations/0001_initial.py | littlegwzh/BDS | 6233ea429d173f855c3f9d19fea284f53778e828 | [
"MIT"
] | null | null | null | bds_setup/migrations/0001_initial.py | littlegwzh/BDS | 6233ea429d173f855c3f9d19fea284f53778e828 | [
"MIT"
] | null | null | null | bds_setup/migrations/0001_initial.py | littlegwzh/BDS | 6233ea429d173f855c3f9d19fea284f53778e828 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-07-14 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Station',
fields=[
('id', models.AutoField(... | 26.64 | 114 | 0.563063 |
2d66df80b5a7620b36e19c1a38ff8394c8ba48e8 | 3,217 | py | Python | haas_lib_bundles/python/docs/examples/solar_monitor/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/solar_monitor/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/solar_monitor/haas506/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import utime
import ujson
from aliyunIoT import Device
import modbus as mb
import yuanda_htb485
import network
import ina219
from driver import GPIO
from driver import ADC
from driver import I2C
# 4G.Cat1连网代码
g_connect_status = False
def on_4g_cb(args):
print("4g ca... | 27.495726 | 485 | 0.528753 |
935054bed8a04b36525ffbdd5165640493a652f0 | 809 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_is_blank.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_is_blank.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_is_blank.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.dqc import MonitorRule
from watchmen_storage import EntityCriteriaExpression, EntityCriteriaOperator
from .data_service_utils import build_column_name_literal
from .factor_value_assert i... | 33.708333 | 77 | 0.845488 |
faa57f9ced0881794b3c7c68b8bf0963f51bd5c9 | 757 | py | Python | source/pkgsrc/mail/feed2exec/patches/patch-feed2exec_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/mail/feed2exec/patches/patch-feed2exec_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/mail/feed2exec/patches/patch-feed2exec_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-feed2exec_____init____.py,v 1.1 2020/01/29 16:48:48 schmonz Exp $
Avoid setuptools_scm since tarball has no .git.
--- feed2exec/__init__.py.orig 2019-02-26 22:03:32.000000000 +0000
+++ feed2exec/__init__.py
@@ -2,17 +2,8 @@
from __future__ import print_function, absolute_import
-try:
- from ._v... | 29.115385 | 80 | 0.7107 |
ea787f6947818538930b5c20f1fa43e10918feaf | 4,815 | py | Python | src/ssc/subspace_preservation.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | 1 | 2021-12-10T04:25:08.000Z | 2021-12-10T04:25:08.000Z | src/ssc/subspace_preservation.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | null | null | null | src/ssc/subspace_preservation.py | shailesh1729/ssc | 6baec02037fc3563bd3b671dd3e7a1fbe16a0841 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import time
from jax import random
import jax.numpy as jnp
import cr.sparse as crs
import cr.sparse.data as crdata
import cr.sparse.la.subspaces
import cr.sparse.cluster as cluster
import cr.sparse.cluster.ssc as ssc
import cr.sparse.cluster.spectral as spectral
from typing imp... | 33.908451 | 110 | 0.613707 |
ea88d3407bd59a30f820a74acef3249a129e8de5 | 13,432 | py | Python | etl/core/engine.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/core/engine.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/core/engine.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | from etl.core.plan import Plan
from etl.core.environment import Environment
import os, logging
from collections import deque
import asyncio
import uvloop
import asyncpg
import concurrent.futures
import functools
import faulthandler
from graphviz import Digraph
import time
ENGINE_LOG_FMT = '%(asctime)s|%(name)s|%(pro... | 35.723404 | 128 | 0.628052 |
35349a9e2c8ef4482adefdd2fcfa604606635775 | 5,804 | py | Python | python_reference/ipython_magic/watermark.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/ipython_magic/watermark.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/ipython_magic/watermark.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | """
Sebastian Raschka 2014
watermark.py
version 1.1.0
IPython magic function to print date/time stamps and various system information.
Installation:
%install_ext https://raw.githubusercontent.com/rasbt/python_reference/master/ipython_magic/watermark.py
Usage:
%load_ext watermark
%watermark
... | 33.549133 | 108 | 0.565817 |
eae8f1a015cd8c3e681ee46567606206536bacaf | 3,593 | py | Python | plugins/tff_backend/migrations/_014_app_user_to_username.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/migrations/_014_app_user_to_username.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/migrations/_014_app_user_to_username.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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... | 43.289157 | 101 | 0.734205 |
f4d2da723d0511dfb4ae5edcd6281d24828a6751 | 983 | py | Python | leetcode/031-Next-Permutation/NextPerm_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/031-Next-Permutation/NextPerm_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/031-Next-Permutation/NextPerm_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # @author: cchen
class Solution:
# @param {integer[]} nums
# @return {void} Do not return anything, modify nums in-place instead.
def nextPermutation(self, nums):
if len(nums) > 1:
flag = True
for i in range(1, len(nums)):
j = len(nums) - 1 - i
... | 32.766667 | 74 | 0.325534 |
761d7e55202dd6a0dd431d005e86235081e49998 | 3,088 | py | Python | app/app.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | app/app.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | app/app.py | Inniag/murmeltier-backend | b9512808e4e8a14443216ddccd8bb2f3d37e5a14 | [
"MIT"
] | null | null | null | from flask import Flask, request, abort
from flask_httpauth import HTTPBasicAuth
from flask_cors import CORS
from flask import jsonify
from .database import (
create_user as db_create_user,
connect,
create_user as db_create_user,
create_murmel as db_create_murmel,
get_murmel_by_id,
get_murmel_by... | 21.746479 | 73 | 0.657383 |
52915e7f205eb0a39d1434bf46176162768b9462 | 398 | py | Python | Wordc.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Wordc.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | Wordc.py | illy777/Python_uebungen | 0106ebd8885974c0e22549688e33c49ddbbff179 | [
"Unlicense"
] | null | null | null | from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt
with open("D:\isaac\Programmierung\Python_uebungen\Teil_05_Alice_in_wonderland.txt", "r") as f:
text = f.read()
wordcloud = WordCloud(width=1920, height=1200)
STOPWORDS.add("said")
STOPWORDS.add("illustration")
wordcloud.generate(text)
pl... | 19.9 | 95 | 0.763819 |
5e523588677f0a60d2c6d69c9ed7902e5c80e66f | 1,077 | py | Python | zencad/settings.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/settings.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/settings.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
from PyQt5.QtCore import *
from zenframe.settings import BaseSettings, default_text_editor_os
class ZencadSettings(BaseSettings):
def __init__(self):
list_of_settings = {
"gui": {
"text_editor": default_text_editor_os(),
... | 25.642857 | 66 | 0.506035 |
5ea0abc7978f543d8d18b670b90970658b27dc85 | 2,017 | py | Python | src/server/app/repository/ChatRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/ChatRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/ChatRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | #from .PresentationRepository import PresentationRepository
from .PresentationRepositoryNew import getPresentationsForDashboard, findPresentation
from .AuthenticationRepository import AuthenticationRepository
from ..db.settings import mongoclient
import json, time
from bson import json_util
#pRepo = PresentationReposi... | 38.056604 | 119 | 0.690134 |
5ebb291c9e40db39c439579a1928c2516c3a76ae | 2,989 | py | Python | tests/onegov/agency/test_excel_export.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_excel_export.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_excel_export.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.agency.excel_export import column_mapper
from onegov.agency.excel_export import export_person_xlsx
from onegov.agency.excel_export import extract_person_data
from onegov.agency.models import ExtendedPerson, ExtendedAgency
from openpyxl import load_workbook
def test_excel_export(session):
agency_x = Ex... | 30.5 | 75 | 0.62362 |
5ecfbe4b13fbeb4654abe97ee9219e56b845dead | 1,530 | py | Python | score_checker.py | KR-16/Flask | b996c16378690d46a2e17d5c382aa78ec504e4ff | [
"MIT"
] | null | null | null | score_checker.py | KR-16/Flask | b996c16378690d46a2e17d5c382aa78ec504e4ff | [
"MIT"
] | null | null | null | score_checker.py | KR-16/Flask | b996c16378690d46a2e17d5c382aa78ec504e4ff | [
"MIT"
] | null | null | null | from flask import Flask,redirect,url_for,render_template,request
import numpy as np
# request helps you to read the posted value
app = Flask(__name__)
@app.route("/")
def result():
return render_template("score_page.html")
@app.route(rule = "/success/<int:score>")
def success(score):
res = ""... | 26.37931 | 70 | 0.584314 |
0deac2c1cb47006d1e5e2a3c51d681581edd71bc | 245 | py | Python | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | 1 | 2021-05-19T06:44:03.000Z | 2021-05-19T06:44:03.000Z | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
def avg(*nums):
return sum(nums)/len(nums)
if __name__ == '__main__':
nums = list(map(int, input().split()))
res = avg(*nums)
print('%.2f' % res + '\n')
| 14.411765 | 42 | 0.612245 |
df30c717cdb5c34f1d31532d6e3a0dd36491d2a1 | 5,591 | py | Python | apps/API/views.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/API/views.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | apps/API/views.py | dongdawang/ssrmgmt | a41e595aec503dcb191a20ea8d58233bbb8f2db0 | [
"MIT"
] | null | null | null | import json
import logging
from django.views import View
from django.http import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from django.conf import settings
from users.models import UserProfile, SSRAccount, DataUsageRecord
from ... | 34.726708 | 97 | 0.549812 |
df83aedeedf4eae151c58122f8f6dab554fa03bf | 1,683 | py | Python | posts/templatetags/post_tags.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/templatetags/post_tags.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/templatetags/post_tags.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | from django import template
from posts.categoryModels import Category
from posts.models import Post
register = template.Library()
@register.simple_tag
def total_posts():
return Post.objects.published().count()
@register.simple_tag
def url_replace(request, field, value):
dict_ = request.GET.copy()
d... | 24.042857 | 72 | 0.736185 |
d5abc90ebe8f834e8daa83feadf33ec30dd382e9 | 176 | py | Python | tests/test_models.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/test_models.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/test_models.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | def test_news_item(client, app, db, seeder):
with app.app_context():
from project.models import NewsItem
item = NewsItem()
assert item is not None
| 25.142857 | 44 | 0.647727 |
982fe985fc8cca96f81f876168580913165e493d | 1,366 | py | Python | src/visitpy/pyavt/py_src/templates/advanced_expression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/pyavt/py_src/templates/advanced_expression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/pyavt/py_src/templates/advanced_expression.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #
# Template for an Advanced Python Expression.
#
class PyExpr(PythonExpression):
def __init__(self):
"""
Constructor.
"""
PythonExpression.__init__(self)
# set to provide a name & description for your expression.
self.name = "PyExpr"
self.description = "Custo... | 31.767442 | 77 | 0.63836 |
101276c029857c0bee7ae2ab67e80ce83af250f0 | 3,639 | py | Python | src/onegov/file/attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/attachments.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pdftotext
from depot.fields.upload import UploadedFile
from depot.io import utils
from depot.io.interfaces import FileStorage
from depot.io.utils import INMEMORY_FILESIZE
from io import BytesIO
from onegov.core.html import sanitize_svg
from onegov.file.utils import digest
from onegov.file.utils import get_image... | 31.643478 | 78 | 0.699093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.