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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
12f14e7e23e0c774be58b843df31b56a41b40629 | 489 | py | Python | src/Themes/NeighborTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Themes/NeighborTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Themes/NeighborTheme.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | from .Theme import Theme
from src.Graph import Graph
class NeighborTheme(Theme):
def __init__(self):
super().__init__()
def prepare(self, graph, shapes):
pass
def determine_kind(self, graph : Graph, shapes, shape):
if graph.get_node(shape.id).has_edges():
if graph.ge... | 23.285714 | 59 | 0.584867 |
429de02f385c1bd324e3ef3820435d3518dd5c77 | 181 | py | Python | modules/fapi/api.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | 3 | 2018-02-11T11:34:30.000Z | 2020-05-06T12:11:03.000Z | modules/fapi/api.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | null | null | null | modules/fapi/api.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | null | null | null | from bottle import route, run, template
@route('/api/savedata')
def api_savedata():
return "savedata"
@route('/api/getdata')
def api_getdata():
return "false"
| 12.928571 | 39 | 0.646409 |
97dc4d6c0a3d791ea53c949493679262490de125 | 217 | py | Python | Contests/CCC/CCC '08 S1 - It's Cold Here!.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '08 S1 - It's Cold Here!.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '08 S1 - It's Cold Here!.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | import sys
input = sys.stdin.readline
cities = []
i = 0
while True:
a = input().split()
cities.append([int(a[1]), a[0]])
if a[0] == "Waterloo":
break
i += 1
cities.sort()
print(cities[0][1]) | 14.466667 | 36 | 0.548387 |
58b8ceebe0525fcaabe64f24f9e4b786d3a604e0 | 355 | py | Python | exercises/zh/exc_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/exc_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/exc_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("zh_core_web_sm")
text = "苹果公布了预购细节,泄露了即将到来的iPhone X的发布日期。"
# 处理文本
doc = ____
# 打印token及序号
for i, token in enumerate(doc):
print(i, token.text)
# 遍历实体
for ____ in ____.____:
# 打印实体文本和标签
print(____.____, ____.____)
# 获取"iPhone X"的跨度(span)
iphone_x = ____
# 打印span的文本
print... | 14.791667 | 41 | 0.695775 |
18d76011303c8bf334c1b9039a3332e57b649b6a | 853 | py | Python | benwaonline/back.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/back.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/back.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | import functools
from flask import session, redirect, url_for, request
class back(object):
"""To be used in views.
Use `anchor` decorator to mark a view as a possible point of return.
`url()` is the last saved url.
Use `redirect` to return to the last return point visited.
"""
cookie = 'back... | 25.848485 | 72 | 0.652989 |
830c631ac40455331fc14e883c17c10b03034dd8 | 16,209 | py | Python | Implementation_scripts/libopencm3/tests/gadget-zero/test_gadget0.py | Generic-SCA-CCA-Lattice-Schemes/Generic-SCA-CCA-Lattice-Schemes | d1cebd9d1addf098fd473bbce941004e51bc73f1 | [
"CC0-1.0"
] | 5 | 2020-08-28T04:44:22.000Z | 2021-09-16T18:33:56.000Z | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/libopencm3/tests/gadget-zero/test_gadget0.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | null | null | null | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/libopencm3/tests/gadget-zero/test_gadget0.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | 1 | 2021-07-10T10:06:02.000Z | 2021-07-10T10:06:02.000Z | import array
import datetime
import usb.core
import usb.util as uu
import sys
import unittest
VENDOR_ID=0xcafe
PRODUCT_ID=0xcafe
# you only need to worry about these if you are trying to explicitly test
# a single target. Normally, the test will autofind the attached target
#DUT_SERIAL = "stm32f429i-disco"
DUT_SERI... | 40.726131 | 125 | 0.654575 |
3696276f9fa748547c55861992638505b0fd4189 | 522 | py | Python | src/onegov/pay/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pay/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pay/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 onegov.core.upgrade import upgrade_task
from sqlalchemy import Column
from sqlalchemy import Text
@upgrade_task('Add remote_id field to payments')
def add_remote... | 30.705882 | 74 | 0.747126 |
3d40dc4175e9067e50d8d773b3f0dc2859f61b73 | 1,747 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/common/test_parsing.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/common/test_parsing.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/module_utils/network/common/test_parsing.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# (c) 2017 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible 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 option) any later ... | 37.170213 | 105 | 0.746422 |
e9e5a884a5f022ede77bc900880f91d99a978863 | 6,946 | py | Python | scratch/mockstreams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | scratch/mockstreams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | scratch/mockstreams.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""mockstreams.py - surrogate io-streams for testing server code.
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2020 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.... | 32.764151 | 85 | 0.557299 |
62b71fb63cf0a56436ae2bc09ab4c5906e91eb6d | 357 | py | Python | listings/chapter04/vectors.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | 2 | 2021-09-20T06:16:41.000Z | 2022-01-17T14:24:43.000Z | listings/chapter04/vectors.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | listings/chapter04/vectors.py | SaschaKersken/Daten-Prozessanalyse | 370f07a75b9465329deb3671adbfbef8483f76f6 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
plt.xlabel('x')
plt.ylabel('y')
plt.arrow(0, 0, 3, 3, head_width=0.1)
plt.arrow(0, 0, -3, 2, head_width=0.1)
plt.arrow(0, 0, -4, -1, head_width=0.1)
plt.text(3.1, 3.1, 'v1')
plt.text(-3.3, 2.2, 'v2')
plt.text(-4.3, -1.2, 'v3')
plt.grid()
plt.axis([-5, 5, -5, 5])
plt.axhline(linewidth=2)... | 22.3125 | 39 | 0.62465 |
c554d79a3068c97c5a200287b3191d578167ea10 | 352 | py | Python | python_connection_side.py | Apo-lo/Muehle_gegen_Horst | 7d5548266082ea0d10358122e0d8bc28abb49b64 | [
"MIT"
] | null | null | null | python_connection_side.py | Apo-lo/Muehle_gegen_Horst | 7d5548266082ea0d10358122e0d8bc28abb49b64 | [
"MIT"
] | null | null | null | python_connection_side.py | Apo-lo/Muehle_gegen_Horst | 7d5548266082ea0d10358122e0d8bc28abb49b64 | [
"MIT"
] | null | null | null | import socket
host = "127.0.0.1"
port = 25001
data = "place 0 true"
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to server and send data
sock.connect((host, port))
sock.sendall(data.encode("utf-8"))
data = sock.recv(1024).decode("utf-8")
print(data)
finally:
# clos... | 19.555556 | 56 | 0.659091 |
c57210b6926ffdc3d0068b65e97c93dcf6a5cbfa | 381 | py | Python | bots/DummyBot.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | 1 | 2021-01-20T18:33:01.000Z | 2021-01-20T18:33:01.000Z | bots/DummyBot.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | null | null | null | bots/DummyBot.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | 2 | 2019-09-04T08:27:14.000Z | 2019-09-06T20:32:30.000Z | import random
from . import BaseBot, CellState
class DummyBot(BaseBot):
name = "Dummy Bot"
def get_guess(self) -> int:
while True:
choice = random.randint(0, self.grid.width - 1)
if self.grid.at(choice, self.grid.height - 1) == CellState.empty:
print(f"Bot {se... | 25.4 | 77 | 0.580052 |
499522f3d73b10b8fc92a8e9ea02e2236fa7fc90 | 3,262 | py | Python | src/autograph/migrations/0001_initial.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | src/autograph/migrations/0001_initial.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | src/autograph/migrations/0001_initial.py | RobetSlovev39/AutoGraph | c8bdb358b95143ab0d8c6f7c475a6c21f7a76b95 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-25 21:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Schema',
fields=[
... | 47.970588 | 168 | 0.594114 |
65cc2be3d30dc6caa90cfda1a05374935dfd19fe | 4,767 | py | Python | src/Sephrasto/UI/DatenbankEditEinstellung.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-02-02T16:15:59.000Z | 2022-02-02T16:15:59.000Z | src/Sephrasto/UI/DatenbankEditEinstellung.py | Ilaris-Tools/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | 1 | 2022-01-14T11:04:19.000Z | 2022-01-14T11:04:19.000Z | src/Sephrasto/UI/DatenbankEditEinstellung.py | lukruh/Sephrasto | 8574a5b45da8ebfa5f69a775066fd3136da1c718 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DatenbankEditEinstellung.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 im... | 49.65625 | 360 | 0.706314 |
02a2c2f99ff242e76937c1375e57dcd53493ff16 | 10,924 | py | Python | extractTool/extractTool/getCSVInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | null | null | null | extractTool/extractTool/getCSVInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 47 | 2018-11-13T13:55:01.000Z | 2019-09-16T13:38:11.000Z | extractTool/extractTool/getCSVInfo.py | corneliazy/Geosoftware2 | 8604c79c58a61b84c602f16b5f1e74e30dfcbd0e | [
"MIT"
] | 4 | 2018-11-27T12:36:51.000Z | 2020-10-14T18:07:04.000Z | import click,json, sqlite3, pygeoj, csv
from osgeo import gdal, ogr, osr
import pandas as pd
import numpy as np
import extractTool
from scipy.spatial import ConvexHull
import dateparser
from pyproj import Proj, transform
#import sys
#import ogr2ogr
#ogr2ogr.BASEPATH = "/home/caro/Vorlagen/Geosoftware2/Metadatenextrakt... | 42.839216 | 141 | 0.493958 |
02ac9a27a13a5b616135c44e6df047d30b680126 | 1,762 | py | Python | headphonecom/headphonecom_compensation.py | Banbeucmas/AutoEq | b8549b2347a19e1f127e6395147ecd6fb225a8ce | [
"MIT"
] | 1 | 2020-07-17T03:48:21.000Z | 2020-07-17T03:48:21.000Z | headphonecom/headphonecom_compensation.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | headphonecom/headphonecom_compensation.py | hyshuma/AutoEq | 4c3ad3478d6b74fc794bd7d973b330d38da338b9 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import os
from glob import glob
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
from frequency_response import FrequencyResponse
def main():
fig, ax = plt.subplots()
diffs = []
# Calculate differences for all models
for file in glob(os.path... | 32.62963 | 97 | 0.679909 |
02e5cf7fe0b3e9ede5b09363a9704e7629b2454a | 1,225 | py | Python | tspdb/src/data/generateARMA.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 43 | 2019-12-10T00:05:51.000Z | 2022-03-31T21:21:20.000Z | tspdb/src/data/generateARMA.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 5 | 2021-05-09T01:12:31.000Z | 2022-03-29T17:34:15.000Z | tspdb/src/data/generateARMA.py | swipswaps/tspdb | 9c085cef7164c114bb0952519b9715dcfa072b34 | [
"Apache-2.0"
] | 14 | 2020-01-13T21:20:07.000Z | 2022-03-31T02:11:26.000Z | ######################################################
#
# Generate ARMA data
#
######################################################
import numpy as np
def generate(arLagsArray, maLagsArray, startingArray, timeSteps, noiseMean, noiseSD, tStart = 0):
p = len(arLagsArray)
q = len(maLagsArray)
prevPoints... | 29.878049 | 98 | 0.613061 |
b8b958d45f41d796a20ee391dc6c5d61374262f8 | 1,128 | py | Python | app/websocket_message.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/websocket_message.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/websocket_message.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
openbikebox websocket-client
Copyright (c) 2021, binary butterfly GmbH
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
"""
from .config import Config
from .system import system
class WebsocketMessage:
reply = None
def __init__(self, m... | 30.486486 | 109 | 0.62234 |
a7595913c31f44d9ff36696d2e655a6feb9b75ea | 128 | py | Python | Backtracking/Permutations.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Backtracking/Permutations.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Backtracking/Permutations.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
https://leetcode.com/problems/permutations/
Given a collection of distinct integers, return all possible permutations.
"""
| 21.333333 | 74 | 0.773438 |
a76f43d76ecd9b2aaef44f9c0e051042ee44134b | 586 | py | Python | Tests/test_mond.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Tests/test_mond.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | Tests/test_mond.py | fdienesch/Solar-System | 617096bcb525a19ee94ff86948b53bd8a65e4386 | [
"MIT"
] | null | null | null | from unittest import TestCase
from Objekte.mond import Mond
from Model.solarSysModel import SolarSunModel
from OpenGL.GLUT import *
__author__ = 'floriandienesch'
class TestMond(TestCase):
def setUp(self):
glutInit(sys.argv)
glutCreateWindow("Solarsystem v0.9")
self.mond = Mond()
... | 26.636364 | 93 | 0.686007 |
022c92504f696f60497ba5cc600e99336ff1917d | 790 | py | Python | Utils/py/ActionSelection/state.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ActionSelection/state.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/ActionSelection/state.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import math
from naoth import math2d as m2d
# represents the robots view on the situation
class State:
def __init__(self, x=1000, y=100):
self.pose = m2d.Pose2D()
self.pose.translation = m2d.Vector2(x, y)
self.pose.rotation = math.radians(0)
self.rotation_vel = 60 # degrees per ... | 29.259259 | 59 | 0.648101 |
5a1bf468e5992924ec181a27af9a5c4e719fcc39 | 3,556 | py | Python | partner_ngos/fund_management/doctype/budget_line/budget_line.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/fund_management/doctype/budget_line/budget_line.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | partner_ngos/fund_management/doctype/budget_line/budget_line.py | AkramMutaher/partner_ngos | 4a345fb6989ff5a21db7fca07aa4e5174dca8f59 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe import _, throw
from frappe.utils import add_days, cstr, date_diff, get_link_to_for... | 32.623853 | 111 | 0.748594 |
ce56caba69cfc805f8e766d0fd8b41db839aa0be | 17,815 | py | Python | python_version/cmUI.py | Hermethus/hernethus.github.io | d2577b71cedb8f60d4d9052f979f8a139d69536d | [
"Apache-2.0"
] | null | null | null | python_version/cmUI.py | Hermethus/hernethus.github.io | d2577b71cedb8f60d4d9052f979f8a139d69536d | [
"Apache-2.0"
] | null | null | null | python_version/cmUI.py | Hermethus/hernethus.github.io | d2577b71cedb8f60d4d9052f979f8a139d69536d | [
"Apache-2.0"
] | null | null | null | from ciphermamager import CipherManager
import hashlib
from tkinter import *
from tkinter import messagebox, filedialog
import pyperclip
class cmUI(Tk):
def __init__(self):
super().__init__()
self.resizable(width=False, height=False)
self.title("密码管理v1.1")
self.setupUI()
... | 41.238426 | 96 | 0.595678 |
cebde25824e3255107389e440016168cc354df6d | 1,019 | py | Python | webapp/dash_tutorial_plotly/basic_callbacks/state.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/dash_tutorial_plotly/basic_callbacks/state.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/dash_tutorial_plotly/basic_callbacks/state.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(
[
... | 29.114286 | 78 | 0.64475 |
ced80906b05f43b45104e9eac4f3c8d5bf66b613 | 2,001 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/doc_fragments/alicloud.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/doc_fragments/alicloud.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/doc_fragments/alicloud.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright: (c) 2017 Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Alicloud only documentation fragment
DOCUMENTATION = r'''
options:
ali... | 35.105263 | 95 | 0.735132 |
0c7dfaabd2ba8694e7cfbbef5120d9931d91960f | 219 | py | Python | backend/products/validators.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/products/validators.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/products/validators.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from products.models import Product
unique_product_title = UniqueValidator(queryset=Product.objects.all(), lookup="iexact")
| 31.285714 | 87 | 0.853881 |
0cd35d179f90c155940228304c32f1c763f9b3a0 | 1,402 | py | Python | research/cv/ntsnet/src/lr_generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/ntsnet/src/lr_generator.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/ntsnet/src/lr_generator.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... | 37.891892 | 87 | 0.664765 |
0b6c4e1d8aa93b0743fc829e60eb6050a5cedded | 2,135 | py | Python | packages/watchmen-data-kernel/test/watchmen_data_kernel_test/test_topic_table.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/test/watchmen_data_kernel_test/test_topic_table.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/test/watchmen_data_kernel_test/test_topic_table.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from unittest import TestCase
from watchmen_auth import PrincipalService
from watchmen_data_kernel.cache import CacheService
from watchmen_data_kernel.service.topic_structure_helper import create_topic_structure, drop_topic_structure, \
update_topic_structure
from watchmen_model.admin import Factor, FactorType, Topic... | 38.125 | 111 | 0.778923 |
e7f170759c49af4b665b91c469c887f34601d7f7 | 2,451 | py | Python | Webpage/utils/management/commands/init.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/utils/management/commands/init.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/utils/management/commands/init.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand
# from arbeitsstunden.models import *
from web.models import HeadPage, infoPage, frontHeader, standartPages
class Command(BaseCommand):
help = 'Creates the init Data'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
... | 37.707692 | 98 | 0.641779 |
d7e8c8632675de49b16e166f4623ba1684585fd6 | 18,100 | py | Python | deutschland/smard/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/smard/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/smard/api/default_api.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Bundesnetzagentur Strommarktdaten
Bundesnetzagentur Strommarktdaten # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from deutschland.smard.api_client import ApiClient, Endpoint as _Endpoin... | 45.137157 | 680 | 0.471436 |
0be6f0d2053f21b23e3aa646fe3967b753218da4 | 289 | py | Python | packages/watchmen-model/src/watchmen_model/gui/last_snapshot.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/gui/last_snapshot.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-model/src/watchmen_model/gui/last_snapshot.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from pydantic import BaseModel
from watchmen_model.common import DashboardId, LastVisit, UserBasedTuple
class LastSnapshot(UserBasedTuple, LastVisit, BaseModel):
language: str = None
lastDashboardId: DashboardId = None
adminDashboardId: DashboardId = None
favoritePin: bool = False
| 26.272727 | 72 | 0.816609 |
aca4b0f602222ac06d77437f23f2768496a50bce | 1,467 | py | Python | api/clean/get_set_speci.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/clean/get_set_speci.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | null | null | null | api/clean/get_set_speci.py | Latent-Lxx/dazhou-dw | 902b4b625cda4c9e4eb205017b8955b81f37a0b5 | [
"MIT"
] | 1 | 2022-02-11T04:44:37.000Z | 2022-02-11T04:44:37.000Z | # !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/7/20 下午5:11
# @Author : Latent
# @Email : latentsky@gmail.com
# @File : set_specification.py
# @Software: PyCharm
# @class : 获取所有的规格,然后对规格合并后形成集合
from db.mongo_db import Mongo
class Get_Set_Sepeci(object):
def __init__(self):
tables = Mongo().mo... | 27.166667 | 72 | 0.408998 |
96ca3fc8bf03ccd489406d8f998556c93531c837 | 2,662 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/simpla/_reporting.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/simpla/_reporting.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/simpla/_reporting.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2014-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.eclipse.org/legal/epl-2.... | 29.577778 | 77 | 0.650639 |
509e06e68ee104045d2354b105ca31f67f1db0ab | 414 | py | Python | exercises/fr/exc_03_16_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/exc_03_16_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/exc_03_16_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("fr_core_news_sm")
text = (
"Le groupe aéronautique Airbus construit des avions et des "
"hélicoptères vendus dans le monde entier. Le siège opérationnel du "
"groupe est situé en France à Toulouse dans la région Occitanie."
)
# Désactive le tagger et le parser
with ____.____... | 25.875 | 73 | 0.707729 |
50acaed13f496524d7a3113eb5571513f6cad0ec | 610 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_duplica.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_duplica.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_duplica.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por uma lista com números duplicados (2 vezes cada número).
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import duplica
class PainelDuplica(Pa... | 32.105263 | 97 | 0.644262 |
50ed8d04a738703549d91193899b488f6c9c3e3f | 359 | py | Python | elements/python/6/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/6/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/6/6/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def dedupe(a):
if len(a) == 0:
return 0
rd = 1
wr = 1
while rd < len(a):
if a[rd] != a[wr-1]:
a[wr] = a[rd]
wr += 1
rd += 1
return wr
def test():
a = [2,3,5,5,7,11,11,11,13]
n = dedupe(a)
assert a[:n] == [2,3,5,7,11,13]
print 'pass'
... | 15.608696 | 35 | 0.406685 |
ba06c620d8cdf37df8f6e1a1146279397bd840c1 | 3,459 | py | Python | Projekt/CNN-Ansatz/TEST2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Projekt/CNN-Ansatz/TEST2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | null | null | null | Projekt/CNN-Ansatz/TEST2.py | Griizz/ComputerVisionPraktikum | 30276eb0b039ea42728d7433c573414d2dfe1ec2 | [
"MIT"
] | 3 | 2019-11-17T01:33:07.000Z | 2020-03-26T10:13:39.000Z | import os
from keras.models import Sequential
from keras.layers import Dense, Conv2D, MaxPooling2D, Flatten
from keras.optimizers import SGD
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau, EarlyStopping
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import wandb
from wandb.keras imp... | 38.865169 | 107 | 0.696733 |
2ce1826b3b1a6c75aac1be79ab02727e445fadd9 | 1,375 | py | Python | internal/weights.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | 13 | 2020-04-10T17:34:49.000Z | 2022-02-13T04:04:30.000Z | internal/weights.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | 213 | 2020-04-10T04:15:00.000Z | 2022-01-20T19:18:55.000Z | internal/weights.py | cixel/sl-shadow-priest | 3159c79fb305a226aeddfa6b884734ddfc108ccd | [
"MIT"
] | 7 | 2020-10-08T07:22:08.000Z | 2021-07-08T21:09:33.000Z | """weight dict definitions"""
weights_sanctum_of_domination = {
'pw_ba_1': 0.000,
'pw_sa_1': 0.055,
'pw_na_1': 0.570,
'lm_ba_1': 0.000,
'lm_sa_1': 0.050,
'lm_na_1': 0.205,
'hm_ba_1': 0.000,
'hm_sa_1': 0.000,
'hm_na_1': 0.000,
'pw_ba_2': 0.020,
'pw_sa_2': 0.020,
'pw_na_2'... | 22.540984 | 44 | 0.594182 |
d774214153ece5adc56b12ff593d918fd39f157a | 92 | py | Python | 2015/01/measles-national-cases/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/01/measles-national-cases/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/01/measles-national-cases/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 = '13YTshKL3Difi1oIKL4cM9Cf_WouGgS_FL4rdGcWmAm8'
| 23 | 68 | 0.847826 |
0f167163ff0689b64ce3c0277bc552535ecb9f86 | 368 | py | Python | cs/lambda_cs/07_computer_architecture/ls8/ls8.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/lambda_cs/07_computer_architecture/ls8/ls8.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/07_computer_architecture/ls8/ls8.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """Computer Architecture :: Main LS-8 runtime script"""
import sys
from cpu import *
# Extract file to use from command line
try:
program_filepath = sys.argv[1]
except IndexError:
print("Please input valid filepath.")
sys.exit()
# Instantiate CPU instance
cpu = CPU()
# Load the program into memory and r... | 19.368421 | 55 | 0.720109 |
adc0da5a2de20b9cfdcc88ae2630e76780c63c9b | 5,744 | py | Python | shinrl/envs/cartpole/calc.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/envs/cartpole/calc.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/envs/cartpole/calc.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from typing import Tuple
import chex
import jax
import jax.numpy as jnp
from chex import Array
from .config import CartPoleConfig
@jax.jit
def to_discrete_act(config: CartPoleConfig, c_act: float) -> int:
"""Convert a continuous action to a discrete ac... | 33.011494 | 87 | 0.635097 |
70d4c27d0e07a286297e05297caadbbf99389707 | 793 | py | Python | Problems/Depth-First Search/easy/SubtreeAnotherTree/subtree_another_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Depth-First Search/easy/SubtreeAnotherTree/subtree_another_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/easy/SubtreeAnotherTree/subtree_another_tree.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import Optional
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def isSubtree(self, root: Optional[TreeNode], subRoot: Optional[TreeNode]) -> bool:
if not root:
... | 26.433333 | 92 | 0.664565 |
cbcdf1501f1bf3b7eb5d12ee8956fcf19192e046 | 1,685 | py | Python | AP5/get_results.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 6 | 2016-08-15T17:57:45.000Z | 2019-03-19T05:08:29.000Z | AP5/get_results.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 10 | 2016-04-11T10:20:34.000Z | 2016-08-09T21:47:48.000Z | AP5/get_results.py | TensorVision/MediSeg | 222fcab98d82f48f09304eda3cfbfe4d6ac825b7 | [
"MIT"
] | 7 | 2016-06-21T04:08:58.000Z | 2018-09-01T14:02:40.000Z | #!/usr/bin/env python
"""Get quality measures for a series of confuscation matrices."""
import tensorvision.analyze as tva
cms = [{0: {0: 37565942, 1: 1483281}, 1: {0: 809240, 1: 3149537}},
{0: {0: 37905696, 1: 1143527}, 1: {0: 645126, 1: 3313651}},
{0: {0: 38422970, 1: 626253}, 1: {0: 673707, 1: 32850... | 52.65625 | 66 | 0.54362 |
2ac86f935b8dc9358147832dd75471cda0d750a4 | 980 | py | Python | Algorithms/Sort_Algorithms/Bucket_Sort/Bucket_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/Bucket_Sort/Bucket_Sort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 60 | 2016-10-11T14:50:47.000Z | 2016-10-31T11:05:01.000Z | Algorithms/Sort_Algorithms/Bucket_Sort/Bucket_Sort.py | JEERU/DS-Algo-Handbook | 86a97d586a4ca8b17168c0a9f5a9f43f856eba58 | [
"MIT"
] | 87 | 2016-09-08T05:04:50.000Z | 2016-10-30T19:19:53.000Z | def insertionsort( aList ):
for i in range( 1, len( aList ) ):
tmp = aList[i]
k = i
while k > 0 and tmp < aList[k - 1]:
aList[k] = aList[k - 1]
k -= 1
aList[k] = tmp
def bucketsort( A ):
# get hash codes
code = hashing( A )
buckets = [list() for _ in range( code[1] )]
# di... | 20 | 46 | 0.514286 |
e211603f25587778ff697b84831aa2c4896874d5 | 1,439 | py | Python | erode.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | erode.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | erode.py | gray0018/Normal-integration-benchmark | 3f4fff86e659ae2a3588c0960ebb0af39e4a1e21 | [
"MIT"
] | null | null | null | import sys
import argparse
import numpy as np
import matplotlib.pyplot as plt
# command line parser
parser = argparse.ArgumentParser(description='Crop boundary to avoid artifacts')
parser.add_argument('obj_name', help='the name of the object')
parser.add_argument('--erode', type=int, default=1, help='how many times y... | 29.979167 | 92 | 0.629604 |
357892301a0b2db171ecc7415c30c6d649a48a95 | 33,338 | py | Python | Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/NetscoutArborSightline/Integrations/NetscoutArborSightline/NetscoutArborSightline.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from time import sleep
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from copy import deepcopy
import requests
import traceback
from typing import Dict, Tuple
from datetime import timezone
# Disable insecure warnings
requests.packages.u... | 42.46879 | 120 | 0.628082 |
359354cc31cb25184bb81a7d1da99be4ed8f4a87 | 714 | py | Python | Packs/Ransomware/Scripts/RansomwareDataEncryptionStatus/RansomwareDataEncryptionStatus.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Ransomware/Scripts/RansomwareDataEncryptionStatus/RansomwareDataEncryptionStatus.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Ransomware/Scripts/RansomwareDataEncryptionStatus/RansomwareDataEncryptionStatus.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
incident = demisto.incidents()
query = incident[0].get('CustomFields', {}).get('ransomwaredataencryptionstatus', "Pending Confirmation")
Color = 'green'
if query == "Encrypted":
color = 'red'
html = "<div style='color:r... | 28.56 | 105 | 0.668067 |
35bb0ca6184fb04174e57035d8b72fa813684d5f | 219 | py | Python | pacman-termux/test/pacman/tests/query007.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/query007.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/query007.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Query ownership of file in root"
sp = pmpkg("dummy")
sp.files = ["etc/config"]
self.addpkg2db("local", sp)
self.filesystem = ["config"]
self.args = "-Qo /config"
self.addrule("PACMAN_RETCODE=1")
| 18.25 | 52 | 0.689498 |
17de573493b1e9783ba83df66e0d3739657b2190 | 89 | py | Python | backend/apps/mapview/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 3 | 2020-03-27T20:39:31.000Z | 2020-03-31T20:24:55.000Z | backend/apps/mapview/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 21 | 2020-03-28T09:57:15.000Z | 2020-03-31T11:38:00.000Z | backend/apps/mapview/apps.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MapviewConfig(AppConfig):
name = 'mapview'
| 14.833333 | 33 | 0.752809 |
17ee6d9891fbf670ec801d6f147e785d49ba48ef | 282 | py | Python | nettests/server/main.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | nettests/server/main.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | nettests/server/main.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | import zmq
from twisted.internet import reactor
from handler import Handler
from server import Server
ctx = zmq.Context()
socket = ctx.socket(zmq.REP)
socket.bind('tcp://*:6666')
handler = Handler()
server = Server(socket).onReadable(handler).registerOn(reactor)
reactor.run()
| 17.625 | 63 | 0.758865 |
f4c89fb117109acc7a91e4f6e11f7fcaab41eb74 | 353 | py | Python | accounts/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | accounts/urls.py | JanakiRaman-2002/Arre-yaar | c0b44ca1f8884a09116241dcd0bf7cfcee3b785d | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import redirect
from django.urls import path
from . import views
from django.contrib.auth.views import LoginView,LogoutView
app_name = "accounts"
urlpatterns = [
path('signup/',views.signup,name = 'signup'),
path('userlogin/',views.userlogin,name = 'userlogin'),
path('logout/',Logout... | 29.416667 | 58 | 0.730878 |
872fa07d2ebdd55abe7e41cdc5b0e5aa49b123eb | 161 | py | Python | exercises/de/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"docs = list(nlp.pipe(TEXTS))" in __solution__
), "Verwendest du nlp.pipe in einer Liste?"
__msg__.good("Gute Arbeit!")
| 26.833333 | 54 | 0.614907 |
5e44f560502732f97e57d340d29c5802a56d4051 | 402,109 | py | Python | ardundzdf.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | ardundzdf.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | ardundzdf.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Python3-Kompatibilität:
from __future__ import absolute_import # sucht erst top-level statt im akt. Verz.
from __future__ import division # // -> int, / -> float
from __future__ import print_function # PYTHON2-Statement -> Funktion
from kodi_six import xbmc, xbmcaddon, xbmcplugin, xbmcg... | 41.855834 | 300 | 0.655176 |
0dabb4e7aa32d287de94fe6352a419c76e6da021 | 234 | py | Python | easyp2p/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/__init__.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018-2020 Niko Sandschneider
"""
easyp2p is an application for downloading and aggregating account statements
from several people-to-people (P2P) lending platforms.
"""
__version__ = '0.0.1'
| 23.4 | 76 | 0.726496 |
0dd2902a18f4f0e51becddaeea0b93c738ab7404 | 174 | py | Python | SequenceModel/settings.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | SequenceModel/settings.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | SequenceModel/settings.py | BhaveshJP25/RSNA | 48d85faf82651b1ae4fdcd829ce2d4978a858d3f | [
"MIT"
] | null | null | null | csv_root = r'/home/sean/Projects/RSNA_data/csv'
feature_path = r'/home/sean/Projects/RSNA_data/features'
final_output_path = r'/home/sean/Projects/RSNA_data/FinalSubmission'
| 43.5 | 68 | 0.810345 |
0df4103324725b8a5ae749e1071dd45abf16e55f | 4,713 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_calibrator.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/traci/_calibrator.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/traci/_calibrator.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-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.... | 40.62931 | 107 | 0.685975 |
10da073045cdba1de069cad3b4ecc219e6f571a3 | 583 | py | Python | src/nfz_module/controller/GPSController.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/controller/GPSController.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/controller/GPSController.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | from gps import *
import threading
import math
class GPSController(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.gpsd = GPS(mode=WATCH_ENABLE) #starting the stream of info
self.running = False
def run(self):
self.running = True
while self.running:
# grab EACH set of gpsd ... | 18.21875 | 65 | 0.728988 |
33c5b0438cb2127f1b2d6f6287b1a78afa31b247 | 5,097 | py | Python | hyperts/hyper_ts.py | oaksharks/HyperTS | cecb38f3ce3c8b0ff9ead82670447457f6de6c56 | [
"Apache-2.0"
] | null | null | null | hyperts/hyper_ts.py | oaksharks/HyperTS | cecb38f3ce3c8b0ff9ead82670447457f6de6c56 | [
"Apache-2.0"
] | 1 | 2021-12-08T02:08:58.000Z | 2021-12-08T02:08:58.000Z | hyperts/hyper_ts.py | newbei/HyperTS | cecb38f3ce3c8b0ff9ead82670447457f6de6c56 | [
"Apache-2.0"
] | 1 | 2021-12-07T01:32:44.000Z | 2021-12-07T01:32:44.000Z | # -*- coding:utf-8 -*-
"""
"""
import pickle
import numpy as np
from sklearn import metrics as sk_metrics
from hypernets.dispatchers.in_process_dispatcher import InProcessDispatcher
from hypernets.model.estimator import Estimator
from hypernets.model.hyper_model import HyperModel
from hypernets.utils imp... | 39.207692 | 153 | 0.655287 |
d57cb8d15b10cb1a27bac0f5aaf46bdc9a5cdea4 | 1,931 | py | Python | kts/cli/utils.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/cli/utils.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/cli/utils.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import os
import shutil
import pkg_resources
def find_root_dir():
i = 0
while os.path.realpath("../" * i) != "/":
if os.path.exists("../" * i + "kts_config.py"):
if i != 0:
return "../" * i
else:
return "./"
i += 1
return False
def... | 26.094595 | 101 | 0.56551 |
7fa8a27893be1ec2b3c24cb82315a641797ea5bc | 1,665 | py | Python | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/structural/test_bridge.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/structural/test_bridge.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_External-learning-resources/02-pyth/python-patterns-master/tests/structural/test_bridge.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | import unittest
from unittest.mock import patch
from patterns.structural.bridge import CircleShape, DrawingAPI1, DrawingAPI2
class BridgeTest(unittest.TestCase):
def test_bridge_shall_draw_with_concrete_api_implementation(cls):
ci1 = DrawingAPI1()
ci2 = DrawingAPI2()
with patch.object(ci1... | 38.72093 | 84 | 0.666066 |
63e88f98d4959b360848c1fd2ee4a32f2bd1c9ab | 718 | py | Python | wechat_xiaowei/exception.py | jiangyx3915/wechat-xiaowei | cc81264431f5f771e3eb3506260ea68ee882d1fe | [
"MIT"
] | 1 | 2020-07-13T16:08:48.000Z | 2020-07-13T16:08:48.000Z | wechat_xiaowei/exception.py | jiangyx3915/wechat-xiaowei | cc81264431f5f771e3eb3506260ea68ee882d1fe | [
"MIT"
] | null | null | null | wechat_xiaowei/exception.py | jiangyx3915/wechat-xiaowei | cc81264431f5f771e3eb3506260ea68ee882d1fe | [
"MIT"
] | null | null | null | class WeChatException(Exception):
DefaultMessage = '未知错误'
ErrorMessage = {
'-1': '系统繁忙,请稍后重试',
'0': '操作失败',
'1': '操作成功',
'10001': '图片上传失败,请重新上传',
'10002': '上传图片格式错误',
'20000': '微信响应签名错误',
'20001': '请求错误,请稍后重试',
'20002': '系统错误,请联系客服人员后重试', # 加密敏感信... | 28.72 | 63 | 0.51532 |
d60008e42d6138b061893ff15ab4fa63ac79efb4 | 1,539 | py | Python | sketches/maze01/maze.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/maze01/maze.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/maze01/maze.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Grid:
def __init__(self, row, col, gsize):
self.row = row
self.col = col
self.gsize = gsize
self.walls = {} # top, left, bottom, right
def connections(self):
my_list = []
for key, val in self.walls.items():
if val != None:
... | 33.456522 | 81 | 0.54256 |
c3a85150cb7c3cd31f3a595056cfa543e4aa911b | 7,755 | py | Python | analizador_sintactico.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | analizador_sintactico.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | analizador_sintactico.py | danielorozco14/proyecto-teo | 1b5c38acef77d2bb495a5acb2e223ba987495805 | [
"MIT"
] | null | null | null | import ply.yacc as yacc
from analizador_lexico import tokens
from analizador_lexico import analizador
# resultado del analisis
resultado_gramatica = []
precedence = (
('right', 'ASIGNAR'),
('left', 'SUMA', 'RESTA', 'MULT', 'DIV'),
('left', 'CHAR', 'INT', 'FLOAT'),
('right', 'UMINUS'),
('right', 'P... | 32.721519 | 132 | 0.546744 |
f61e70463229208ef894ce1360995b6f870be2a7 | 1,582 | py | Python | products/utils.py | silver-whale-enterprises-llc/amzproduzer | 25e63f64b0ef09241475c72af9a710dcb7d9e926 | [
"Apache-2.0"
] | 1 | 2019-07-22T14:03:11.000Z | 2019-07-22T14:03:11.000Z | products/utils.py | silver-whale-enterprises-llc/amzproduzer | 25e63f64b0ef09241475c72af9a710dcb7d9e926 | [
"Apache-2.0"
] | null | null | null | products/utils.py | silver-whale-enterprises-llc/amzproduzer | 25e63f64b0ef09241475c72af9a710dcb7d9e926 | [
"Apache-2.0"
] | null | null | null | import re
from decimal import Decimal
from products.models import InventoryUpload, Product
def find_price_col_index(obj: InventoryUpload, line: list) -> int:
try:
return int(obj.price_col)
except ValueError:
for index, value in enumerate(line):
if obj.price_col.strip().lower() == ... | 27.754386 | 100 | 0.639697 |
211cfd20f460a08c601436b1ba6074d5c9f44ef2 | 11,654 | py | Python | src/test/tests/databases/ProteinDataBank.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/ProteinDataBank.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/databases/ProteinDataBank.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: ProteinDataBank.py
#
# Tests: mesh - 3D points
# plots - Molecule
#
# Programmer: Brad Whitlock
# Date: Tue Mar 28 15:46:53 PST 2006
#
# Modifications:
# Jeremy Mer... | 31.928767 | 103 | 0.671014 |
2169260854863bc1914a38ba663fd80d07abf00a | 1,218 | py | Python | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/workstation/test_workstation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/workstation/test_workstation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/workstation/test_workstation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from erpnext.manufacturing.doctype.workstation.workstation import check_if_within_operating_hours, NotInWorkingHoursError, WorkstationHolidayErro... | 52.956522 | 146 | 0.786535 |
b493240f699a2e326ca253f6bb16fccf97b22f2e | 1,914 | py | Python | INBa/2014/Andreev_F_I/Andreev_8_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/Andreev_F_I/Andreev_8_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/Andreev_F_I/Andreev_8_2.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 8, вариант 2
# Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка.
# Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков,
# по которой бы игроки, отгадавши... | 29.90625 | 135 | 0.652038 |
b4c458b9615baff8789a709b852a0618992c9825 | 344 | py | Python | exercises/pt/solution_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Importe a classe Doc
from spacy.tokens import Doc
# Texto desejado: "Oh, realmente?!"
words = ["Oh", ",", "realmente", "?", "!"]
spaces = [False, True, False, False, False]
# Crie um Doc a partir das palavras words e espaçamento spaces
doc = Doc(nlp.vocab, words=words, spaces=... | 22.933333 | 62 | 0.68314 |
371f6b035c02b8dcd52bd86d695fd9d217297e40 | 747 | py | Python | utils/conditional_scope.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | 2 | 2018-01-10T03:12:09.000Z | 2018-02-20T14:40:28.000Z | utils/conditional_scope.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | null | null | null | utils/conditional_scope.py | oracleofnj/nmt-attention-tensorflow | 6907def51daf3b1b8f0a2b683f220494a7361a75 | [
"MIT"
] | null | null | null | """Conditional scope entry."""
import tensorflow as tf
# Shoutout to:
# https://stackoverflow.com/questions/41695893/tensorflow-conditionally-add-variable-scope
class empty_scope():
"""Scope that does nothing."""
def __init__(self):
"""Do nothing."""
pass
def __enter__(self):
""... | 23.34375 | 90 | 0.654618 |
25965e76b296c05f9e2807f144e0ac0f709f2a6e | 3,914 | py | Python | scripts/SPTK_matrix.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | scripts/SPTK_matrix.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | scripts/SPTK_matrix.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
Script to create grid(s), given input args.
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
import argparse
import sys
import logging
import pandas as pd
import gensim
import pkg_resources
from geol.geol_logger.geol_logger import logger
from geol.utils import utils
import re
import os
import numpy as... | 28.992593 | 169 | 0.514308 |
d334de4bddd9a3a7a15960729a4cada60fe304e9 | 2,156 | py | Python | huTools/obfuscation.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/obfuscation.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/obfuscation.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
hutools/obfuscation.py this contains code to hide data from your little sister.
THIS IS NOT INDUSTRIAL-STRENGTH CRYPTO - use OpenSSL abd friends if you need real crypto!
Created by Maximillian Dornseif on 2009-08-31.
Copyright (c) 2009 HUDORA. All rights reserved.
"""
from ... | 33.6875 | 105 | 0.608534 |
d34807293e09afa12c7980fcb16fc8ddcc75bfd1 | 28,225 | py | Python | mltrain-nips-2017/forough_arabshahi/notebooks/nnTreeMain.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | mltrain-nips-2017/forough_arabshahi/notebooks/nnTreeMain.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | mltrain-nips-2017/forough_arabshahi/notebooks/nnTreeMain.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import sys
# path to latex2sympy. Converts a latex equation to sympy format
sys.path.append('/Users/Forough/Documents/bitBucket/math-knowledge-base/Codes/latex2sympy')
import copy
import json
#from process_latex import process_sympy
from sympy import *
import re
import pprint
import mxnet as mx
import numpy as np
#fro... | 35.637626 | 149 | 0.632135 |
6cd274dcf0cec452211575d3e32f6cb65aa7739e | 2,181 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo_built_in.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo_built_in.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/intro/fib_with_memo_built_in.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import functools
import time
from functools import wraps
def fib_rec_orig(n):
if n <= 0:
raise ValueError("n must be >= 1")
if n == 1 or n == 2:
return 1
# rekursiver Abstieg
return fib_rec_orig... | 17.731707 | 67 | 0.618982 |
2c7a84f8e15dbb56888c4ed146e2d62c58a98802 | 176 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.3-exer.1-draw-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.3-exer.1-draw-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-007/pg-7.3-exer.1-draw-triangle.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | import turtle
def draw_triangle(side_length):
for i in range(3):
turtle.forward(side_length)
turtle.left(120)
draw_triangle(100)
turtle.exitonclick()
| 12.571429 | 35 | 0.6875 |
2c955c4eda2722ff3ad2bfd8e263b619030fa9e3 | 840 | py | Python | run_phypi.py | Phylex/PhyPiDAQ | d3fe281b79591a7d416031e9262e435a52c26516 | [
"BSD-2-Clause"
] | null | null | null | run_phypi.py | Phylex/PhyPiDAQ | d3fe281b79591a7d416031e9262e435a52c26516 | [
"BSD-2-Clause"
] | null | null | null | run_phypi.py | Phylex/PhyPiDAQ | d3fe281b79591a7d416031e9262e435a52c26516 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
''' script run_phypi.py to execute PhyPiDAQ
usage: run_phypi.py <config>.daq
'''
import sys
import argparse as ap
from phypidaq.runPhyPiDAQ import *
if __name__ == "__main__": # - - - - - - - - - - - - - - - - - - - -
parser = ap.ArgumentParser(description="runs Phy... | 35 | 91 | 0.652381 |
1aa1c4fd216e8c75ec667e35d73bd3e1927511c8 | 425 | py | Python | Algorithms/2_Implementation/35.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/35.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/35.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/extra-long-factorials/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'extraLongFactorials' function below.
#
# The function accepts INTEGER n as parameter.
#
def extraLongFactorials(n):
return 1 if(n==1) else n*extraLongFa... | 18.478261 | 69 | 0.731765 |
46c554e597635b998345a67dcf63c053145d4351 | 6,181 | py | Python | .venv/Lib/site-packages/dexpy/optimal.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/dexpy/optimal.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/dexpy/optimal.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | """Functions for creating an optimal design."""
import dexpy.design
import pandas as pd
import numpy as np
import math
import logging
from patsy import dmatrix, ModelDesc
from dexpy.model import make_model, ModelOrder
from dexpy.samplers import hit_and_run
def update(XtXi, new_point, old_point):
"""rank-2 update ... | 33.592391 | 103 | 0.588254 |
647cb8993a4610c924d7026accae2a693ccbfa0f | 5,115 | py | Python | bp-revok/python/lib/python2.7/site-packages/netlib/wsgi.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | null | null | null | bp-revok/python/lib/python2.7/site-packages/netlib/wsgi.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | null | null | null | bp-revok/python/lib/python2.7/site-packages/netlib/wsgi.py | fkolacek/FIT-VUT | bb6f7f6eb1fea1f13952e0ab463e5aa69a84084c | [
"Apache-2.0"
] | 3 | 2017-04-07T12:02:22.000Z | 2020-03-23T12:11:55.000Z | import cStringIO, urllib, time, traceback
import odict
class ClientConn:
def __init__(self, address):
self.address = address
class Request:
def __init__(self, client_conn, scheme, method, path, headers, content):
self.scheme, self.method, self.path = scheme, method, path
self.headers... | 36.021127 | 88 | 0.500489 |
64c20a3b5be51304df6b777505a1c7941a5dc813 | 6,583 | py | Python | Control_feedback.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | 1 | 2019-10-22T14:02:34.000Z | 2019-10-22T14:02:34.000Z | Control_feedback.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | null | null | null | Control_feedback.py | BogyMitutoyoCTL/Riesen-Tetris-3 | 349d7b6f12c2ddf0b66683c904406a5e8596228d | [
"MIT"
] | null | null | null | import pygame
class Controller:
def __init__(self):
self.running = True
self.joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]
for joystick in self.joysticks:
joystick.init()
self.listofpressedbuttons = []
self.listofreleasedbu... | 42.746753 | 98 | 0.497949 |
379409cece8080e6d2f4a8454ddb129b7bc64771 | 3,656 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/topic_schema/topic_schema.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/topic_schema/topic_schema.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/topic_schema/topic_schema.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Any, Dict, List
from watchmen_auth import PrincipalService
from watchmen_meta.common import ask_snowflake_generator
from watchmen_model.admin import is_raw_topic, Topic, TopicKind
from watchmen_utilities import ArrayHelper
from .aid_hierarchy import aid
from .date... | 34.168224 | 101 | 0.766685 |
ff1c5414dfdefe8644b7f8d479a827f8d02ac727 | 512 | py | Python | list/Node.py | EliHar/List-ADT | 78a576e1816f765877f24c4cdb0ff49e12e812a5 | [
"MIT"
] | 1 | 2020-11-27T12:32:51.000Z | 2020-11-27T12:32:51.000Z | list/Node.py | EliHar/List-ADT | 78a576e1816f765877f24c4cdb0ff49e12e812a5 | [
"MIT"
] | null | null | null | list/Node.py | EliHar/List-ADT | 78a576e1816f765877f24c4cdb0ff49e12e812a5 | [
"MIT"
] | null | null | null | __author__ = 'Elias Haroun'
class Node(object):
def __init__(self, data, next, previous):
self.data = data
self.next = next
self.previous = previous
def getData(self):
return self.data
def getNext(self):
return self.next
def getPrevious(self):
return ... | 18.285714 | 45 | 0.595703 |
208846b8e340009bc6448a922b86113f5314cce8 | 580 | py | Python | fence/blueprints/login/cilogon.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/blueprints/login/cilogon.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/blueprints/login/cilogon.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | import flask
from fence.blueprints.login.base import DefaultOAuth2Login, DefaultOAuth2Callback
CILOGON_IDP_NAME = "cilogon"
class CilogonLogin(DefaultOAuth2Login):
def __init__(self):
super(CilogonLogin, self).__init__(
idp_name=CILOGON_IDP_NAME, client=flask.current_app.cilogon_client
... | 26.363636 | 81 | 0.708621 |
454d93c5e45d78ca9ad241221b410ecce2d18fd9 | 2,781 | py | Python | Packs/Campaign/Scripts/GetSendEmailInstances/GetSendEmailInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/Campaign/Scripts/GetSendEmailInstances/GetSendEmailInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/Campaign/Scripts/GetSendEmailInstances/GetSendEmailInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def get_all_integrations_commands():
""" Send API request with demisto rest api, to get all integration instances configured in the demisto. """
integration_commands_res = demisto.internalHttpRequest('GET', '/settings/i... | 38.625 | 115 | 0.696512 |
ffbba41b59067f424bc6aa9fcaaad4272de580d9 | 9,319 | py | Python | SBTK_League_Helper/other_stuff.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/other_stuff.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | SBTK_League_Helper/other_stuff.py | juanchodepisa/sbtk | 7cba7748e75a02b491e551d6c1be9bd7987c5051 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
print ("\nThis is just an ad-hoc utility file. Only useful for the tutorial")
print ("Execute TUTORIAL.py instead.\n")
else:
import sys, __main__
FILENAME = __main__.__file__
if len(FILENAME) > 45:
f = "..." + FILENAME[-42:]
else:
f = FILENAME
v = s... | 30.454248 | 155 | 0.495332 |
442eea6f2695d6bed836ef87f2446da574f6d04f | 2,358 | py | Python | BluePrint/migrations/versions/1e3d077bd721_.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/migrations/versions/1e3d077bd721_.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | BluePrint/migrations/versions/1e3d077bd721_.py | CodeMath/jinrockets | 6bb26e9ca66ba951ab2d34bf1ffe79b2c605963f | [
"MIT"
] | null | null | null | """empty message
Revision ID: 1e3d077bd721
Revises: None
Create Date: 2014-09-27 19:49:43.224392
"""
# revision identifiers, used by Alembic.
revision = '1e3d077bd721'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | 39.966102 | 74 | 0.687871 |
447d1aa457dbac6583cc627de8a85dbf9baa5c32 | 727 | py | Python | Algorithms/2_Implementation/39.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/2_Implementation/39.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/2_Implementation/39.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/cut-the-sticks/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'cutTheSticks' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts INTEGER_ARRAY arr as parameter.
#
def cutTheSticks(ar... | 20.194444 | 62 | 0.650619 |
9295cec7c438a67c2cd932ad6e547be4071bc392 | 1,007 | py | Python | src/using_tips/decorator/decorator_demo1.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/decorator_demo1.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/decorator_demo1.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/python
# -*- coding: utf-8 -*-
"""
装饰器是一个很著名的设计模式,经常被用于有切面需求的场景,较为经典的有插入日志、性能测试、事务处理等。
装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量函数中与函数功能本身无关的雷同代码并继续重用。
概括的讲,装饰器的作用就是为已经存在的对象添加额外的功能
Python装饰器(decorator)在实现的时候,被装饰后的函数其实已经是另外一个函数了(函数名等函数属性会发生改变),为了不影响,Python的functools包中提供了一个叫wraps的decorator来消除这样的副作用。写一个decorator的时候,最... | 20.14 | 178 | 0.692155 |
2bd3e63409b6dcc72529be89091a2726a094354e | 300 | py | Python | exercises/fr/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/solution_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("fr_core_news_sm")
text = "Apple a été créée en 1976 par Steve Wozniak, Steve Jobs et Ron Wayne."
# Traite le texte
doc = nlp(text)
# Itère sur les entités prédites
for ent in doc.ents:
# Affiche le texte de l'entité et son label
print(ent.text, ent.label_)
| 21.428571 | 78 | 0.713333 |
a62aa6614955040e86e36b1af3844797c22b67b3 | 6,099 | py | Python | Packs/HostIo/Integrations/HostIo/HostIo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/HostIo/Integrations/HostIo/HostIo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/HostIo/Integrations/HostIo/HostIo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import List, Any
import urllib3
from CommonServerPython import *
from math import ceil
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
''' CLIENT CLASS '''
class Client(BaseClient):
def get_domain_data(self, domain: str) -> Dict[str, ... | 28.367442 | 95 | 0.601246 |
472329b4b69978a94ee2b6d475b52f0b5d519709 | 530 | py | Python | 2_Iterables/Strings/formatting.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 2_Iterables/Strings/formatting.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 2_Iterables/Strings/formatting.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | from datetime import datetime
my_template = "Hello my name is Felix, nice to meet you. Today is the 24.04.2020."
print(my_template)
print("----------altes Format----------")
# %s = String
# %d = Integer
# %e, %f = Float
# %r = Lists, etc.
# %x = Hexa
# %o = Octa
print("Hallo ich heiße %s %s" % ("Hans", "Meier"))
pri... | 23.043478 | 82 | 0.583019 |
5b6ca9acc1ab948ef9b25d5d846255d15befb425 | 1,905 | py | Python | libs/azuretextanalytics/AzureDataHandler.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/azuretextanalytics/AzureDataHandler.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | libs/azuretextanalytics/AzureDataHandler.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import uuid
class AzureDataHandler:
"""Handle azure data formats for of the service request and response."""
#
# Prepare Azure service request
#
def __init__(self, debug=False):
self.debug = debug
def create_document(self, text, id=None):
text_id = id if (id != None) else s... | 27.608696 | 97 | 0.52336 |
5b95453402ada76dfc72c33114e118ad0cdb7f63 | 1,868 | py | Python | Skripts/open_face_wrapper.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | Skripts/open_face_wrapper.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | Skripts/open_face_wrapper.py | galberding/Klassifikation_von_Erschoepfung | 33331762baf0a5ea2898004e63d9a98d26bb3070 | [
"Apache-2.0"
] | null | null | null | """Wrapper to execute the openFace commands with options and stores the output.
The wrapper is based on the commandline usage: https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments"""
import os
import subprocess as sp
# import environment_laptop as paths
# import environment_techfak as paths
import... | 39.744681 | 123 | 0.629015 |
f3b79add32bf3b3519a6a49f5aa3e886407538d2 | 634 | py | Python | docs/API/Users_Guide/scripts/Download_Files_Post.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 67 | 2016-06-09T14:11:51.000Z | 2022-03-16T07:54:44.000Z | docs/API/Users_Guide/scripts/Download_Files_Post.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 19 | 2016-06-21T15:51:11.000Z | 2021-06-07T09:22:20.000Z | docs/API/Users_Guide/scripts/Download_Files_Post.py | ZhenyuZ/gdc-docs | f024d5d4cd86dfa2c9e7d63850eee94d975b7948 | [
"Apache-2.0"
] | 32 | 2016-07-15T01:24:19.000Z | 2019-03-25T10:42:28.000Z | import requests
import json
import re
data_endpt = "https://api.gdc.cancer.gov/data"
ids = [
"b658d635-258a-4f6f-8377-767a43771fe4",
"3968213d-b293-4b3d-8033-5b5a0ca07b6c"
]
params = {"ids": ids}
response = requests.post(data_endpt,
data = json.dumps(params),
... | 24.384615 | 62 | 0.602524 |
345d70e49e3eea7d469b9ffcc6eaa6db80338aaa | 263 | py | Python | python/celery/usage/tasks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/celery/usage/tasks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/celery/usage/tasks.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import time
import random
from celery import Celery
app = Celery("tasks", broker="amqp://localhost", backend="rpc://")
@app.task
def add(x, y):
time.sleep(random.randrange(1, 6) / 10)
return x + y
@app.task
def tsum(results):
return sum(results)
| 15.470588 | 66 | 0.665399 |
1b522424b865fc9db3867c58abc3c0d93bfaf58d | 2,171 | py | Python | extension/fts/fts_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | extension/fts/fts_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | extension/fts/fts_config.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import os
# list all include directories
include_directories = [os.path.sep.join(x.split('/')) for x in ['extension/fts/include', 'third_party/snowball/libstemmer', 'third_party/snowball/runtime', 'third_party/snowball/src_c']]
# source files
source_files = [os.path.sep.join(x.split('/')) for x in ['extension/fts/fts-e... | 241.222222 | 1,788 | 0.823584 |
1b6d48a0f948aae9fae842c062db4cb7e62ea01c | 1,174 | py | Python | src/data_augment.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/data_augment.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/data_augment.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
import os
import argparse
def random_crop(image, crop_size=(224, 224)):
h, w, _ = image.shape
# (0 ~ 224)の間でtop, left
top = np.random.randint(0, h - crop_size[0])
left = np.random.randint(0, w - crop_size[1])
# bottom, rightを決める
bottom = top + crop_size[0]
right = left + c... | 30.894737 | 83 | 0.667802 |
9439b34985b28bfd1c06bb7c14fd21a43fce0a68 | 10,940 | py | Python | zencad/convert/svg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/convert/svg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/convert/svg.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import zencad.util
from zencad.geom.unify import _unify
from zencad.geom.operations import _restore_shapetype
from zencad.geom.face import _fix_face, _fill
from zencad.geom.boolops import _union
from zencad.geom.trans import mirrorO, mirrorX, mirrorY
import xml.etree.ElementTree as ET
import mat... | 27.35 | 83 | 0.489854 |
8498f8989ed00042ed9246a1300da77bc2915cb3 | 1,916 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_abstrato.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_abstrato.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_abstrato.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe que descreve o comportamento padrão de todo tipo de painel
from abc import ABC, abstractmethod
class PainelAbstrato(ABC):
def __init__(self, titulo):
self._titulo = titulo
def ... | 28.597015 | 101 | 0.504697 |
84a524c2fa91fbb6d398093e3a455b49f0de5671 | 2,274 | py | Python | CSVtoDatabase/csv2db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | CSVtoDatabase/csv2db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | CSVtoDatabase/csv2db.py | kkysen/Soft-Dev | b19881b1fcc9c7daefc817e6b975ff6bce545d81 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import csv
import os
import sqlite3
from collections import Iterable
class Database(object):
"""Database wrapper."""
def __init__(self, path, debug=False):
# type: (str) -> Database
self.path = path
self._db = sqlite3.connect(path)
self.c... | 30.72973 | 83 | 0.558047 |
b6d02a7ffe53914cd4402e9bb295664872f844e0 | 456 | py | Python | Python/Courses/PythonPractice/LearnPythonHardWay3/ex6.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | Python/Courses/PythonPractice/LearnPythonHardWay3/ex6.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | Python/Courses/PythonPractice/LearnPythonHardWay3/ex6.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | # Declare Variables Here
binary = "binary"
do_not = "don't"
hilarious = False
joke_evaluation = "Isn't that joke so funny?! %r"
# Print Strings Here
x = "There are %d types of people" % 10
y = "Those who know %s and those who %s." % (binary, do_not)
w = "This is the left side of "
e = "a string with a right side."
... | 19.826087 | 60 | 0.651316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.