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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c4195385e3237b0ba30866cf63f559ee307a225c | 442 | py | Python | content/labs/lab10/solutions/importance.py | tteenathankachan/2021-CS109A | 9349749539f439deff280ceb25621fc61a337253 | [
"MIT"
] | 19 | 2021-08-29T21:23:48.000Z | 2022-03-16T14:38:25.000Z | content/labs/lab10/solutions/importance.py | SBalas/2021-CS109A | 0f57c3d80b7cef99d660f6a77c0166cffc1253e8 | [
"MIT"
] | null | null | null | content/labs/lab10/solutions/importance.py | SBalas/2021-CS109A | 0f57c3d80b7cef99d660f6a77c0166cffc1253e8 | [
"MIT"
] | 22 | 2021-09-01T13:03:05.000Z | 2022-03-31T14:34:36.000Z | feature_importance = best_rf_model.feature_importances_
feature_importance = 100.0 * (feature_importance / feature_importance.max())
sorted_idx = np.argsort(feature_importance)
pos = np.arange(sorted_idx.shape[0]) + .5
#Plot
plt.figure(figsize=(10,12))
plt.barh(pos, feature_importance[sorted_idx], align='center')
plt.... | 36.833333 | 76 | 0.791855 |
c01e9f6b393800da5875a13d8ec94e1e586b5ffb | 12,788 | py | Python | cloud/aws/stage3/dev-services/locust/locust/tasks/trews.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | cloud/aws/stage3/prod-services/locust/locust/tasks/trews.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | cloud/aws/stage3/prod-services/locust/locust/tasks/trews.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | #!/usr/bin/env python3
from locust import HttpLocust, TaskSet, events, stats
import sys, os, random
import logging
import datetime
import copy
import json
import pytz
import requests
import sqlalchemy
from sqlalchemy import text
####################
# Configuration
sys.path.append(os.getcwd())
logging.basicConfig()
... | 28.04386 | 235 | 0.634032 |
e146ec7fc5a01601b90b830ff72b28dbc2670918 | 2,462 | py | Python | challenge/Thiemo/main.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | 7 | 2015-11-27T09:53:32.000Z | 2021-01-13T17:35:54.000Z | challenge/Thiemo/main.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | challenge/Thiemo/main.py | florianletsch/kinect-juggling | f320cc0b55adf65d338d25986a03106a7e3f46ef | [
"Unlicense",
"MIT"
] | null | null | null | import timeit
# setup = '''
# import numpy as np
# import add1 as add
# a = np.random.random_integers(0,255, (128,128)).astype(np.uint8)
# b = np.random.random_integers(0,255, (128,128)).astype(np.uint8)
# '''
# print 'time python (128,128): %f' % timeit.timeit('add.my_add(a, b)', setup=setup, number=100)
... | 36.205882 | 105 | 0.675061 |
bef37bed93a59cd27034aaf5899d6d52d4d6bcef | 353 | py | Python | rename.py | Jie-long-long/SmallCode | 82376fc853e5a295f00f29a5727b9576c17eefe4 | [
"MIT"
] | null | null | null | rename.py | Jie-long-long/SmallCode | 82376fc853e5a295f00f29a5727b9576c17eefe4 | [
"MIT"
] | null | null | null | rename.py | Jie-long-long/SmallCode | 82376fc853e5a295f00f29a5727b9576c17eefe4 | [
"MIT"
] | null | null | null | # —*— coding:utf-8 _*_
import os
path = input('请输入文件路径(结尾加上/):')
prefix = input('请输入新文件名前缀:')
# 获取该目录下所有文件,存入列表中
f = os.listdir(path)
n = 0
for i in f:
oldname = path + f[n] # 设置旧文件名(路径+文件名)
newname = path + prefix + '-' + str(n+1) + '.txt' # 设置新文件名
os.rename(oldname,newname) # 用os模块中的rename方法对文件改名
print(... | 20.764706 | 61 | 0.611898 |
83016bafb775f6773f2ca98b70e5d0b3567aab0e | 2,036 | py | Python | Packs/ThreatIntelligenceManagement/Scripts/ThreatIntelligenceManagementGetIncidentsPerFeed/ThreatIntelligenceManagementGetIncidentsPerFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ThreatIntelligenceManagement/Scripts/ThreatIntelligenceManagementGetIncidentsPerFeed/ThreatIntelligenceManagementGetIncidentsPerFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ThreatIntelligenceManagement/Scripts/ThreatIntelligenceManagementGetIncidentsPerFeed/ThreatIntelligenceManagementGetIncidentsPerFeed_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from ThreatIntelligenceManagementGetIncidentsPerFeed import get_incidents_per_feed
import re
INDICATORS_TO_RETURN = [
[
{
'sourceBrands': [
'Test1 Feed',
'Test2 Feed',
'Test3',
]
},
{
... | 24.829268 | 101 | 0.516208 |
831eef64f98634cdc2c41f114f763115b9c6e766 | 66 | py | Python | adzuki/__init__.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | adzuki/__init__.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | 5 | 2019-03-19T22:21:28.000Z | 2020-09-16T03:08:56.000Z | adzuki/__init__.py | showhue/adzuki | 23dff5b01905ba3622b4846708c6fd9d2fdd7385 | [
"BSD-3-Clause"
] | null | null | null | from .entitywrapper import EntityWrapper
from .model import Model
| 22 | 40 | 0.848485 |
364e1b7799f9d48da123ed4310c3dafcee42925b | 834 | py | Python | Packs/Vertica/Integrations/Vertica/Vertica_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Vertica/Integrations/Vertica/Vertica_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Vertica/Integrations/Vertica/Vertica_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from Vertica import connect_db
RETURN_ERROR_TARGET = 'Vertica.return_error'
def test_connect_db_fail(mocker):
bad_connection_params = {
"credentials": {
"identifier": "stam",
"password": "stam"
},
"database": "bad",
"url": "127... | 30.888889 | 62 | 0.647482 |
7fc88e5729ae2e035289a399c7429672bded4784 | 15,785 | py | Python | src/onegov/core/orm/abstract/adjacency_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/abstract/adjacency_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/abstract/adjacency_list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from enum import Enum
from itertools import chain
from lazy_object_proxy import Proxy
from onegov.core.orm import Base
from onegov.core.utils import normalize_for_url, increment_name, is_sorted
from sqlalchemy import Column, ForeignKey, Integer, Text
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.... | 30.769981 | 79 | 0.603928 |
a15301b318045991f1ed4287fb951de860b7a4c4 | 1,193 | py | Python | flask-method/application.py | scaraclette/flask-javascript-ajax | 50829cb78094c10bc8dca57ba6db17434cd165c5 | [
"MIT"
] | null | null | null | flask-method/application.py | scaraclette/flask-javascript-ajax | 50829cb78094c10bc8dca57ba6db17434cd165c5 | [
"MIT"
] | 1 | 2019-05-19T20:14:42.000Z | 2019-05-19T20:14:42.000Z | flask-method/application.py | scaraclette/flask-javascript-ajax | 50829cb78094c10bc8dca57ba6db17434cd165c5 | [
"MIT"
] | null | null | null | import requests, json
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
currentInput = ""
@app.route("/")
def index():
return render_template("index.html")
@app.route("/call-function", methods=["POST", "GET"])
def call_function():
# Make the currentInput global function to sto... | 35.088235 | 170 | 0.699916 |
a1ec4120ff882005a342924d328679096bc42bab | 687 | py | Python | fuzzsvc/model/FuzzingJobOption.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | model/FuzzingJobOption.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | model/FuzzingJobOption.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from app import app
db = app.config['db']
class FuzzingJobOption(db.Model):
id = db.Column(db.Integer, primary_key=True)
job_id = db.Column(db.Integer, db.ForeignKey('fuzzing_job.id'))
job = db.relationship('FuzzingJob', foreign_keys=job_id)
option_id = db.Column(db.Integer, db.ForeignKey('fuzzing_op... | 32.714286 | 83 | 0.681223 |
a1fd979bf19333a73509a82a93c32dfcce5beea3 | 8,350 | py | Python | pghoard/rohmu/delta/common.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 731 | 2018-06-01T21:48:43.000Z | 2022-03-29T08:21:42.000Z | pghoard/rohmu/delta/common.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 124 | 2018-06-19T05:59:50.000Z | 2022-03-31T18:17:59.000Z | pghoard/rohmu/delta/common.py | st3fan/sphinx-automation-experiment | c92c8400770c6c604e2451e4f1e71957fc4c5ef8 | [
"Apache-2.0"
] | 64 | 2018-06-26T14:12:53.000Z | 2022-03-20T07:33:33.000Z | # Copyright (c) 2021 Aiven, Helsinki, Finland. https://aiven.io/
import functools
import hashlib
import json as _json
import logging
import math
import os
from datetime import datetime
from multiprocessing.dummy import Pool
from pathlib import Path
from typing import List, Optional
from pydantic import BaseModel, Fiel... | 29.5053 | 104 | 0.64491 |
62e9c0a82681c430de1bfd57715e0e7c246dffb6 | 452 | py | Python | .cmake-format.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | .cmake-format.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | .cmake-format.py | leviathanch/monado | 36a540a764fd5529018dfceb28e10804db9596bf | [
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | null | null | null | # SPDX-FileCopyrightText: 2021, Collabora, Ltd.
# SPDX-License-Identifier: CC0-1.0
with section("format"):
line_width = 100
tab_size = 8
use_tabchars = True
fractional_tab_policy = "use-space"
max_prefix_chars = 4
dangle_parens = True
dangle_align = "prefix-indent"
max_pargs_hwrap = 4... | 18.833333 | 47 | 0.683628 |
3d69da8c03d1778f2e3627b40d9da5da3b658563 | 3,479 | py | Python | DHParser/scripts/dhparser_rename.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | DHParser/scripts/dhparser_rename.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | DHParser/scripts/dhparser_rename.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""dhparser_rename.py - rename a dhparser project properly
UNMAINTAINED!!!
Copyright 2019 by Eckhart Arnold (arnold@badw.de)
Bavarian Academy of Sciences an Humanities (badw.de)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except i... | 33.776699 | 98 | 0.643288 |
3dc2214c3a5998c4ece703abfcd576e3c7841def | 3,077 | py | Python | doc/fb_memoir/python/diodeVI.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/diodeVI.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/diodeVI.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | #!/usr/bin/env python3
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
n = 1.6
n2 = 2
IS = 1.6e-6
IS_3 = 1.6e-5
k = 1.38e-23
T = 300
q = 1.609e-19
U = sp.Symbol('U')
#func1 = 1/2 * (2 + sp.cos(2*w1*x) + sp.cos(2*w2*x) + 2*sp.cos((w1+w2)*x) + 2*sp.cos((w1-w2)*x))
vi_pos = IS * (sp.exp(U/(... | 33.445652 | 101 | 0.669808 |
9adec531d5e22b7631fb1262cde17958a0d3c834 | 3,131 | py | Python | Documentation/generator.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 15 | 2019-12-20T08:24:31.000Z | 2022-03-18T09:24:25.000Z | Documentation/generator.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 124 | 2020-04-20T04:36:49.000Z | 2022-01-29T11:08:09.000Z | Documentation/generator.py | simonbredemeier/ds100bot | 1318b32b818891f4bc6d24f12fcf0ceae898f8bd | [
"Apache-2.0"
] | 12 | 2020-07-08T22:19:39.000Z | 2022-03-19T09:13:11.000Z | """Base class for all HTML documentation generators"""
from xml.etree import ElementTree as ET
class Generator:
SITENAME = {'property': 'og:site_name', 'content': 'DS100 Bot'}
CARD = {'content': 'https://ds100.frankfurtium.de/socialcard.png'}
LOCALE = {'property': 'og:locale', 'content': 'de_DE'}
CARD... | 47.439394 | 95 | 0.592143 |
658dadf513817a9c2b9376c40b9447b5cb8bd030 | 20,332 | py | Python | map_engine.py | jkopka/routefinder | 7594278a9662051ddc764de2b9178ba43b789fef | [
"MIT"
] | null | null | null | map_engine.py | jkopka/routefinder | 7594278a9662051ddc764de2b9178ba43b789fef | [
"MIT"
] | null | null | null | map_engine.py | jkopka/routefinder | 7594278a9662051ddc764de2b9178ba43b789fef | [
"MIT"
] | null | null | null | import pygame, random
import configparser
from pygame import Color, Surface, draw
from pygame.locals import *
from PIL import Image
import os
# Konfiguration
config = configparser.ConfigParser()
config.read('config.ini')
WHITE = Color(config['COLOR']['WHITE'])
BLUE = Color(config['COLOR']['BLUE'])
GREEN = Color(confi... | 48.757794 | 200 | 0.613565 |
ac12fe5d71a950ee5c620123055daa261b4a54cd | 1,507 | py | Python | src/python/GDMdefine.py | coulsonzero/webProject | 46ba2456620496f376ed954a6469381b8142e0f6 | [
"MIT"
] | null | null | null | src/python/GDMdefine.py | coulsonzero/webProject | 46ba2456620496f376ed954a6469381b8142e0f6 | [
"MIT"
] | null | null | null | src/python/GDMdefine.py | coulsonzero/webProject | 46ba2456620496f376ed954a6469381b8142e0f6 | [
"MIT"
] | null | null | null | """
产品组件:GDM (数据建模工作台)
工作空间:b
文件:机器学习模型1.gdmm
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.io.matlab.tests.test_mio import a
from sklearn.metrics import mean_squared_error
from gdmBHTR.transformed_histogram import TransformedHistogramRegressor
from gdmBHTR.transformed_boost i... | 21.528571 | 101 | 0.712674 |
022ce058e8a10121fd77a0265a715bf315074d01 | 2,754 | py | Python | resources/mechanics_lib/api/EComponent.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 7 | 2016-01-20T02:33:00.000Z | 2021-02-04T04:06:57.000Z | resources/mechanics_lib/api/EComponent.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | null | null | null | resources/mechanics_lib/api/EComponent.py | PRECISE/ROSLab | 2a6a295b71d4c73bc5c6ae2ec0330274afa31d0d | [
"Apache-2.0"
] | 3 | 2016-10-05T07:20:30.000Z | 2017-11-20T10:36:50.000Z |
class EComponent:
"""
A class to define an interface to electrical components. For example,
L{EBrain}, L{EModule}, and L{EDevice} may all inherit from this class.
Classes inheriting from EComponent should override the following:
- L{attach}
- L{copyComponent}
"""
def __init__(sel... | 30.94382 | 116 | 0.610022 |
0b9699995d9dc148c70981a08380bafbb481b25e | 4,165 | py | Python | scorer.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | scorer.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | scorer.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | #from transformers import GPT2LMHeadModel, GPT2Tokenizer
#from transformers import BertModel, BertTokenizer, BertConfig
#from transformers import DebertaTokenizer, DebertaModel, DebertaConfig
from transformers import *
import torch
from score_utils_2 import word_mover_score, lm_perplexity
from sentence_transformers imp... | 54.802632 | 179 | 0.69964 |
f05e7f2b888623776e8bc499ab016de35782e63e | 443 | py | Python | cryptoauthlib/python/tests/test_bytes.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 12 | 2017-11-15T08:29:03.000Z | 2021-05-22T04:57:20.000Z | cryptoauthlib/python/tests/test_bytes.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 2 | 2019-09-22T12:02:07.000Z | 2021-09-09T22:38:25.000Z | cryptoauthlib/python/tests/test_bytes.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 5 | 2019-04-05T13:46:44.000Z | 2020-11-25T08:58:32.000Z | from ctypes import create_string_buffer
#r_aes_out = create_string_buffer(16)
#r_aes_out.value = bytes([0x00, 0x01, 0x02, 0x04, 0x00, 0x01, 0x02, 0x04, 0x00, 0x01, 0x02, 0x04, 0x00, 0x01, 0x02, 0x04])
b = bytes(bytearray([0x00, 0x01, 0x02, 0x04, 0x00, 0x01, 0x02, 0x04, 0x00, 0x01, 0x02, 0x04, 0x00, 0x01... | 40.272727 | 126 | 0.688488 |
33708817602591ce126270d6b044ed103d888521 | 6,342 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/transnetv2_metric.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/transnetv2_metric.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/transnetv2_metric.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.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.448276 | 112 | 0.571113 |
6852d1d149f3cd4480c5c9d53ed8984b61c9ef3d | 780 | py | Python | 20-fs-ias-lec/groups/11-sensUI/sensui/NodeManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/NodeManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/11-sensUI/sensui/NodeManager.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from Manager import Manager
from Node import Node
class NodeManager(Manager):
def __init__(self, nodes, callbackNodeAdded=None):
super().__init__(nodes)
self.__callbackNodeAdded = callbackNodeAdded
def setCallbackNodeAdded(self, callbackNodeAdded):
self.__callbackNodeAdded = callback... | 27.857143 | 54 | 0.648718 |
68713079d16622fce82492988bd0814474a10fd9 | 1,379 | py | Python | exercises/fr/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(pattern1) == 2, "pattern1 doit décrire deux tokens."
assert len(pattern2) == 2, "pattern2 doit décrire deux tokens."
assert (
len(pattern1[0]) == 1
), "Le premier token de pattern1 nécessite un attribut seulement."
assert any(
pattern1[0].get(l) == "iphone" for... | 41.787879 | 77 | 0.629442 |
d7beb5a486b585510e81008edf21ccc3aaf2c338 | 2,017 | py | Python | basketball/player/UI_CommonInfo.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/UI_CommonInfo.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | basketball/player/UI_CommonInfo.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null |
import PyQt5
import PyQt5.QtWidgets
class UI_CommonInfo(PyQt5.QtWidgets.QDialog):
"""
Display Common Player Information
"""
def __init__(self, parent=None):
super(UI_CommonInfo, self).__init__(parent)
self.topLayout = PyQt5.QtWidgets.QVBoxLayout()
self.hbox1 = PyQt5.QtWidgets... | 33.065574 | 61 | 0.660882 |
50142390cb4e9ac8a2797230d701af77d69bef64 | 287 | py | Python | Algorithms/Dynamic_Programming/the_coin_change_problem.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/the_coin_change_problem.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Dynamic_Programming/the_coin_change_problem.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
n, m = list(map(int, input().strip().split()))
c = list(map(int, input().strip().split()))
ways = [1] + [0] * n
for coin in c:
for i in range(coin, n+1):
ways[i] += ways[i-coin]
# print(ways)
# print('\t', i, i - coin)
print(ways[n])
| 22.076923 | 46 | 0.515679 |
a8998c11b205f0aac5eedf5bb7ff841dbb24e462 | 529 | py | Python | sketches/shaunsim3/config.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/shaunsim3/config.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/shaunsim3/config.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
class Settings():
def __init__(self):
# Einige nützliche Konstanten:
self.WIDTH = 640
self.HEIGHT = 480
self.FPS = 5
self.PATCHSIZE = 10
# Ein paar Farbdefinitionen
self.WHITE = color(255, 255, 255)
self.YELLOW = ... | 25.190476 | 41 | 0.517958 |
a8b93e8261bd5f1d30cb000ba15f937a7f9fae2e | 155 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.1-list.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.1-list.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.1-list.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | number_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(number_list)
print(number_list[0])
print(number_list[1])
print(number_list[9])
print(number_list[10])
| 19.375 | 45 | 0.690323 |
50f5e54bc6a5208c62c91c541dcb69a213a393ba | 497 | py | Python | leetcode/045-Jump-Game-II/JumpGameII_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/045-Jump-Game-II/JumpGameII_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/045-Jump-Game-II/JumpGameII_002.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def jump(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
n = len(nums)
if n < 2:
return 0
start, end, newend = 0, nums[0], nums[0]
for cnt in range(1, n):
for i in range(start, end + 1):
... | 29.235294 | 59 | 0.428571 |
d705d2e8e3a782e8d3feede82c17801ddeb1cb4b | 1,237 | py | Python | Sandbox/google_calendar.py | manashmndl/KLAS | 036dab470e3015e119c3fcd0edff0fb01bb21ce6 | [
"MIT"
] | 1 | 2017-03-03T23:13:11.000Z | 2017-03-03T23:13:11.000Z | Sandbox/google_calendar.py | manashmndl/KLAS | 036dab470e3015e119c3fcd0edff0fb01bb21ce6 | [
"MIT"
] | null | null | null | Sandbox/google_calendar.py | manashmndl/KLAS | 036dab470e3015e119c3fcd0edff0fb01bb21ce6 | [
"MIT"
] | null | null | null | from __future__ import print_function
from httplib2 import Http
from oauth2client import file, client, tools
from googleapiclient.discovery import build
import time
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
class GoogleCa... | 26.891304 | 104 | 0.611964 |
ad0b8f41e3547fc6a8372d862ae30a8d10f6870a | 4,621 | py | Python | Mass-Alexa-Checker-main/Alexa.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Mass-Alexa-Checker-main/Alexa.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Mass-Alexa-Checker-main/Alexa.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # -*- coding: utf-8 -*
#!/usr/bin/python
#Thanks TO : JametKNTLS - h0d3_g4n - Moslem And All Coders
#Blog : https://www.blog-gan.org
#YT : PY
################Command#####################
import requests, re, urllib2, os, sys, codecs, random
from multiprocessing.dummy import Pool
from time import time as... | 37.266129 | 745 | 0.663926 |
66fe9bc2c099fe5b8c0cda2cae4481980946c473 | 555 | py | Python | pandasguide/com/aaron/pandas_read_excel.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | pandasguide/com/aaron/pandas_read_excel.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | pandasguide/com/aaron/pandas_read_excel.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # _*_ encoding:utf-8 _*_
"""
panadas read excel test
"""
__author__="aaron.qiu"
import json
import pandas as pd
def read_excel():
"""读取excel file"""
# keep_default_na=False
df = pd.read_excel(r"C:\\Users\\Administrator\\Desktop\\pandas_test.xlsx", usecols=[1, 2], nrows=3, header=None, keep_default_na=F... | 20.555556 | 141 | 0.666667 |
7e6b6c6205fbf2725fea0aed10868894c35ea13d | 605 | py | Python | leetcode/080-Remove-Duplicates-from-Sorted-Array-II/RmDupFrSortedArr2_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/080-Remove-Duplicates-from-Sorted-Array-II/RmDupFrSortedArr2_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/080-Remove-Duplicates-from-Sorted-Array-II/RmDupFrSortedArr2_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
# @return {integer}
def removeDuplicates(self, nums):
if len(nums) < 3:
return len(nums)
cnt = 2
tmp = nums[0]
res = 0
p = 0
for i in range(len(nums)):
if nums[i] == tmp and cnt > 0:
... | 24.2 | 42 | 0.353719 |
ade85a0d1d9c2dbaac673b9f2772806ce5b0327e | 1,002 | py | Python | rating/favicon.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/favicon.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/favicon.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
This gives a score if the site has an icon.
"""
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
default_value = False
depends_on_checks = ['html_head', 'load_favicons']
max_score = 1
def __init__(self, check_results):
super().__init... | 25.692308 | 77 | 0.546906 |
2a4076355d06b1c550d363810a5a7b8c490a157f | 14,991 | py | Python | Packs/AwakeSecurity/Integrations/AwakeSecurity/AwakeSecurity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/AwakeSecurity/Integrations/AwakeSecurity/AwakeSecurity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/AwakeSecurity/Integrations/AwakeSecurity/AwakeSecurity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
import demistomock as demisto
from CommonServerPython import *
''' IMPORTS '''
import base64
import re
import requests
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBALS '''
handle_proxy()
params = demisto.params()
server = params["server"].rstrip('/')
prefix = server + "/awakeapi/v... | 31.493697 | 119 | 0.612768 |
2a6cf7c68a24aea0a9ee10f41108e8f063522212 | 7,650 | py | Python | cryptoauthlib/python/cryptoauthlib/atcacert.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 12 | 2017-11-15T08:29:03.000Z | 2021-05-22T04:57:20.000Z | cryptoauthlib/python/cryptoauthlib/atcacert.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 2 | 2019-09-22T12:02:07.000Z | 2021-09-09T22:38:25.000Z | cryptoauthlib/python/cryptoauthlib/atcacert.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 5 | 2019-04-05T13:46:44.000Z | 2020-11-25T08:58:32.000Z | from ctypes import Structure, c_int, c_uint8, c_uint16, c_char, POINTER, Array
from .atcab import get_cryptoauthlib
from .atcaenum import AtcaEnum
import binascii
class atcacert_cert_type_t(AtcaEnum):
"""Types of certificates"""
CERTTYPE_X509 = 0 # Standard X509 certificate
CERTTYPE_CUSTOM = 1 ... | 51.342282 | 204 | 0.697908 |
63053adb1bcde0b5afa494619d12e1be03db32d7 | 7,180 | py | Python | Fastir_Collector/evt/logs.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Fastir_Collector/evt/logs.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Fastir_Collector/evt/logs.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import win32evtlog
from utils.utils import get_csv_writer, get_json_writer, write_to_csv, write_to_json, close_json_writer
import datetime
import os
# UserID is a SID to convert
hevt_to_write = {'Channel': '', 'EventID': '', 'Execution': 'ProcessID', 'Lev... | 59.833333 | 122 | 0.545682 |
fab767ba2ef3fcbf595a6257bb174b0c6c99f7a1 | 4,307 | py | Python | tests/test_008_aemtEntfernen.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/tests/test_008_aemtEntfernen.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/tests/test_008_aemtEntfernen.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from tests.MyTestCase import MyTestCase
from tests.MyFuncLogin import loginAsLukasAdmin
from tests.MyFuncAemter import createAmt, createReferat, createUnterbereich
class TestAemtEntfernen(MyTestCase):
"""
Setup and Teardown functions are specified in
MyTestCase
"""
def test_1ReferatEntfer... | 34.456 | 139 | 0.604365 |
878b2f2a0c6455a8f4eb58f6ce044eebad38eadd | 3,006 | py | Python | frappe-bench/apps/erpnext/erpnext/config/setup.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/setup.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/setup.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
from frappe.desk.moduleview import add_setup_section
def get_data():
data = [
{
"label": _("Settings"),
"icon": "fa fa-wrench",
"items": [
{
"type": "doctype",
"name": "Global Defaults",
"label": _("Global Settings"),
"des... | 23.484375 | 94 | 0.547572 |
529dfd048cfe422a857b31a23ce1397b05cd246e | 4,049 | py | Python | finbyz_dashboard/patches/property_setter/property_setter.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/patches/property_setter/property_setter.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/patches/property_setter/property_setter.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | from __future__ import unicode_literals
import frappe
def execute():
doc = frappe.new_doc("Property Setter")
doc.doctype_or_field = "DocField"
doc.doc_type = "Dashboard Chart"
doc.field_name = "document_type"
doc.property = "depends_on"
doc.property_type = "Data"
doc.value = "eval: doc.char... | 29.992593 | 95 | 0.645345 |
eab81861927ab037a63ebc99da77db2e1936d078 | 1,129 | py | Python | src/nfz_module/adapter/GPSSensorAdapter.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/adapter/GPSSensorAdapter.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/adapter/GPSSensorAdapter.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | __author__ = 'Hans-Werner Roitzsch'
__date__ = '2015-12-29'
from adapter.SensorAdapter import SensorAdapter
from controller.GPSController import GPSController
class GPSSensorAdapter(SensorAdapter):
def __init__(self):
self.last_values = {}
self.gpsc = GPSController()
try:
self.gpsc.start()
except:
... | 25.659091 | 57 | 0.725421 |
dc1f8442778b7b5310e81cb13d69be54e6989ed9 | 4,711 | py | Python | official/nlp/ernie/src/assessment_method.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/ernie/src/assessment_method.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/ernie/src/assessment_method.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.65 | 93 | 0.554872 |
0db4eedd23260f60ccd38bf638ad664e3035e78b | 2,318 | py | Python | travelplanner/tests/test_travelplanner.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/tests/test_travelplanner.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/tests/test_travelplanner.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | from travelplanner.read_passengers import Read_passengers, Read_route
from travelplanner.Passenger import Passenger
from travelplanner.Route import Route
from travelplanner.Journey import Journey
import numpy as np
import pytest
# passenger class tests
def test_Passenger():
testpassenger = Passenger(start=(0, 0)... | 29.717949 | 74 | 0.679896 |
df4f04b01c561cc70a8a8025debdedff26389677 | 4,541 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/rmboard.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/rmboard.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/rmboard.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# SPDX-License-Identifier: GPL-2.0+
# Copyright 2019 Google LLC
#
"""
Script to remove boards
Usage:
rmboard.py <board_name>...
A single commit is created for each board removed.
Some boards may depend on files provided by another and this will cause
problems, generally the removal of files wh... | 30.072848 | 79 | 0.615283 |
d565975d5c6295b512c456ab9bae2b597eba5e6d | 260 | py | Python | partner_ngos/programs_management/doctype/programs/programs.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | 1 | 2021-06-03T17:14:08.000Z | 2021-06-03T17:14:08.000Z | partner_ngos/programs_management/doctype/programs/programs.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/programs_management/doctype/programs/programs.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | 1 | 2021-10-09T16:20:09.000Z | 2021-10-09T16:20:09.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Programs(Document):
pass
| 23.636364 | 52 | 0.773077 |
63c2f1a42635fbdc33b808a0256c765b58f1b5d0 | 428 | py | Python | demos/Multiscale/ThreeSided/model/parts/system.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSided/model/parts/system.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSided/model/parts/system.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z |
# Mechanisms
def update_smooth_avg_fiat_reserve(params, step, sL, s, _input):
y = 'smooth_avg_fiat_reserve'
x = s['fiat_reserve']*params['rho']+s['smooth_avg_fiat_reserve']*(1-params['rho'])
return (y, x)
def update_smooth_avg_token_reserve(params, step, sL, s, _input):
y = 'smooth_avg_token_reserve'
... | 32.923077 | 88 | 0.691589 |
8939b20777b410e380be35956956da4c5b159ed8 | 1,224 | py | Python | PopulationLib/Population.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | PopulationLib/Population.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | PopulationLib/Population.py | jvollhueter/pyMANGA-1 | 414204a394d44405225b4b8224b19464c1006f1d | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2018-Today
@author: jasper.bathmann@ufz.de
"""
import PopulationLib as PLib
from PopulationLib import TreeGroup
class Population(TreeGroup):
def __init__(self, args):
self.tree_groups = {}
self.trees = []
self.max_id = 0
fo... | 25.5 | 54 | 0.620098 |
122a4cb1befa174971f64b5264bb19239a36d5d1 | 346 | py | Python | Licence 1/I11/TP7/vecteur.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP7/vecteur.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP7/vecteur.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | """
Module vecteur
créé par Axel Coezard
le 10 / 12 / 19
"""
def somme_vect(u, v):
return tuple(a + b for a, b in zip(u, v))
def diff_vect(u, v):
return tuple(a - b for a, b in zip(u, v))
def prod_scal(u, v):
return sum(a * b for a, b in zip(u, v))
def prod_mat_vec(u, m):
return tuple(pr... | 19.222222 | 45 | 0.580925 |
89e4548405576c1a573e219d55dba50fb24b9652 | 1,163 | py | Python | src/onegov/winterthur/views/daycare.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/daycare.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/winterthur/views/daycare.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.winterthur import WinterthurApp, _
from onegov.winterthur.daycare import DaycareSubsidyCalculator
from onegov.winterthur.daycare import DaycareSubsidyCalculatorForm
from onegov.winterthur.layout import DaycareSubsidyCalculatorLayout
@WinterthurApp.form(
model=Da... | 32.305556 | 70 | 0.687876 |
89effa23ba470b4e9b2a2939e8080bf3470081ba | 1,203 | py | Python | kts/core/backend/address_manager.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/backend/address_manager.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/backend/address_manager.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import os
import time
import ray
try:
from ray.experimental import get_actor # ray<=0.8.1
except ImportError:
from ray.util import get_actor # ray>=0.8.2
@ray.remote
class AddressManager:
def __init__(self):
self.data = dict()
self.is_none = dict()
self.timestamps = dic... | 20.741379 | 71 | 0.61596 |
d63a50972ce37b784766530d3f062c789b58ba02 | 264 | py | Python | Tjctf2018/qaq.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Tjctf2018/qaq.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Tjctf2018/qaq.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import requests, time
session = requests.session()
session.get("https://moar_horse.tjctf.org/")
while (True):
content = session.get("https://moar_horse.tjctf.org/legs").content.decode()
if content.find("tjctf") != -1:
print(content)
break | 26.4 | 79 | 0.662879 |
c390d556d8a934b74de6e77e84990a277d83368e | 791 | py | Python | elements/python/10/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/10/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/10/1/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | class Node(object):
def __init__(self, left=None, right=None):
self.left = left
self.right = right
def is_balanced(n):
mn, mx = depth_range(n)
return mx - mn <= 1
def depth_range(n):
if n is None:
return 0, 0
mnl, mxl = depth_range(n.left)
mnr, mxr = depth_range(n.rig... | 17.977273 | 49 | 0.527181 |
c3b2c222060c82151bdc456fbf0bcffc8e8aecee | 1,017 | py | Python | src/tokenizer/yomi_sp_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | src/tokenizer/yomi_sp_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | src/tokenizer/yomi_sp_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | import subprocess
import sentencepiece as spm
class YomiSPTokenizer(object):
'''
Japanese Yomi SentencePiece Tokenizer
'''
def __init__(self, model_path, vocab_path):
'''
:parameters:
model_path: SentencePiece .model path
vocab_path: SentencePiece .vocab path
... | 29.911765 | 117 | 0.546706 |
9c9ebb21a0719a1dc9f1d442626dcd2a4acd8e36 | 1,923 | py | Python | src/onegov/translator_directory/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/translator_directory/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`.
"""
from sqlalchemy import Column, Boolean
from onegov.core.orm.types import JSON
from onegov.core.upgrade import upgrade_task
@upgrade_task('Change withholding tax colum... | 32.05 | 74 | 0.666667 |
147f5a36435b5e8996d8ba03c23b428f5b039f65 | 515 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_party_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_party_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_party_type.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('setup', 'doctype', 'party_type')
make_party_type()
def make_party_type():
for party_type in ["Cu... | 32.1875 | 71 | 0.749515 |
b4ea0bafbd842154c8157c2870562b84b81f1865 | 959 | py | Python | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/VerifyIPv4Indicator/Scripts/VerifyIPv4Indicator/VerifyIPv4Indicator.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import ipaddress
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def is_valid_ipv4_address(address: str):
try:
ipaddress.IPv4Address(address)
return True
except ValueError:
return False
''' MAIN FUNCTION '''
def main():
try:
t... | 21.795455 | 71 | 0.604797 |
2ec0830fb6c2831fa2970cdb1b790dd9a2f134f2 | 2,881 | py | Python | python/convert_old_data.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | null | null | null | python/convert_old_data.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 3 | 2021-01-28T13:46:07.000Z | 2021-01-28T14:26:27.000Z | python/convert_old_data.py | w20karobau40/w20karobau40.github.io | 64c6d77399e06e6e7b8ce15e01fa53402eb97365 | [
"MIT"
] | 1 | 2020-08-13T11:51:09.000Z | 2020-08-13T11:51:09.000Z | import json
import Levenshtein
from loguru import logger
from openpyxl import load_workbook
@logger.catch
def main():
HEADER_ROW = 3
MAX_ROW = 37
COLS = 90
with open('question_and_answers.json') as input_file:
question_and_answers = json.load(input_file)
questions = []
for qa in quest... | 43 | 197 | 0.575842 |
d32668da0a780289f33a4e32dbc0ba0b725cd39f | 3,854 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/latex.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/latex.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V61_HeNe_Laser/Python/latex.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import collections
import numpy as np
import uncertainties
import pint
from uncertainties import ufloat
from uncertainties import ufloat_fromstr
from pint import UnitRegistry
import string
#import latex
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import uncertainties.unumpy as unp
import... | 48.175 | 288 | 0.610794 |
46deb1da9b90918dbe977a044d8930bf5873d827 | 469 | py | Python | pacman-termux/test/pacman/tests/provision002.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/provision002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/provision002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "-S provision, multiple providers, one installed"
sp = pmpkg("pkg1", "1.0-2")
sp.provides = ["pkg-env"]
self.addpkg2db("sync", sp)
sp = pmpkg("pkg2", "1.0-2")
sp.provides = ["pkg-env"]
self.addpkg2db("sync", sp)
lp = pmpkg("pkg2")
lp.provides = ["pkg-env"]
self.addpkg2db("local", lp)
self.args = ... | 22.333333 | 68 | 0.675906 |
b61112d8d42c5c7c5e0eed7adc314421cccbed8b | 102,581 | py | Python | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCQuestionPopulate/NCSCQuestionPopulate.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCQuestionPopulate/NCSCQuestionPopulate.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/NCSCQuestionPopulate/NCSCQuestionPopulate.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
question_data = {
"AssessmentA": [{
"name": "A1a Board Direction", # noqa: E501
"question": "You have effective organisational security management led at board level and articulated clearly "
... | 68.938844 | 396 | 0.635391 |
45c6203e74cb4015eccfb7c74c96a069234310cf | 6,964 | py | Python | Utils/py/SimsparkTests/sexpr.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/py/SimsparkTests/sexpr.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/py/SimsparkTests/sexpr.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | #!/usr/bin/env python
##
## sexpr.py - by Yusuke Shinyama
##
## * public domain *
##
## AbstractFilter
##
class AbstractFilter:
def __init__(self, next_filter):
self.next_filter = next_filter
return
def process(self, s):
raise NotImplementedError
def feed(self, s):
sel... | 29.634043 | 91 | 0.544945 |
b3314106d2273b8c412a601394f9d82b3abfef83 | 2,360 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/shapes/poi_atTLS.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/shapes/poi_atTLS.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/shapes/poi_atTLS.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# 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.ec... | 34.202899 | 101 | 0.635593 |
2fe2751f8da062668ff64bbd0afb2cd61677e96d | 18,133 | py | Python | strictMatch.py | ixa-ehu/crosstext | 196c18619c730d4168a957038ba237f0dc5f32ca | [
"Apache-2.0"
] | null | null | null | strictMatch.py | ixa-ehu/crosstext | 196c18619c730d4168a957038ba237f0dc5f32ca | [
"Apache-2.0"
] | null | null | null | strictMatch.py | ixa-ehu/crosstext | 196c18619c730d4168a957038ba237f0dc5f32ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This script is to generate projection for a given target language from 3 other source languages."""
import sys, os
from collections import Counter
from itertools import *
#backoff corpora
corporaType = "wikiner"
en_freq_tag = "en.wikiner"
es_freq_tag = "e... | 47.970899 | 133 | 0.626537 |
a6a8ea84c8d0150e527d92f30cc66ac7eb24da09 | 1,223 | py | Python | backend/migrations/versions/d51cbebf0684_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/d51cbebf0684_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/d51cbebf0684_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: d51cbebf0684
Revises: c59f1ce5a3dc
Create Date: 2019-04-03 14:12:58.939792
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd51cbebf0684'
down_revision = 'c59f1ce5a3dc'
branch_labels = None
depends_on = None
def upgrade():
# ... | 33.054054 | 111 | 0.700736 |
5b7f04c747e5fbe7dea71a9b6cc879d8fa260d55 | 828 | py | Python | code/snake/Algorithms/BlerijanImproved.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 1 | 2020-03-30T09:25:53.000Z | 2020-03-30T09:25:53.000Z | code/snake/Algorithms/BlerijanImproved.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | 2 | 2020-02-05T14:00:23.000Z | 2020-03-30T19:57:19.000Z | code/snake/Algorithms/BlerijanImproved.py | BogyMitutoyoCTL/AI-Preparation | ef535741816b02e5e63d426a3232a688c9abd726 | [
"MIT"
] | null | null | null | from Algorithms.Algorithms import Algorithm
from GameData import GameData
class BlerijanImproved(Algorithm):
def __init__(self):
super().__init__()
def decide(self, info: GameData) -> str:
print("Kopf ist bei", info.head_x, " / ", info.head_y)
print("Abstand zur Wand im Norden: ", inf... | 34.5 | 66 | 0.61715 |
45f0814994f8c3b57e7ffafb776e446873ebde56 | 2,522 | py | Python | python/odml/test_scripts/debug_conversion.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/test_scripts/debug_conversion.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | python/odml/test_scripts/debug_conversion.py | mpsonntag/snippets | fc3cc42ea49b885c1f29c0aef1379055a931a978 | [
"BSD-3-Clause"
] | null | null | null | import os
import odml
from odml.tools.version_converter import VersionConverter as VC
root = os.path.join(os.environ['HOME'], 'Chaos', 'DL', 'x_odml', 'convert')
"""
conv_no_enc = os.path.join(root, '1.3_convert.xml')
out_noenc = os.path.join(root, '1.4_converted_noenc.xml')
conv_utf8 = os.path.join(root, '1.3_conv... | 27.714286 | 107 | 0.658208 |
340ea7840365dd8a9ce6af25d3cf8d2282e6859c | 656 | py | Python | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section2DataTypes/11DataTypesListsAndTuples.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section2DataTypes/11DataTypesListsAndTuples.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | Python/Courses/LearnToCodeInPython3ProgrammingBeginnerToAdvancedYourProgress/python_course/Section2DataTypes/11DataTypesListsAndTuples.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | students = "John, Mary, Steve"
print("The type of students: ", type(students))
print("A string: ", students)
print("----------------------")
students = ["John", "Mary", "Steve"]
print("The type of students now: ", type(students))
print("A list: ", students)
students.append("Dave")
print("A list: ", students)
students.p... | 28.521739 | 51 | 0.626524 |
3424c62b4d6a59d576635c7b1285fcc581137719 | 1,069 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex03_list_reverse_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex03_list_reverse_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex03_list_reverse_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch05_datastructures.solutions.ex03_list_reverse import reverse, reverse_inplace, reverse_with_slicing
def list_reverse_inputs_and_expected():
return [([1, 2, 3, 4], [4, 3, 2, 1]),
(["A", "BB", "... | 27.410256 | 106 | 0.688494 |
940ec2ccb6f1c74397342da89c432bafd1a9fcdd | 30,048 | py | Python | autojail/config/configurator.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/config/configurator.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/config/configurator.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import os
import re
import shutil
import subprocess
import sys
from pathlib import Path
from typing import List, Optional, Union
import ruamel.yaml
from .. import utils
from ..model import (
AutojailConfig,
Board,
DebugConsole,
GroupedMemoryRegion,
JailhouseConfig,
MemoryRegionData,
Platfo... | 36.466019 | 106 | 0.489716 |
944c840996ed2c3369ec5df014adddcde1370ab1 | 582 | py | Python | PYTHON/Itertools/maximize_it.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/maximize_it.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Itertools/maximize_it.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from itertools import combinations, product
from functools import reduce
if __name__ == '__main__':
temp = input().split()
K = int(temp[0])
M = int(temp[1])
val = []
for _ in range(K):
temp = (list(map(int, input().split()))[1:])
l = [v ** 2 for v i... | 22.384615 | 52 | 0.503436 |
84929e6166f76f93abcfc64fc77e9736ab02e9ec | 644 | py | Python | day23/player.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day23/player.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day23/player.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from turtle import Turtle
STARTING_POSITION = (0, -280)
MOVE_DISTANCE = 10
FINISH_LINE_Y = 280
class Player(Turtle):
def __init__(self) -> None:
super().__init__()
self.shape("turtle")
self.penup()
self.setheading(90)
self.goto(STARTING_POSITION)
def move(self):... | 20.774194 | 42 | 0.611801 |
ca788e6c3c9f414d7498586801a266e2b0e5b610 | 10,461 | py | Python | MachineTranslation/lib/data_generator/tokenizer_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | 2 | 2021-08-25T01:13:29.000Z | 2021-10-10T14:49:59.000Z | MachineTranslation/lib/data_generator/tokenizer_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | MachineTranslation/lib/data_generator/tokenizer_xrh.py | Xinrihui/DeepLearningApp | 8d86b88251ee8d37358c642b1ec4a341767bfd17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import tensorflow as tf
from tensorflow.keras.layers import TextVectorization, StringLookup
import tensorflow_text as tf_text
from tensorflow_text.tools.wordpiece_vocab import bert_vocab_from_dataset as bert_vocab
class SubwordTokenizer(tf.keras.Model):
"""
使用 ten... | 29.22067 | 147 | 0.627187 |
046b8786adb1af8221453e947fffe94c8187307e | 1,705 | py | Python | nnc/migrations/0004_order_orderproduct.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/migrations/0004_order_orderproduct.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | nnc/migrations/0004_order_orderproduct.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2021-08-01 17:19
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL)... | 42.625 | 118 | 0.615836 |
6d1234b7eb82366e019f99141e8c266e2d5df84b | 320 | py | Python | src/offenewahlen_api/settings_development.py | frocentus/offenewahlen_api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 14 | 2017-07-12T14:42:57.000Z | 2017-09-08T20:32:53.000Z | src/offenewahlen_api/settings_development.py | frocentus/offenewahlen_api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 209 | 2017-07-11T21:36:01.000Z | 2017-11-05T01:10:50.000Z | src/offenewahlen_api/settings_development.py | OKFNat/offenewahlen-api | 71860583890f8a4c23df67f271e8f13558fa9582 | [
"MIT"
] | 8 | 2017-07-15T09:40:42.000Z | 2018-01-12T03:02:06.000Z | import os
from offenewahlen_api.settings_user import *
from offenewahlen_api.settings import *
DEBUG = True
DEBUG_TB_INTERCEPT_REDIRECTS = False
USER_SETTINGS_EXIST = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'app.sqlite3')
}
}
| 20 | 53 | 0.696875 |
b6b3a10cd18d1b2c669cb36a867bc7b16d0e2755 | 1,551 | py | Python | test/copy_resource.py | openharmony-sig-ci/ark_js_runtime | 72fcff4c114fd8323c9a5d1a835efeac043e9a72 | [
"Apache-2.0"
] | null | null | null | test/copy_resource.py | openharmony-sig-ci/ark_js_runtime | 72fcff4c114fd8323c9a5d1a835efeac043e9a72 | [
"Apache-2.0"
] | null | null | null | test/copy_resource.py | openharmony-sig-ci/ark_js_runtime | 72fcff4c114fd8323c9a5d1a835efeac043e9a72 | [
"Apache-2.0"
] | 1 | 2021-09-13T12:12:04.000Z | 2021-09-13T12:12:04.000Z | #!/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
Unless required ... | 27.696429 | 72 | 0.715667 |
fcc7f461daa9f56a5c9d7e1dbaf0eb43f28e2bb3 | 1,985 | py | Python | novel/swallows/the_swallows++.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | novel/swallows/the_swallows++.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | novel/swallows/the_swallows++.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Example of extending _The Swallows_ world to produce a different story.
#
import sys
from os.path import realpath, dirname, join
# get the ../src/ directory onto the Python module search path
sys.path.insert(0, join(dirname(realpath(sys.argv[0])), '..', 'src'))
# n... | 31.507937 | 95 | 0.738035 |
1e0994332b3cf7942dc353903fd79dc00d4d21dd | 294 | py | Python | Mathematics/024-Is-Fibo.py | sadikkuzu/HackerRank | 2b1ed2cf41f6a5404c5b9293186f301b646b5d33 | [
"Apache-2.0"
] | 5 | 2019-03-09T22:44:01.000Z | 2021-09-14T00:11:38.000Z | Mathematics/024-Is-Fibo.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 4 | 2018-08-16T09:39:47.000Z | 2018-09-14T17:37:07.000Z | Mathematics/024-Is-Fibo.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 1 | 2020-06-01T23:38:35.000Z | 2020-06-01T23:38:35.000Z | #!/bin/python
fib = list()
fib.append(0)
fib.append(1)
def add_fib():
global fib
fib.append(fib[-2] + fib[-1])
# Complete the solve function below.
def solve(n):
global fib
while n > max(fib):
add_fib()
if n in fib:
return "IsFibo"
return "IsNotFibo" | 15.473684 | 36 | 0.588435 |
1e0bd1b388687ff303eefeaf9546ce142986be13 | 2,594 | py | Python | 1. Runde/Abgabe/Junioraufgabe 2/Junioraufgabe 2.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | 2 | 2020-12-27T19:57:53.000Z | 2021-01-04T15:16:42.000Z | 1. Runde/Abgabe/Junioraufgabe 2/Junioraufgabe 2.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | null | null | null | 1. Runde/Abgabe/Junioraufgabe 2/Junioraufgabe 2.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Folgende Annahmen wurden genommen:
# -In dem Hauptverzeichnis liegt mindestens eine Datei, utf-8 encodiert, in der beide Karten liegen
# -Die Karten sind mit einem Zeilenumbruch voneinander getrennt
# -Die Karten enthalten gleichviele Elemente
# -Die einzelnen Elemente sind mit " " voneinand... | 64.85 | 148 | 0.559753 |
94d15cb3cf385ebefc072d6aab3fa0e465e64f68 | 3,581 | py | Python | tests/onegov/feriennet/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/feriennet/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/feriennet/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import transaction
import pytest
from onegov.feriennet import FeriennetApp
from onegov.feriennet.initial_content import create_new_organisation
from onegov.feriennet.models import VacationActivity
from onegov.user import User
from pytest_localserver.http import WSGIServer
from sqlalchemy.orm.session import close_all_s... | 30.092437 | 78 | 0.699525 |
7806d1699d80e6b8a43d5781deb192dbab390adc | 5,048 | py | Python | migrations/0001_initial.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | migrations/0001_initial.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | 9 | 2017-06-15T10:24:09.000Z | 2018-08-01T21:07:25.000Z | migrations/0001_initial.py | klml/kohrsupply | 89ae3ebae120398e8259dbe77c3b092485cc79f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-08 21:02
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 58.697674 | 227 | 0.623415 |
78ae38f487d51aa8701b459788df48ffe72ed228 | 812 | py | Python | Algorithms/Sort_Algorithms/Radix_Sort/Radix_Sort.py | hussamEL-Hwary/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 18 | 2016-11-01T04:00:36.000Z | 2021-09-13T14:26:35.000Z | Algorithms/Sort_Algorithms/Radix_Sort/Radix_Sort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Algorithms/Sort_Algorithms/Radix_Sort/Radix_Sort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | from math import log10
from random import randint
def get_digit(number, base, pos):
return (number // base ** pos) % base
def prefix_sum(array):
for i in range(1, len(array)):
array[i] = array[i] + array[i-1]
return array
def radixsort(l, base=10):
passes = int(log10(max(l))+1)
output = [0] * len(l)
... | 20.820513 | 49 | 0.609606 |
156a8df10458d6be6dd15ee2275e5556ddf9ba87 | 1,131 | py | Python | bib_update.py | DDMAL/MIRAI | 2230e6a9c610bd5dc7f9fc9bf053292cb0fceca0 | [
"MIT"
] | 1 | 2021-11-15T06:29:44.000Z | 2021-11-15T06:29:44.000Z | bib_update.py | DDMAL/MIRAI | 2230e6a9c610bd5dc7f9fc9bf053292cb0fceca0 | [
"MIT"
] | 12 | 2019-05-03T20:33:04.000Z | 2021-12-08T21:06:04.000Z | bib_update.py | DDMAL/MIRAI | 2230e6a9c610bd5dc7f9fc9bf053292cb0fceca0 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import re
import os
print('What directory would you like to update?\n - publications\n - presentations\n')
update_direc = input()
if not os.path.isdir(f'_{ update_direc }'):
os.mkdir(f'_{ update_direc }')
print('What zotero export file (HTML) would you like to parse?')
for file i... | 36.483871 | 97 | 0.589744 |
158f829f6e23886a6dacaec15354199e07b32827 | 212 | py | Python | Zeit.py | HyperGamer27/Zeit | 3f5f09e479dc8f1c4b2c2b8b51dab79522eeb5a5 | [
"MIT"
] | null | null | null | Zeit.py | HyperGamer27/Zeit | 3f5f09e479dc8f1c4b2c2b8b51dab79522eeb5a5 | [
"MIT"
] | null | null | null | Zeit.py | HyperGamer27/Zeit | 3f5f09e479dc8f1c4b2c2b8b51dab79522eeb5a5 | [
"MIT"
] | null | null | null | import os
import sys
class Zeit(object):
"""docstring for Zeit."""
def __init__(self, arg):
super(Zeit, self).__init__()
self.arg = arg
print(self.arg)
zeit = Zeit("Hello World!")
| 21.2 | 36 | 0.599057 |
01a81040e9beeb33b42241481de7c21a1775577b | 4,600 | py | Python | sdd-db/db-api/christian.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | sdd-db/db-api/christian.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | sdd-db/db-api/christian.py | socialdistancingdashboard/virushack | 6ef69d26c5719d0bf257f4594ed2488dd73cdc40 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | """ This Script retrieves data from db and delivers spacial data for dashboard requests."""
try:
if __IPYTHON__ : os.chdir(__file__)
except: pass
import json
import pandas as pd
from datetime import datetime, timedelta
import pymysql
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
import ... | 32.624113 | 189 | 0.590435 |
01b1035c09ae9ef096b5f80ec9099bcb25e410e5 | 21,818 | py | Python | Packs/Coralogix/Integrations/Coralogix/Coralogix.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Coralogix/Integrations/Coralogix/Coralogix.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Coralogix/Integrations/Coralogix/Coralogix.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # TODO: Add description to the integration in <root>/Packs/Coralogix/Integrations/Coralogix/Coralogix_description.md
from datetime import timezone
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import json
import requests
import urllib3
import dateu... | 39.525362 | 129 | 0.617838 |
170ff53985e78a1cf48c01a7394b36cb8ef004dd | 1,524 | py | Python | books/SystemProgramming/ch3_introduction/monitoring.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch3_introduction/monitoring.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/SystemProgramming/ch3_introduction/monitoring.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/bin/env python
import os
import sys
import datetime
from time import sleep
from text_colors import colors
from mylog import get_log_data
def check(file_name, search_word, out_file_name):
if os.path.exists(file_name):
print(f"모니터링 시작 : {file_name}")
print(f"대상 : {search_word}")
print("-... | 27.709091 | 89 | 0.576772 |
e5af6c7468d9583a069a76b42ccc8249ab198821 | 4,229 | py | Python | repo/service.vpn.manager/resetVPN.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/resetVPN.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/resetVPN.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 44.989362 | 161 | 0.621424 |
008b23d8257887a7911fa3cff0fea7eab8ceab9b | 1,671 | py | Python | fromcsv.py | gbd-consult/windrose | bd0187720e81cbbcc5f03cabf0b4e32176b5c7be | [
"MIT"
] | null | null | null | fromcsv.py | gbd-consult/windrose | bd0187720e81cbbcc5f03cabf0b4e32176b5c7be | [
"MIT"
] | null | null | null | fromcsv.py | gbd-consult/windrose | bd0187720e81cbbcc5f03cabf0b4e32176b5c7be | [
"MIT"
] | 1 | 2020-11-17T12:32:50.000Z | 2020-11-17T12:32:50.000Z | """
Skript zum Erstellen von Windrose Plots aus CSV Dateien.
python3 fromcsv.py windrose pfad/zur/datei.csv ordner/fuer/ausgabe
"""
import csv
import sys
import os.path
from windrose import windrose, balken
csv_file = sys.argv[2]
out_path = sys.argv[3]
stations = []
with open(csv_file, encoding = 'latin1') a... | 37.977273 | 99 | 0.564931 |
00e120bc2574537aca7015f367f84a827ce97550 | 367 | py | Python | packages/watchmen-storage/src/watchmen_storage/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage/src/watchmen_storage/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage/src/watchmen_storage/settings.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from pydantic import BaseSettings
class StorageSettings(BaseSettings):
DECIMAL_INTEGRAL_DIGITS: int = 24
DECIMAL_FRACTION_DIGITS: int = 8
storage_settings = StorageSettings()
def ask_decimal_integral_digits() -> int:
return storage_settings.DECIMAL_INTEGRAL_DIGITS
def ask_decimal_fraction_digits() -> int:
r... | 20.388889 | 48 | 0.828338 |
9742389bc97a3fe1fd10f983cf2d7cfd9881ffc0 | 157 | py | Python | pages/themes/beginners/variousFormatsHandling/examples/CSV/parse_csv.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/variousFormatsHandling/examples/CSV/parse_csv.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/variousFormatsHandling/examples/CSV/parse_csv.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | import csv
with open('sample_data.csv') as f:
f_csv = csv.reader(f)
headers = next(f_csv)
for row in sorted(f_csv, key=lambda a:a[0]):
print(row) | 26.166667 | 46 | 0.66242 |
c1ab769671fe0b3498c7228689f5b232ac2d42bd | 6,572 | py | Python | libs/sql.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | null | null | null | libs/sql.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | 2 | 2019-10-15T19:07:33.000Z | 2019-10-30T14:05:10.000Z | libs/sql.py | tschitschable/surelock | a93c7e9eae73d9534edc23d86ccca888f8435c46 | [
"MIT"
] | 1 | 2019-10-14T16:28:07.000Z | 2019-10-14T16:28:07.000Z | #!/usr/bin/env python3
import sqlite3
from libs import crypto_funcs
from libs import common
db_name = "surelock.db"
class Database:
def __init__(self, filename=db_name):
self.filename = filename
self.conn = sqlite3.connect(self.filename)
self.c = self.conn.cursor()
def run_cmd(self, c... | 41.333333 | 185 | 0.67042 |
a9d1303df73f32cad330e9f031d6a6b64dad00ab | 6,699 | py | Python | agents/hgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | agents/hgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | agents/hgn.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from modules.hgn import HGNNetwork
from utils.numba_utils import *
from utils.torch_utils import *
from utils.hparams import hparams
from copy import deepcopy
class HGNAgent(nn.Module):
def __init__(self, in_dims, act_dims):
... | 44.66 | 120 | 0.605165 |
a9e924a2e07e88cd3f6026032e750dbeecf5a8c9 | 2,094 | py | Python | doc/fb_memoir/python/title.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/title.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/title.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | #!/usr/bin/env python3
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
# Approx 10 kHz
w = 66e3
deltaW = 33e3
T = 2 * np.pi / w
T_lo = 2 * np.pi / (w - deltaW)
T_hi = 2 * np.pi / (w + deltaW)
A1 = 5
A2 = 30
x = sp.Symbol('x')
fsk_mod_lo = A1 * sp.sin(w * x)
fsk_mod_hi = A2 * s... | 29.492958 | 69 | 0.657116 |
e73686e0371184597dc17d55454de31951fb3fca | 3,229 | py | Python | Python/pyBitwiseAutomation/PelaDevice.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | null | null | null | Python/pyBitwiseAutomation/PelaDevice.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | null | null | null | Python/pyBitwiseAutomation/PelaDevice.py | jimwaschura/Automation | f655feeea74ff22ebe44d8b68374ba6983748f60 | [
"BSL-1.0"
] | 1 | 2020-08-16T00:11:55.000Z | 2020-08-16T00:11:55.000Z | # PelaDevice.py
# ================================================================================
# BOOST SOFTWARE LICENSE
#
# Copyright 2020 BitWise Laboratories Inc.
# Original Author.......Jim Waschura
# Contact...............info@bitwiselabs.com
#
# Permission is hereby granted, free of charge, to any person or or... | 39.378049 | 82 | 0.643233 |
e754817f44b801a5d0e1616318e36fb254a948d0 | 242 | py | Python | generator/generator/__main__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 29 | 2017-06-21T19:29:07.000Z | 2022-02-17T12:26:24.000Z | generator/generator/__main__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 34 | 2017-06-26T14:31:02.000Z | 2022-02-03T16:40:41.000Z | generator/generator/__main__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 22 | 2017-06-29T11:08:42.000Z | 2022-02-03T16:16:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Entry Point for Command-Line Invocation."""
import sys
from generator.control import Control
def main():
"""Main."""
Control().run()
if __name__ == '__main__':
sys.exit(main())
| 16.133333 | 46 | 0.623967 |
8201aefffab8c5f8bc197dbad38ffc7c1cfe3119 | 112 | py | Python | Online-Judges/CodingBat/Python/List-01/12-has23.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/List-01/12-has23.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/List-01/12-has23.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def has23(nums):
for num in nums:
if num == 2 or num == 3:
return True
return False
| 18.666667 | 32 | 0.508929 |
00fc49c2726020cb357bc670d8a9c282104e8002 | 300 | py | Python | python/generator_tricks_for_systemprogrammer/genlog.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genlog.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genlog.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # genlog.py
#
# Sum up the bytes transferred in an Apache server log using
# generator expressions
with open("access-log") as wwwlog:
bytecolumn = (line.rsplit(None, 1)[1] for line in wwwlog)
bytes_sent = (int(x) for x in bytecolumn if x != "-")
print("Total", sum(bytes_sent))
| 30 | 62 | 0.66 |
5cfa99b98ffa224c06978829a337d0de0ce6eaff | 313 | py | Python | Curso-Em-Video-Python/2Exercicios/ex109/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex109/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/ex109/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import moedas
p = float(input('Digite o preço: R$ '))
print(f'A metade de {moedas.moeda(p)} é {moedas.metade(p, False)}')
print(f'O dobro de {moedas.moeda(p)} é {moedas.dobro(p, False)}')
print(f'Aumentando 10%, temos {moedas.aumentar(p, 10, True)}')
print(f'Reduzindo 13%, temos {moedas.reduzir(p, 13, True)}')
| 39.125 | 67 | 0.677316 |
41f5c60cbad25894328dbcc6712e89e3c4e6be17 | 6,433 | py | Python | Packs/Synapse/Integrations/Synapse/Synapse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Synapse/Integrations/Synapse/Synapse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Synapse/Integrations/Synapse/Synapse_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def util_load_bytes(path):
with io.open(path, mode='r') as f:
return f.read()
def test_list_users(requests_mock):
"""
Tests synapse-list-users command fu... | 28.71875 | 98 | 0.664231 |
519a5279d0b5e3c5b7a0fb88bd452bbe7e21b970 | 8,133 | py | Python | experimental/BibTeX/BibTeXParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | experimental/BibTeX/BibTeXParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | experimental/BibTeX/BibTeXParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#######################################################################
#
# SYMBOLS SECTION - Can be edited. Changes will be preserved.
#
#######################################################################
from functools import partial
import os
import sys
try:
import regex as re
excep... | 35.056034 | 246 | 0.60273 |
cfa945edfa3260d20f7ed1f2cebd20600c0f6cba | 4,467 | py | Python | test/test_npu/test_kl_div_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_kl_div_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_kl_div_backward.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... | 37.225 | 78 | 0.613611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.