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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3e28b9b4e22d45e6bc49dc9b089760647d975c | 969 | py | Python | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import PhraseMatcher
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
animals = ["Golden Retriever", "cat", "turtle", "Rattus norvegicus"]
animal_patterns = list(nlp.pipe(animals))
print("animal_patterns:", animal_patterns)
matcher = PhraseMatcher(nlp.vocab)
matcher.add(... | 32.3 | 83 | 0.734778 |
1c8ec23ebdf4c321abac1d0f538c94d808ee6f2c | 254 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/quality_inspection/test_quality_inspection.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
import frappe
import unittest
# test_records = frappe.get_test_records('Quality Inspection')
class TestQualityInspection(unittest.TestCase):
pass
| 23.090909 | 85 | 0.80315 |
c7035ddb07588c96767f335ee8c0b5b64af10bcf | 736 | py | Python | django_project/apps/cms/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | django_project/apps/cms/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | django_project/apps/cms/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.urls import path
from . import views
from . import staff_views
app_name = 'cms'
urlpatterns = [
path('',views.index,name='index'),
path('news_list/',views.NewsListView.as_view(),name='news_list'),
path('add_news_category/',views.add_news_category,name='add_news_category'),
path('news_catego... | 33.454545 | 80 | 0.717391 |
c73de49b39decd518257017279681ae0b59c936a | 326 | py | Python | src/onegov/winterthur/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger('onegov.winterthur') # noqa
log.addHandler(logging.NullHandler()) # noqa
from translationstring import TranslationStringFactory # noqa
_ = TranslationStringFactory('onegov.winterthur') # noqa
from onegov.winterthur.app import WinterthurApp
__all__ = ('WinterthurApp', 'log',... | 29.636364 | 62 | 0.776074 |
c7a59634acef4230bb04bf05fa66272652ebbf58 | 5,634 | py | Python | other/re-risky/split-version/task2/task/silver.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | other/re-risky/split-version/task2/task/silver.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | other/re-risky/split-version/task2/task/silver.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
# -*- coding: utf8 -*-
# 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
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 119.87234 | 4,122 | 0.72098 |
c7be042065cf76f37558122a8ece89c5c3177296 | 26 | py | Python | TwitterDataCollect/__init__.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | TwitterDataCollect/__init__.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | TwitterDataCollect/__init__.py | dxmahata/TwitterSentimentAnalysis | b228747dfa74266853d4f8e6d4bc4eb29c080dd3 | [
"MIT"
] | null | null | null | __author__ = 'cisstudent'
| 13 | 25 | 0.769231 |
1bf5aa114251a11e183c2051886f76ec1c22d622 | 1,985 | py | Python | pyventskalender/tag02_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag02_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag02_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | def addiere_zahlen(a, b):
summe = a + b
return summe
def bilde_durchschnitt(a, b, c, d, e):
summe = addiere_zahlen(a, b)
summe = addiere_zahlen(c, summe)
summe = addiere_zahlen(d, summe)
summe = addiere_zahlen(e, summe)
return summe/5
def elchgeraeusch(wiederholungen):
"""Gibt einen ... | 28.768116 | 77 | 0.700756 |
40301f40beb4d060cd3d2d05d7208b520633c974 | 6,154 | py | Python | src/Sephrasto/Wolke.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Wolke.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/Wolke.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 5 22:02:26 2017
@author: Aeolitus
"""
class Wolke:
Char = None
DB = None
Reqs = True
Fehlercode = 0
Settings = {
'Version' : 1,
'Bogen': 'Frag immer nach',
'Datenbank': None,
'Cheatsheet': False,
'Cheatsheet-... | 52.152542 | 88 | 0.652909 |
405abb95fc5970a7188b04ea264e79085eda9940 | 1,249 | py | Python | fuzzsvc/model/FuzzingCrash.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | model/FuzzingCrash.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | model/FuzzingCrash.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from app import app
from datetime import *
db = app.config['db']
'''
For simplicity I am just using one simple model for each crash and not using the previous db schema. We may want to move
the crash system to a bugzilla friendly format. Based on the decision on the design of crash analysis (clientside or serverside)... | 36.735294 | 128 | 0.65012 |
40cbb9f188bdf7596a739e191f68dff9d8422cff | 2,316 | py | Python | src/Intrepreter.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Intrepreter.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Intrepreter.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | from src.Node import Node
from src.Shape import Shape
from typing import List
import logging
from src.Graph import Graph
class Interpreter:
"""
This module gets a collection of fuzzy elevated surface shapes and then builds a hierarchy (non-cyclical graph;tree)
depending on the objects' fuzzyness and surfa... | 40.631579 | 120 | 0.584629 |
467560f158303dc9dc8d06395616c3c4391267f7 | 2,387 | py | Python | measure/system/demo/TracemallocDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/system/demo/TracemallocDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/system/demo/TracemallocDemo.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import tracemalloc
import math
from libs.ModelFactory import ModelFactory
from measure.ModelMeter import ModelMeter
# =============================================================================
# Explore some tracemalloc commands.
# Further details see https://docs.python.org/3/library/tracemalloc.html
# and https:... | 31 | 125 | 0.529535 |
d3df8b9f0a99a8ec5f6ae30ba7bd88295920c033 | 38 | py | Python | publ/__version__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/__version__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/__version__.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ version """
__version__ = "0.7.4"
| 12.666667 | 21 | 0.552632 |
31da0949aa36c9fb5693cd9bb4a743d3df4d89d3 | 1,105 | py | Python | robolib/networks/predict_result.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/networks/predict_result.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/networks/predict_result.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import numpy as np
class PredictResult:
def __init__(self):
self.arr_type = np.dtype([('class', 'U30'), ('probability', 'f8')])
self.values = np.array([], dtype=self.arr_type)
self.finished = False
self.max_entries = 10
def append(self, class_name, probability):
self.f... | 29.864865 | 102 | 0.604525 |
9ecd76178527a0f016766b84c22d8c3885c71ab3 | 400 | py | Python | SBTK_League_Helper/src/tools/__DEPRECATED/counters.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/tools/__DEPRECATED/counters.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/src/tools/__DEPRECATED/counters.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | # DEPRECATION:
# Substituted by the standard library Counter class
class MultiCounter(dict):
def __init__(self, *args, default=0, increment=1):
self.__default=0
self.__increment=1
super(MultiCounter, self).__init__(*args)
def __missing__(self, key):
return self.__default
... | 28.571429 | 54 | 0.655 |
b4102b0eb86a27d0f28b768af761ef43ad0a59ed | 1,645 | py | Python | train.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | train.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | train.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import json
import torch
import argparse
import datetime
from commons.utils import train, eval, import_module
if __name__ == '__main__':
# Parse Arguments
parser = argparse.ArgumentParser()
parser.add_argument('--train_config', type=str, default='', help='Path for train config json file')
parser.add_ar... | 32.9 | 116 | 0.654711 |
b41dc8da0e840642049df6a2eb8610fbf0a9652d | 4,627 | py | Python | myspiders/spider_hr/nbcb_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/spider_hr/nbcb_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/spider_hr/nbcb_spider.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from myspiders.ruia import Item, Spider, Bs4HtmlField, Bs4AttrField, Bs4TextField, JsonField, RegexField
from urllib.parse import urlencode, urlparse, urljoin, quote
from config import Target, CONFIG
import re
import math
from bs4 import BeautifulSoup
import time
import random
'''
CompID: 447
PubTime: "2020-05-29 11:0... | 28.73913 | 150 | 0.664361 |
c30522f6f8e1b3ea7573ab8672fc5be4eead8abb | 454 | py | Python | weibo/test/testReplace.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testReplace.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/test/testReplace.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #encoding:utf8
'''
Created on 2016年4月12日
@author: wb-zhaohaibo
'''
import re
#http://weibo.com/u/5045053810?refer_flag=1005050005_&is_hot=1
#http://weibo.com/p/1005055045053810/info?mod=pedit_more
html_cont = open("text.html").read()
#href="/u/5710218160?refer_flag=1005050005_"
#href=\"\/u\/5775850992?fro... | 28.375 | 69 | 0.696035 |
6f446c206088ce4471a32293e2ca0c6539782bf4 | 2,334 | py | Python | x2paddle/op_mapper/pytorch2paddle/pytorch_custom_layer/instance_norm.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 559 | 2019-01-14T06:01:55.000Z | 2022-03-31T02:52:43.000Z | x2paddle/op_mapper/pytorch2paddle/pytorch_custom_layer/instance_norm.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 353 | 2019-05-07T13:20:03.000Z | 2022-03-31T05:30:12.000Z | x2paddle/op_mapper/pytorch2paddle/pytorch_custom_layer/instance_norm.py | usertianqin/X2Paddle | b554a8094ca3e255ef4bd2e80337222a35625133 | [
"Apache-2.0"
] | 241 | 2018-12-25T02:13:51.000Z | 2022-03-27T23:21:43.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 applic... | 36.46875 | 126 | 0.619966 |
6f77fa4323189964524ad6487dec790537534bca | 1,917 | py | Python | Utils/github_workflow_scripts/run_secrets_detection.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/github_workflow_scripts/run_secrets_detection.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/github_workflow_scripts/run_secrets_detection.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | #!/usr/bin/env python3
import argparse
import sys
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
SECRETS_INSTANCE_URL = "https://content-gold.paloaltonetworks.com/instance/execute/GenericWebhook_Secrets"
def arguments_handler():
""" Validates and parses scri... | 29.492308 | 120 | 0.691706 |
7d80836ad111cf897fa83ab083d7c2082ffab16f | 10,736 | py | Python | Uebung10/Aufgabe28.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung10/Aufgabe28.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung10/Aufgabe28.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | #sauce header
from random import randint
###################################
class Node:
def __init__(self, value):
self.pred = None
self.succ = None
self.value = value
class Liste:
def __init__(self, beginNode = None, endNode = None):
self.beginNode = beginNode
se... | 29.988827 | 116 | 0.567344 |
9639b078a10f2d25d991fb3cd3e8c817aeab93a8 | 5,527 | py | Python | research/nlp/tprr/src/reader_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/tprr/src/reader_eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/tprr/src/reader_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... | 38.65035 | 105 | 0.619323 |
96bbc2e9f39b5d3b59b0e98fb4e34cfb377532c7 | 5,318 | py | Python | src/test/tests/operators/transform.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/operators/transform.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/operators/transform.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: transform.py
#
# Tests: mesh - 3D unstructured, single domain,
# 3D rectilinear, single domain.
# plots - pc, mesh, contour, vector
# oper... | 23.324561 | 78 | 0.710982 |
838ef8b0674be29947678dc7c593cf766f140ea5 | 2,265 | py | Python | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/special_event.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 14 | 2016-11-03T19:06:21.000Z | 2021-11-24T09:05:09.000Z | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/special_event.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 10 | 2022-02-16T07:17:49.000Z | 2022-03-08T12:43:51.000Z | asset/integrations/django/samples/fusioncharts/samples/special_event.py | Piusshungu/catherine-junior-school | 5356f4ff5a5c8383849d32e22a60d638c35b1a48 | [
"MIT"
] | 17 | 2016-05-19T13:16:34.000Z | 2021-04-30T14:38:42.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file which has required functions to embed the charts in html page
from ..fusioncharts import FusionCharts
# Loading Data from a Static JSON String
# It is a example to show how to attach event in chart.
# The `ch... | 39.736842 | 136 | 0.465784 |
583c43b087f2ed2361787ad686385d4aab2ac59c | 70 | py | Python | babelbox/__init__.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | 2 | 2021-03-18T04:34:23.000Z | 2021-03-23T17:35:07.000Z | babelbox/__init__.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | babelbox/__init__.py | OrangeUtan/babelbox | 3dd01e078aea8aa352ff5606179d5e1e09f4b827 | [
"MIT"
] | null | null | null | __version__ = "2.1.1"
from . import integration
from .parser import *
| 17.5 | 25 | 0.728571 |
54352f3fc9d40519286efe92a3678de741dd28f8 | 92 | py | Python | 2015/01/oil-producers/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/01/oil-producers/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/01/oil-producers/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1-TvtEaichy2vKKqzvqTxm-wEPyvePowugV5PUvTp6zE'
| 23 | 68 | 0.826087 |
544e17b868db53307fa50fb7032f47b436124473 | 488 | py | Python | projects/g3h2-algorithm/practice1/1.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/1.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-algorithm/practice1/1.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | def find_sum(s: list, x: int) -> (bool, (int, int)):
s = sorted(s)
i = 0
j = len(s) - 1
while i < j:
if s[i] + s[j] == x:
return True, (s[i], s[j])
elif s[i] + s[j] > x:
j -= 1
else:
i += 1
return False, None
if __name__ == '__main__':
... | 19.52 | 52 | 0.383197 |
54b62fb420ad4b077c6414d49daabaf80869b5f1 | 181 | py | Python | python/gdal_cookbook/cookbook_general/check_version.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_general/check_version.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/gdal_cookbook/cookbook_general/check_version.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import sys
from osgeo import gdal
version_num = int(gdal.VersionInfo('VERSION_NUM'))
if version_num < 1100000:
sys.exit('ERROR: Python bindings of GDAL 1.10 or later required') | 30.166667 | 69 | 0.762431 |
b7469f06467d737cfba636355aec05190d45ffec | 1,369 | py | Python | multimeter/read_arduino.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/read_arduino.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/read_arduino.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | import serial
import globvar
"""import logging
logging.basicConfig(filename="log/multimeter.log",
level=logging.DEBUG,
)
logger = logging.getLogger("read_arduino")"""
def read():
"""
reads analog measured data via usb from a connected arduino
"""
global measure0
global measure1
global m... | 20.432836 | 61 | 0.627465 |
b7a84a8d1a3cc68ed58a9cfc5760cf9ca68c6c51 | 1,995 | py | Python | tests/nlu/extractors/test_entity_synonyms.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 37 | 2019-06-07T07:39:00.000Z | 2022-01-27T08:32:57.000Z | tests/nlu/extractors/test_entity_synonyms.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 216 | 2020-09-20T13:05:58.000Z | 2022-03-28T12:10:24.000Z | tests/nlu/extractors/test_entity_synonyms.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 65 | 2019-05-21T12:16:53.000Z | 2022-02-23T10:54:15.000Z | from rasa.nlu.extractors.entity_synonyms import EntitySynonymMapper
from rasa.shared.nlu.constants import TEXT
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
def test_entity_synonyms():
entities = [
{"entity": "test", "value":... | 33.813559 | 84 | 0.595489 |
b7eeca8e22628023fb029a098c3353d1601861d3 | 1,603 | py | Python | make_strip.py | k11d/PAL | cc4f2ba2100cd38f80cb8a632ec2b46985599962 | [
"MIT"
] | null | null | null | make_strip.py | k11d/PAL | cc4f2ba2100cd38f80cb8a632ec2b46985599962 | [
"MIT"
] | null | null | null | make_strip.py | k11d/PAL | cc4f2ba2100cd38f80cb8a632ec2b46985599962 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import numpy as np
from PIL import Image
def main():
def _load_frames(frames_path_gen, direction):
_frames = []
h, w = 0, 0
for frame in frames_path_gen:
im = Image.open(frame)
iar = np.array(im)
_frames.appe... | 30.245283 | 120 | 0.528384 |
42720e98aa7cae7f52b4ea8a899826f97b972b17 | 991 | py | Python | tasks.py | alexandrebarbaruiva/rasa-plus | fe2ef9fcde007e42d62b38bf1afeeadd49f5ba95 | [
"MIT"
] | null | null | null | tasks.py | alexandrebarbaruiva/rasa-plus | fe2ef9fcde007e42d62b38bf1afeeadd49f5ba95 | [
"MIT"
] | 1 | 2020-08-08T13:00:11.000Z | 2020-08-08T13:00:11.000Z | tasks.py | alexandrebarbaruiva/rasa-plus | fe2ef9fcde007e42d62b38bf1afeeadd49f5ba95 | [
"MIT"
] | null | null | null | from invoke import task
import shutil
@task
def clean(c):
"""
Remove distribution files
"""
shutil.rmtree("dist/", ignore_errors=True)
shutil.rmtree("build/", ignore_errors=True)
shutil.rmtree("rasa_plus.egg-info/", ignore_errors=True)
shutil.rmtree("rasa_plus/__pycache__/", ignore_errors=... | 21.085106 | 81 | 0.641776 |
67f59e4a53118e01e26faf7a09a0e07f870ca30f | 517 | py | Python | new-docs/examples/inheritance/python/inheritance_external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-07-08T17:36:08.000Z | 2021-07-08T17:36:08.000Z | new-docs/examples/inheritance/python/inheritance_external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | new-docs/examples/inheritance/python/inheritance_external.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | import oso
@oso.polar_class
class Actor:
def __init__(self, role, treated):
self.role = role
self._treated = treated
def treated(self, patient):
return patient in self._treated
# start-patient-data
@oso.polar_class
class PatientData:
def __init__(self, patient):
self.pat... | 14.771429 | 39 | 0.680851 |
e1e120d4a199816cbbef1cb0c29df91b4cefc626 | 299 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_5_Set/82. remove elements that exist only in set1 but not in set2.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_5_Set/82. remove elements that exist only in set1 but not in set2.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_5_Set/82. remove elements that exist only in set1 but not in set2.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | '''
Write a function that deletes all elements in set1 that exists only in set1 but not in set2.
set1 = {1,2,3,4,5}
set2 = {4,5,6,7,8}
'''
def diff_update(set1,set2):
for elem in set2:
if elem not in set1:
pass
else:
set1.discard(elem)
return set1 | 18.6875 | 92 | 0.585284 |
c048b8710e2817c74b7440da06275f94f658db43 | 280 | py | Python | login/tests/test_apps.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/login/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/login/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.apps import apps
from django.test import TestCase
from login.apps import LoginConfig
class ReportsConfigTest(TestCase):
def test_apps(self):
self.assertEqual(LoginConfig.name, 'login')
self.assertEqual(apps.get_app_config('login').name, 'login')
| 28 | 68 | 0.75 |
220402cdc6f78c3cf009d963639990ae75610f85 | 629 | py | Python | Hackerrank_problems/Big_Sorting/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Hackerrank_problems/Big_Sorting/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Hackerrank_problems/Big_Sorting/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #python3 with bucket sort
#What is bucket sort?
#Bucket sort is mainly useful when input is uniformly distributed over a range.
#taking input from user
n = int(input().strip())
bucket = {}
# read all integers as strings, store them by length in the bucket
for _ in range(n):
number = input().strip()
length = l... | 26.208333 | 79 | 0.677266 |
58f772cc32bfda8a6215542c2ebac5ed90a6926f | 15,943 | py | Python | nodes/sickldmrs.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | 1 | 2017-12-29T07:58:31.000Z | 2017-12-29T07:58:31.000Z | nodes/sickldmrs.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | null | null | null | nodes/sickldmrs.py | achambers16/sick_ldmrs | a65f2239f474263a16b382bae6fc4cb5e5505ba5 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#***********************************************************
#* Software License Agreement (BSD License)
#*
#* Copyright (c) 2010, CSIRO Autonomous Systems Laboratory
#* All rights reserved.
#*
#* Redistribution and use in source and binary forms, with or without
#* modification, are permitte... | 38.416867 | 106 | 0.628991 |
188a2fba42601219e77293c03b018c49463bf283 | 3,222 | py | Python | tests/test_angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_angebotsvariante.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import datetime
import pytest # type:ignore[import]
from bo4e.com.angebotsvariante import Angebotsvariante, AngebotsvarianteSchema
from bo4e.enum.angebotsstatus import Angebotsstatus
from tests.serialization_helper import assert_serialization_roundtrip # type:ignore[import]
from tests.test_angebotsteil import examp... | 45.380282 | 120 | 0.621353 |
18d04e288e486d9ddfe3e3f27bdba235766a0082 | 935 | py | Python | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Algorithms/Sort_Algorithms/Topological_Sort/TopologicalSort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | '''
Topological sort.
Taken from :
http://stackoverflow.com/questions/15038876/topological-sort-python
'''
from collections import defaultdict
from itertools import takewhile, count
def sort_topologically(graph):
levels_by_name = {}
names_by_level = defaultdict(set)
def walk_depth_first(name):
i... | 24.605263 | 99 | 0.626738 |
18e03cc8be120f0fd82681903783b224041cb26c | 473 | py | Python | sources/stage01/tt.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage01/tt.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage01/tt.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | import turtle as t
wn = t.Screen()
wn.colormode(255)
wn.bgcolor(43, 62, 80)
wn.setup(width = 600, height = 600)
wn.title("Ein Super-Duper Turtle-Programm")
alex = t.Turtle()
alex.shape("turtle")
berta = t.Turtle()
berta.shape("circle")
def quadrat(t):
for i in range(4):
t.forward(100)
t.left(90)... | 15.766667 | 43 | 0.655391 |
7a0a7652646d2b3c0f5958775d0778529a0077f9 | 428 | py | Python | leetcode/350 Intersection of Two Arrays II/IntersectionOfTwoArraysII_simplified.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/350 Intersection of Two Arrays II/IntersectionOfTwoArraysII_simplified.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/350 Intersection of Two Arrays II/IntersectionOfTwoArraysII_simplified.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def intersect(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
sect = {}
res = []
for num in nums1:
sect[num] = sect.get(num, 0) + 1
for num in nums2:
i... | 25.176471 | 44 | 0.432243 |
18657a078b185eb5e6c8ce1e5161831a025489f6 | 8,712 | py | Python | Plugins/CharakterAssistent/WizardWrapper.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 15 | 2017-11-09T12:49:52.000Z | 2022-03-06T12:18:48.000Z | Plugins/CharakterAssistent/WizardWrapper.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 40 | 2018-02-01T21:32:01.000Z | 2022-03-22T11:35:28.000Z | Plugins/CharakterAssistent/WizardWrapper.py | klnrdknt/Sephrasto | 591224fe01825a169c21ebc6136533f282ce9a0b | [
"MIT"
] | 13 | 2018-03-12T17:50:42.000Z | 2022-03-06T12:21:41.000Z | from PyQt5 import QtWidgets, QtCore
import os.path
import logging
from Wolke import Wolke
import lxml.etree as etree
from EinstellungenWrapper import EinstellungenWrapper
from EventBus import EventBus
from CharakterAssistent.CharakterMerger import CharakterMerger
class Regeln(object):
def __init__(self):
s... | 45.375 | 183 | 0.629132 |
43fe7e8bc6e88b6453d6dbeb8b6f585dd1af4f30 | 11,333 | py | Python | recipes/common/common.py | SolarFramework/conan-solar | cdb6253556c056baacaf3e5f28b595869adddb88 | [
"Apache-2.0"
] | null | null | null | recipes/common/common.py | SolarFramework/conan-solar | cdb6253556c056baacaf3e5f28b595869adddb88 | [
"Apache-2.0"
] | 3 | 2021-02-15T08:48:16.000Z | 2021-02-24T16:35:54.000Z | recipes/common/common.py | SolarFramework/conan-solar | cdb6253556c056baacaf3e5f28b595869adddb88 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
import re
from conans import tools
from fnmatch import fnmatch
from pathlib import Path
def get_c_flags(**kwargs):
if kwargs.get('is_posix', tools.os_info.is_posix):
if kwargs.get('is_macos', tools.os_info.is_macos):
# Our... | 33.137427 | 111 | 0.582458 |
9a9757582f575c55980140daf8fcf47e81441227 | 277 | py | Python | synop_bkp.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | synop_bkp.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | synop_bkp.py | dcazabat/SYNOP_PY | 7a9f1804858d72b1ec2584fed887689161036ad7 | [
"MIT"
] | null | null | null | import shutil
# Copia de Seguridad de la LIBRETA
RUTA_ORIGEN = 'c:\\LIBRETA\\'
RUTA_DESTINO = 'e:\\PenAero\\Aero Diario\\Aero\\LIBRETA\\'
print('Eliminando Copia')
shutil.rmtree(RUTA_DESTINO)
print('Copiando')
print(shutil.copytree(RUTA_ORIGEN,RUTA_DESTINO))
print('Copiado') | 25.181818 | 58 | 0.758123 |
9ab3591c79086f19e7adfc0d86ef525d8b5147f9 | 291 | py | Python | GUI Project/Filehandler.py | PiecePaperCode/Projekt | 524996cdb9fa08e6e83c289dd124c49e35886820 | [
"MIT"
] | null | null | null | GUI Project/Filehandler.py | PiecePaperCode/Projekt | 524996cdb9fa08e6e83c289dd124c49e35886820 | [
"MIT"
] | null | null | null | GUI Project/Filehandler.py | PiecePaperCode/Projekt | 524996cdb9fa08e6e83c289dd124c49e35886820 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
Basisroutine = Path(os.path.dirname(__file__)) / 'Basisroutine.txt'
def read_Basisroutine():
with open(Basisroutine) as file:
return file.read()
def write_Basisroutine(text):
with open(Basisroutine, 'w') as file:
file.write(text) | 24.25 | 67 | 0.707904 |
77469ecba7498902cca038ecae0674ae2806d0ba | 696 | py | Python | Code/TemplateExample/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Code/TemplateExample/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | Code/TemplateExample/main.py | miku/haw-di-bim-lv22 | 5e3dd1f7a1eb02ebbe5cc801bd8094618d6525e3 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
from jinja2 import Template
# Parse data
tree = ET.parse('index-rss.xml')
root = tree.getroot()
# Prepare target
docs = []
# Iterate over items
for item in root.iter('{http://purl.org/rss/1.0/}item'):
doc = {
"title": item.find('{http://purl.org/rss/1.0/}title').text,
... | 27.84 | 79 | 0.625 |
b8810d91d968efecec611402945b929898f64481 | 4,638 | py | Python | Imaginary/2021/misc/Mazed/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/misc/Mazed/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/misc/Mazed/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python -u
from random import choice
from copy import deepcopy
# https://pypi.org/project/timeout-decorator/
import timeout_decorator
class Maze:
def __init__(self, dim, size):
self.dim = dim
self.size = size
self.maze = '#'
self.loc = tuple([0]*dim)
for i i... | 29.541401 | 329 | 0.487926 |
b2a8844c790d0ba703f1c4a60e3f10f793f252d9 | 5,936 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/fir_frequency.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/fir_frequency.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/fir_frequency.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null |
# How to create a FIR filter using Marsyas and Python
# In this advanced tutorial, we will create a FIR filter in the frequency domain.
# For you to understand this tutorial, you should have the following skills:
# - You can build simple Marsyas networks for audio reproduction
# - You understand what a DFT is
# - You ... | 52.530973 | 214 | 0.757581 |
ced2f5a195ec36fe80f006dcfdea67d2fd44097e | 673 | py | Python | old/test.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | old/test.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | old/test.py | friemoeh/stau | 0a624759a9c65eda2be4cf62d0ece9a5ad7366bb | [
"Apache-2.0"
] | null | null | null | from random import randrange
from Car import Car
def bremsen(v, delta):
if v<delta:
return v
return v-delta
def acc(v, delta):
if v<maxV:
return v+delta
return v
# time in sec
t = 0
n = 1
vall = []
maxV = 100
for car in range(0, n):
v = randrange(40, 50)
vall.append((car, v))
for t in range(11)... | 13.734694 | 87 | 0.570579 |
0cbf21490bbe5fb090c8c47b64bb2f24992f2bf6 | 17,965 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/import/gtfs/gtfs2pt.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/import/gtfs/gtfs2pt.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/import/gtfs/gtfs2pt.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python3
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.e... | 52.683284 | 119 | 0.566602 |
e7f6e5e2328d03fb0274283339291f69a4b02f29 | 3,023 | py | Python | home-assistant/custom_components/harvest/sensor.py | Adamvg/SmartHouse | 740b010260f6f6b38a19e2a75d431446abd54253 | [
"MIT"
] | 136 | 2019-06-27T08:11:47.000Z | 2022-03-11T12:26:53.000Z | home-assistant/custom_components/harvest/sensor.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 5 | 2020-05-30T00:19:22.000Z | 2022-03-25T18:49:47.000Z | home-assistant/custom_components/harvest/sensor.py | Venkysgithu/SmartHouse | d4e42dbbbb1f535f1684d507de411a4421b92e4d | [
"MIT"
] | 63 | 2019-07-15T21:11:58.000Z | 2022-03-13T09:43:24.000Z | """
Fetch how much work time is harvested on getharvest.com
"""
import voluptuous as vol
import logging
import homeassistant.helpers.config_validation as cv
import async_timeout
import aiohttp
import asyncio
import homeassistant.util as util
from aiohttp.hdrs import AUTHORIZATION
from datetime import timedelta, datet... | 29.637255 | 129 | 0.727423 |
683370e6a8ef481e537c45001846dd4941e94583 | 1,299 | py | Python | IF11C/ITT/Codes/Lauflicht.py | Semoxeaa/sjsaueressig.github.io | 55f81360e1285b46bb67b89d16060479be297489 | [
"MIT"
] | 1 | 2021-12-21T09:05:22.000Z | 2021-12-21T09:05:22.000Z | IF11C/ITT/Codes/Lauflicht.py | Semoxeaa/sjsaueressig.github.io | 55f81360e1285b46bb67b89d16060479be297489 | [
"MIT"
] | null | null | null | IF11C/ITT/Codes/Lauflicht.py | Semoxeaa/sjsaueressig.github.io | 55f81360e1285b46bb67b89d16060479be297489 | [
"MIT"
] | null | null | null | # import modules
import RPi.GPIO as GPIO
import time
# disable warnings
GPIO.setwarnings(False)
# setup pins
GPIO.setmode(GPIO.BOARD)
ButtonPortNumbers = [3, 5, 7]
LEDPortNumbers = [8, 10, 16, 18, 22, 24, 26, 32]
#LEDPortNumbers = [32, 26, 24, 22, 18, 16, 10, 8]
# Setup Ports
for PortNr in Button... | 25.470588 | 62 | 0.625866 |
043bada56e297e6db60a1eb8b75863a78fd43a57 | 334 | py | Python | distance.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | distance.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | distance.py | bariseser/elbow_algorithm | 7dd61404422818ddc777321c439f8e6e50aee41d | [
"MIT"
] | null | null | null | import math
def euclidean(test, training, length):
distance = 0
for x in range(length):
distance += pow((test[x] - training[x]), 2)
return math.sqrt(distance)
def manhattan(test, training, length):
distance = 0
for x in range(length):
distance += abs(test[x] - training[x])
re... | 20.875 | 51 | 0.625749 |
04559ee984c8fa12d7f76ed4101e3a7bf1f8c440 | 170 | py | Python | tests/resources/postgres-docker/postgres-docker-project/postgres_docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 14 | 2021-03-27T22:18:56.000Z | 2022-03-21T19:04:48.000Z | tests/resources/postgres-docker/postgres-docker-project/postgres_docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 33 | 2021-03-28T21:06:22.000Z | 2022-03-07T14:18:26.000Z | tests/resources/postgres-docker/postgres-docker-project/postgres_docker_project/api/v1/__init__.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from postgres_docker_project.api.v1.home import router as home_router
router = APIRouter(prefix="/v1")
router.include_router(home_router)
| 24.285714 | 69 | 0.829412 |
f0e1d052eb7c5b18df1a9ae04406f9d014879c16 | 3,921 | py | Python | src/backend/utils/time_utils.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 2 | 2021-04-07T03:12:33.000Z | 2021-05-25T10:01:40.000Z | src/backend/utils/time_utils.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | null | null | null | src/backend/utils/time_utils.py | tonyLyx1/CSC4001-Better-SIS | 98c69317a2c2ea4bfe45b3fc6f3db4766c4aae91 | [
"MIT"
] | 3 | 2021-04-07T03:12:44.000Z | 2021-04-13T11:21:03.000Z | from datetime import datetime, timedelta
class TimeOfWeek:
"""
Wrapper class of the built-in datetime to represent time in
a weekday by keeping year=1990 and month=1
"""
def __init__(self, time_str: str):
"""
Init TimeOfWeek object by providing time_str in format `%d %H:%M`.
... | 27.612676 | 93 | 0.570263 |
f0f5d5fe70de8ce91c095dba16e6e33c65a6bf5d | 7,956 | py | Python | tests/onegov/server/test_server.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/server/test_server.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/server/test_server.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.server.application import Application
from onegov.server.core import Server
from onegov.server.config import Config
from webob import BaseRequest, Response
from webtest import TestApp as Client
def test_application_mapping():
class EchoApplication(Application):
def __call__(self, environ, st... | 28.014085 | 78 | 0.553796 |
5061f7529012fb24cb790515bdc6b89581954055 | 516 | py | Python | packages/watchmen-model/src/watchmen_model/system/external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/system/external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/system/external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from enum import Enum
from pydantic import BaseModel
from watchmen_model.common import ExternalWriterId, OptimisticLock, TenantBasedTuple
class ExternalWriterType(str, Enum):
STANDARD_WRITER = 'standard-writer',
ELASTIC_SEARCH_WRITER = 'elastic-search-writer'
class ExternalWriter(TenantBasedTuple, OptimisticLoc... | 25.8 | 84 | 0.80814 |
acece32a7f4d27fa1ffccbfc4da26b82ba51b21e | 390 | py | Python | src/onegov/town6/views/dashboard.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/views/dashboard.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/views/dashboard.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Secret
from onegov.org.views.dashboard import dashboard
from onegov.town6 import TownApp
from onegov.org.models import Dashboard
from onegov.town6.layout import DashboardLayout
@TownApp.html(model=Dashboard, template='dashboard.pt', permission=Secret)
def town_dashboard(self, request)... | 35.454545 | 74 | 0.820513 |
c5a7c5e2b2091719addb7c1dc79bb96376ac4931 | 713 | py | Python | Python/Random/List-Comprehensions/00.02-List-Comprehensions-3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Random/List-Comprehensions/00.02-List-Comprehensions-3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Random/List-Comprehensions/00.02-List-Comprehensions-3.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | from math import pi
vec = [-4, -2, 0, 2, 4]
# create a new list with the values doubled
print([x * 2 for x in vec])
# filter the list to exclude negative numbers
print([x for x in vec if x >= 0])
# apply a function to all the elements
print([abs(x) for x in vec])
# call a method on each element
fresh_fruit = [" ba... | 25.464286 | 62 | 0.642356 |
507df6ce6b60ab34dc118a7242be21d3d972f6d4 | 288 | py | Python | 20-fs-ias-lec/groups/05-loraLink/src/old/Feed_Sender_release3/Feed_Sender_1/lib/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/Feed_Sender_release3/Feed_Sender_1/lib/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/Feed_Sender_release3/Feed_Sender_1/lib/lora_test_sensor_layer.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from lora_feed_layer import Lora_Feed_Layer
class Lora_Test_Sensor_Layer:
def __init__(self, feed_layer):
self.feed_layer = feed_layer
self.feed_layer.subscribe(self.callback_new_events, 1)
def callback_new_events(self, wired):
print(wired)
| 24 | 63 | 0.708333 |
50aa5184251ed807f2800c680873a5ffa6aac5b3 | 551 | py | Python | Packs/CommonScripts/Scripts/URLDecode/URLDecode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/URLDecode/URLDecode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/URLDecode/URLDecode_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from URLDecode import main
import pytest
@pytest.mark.parametrize("url,res", [
('https:%2F%2Fexample.com', 'https://example.com'),
('https://example.com/?test%20this', 'https://example.com/?test this'),
])
def test_main(mocker, url, res):
mocker.patch.object(demisto, 'args... | 32.411765 | 75 | 0.680581 |
fa70c5846eda2e825a2c131f418cd0fb59de310e | 2,186 | py | Python | back-end/src/analysis/outagePrefixAnalysis/plotscatter.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/outagePrefixAnalysis/plotscatter.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | back-end/src/analysis/outagePrefixAnalysis/plotscatter.py | akshah/iodb | 80fbad1cb639e2cad304d6565cf4918ee5b4e4c0 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
zd1=np.loadtxt('pfxlen2',delimiter=',',usecols=(0,0))
xd1=np.loadtxt('pfxlen2',delimiter=',',usecols=(1,1))
yd1=np.loadtxt('pfxlen2',delimiter=',',usecols=(2,2))
xd=xd1[:,0]
yd=yd1[:,0]
zd=zd1[:,0]
plt.figure(figsize=(15, 10))
ax1 = plt.subplot(211)
#dx_in_points = ... | 44.612245 | 214 | 0.697621 |
a8f50e61309065ade4e082e516fe74b966d1a139 | 3,885 | py | Python | src/inspect_kp_result.py | tuanminh3395/gr-bone-age | 248c929d75e9d88dc9fa102ea11f4eae1e0f3157 | [
"MIT"
] | null | null | null | src/inspect_kp_result.py | tuanminh3395/gr-bone-age | 248c929d75e9d88dc9fa102ea11f4eae1e0f3157 | [
"MIT"
] | null | null | null | src/inspect_kp_result.py | tuanminh3395/gr-bone-age | 248c929d75e9d88dc9fa102ea11f4eae1e0f3157 | [
"MIT"
] | null | null | null | import Tkinter as tk
from PIL import Image, ImageTk
from constants import kp_test_path, color_red, color_yellow, color_blue
import os
import os.path
from skimage.io import imread
from Tkinter import Frame, SUNKEN, Scrollbar, Canvas, HORIZONTAL, E, S, N, W, BOTH, ALL
from constants import key_points_max_size, key_points... | 30.833333 | 134 | 0.754698 |
7e65a5611fd619dae416de68fd1a01bbc1003fcc | 2,005 | py | Python | charvita/charvita.py | ajeyln/deutsch_lernen | 90d05d3532e7e49298e0990d4e691e0219f1372b | [
"MIT"
] | null | null | null | charvita/charvita.py | ajeyln/deutsch_lernen | 90d05d3532e7e49298e0990d4e691e0219f1372b | [
"MIT"
] | null | null | null | charvita/charvita.py | ajeyln/deutsch_lernen | 90d05d3532e7e49298e0990d4e691e0219f1372b | [
"MIT"
] | null | null | null | # This file helps German learners to memorize the vocabulary
# Program flashes a word and user must "memorize" the right response
# Program name is inspired by Samskruta word "Charvita Charvana"
# kind of Rote learning
# developed by vazudew
# -*- coding: iso-8859-1 -*-
import codecs
import time
import sys
import os
... | 30.846154 | 121 | 0.581546 |
0ea94f40c964a22ee4e532ee567d0724b6958041 | 369 | py | Python | pocketthrone/entities/__init__.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/entities/__init__.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/entities/__init__.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | __all__ = ("building", "city", "event", "player", "region", "tile", "tilemap", "unit", "weapon", "enum")
import __future__
from event import *
from building import Building
from city import City
from player import Player
from region import Region
from tile import Tile
from tilemap import TileMap
from unit import Unit... | 24.6 | 104 | 0.758808 |
7ee10060cf218ccad7895ee307d4c0bd2c3018f9 | 14,649 | py | Python | oldp/apps/cases/tests/test_processing.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/tests/test_processing.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/tests/test_processing.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import logging
import os
import re
from unittest import skip
from django.test import TestCase
from oldp.apps.cases.models import Case
from oldp.apps.cases.processing.processing_steps.extract_refs import ExtractRefs
from oldp.apps.references.models import CaseReferenceMarker
from oldp.utils.test_utils import TestCaseH... | 49.657627 | 219 | 0.568913 |
7d491a6b952e85fd2aba04e0fd30fc6e3bf0c2b6 | 678 | py | Python | Packs/CiscoWebExFeed/Integrations/CiscoWebExFeed/CiscoWebExFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CiscoWebExFeed/Integrations/CiscoWebExFeed/CiscoWebExFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CiscoWebExFeed/Integrations/CiscoWebExFeed/CiscoWebExFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | DOMAIN_TABLE = [['Client Type', 'Domain(s)'],
['domain1', '*.d1.com'],
['domain2', '*.d2.com'],
['Long message without domain name']]
def test_grab_domains():
"""
Given:
- Raw list of tuples that contains domain name and domain url, returned by api call:... | 33.9 | 92 | 0.60472 |
bc209d6fd24f1eb1efae34f89aad85a16b31cfda | 793 | py | Python | SiteGadget-main/modules/Scraping.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | SiteGadget-main/modules/Scraping.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SiteGadget-main/modules/Scraping.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 ,requests
from bs4 import BeautifulSoup
from insides.Colors import Colors
def Scraping(site, _verbose=None):
if _verbose != None:
try:
u = ("https://"+site)
response = requests.get(u)
html = response.content
soup=BeautifulSoup(html,"html.parser")
rgx = str(soup)
urls = re.findall('(https... | 36.045455 | 238 | 0.600252 |
bc2a19c89475a0cee12286ce060ec46f018dcbc7 | 416 | py | Python | exercise9.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | 1 | 2020-11-21T16:57:40.000Z | 2020-11-21T16:57:40.000Z | exercise9.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | exercise9.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null |
def are_anagrams(word1, word2):
"""Return True, if words are anagrams."""
word1_sorted = sorted(word1)
word2_sorted = sorted(word2)
return word1_sorted == word2_sorted
print("Anagram Test")
two_words = input("Enter two space separated words: ")
word1,word2 = two_words.split()
if are_anagrams(w... | 21.894737 | 54 | 0.694712 |
bc2ee864ebb0fa0013ff728ac206f3c64231998e | 2,330 | py | Python | python/Expression.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | null | null | null | python/Expression.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | 5 | 2021-08-24T11:09:54.000Z | 2021-08-24T21:14:15.000Z | python/Expression.py | Greakz/mdh-cmake-cubevis | 6c64ec0e14dcdd07e69fa1f018aa7954eeeaf173 | [
"MIT"
] | null | null | null | class Expression:
@staticmethod
def process_string_without_clocks(data, raw_txt):
result = raw_txt
for constant in data.constants:
result = result.replace(constant["name"], "this->" + constant["cname"])
return result
@staticmethod
def process_string(data, raw_txt):
... | 42.363636 | 123 | 0.579399 |
cb0705fe3da8a3551ec7a928dcbd06369e78b720 | 1,059 | py | Python | src/fpgrowth.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/fpgrowth.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | src/fpgrowth.py | PAULUAPAUL/MasterThesis_AssociationRulesBiodiversity | 0855abc5ec4835a28be4aa305e5e45e73297b389 | [
"MIT"
] | null | null | null | from collections import defaultdict, OrderedDict
from csv import reader
from itertools import chain, combinations
from optparse import OptionParser
from fpgrowth_py.utils import *
from csv_writer import *
def fpgrowth(itemSetList, minSupRatio, minConf):
frequency = getFrequencyFromList(itemSetList)
mi... | 40.730769 | 100 | 0.672332 |
6301aa82a3d45f302416cc667db3c205db4882f7 | 4,925 | py | Python | scripts/dim-reduction/punjabi-series-cache-frames.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | scripts/dim-reduction/punjabi-series-cache-frames.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | scripts/dim-reduction/punjabi-series-cache-frames.py | jenniferxkuo/ultramisc | 65bff53c97715eb9a24acc62b77460f22e0dabc6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
TODO docstring
"""
from __future__ import absolute_import, division, print_function
import os, sys, glob, re
from PIL import Image
import struct
import argparse
from operator import itemgetter
import numpy as np
from scipy import ndimage
import subprocess
import pandas as pd
from hashlib im... | 38.476563 | 99 | 0.550457 |
9344ba973ab4088c9375f854ab40063551810d44 | 1,018 | py | Python | LeetCode_problems/merge two sorted linked list/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/merge two sorted linked list/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/merge two sorted linked list/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Definition for singly-linked list.
# step 1: first make the structure of the linkedlist
# step 2: create the merge function
# step 3: If l1 list has small value then add this value into list l3 otherwise add l2 value
# step 4: Repeat steps until l1 and l2 become none
class ListNode:
def __init__(self, v... | 28.277778 | 93 | 0.504912 |
4f0c418c9c8e9f781f828f264c24d6d3f67e812c | 823 | py | Python | tests/onegov/pay/test_utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_utils.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from decimal import Decimal
from onegov.pay import Price
def test_price():
assert Price(0, 'CHF') == Price(0, 'CHF')
assert Price(0, 'CHF') < Price(1, 'CHF')
assert Price(10, 'CHF') + Price(20, 'CHF') == Price(30, 'CHF')
assert Price.zero() + Price(10, 'CHF') == Price(10, 'CHF')
assert Price(10, '... | 30.481481 | 67 | 0.55164 |
35c5b11ae4f2feb959c1b1d483700ef74695c796 | 544 | py | Python | LeetCode_problems/insert-into-a-binary-search-tree/Add Strings/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | LeetCode_problems/insert-into-a-binary-search-tree/Add Strings/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | LeetCode_problems/insert-into-a-binary-search-tree/Add Strings/Solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 2020
@author: Shrey1608
"""
# Approach : 1) we will use recursion technique to insert the element into a bst(Time complexity= O(H)(h is height of the tree)
#Solution : Recursion
class Solution:
def insertIntoBST(self, root: TreeNode, val: int) -> TreeNode:
... | 24.727273 | 127 | 0.630515 |
ea48302ba1ac06cde85fcb9c76424f6394e062c5 | 2,333 | py | Python | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/elliptic_curve.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/elliptic_curve.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | ais3-pre-exam-2022-writeup/Crypto/pekobot/chall/elliptic_curve.py | Jimmy01240397/balsn-2021-writeup | 91b71dfbddc1c214552280b12979a82ee1c3cb7e | [
"MIT"
] | null | null | null | class Curve:
def __init__(self, p, a, b):
self.p = p
self.a = a
self.b = b
def __eq__(self, other):
if isinstance(other, Curve):
return self.p == other.p and self.a == other.a and self.b == other.b
return None
def __str__(self):
return "y^2 = x^3... | 27.447059 | 88 | 0.473639 |
ea688b333c7be55e391e4c18700dea0325d304d8 | 591 | py | Python | fileOperate/utils.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 8 | 2020-07-11T14:11:11.000Z | 2022-01-27T05:06:07.000Z | fileOperate/utils.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | null | null | null | fileOperate/utils.py | MaoningGuan/FileService | d55fee19a0c96f2cc6dda187d331389b9ae192d3 | [
"MIT"
] | 4 | 2020-07-11T14:11:17.000Z | 2022-01-27T05:06:11.000Z | # -*- coding: utf-8 -*-
import os
def get_FileSize(filePath):
"""
获取文件大小(M)
:param filePath:
:return:
"""
fsize = os.path.getsize(filePath)
fsize = fsize / float(1024 * 1024)
return round(fsize, 2)
# 通常访问者的IP就在其中,所以我们可以用下列方法获取用户的真实IP:
# X-Forwarded-For:简称XFF头,它代表客户端,也就是HTTP的请求端真实的IP,... | 23.64 | 79 | 0.670051 |
57ef78c7802b707b7d2274c759565eaaefc44582 | 3,816 | py | Python | tests/rbac/common/util/test_utility.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | null | null | null | tests/rbac/common/util/test_utility.py | akgunkel/sawtooth-next-directory | a88833033ab30e9091479a38947f04c5e396ca46 | [
"Apache-2.0"
] | 1 | 2019-07-08T22:32:43.000Z | 2019-07-08T22:32:43.000Z | tests/rbac/common/util/test_utility.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 ... | 33.769912 | 79 | 0.676887 |
eab8469c71894ab3cbb4678bb2fcf53cc350c152 | 291 | py | Python | exercises/es/solution_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/solution_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/solution_01_03_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importa spaCy y crea el objeto nlp para procesar español
import spacy
nlp = spacy.blank("es")
# Procesa el texto
doc = nlp("Me gustan las panteras negras y los leones.")
# Selecciona el primer token
first_token = doc[0]
# Imprime en pantalla el texto del token
print(first_token.text)
| 20.785714 | 58 | 0.749141 |
d816570cdb96c56c978aab38ee09e50c307c1692 | 392 | py | Python | leetcode/014-Longest-Common-Prefix/LongComPrefix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/014-Longest-Common-Prefix/LongComPrefix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/014-Longest-Common-Prefix/LongComPrefix_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {string[]} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
mi = len(min(strs, key=lambda s: len(s)))
for j in xrange(mi):
for i in xrange(1, len(strs)):
if strs[i][j] != strs[i - 1][... | 26.133333 | 49 | 0.471939 |
8766ace54f3db3d68301a2468a435926438ccc79 | 649 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/remove_employee_role_if_no_employee.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/v4_0/remove_employee_role_if_no_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/remove_employee_role_if_no_employee.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # 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
import frappe.permissions
def execute():
for user in frappe.db.sql_list("select distinct parent from `tabHas Role` where role='Employee'... | 34.157895 | 99 | 0.719569 |
21fec4ef526ab318659cbfaba7fd7561edac6a9b | 929 | py | Python | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/vector_quantization.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/vector_quantization.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/vector_quantization.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 4 21:27:37 2016
@author: abhishek
"""
import numpy as np
import pandas as pd
from scipy.cluster import vq
# load train and test set
train = pd.read_csv('./data/train.csv', index_col='ID')
test = pd.read_csv('./data/test.csv', index_col='ID')
# columns with high freq... | 25.805556 | 80 | 0.666308 |
804edd8017f932f4d4e09e8a53acfebe4baa9dde | 1,877 | py | Python | phypidaq/MAX31855Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | phypidaq/MAX31855Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | phypidaq/MAX31855Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys
# import relevant pieces for MAX31855
import Adafruit_GPIO.SPI as SPI
import Adafruit_MAX31855.MAX31855 as MAX31855
class MAX31855Config(object):
''' MAX318... | 27.602941 | 74 | 0.625999 |
d511456f2908486a7f2a733e743cff2aa062c394 | 2,844 | py | Python | Txt.BoardGame/tools/genOverView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | Txt.BoardGame/tools/genOverView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | Txt.BoardGame/tools/genOverView.py | okard/depot | ac10c2388799a76bfabf9ddf20b11cd2c516bcab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import re
from lib.SvgWriter import SvgWriter
from lib.Token import TokenDB, Token
from lib.TokenWriter import writeTokenFront, writeTokenBack
########################################################################################################
# generate an overview from list
#... | 24.947368 | 155 | 0.617792 |
63f0d2f931ebe328527aed97513230dc12bcd834 | 42,517 | py | Python | Packs/TOPdesk/Integrations/TOPdesk/TOPdesk_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/TOPdesk/Integrations/TOPdesk/TOPdesk_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/TOPdesk/Integrations/TOPdesk/TOPdesk_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import pytest
import demistomock as demisto
import json
import io
from TOPdesk import Client, INTEGRATION_NAME, MAX_API_PAGE_SIZE, \
fetch_incidents, entry_types_command, call_types_command, categories_command, subcategories_command, \
list_persons_command, list_operators_command, branches_command, get_incident... | 44.381002 | 120 | 0.602888 |
612fa3ae5b04c6fcb5e3560b4aa2f1e3d9a3277d | 2,556 | py | Python | research/cv/ProtoNet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ProtoNet/eval.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ProtoNet/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... | 36 | 89 | 0.663146 |
9cc8c592e530cb3f4791b3ae7efc8e239a9e565f | 2,590 | py | Python | novel/swallows/story/world.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/swallows/story/world.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/swallows/story/world.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | # coding=utf-8
import random
from novel.swallows import (
Location, ProperLocation, Treasure, PluralTreasure,
Container, ProperContainer,
Item, Weapon, Horror
)
from novel.swallows import MaleCharacter, FemaleCharacter
# 世界:
# 更多反应的尸体:
# -如果他们同意,采取一对一的行动
# 协议后:
# 呼叫警察(他们有一个座机?这可能是娱乐性的。
# 如果他们共享两者之间的一个移动电... | 26.979167 | 82 | 0.747104 |
14a20e6edc544161f68b5cf48560a64cf9589066 | 303 | py | Python | 1.Array/Problems/max_sum_of_subsequence.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | 3 | 2020-09-10T18:40:40.000Z | 2020-09-15T17:32:12.000Z | 1.Array/Problems/max_sum_of_subsequence.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | null | null | null | 1.Array/Problems/max_sum_of_subsequence.py | Vinaypatil-Ev/vinEvC_datastructure | 3e02e49c03a2b7d2e09af9a2dce080e6d9abbf74 | [
"MIT"
] | null | null | null | def max_sub_seq(arr, n):
a = -1000000000000000000
b = 0
z = []
for i in range(n):
b = b + arr[i]
if a < b:
z.append(i)
a = b
if b < 0:
b = 0
print(arr, z, a)
x = [-2, -3, 4, -1, -2, 1, 5, -3]
max_sub_seq(x, len(x)) | 20.2 | 33 | 0.376238 |
14b5ca4869994173f797e1731bdbe1e8d8180839 | 7,702 | py | Python | migrate_publications.py | lucasalexsorensen/belongielab.github.io | 1a5795188464e3b14baf821dc18018e65657a20c | [
"MIT"
] | 1 | 2021-12-18T21:33:25.000Z | 2021-12-18T21:33:25.000Z | migrate_publications.py | lucasalexsorensen/belongielab.github.io | 1a5795188464e3b14baf821dc18018e65657a20c | [
"MIT"
] | null | null | null | migrate_publications.py | lucasalexsorensen/belongielab.github.io | 1a5795188464e3b14baf821dc18018e65657a20c | [
"MIT"
] | 2 | 2022-03-14T11:26:09.000Z | 2022-03-14T11:47:09.000Z | #!/usr/bin/env python
"""
Migrate publication list from SE3 website here
Note: this script will overwrite current yml file
Usage:
step 1: download the publication from wordpress in bibtex(.bib) format
step 2: execute below command with the correct path to the downloaded file:
python migrate_publications.py --bib-path... | 33.780702 | 132 | 0.532589 |
dcdf690ea5569acaf6524db33e4dfb9c379e8943 | 1,531 | py | Python | PolicyGradient/run_cartpole.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | 2 | 2021-01-06T09:45:23.000Z | 2021-04-21T09:39:14.000Z | PolicyGradient/run_cartpole.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | PolicyGradient/run_cartpole.py | pickxiguapi/rl-algorithm | a57991acd178077fd7f51bcd4ae2ee58492475c2 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@File : run_cartpole.py
@Time : 2020/12/5
@Author : Yuan Yifu
"""
import gym
from policy_gradient import PolicyGradient
import matplotlib.pyplot as plt
DISPLAY_REWARD_THRESHOLD = 400 # renders environment if total episode reward is greater then this threshold
RENDER = False # re... | 27.339286 | 108 | 0.638798 |
0d03016bfc357a0c430b8a7e2d7a97034e3eeb38 | 250 | py | Python | random_attendee.py | oakoneric/programmierung-ss19 | 819a789020d7e280b1cb54f14494674e6772adce | [
"MIT"
] | 9 | 2019-04-10T21:32:59.000Z | 2019-07-29T14:58:17.000Z | random_attendee.py | oakoneric/programmierung-ss19 | 819a789020d7e280b1cb54f14494674e6772adce | [
"MIT"
] | null | null | null | random_attendee.py | oakoneric/programmierung-ss19 | 819a789020d7e280b1cb54f14494674e6772adce | [
"MIT"
] | 1 | 2021-07-19T14:07:26.000Z | 2021-07-19T14:07:26.000Z | import random
print('-----------------------------------------------')
num = int(input('number of attendees: '))
print('the next task is reserved for student no. ' + str(random.randint(1,num)))
print('-----------------------------------------------') | 50 | 80 | 0.432 |
0d3723964dc621de280a4850c8f70e40c8d53f13 | 2,603 | py | Python | src/utils/assets.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null | src/utils/assets.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null | src/utils/assets.py | muhammedtiftikci/Proje-A | 363ddb8e03afe0387d144621479ed742d2d40dc6 | [
"MIT"
] | null | null | null | from datetime import datetime
import math
import settings
class Location:
def __init__(self, latitude, longitude):
self.__latitude = latitude
self.__longitude = longitude
@property
def latitude(self):
return self.__latitude
@property
def longitude(self):
return se... | 25.028846 | 93 | 0.626201 |
0d4ad1bf7f13fc419cf5ae3bc5c5b47b0f69f250 | 1,218 | py | Python | lesson6/bfundme/tests/test_fund_me.py | raynardj/sbs | 726dd47c7a3da0874b97b3df8dcf5b34060d79f6 | [
"MIT"
] | null | null | null | lesson6/bfundme/tests/test_fund_me.py | raynardj/sbs | 726dd47c7a3da0874b97b3df8dcf5b34060d79f6 | [
"MIT"
] | null | null | null | lesson6/bfundme/tests/test_fund_me.py | raynardj/sbs | 726dd47c7a3da0874b97b3df8dcf5b34060d79f6 | [
"MIT"
] | null | null | null | from torch import baddbmm
from scripts.utils import get_account
from scripts.deploy import deploy_fund_me, PUBLIC_NETS
from brownie import FundMe, network, accounts, exceptions
import pytest
def test_can_fund_and_withdraw():
if len(FundMe)==0:
deploy_fund_me()
fund_me = FundMe[-1]
account = get_ac... | 25.375 | 75 | 0.704433 |
258fb939c85c39e7a68a3d8c7a2cfc63ec38f0f7 | 1,743 | py | Python | code/snake/Algorithms/Situationrechner_Nina.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/Algorithms/Situationrechner_Nina.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/Algorithms/Situationrechner_Nina.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | from Field import Field
from GameData import GameData
from Snake import Snake
# 1 2 4
#
# 8 - 16
#
# 32 64 128
def situation_number(kantenlänge: int, maske: str, field: GameData):
maske = maske.replace(" ", "")
# Schritt 1: wir suchen den Ausschnitt um den Kopf herum
# Bei einer Ka... | 29.05 | 75 | 0.570855 |
6ca6da79a18fb0dc9d8628b68d56978a44698e5e | 594 | py | Python | run.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | run.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | run.py | 497022407/Shifts-manager | beccb63c8622c015a9a453f586d4c3bb5d5066b9 | [
"Apache-2.0"
] | null | null | null | import yaml
import msal
import time
import requests
import json
import django
import os
import webbrowser
f = open('install','r')
if(f.read() == '0'):
print("Installing modules......")
f.close()
os.system('pip install Django==3.2.2')
os.system('pip install msal==1.7.0')
os.system('pip install requ... | 23.76 | 51 | 0.646465 |
2cc920ad81c91b991e703eb899fc9d9dab50ade4 | 9,698 | py | Python | angstrom/2021/crypto/Cache_Money/cachemoney.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2021/crypto/Cache_Money/cachemoney.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2021/crypto/Cache_Money/cachemoney.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import itertools
from time import perf_counter_ns as timer
from time import monotonic_ns as timestamp
class Rijndael:
sbox = bytes.fromhex(
"637c777bf26b6fc53001672bfed7ab76ca82c97dfa5947f0add4a2af9ca472c0b7fd9326363ff7cc34a5e5f171d8311504c723c31896059a071280e2eb27b27509832c1a1b6e5aa0523bd6b329e32f8453d10... | 34.02807 | 522 | 0.524026 |
39429ebad3cc0561ff64b4a4aad640aee4570504 | 13,979 | py | Python | Contrib-Inspur/openbmc/poky/scripts/lib/recipetool/create_npm.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/recipetool/create_npm.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/recipetool/create_npm.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Recipe creation tool - node.js NPM module support plugin
#
# Copyright (C) 2016 Intel Corporation
#
# SPDX-License-Identifier: GPL-2.0-only
#
import os
import sys
import logging
import subprocess
import tempfile
import shutil
import json
from recipetool.create import RecipeHandler, split_pkg_licenses, handle_license... | 43.413043 | 137 | 0.555548 |
64cf7a49e097e2381ee5a2056dee867c28ff8ffb | 3,460 | py | Python | pykasso/pdf_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | pykasso/pdf_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null | pykasso/pdf_abrechnung.py | pekh/pykasso | 86ece737d62ce28aef00805a19a789714e788453 | [
"MIT"
] | null | null | null |
from io import BytesIO
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import mm
from reportlab.platypus import BaseDocTemplate, Frame, NextPageTemplate, PageTemplate, Paragraph
from .abrechnung import Abrechnung, Mitglied
DEBUG = True
PAGE_WIDTH, PAGE... | 28.833333 | 96 | 0.604046 |
b35b9c2a0160ebf4e0740847ad5fad6961d3ca3f | 757 | py | Python | devscripts/fix_permissions.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | devscripts/fix_permissions.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | devscripts/fix_permissions.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
def fix_permissions(path):
entries = os.listdir(path)
for entry in entries:
entry_path = os.path.join(path, entry)
if os.path.isdir(entry_path):
os.chmod(entry_path, 0o755)
fix_permissions(entry_path)
else:
with open(... | 27.035714 | 91 | 0.553501 |
44038328ac8c2b4e6ab9a494145379a2ea8fda67 | 8,318 | py | Python | src/onegov/reservation/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/models/resource.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import secrets
from datetime import timedelta, date
from libres import new_scheduler
from libres.db.models import Allocation
from libres.db.models.base import ORMBase
from onegov.core.cache import lru_cache
from onegov.core.orm import ModelBase
from onegov.core.orm.mixins import content_property
from onegov.core.orm.m... | 31.992308 | 79 | 0.665424 |
2bb2614857ee337381ffa1d5a537a7e2abace77a | 443 | py | Python | crypto/Mxor/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | crypto/Mxor/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | crypto/Mxor/solve.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | import libnum, string
a = open('flag.enc').read().decode('base64')
b = []
c = a
while c:
b.append(c[:5])
c = c[5:]
pos = [[],[],[],[],[]]
for k in string.lowercase:
for j in range(5):
if all(chr(ord(k) ^ ord(b[i][j])) in string.digits for i in range(len(b))):
pos[j].append(k)
print pos # key found: hutan
fl... | 19.26087 | 77 | 0.575621 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.