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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
61e425e724c3118d91c8a982f8c34b491617b9c1 | 8,794 | py | Python | official_examples/Using_MoXing_to_Create_a_Iceberg_Images_Classification_Application/codes/data_format_conversion.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | official_examples/Using_MoXing_to_Create_a_Iceberg_Images_Classification_Application/codes/data_format_conversion.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | official_examples/Using_MoXing_to_Create_a_Iceberg_Images_Classification_Application/codes/data_format_conversion.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | import os
import numpy as np
import pandas as pd
import tensorflow as tf
import moxing.tensorflow as mox
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
slim = tf.contrib.slim
BASE_PATH = 's3://obs-testdata/iceberg/'
def get_image(df):
images = []
for i, row in df.iterrows():
... | 43.534653 | 100 | 0.656243 |
fed2b083998077f23d02ee5eb0f4c0d7401277ee | 1,024 | py | Python | python/postgresql/get_parts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/get_parts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/postgresql/get_parts.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import psycopg2
from config import config
def get_parts(vendor_id):
""" get parts provided by a vendor specified by the vendor_id """
conn = None
try:
# read database configuration
params = config()
# connect to the PostgreSQL database
conn = psycopg2.conn... | 29.257143 | 77 | 0.613281 |
3a0bde23285ba8aed9ea917c55b50b1706859194 | 5,631 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/traci/_polygon.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/_polygon.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/_polygon.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) 2011-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.... | 43.992188 | 124 | 0.656899 |
e9176f80a808c84490aaa16bc91617ae4b5a4430 | 776 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/encryption/mail_masker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/encryption/mail_masker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/encryption/mail_masker.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Any, Union
from watchmen_model.admin import FactorEncryptMethod
from .encryptor import Encryptor
class MailMasker(Encryptor):
def accept(self, method: Union[FactorEncryptMethod, str]) -> bool:
return method == FactorEncryptMethod.MASK_MAIL
def is_encrypted(self, value: Any) -> bool:
if valu... | 23.515152 | 67 | 0.706186 |
a374081d5b08b35b2e7722a498376e3ef1cb2177 | 3,815 | py | Python | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DeveloperTools/Integrations/CustomIndicatorDemo/CustomIndicatorDemo.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
import requests
import traceback
from typing import Dict
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
... | 29.122137 | 89 | 0.657929 |
6ed812f2a7826e89e4d49c9f11abb4ae2c883ce1 | 328 | py | Python | Uebung1/Uebung1_Aufgabe3_4.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung1/Uebung1_Aufgabe3_4.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung1/Uebung1_Aufgabe3_4.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | # p gesucht
K = float(input("Wie hoch ist das Endkapital?"))
K0 = float(input("Wie hoch ist das Startkapital?"))
n = float(input("Wieviele Perioden hast du angelegt?"))
# Berechnung:
# n-te-Wurzel(K/K0)- 1 = p
p = ((K/K0))**(1/n) - 1
p = round(p,2) #auf 2 Nachkommastellen runden.
print("Der Zinssatz beträgt ", ... | 21.866667 | 55 | 0.637195 |
9576957713d1a3e7ea38563dc7758e77f667a9a0 | 1,166 | py | Python | core/gaussianGrid.py | kklocker/EiT-WiFi-placer | c2c621baa06377d62567d7bd0c2f048f1e6c0859 | [
"MIT"
] | null | null | null | core/gaussianGrid.py | kklocker/EiT-WiFi-placer | c2c621baa06377d62567d7bd0c2f048f1e6c0859 | [
"MIT"
] | null | null | null | core/gaussianGrid.py | kklocker/EiT-WiFi-placer | c2c621baa06377d62567d7bd0c2f048f1e6c0859 | [
"MIT"
] | null | null | null | import numpy as np
from scipy import signal
def normalize(x, low, high):
x -= low
x = x * (high / max(x))
return x.astype(int)
def wall_filter(points, img):
"""
Filters away points that are inside walls. Works by checking where the refractive index is not 1.
"""
deletion_mask = img[point... | 25.911111 | 101 | 0.632075 |
06d0337171c99cf7a1e7bcbfc66a97c058f1961b | 18,184 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/build/checkStyle.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/build/checkStyle.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/build/checkStyle.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... | 46.865979 | 115 | 0.519468 |
66070a79ef0d31b32a92eecec69115f0f11dc7b2 | 10,421 | py | Python | research/cv/DBPN/src/model/base_network.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DBPN/src/model/base_network.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DBPN/src/model/base_network.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.324528 | 120 | 0.583821 |
66350cd165068d76ce112a9e36c326886611ddb9 | 1,162 | py | Python | Packs/PaloAltoNetworks_IoT/Scripts/iot_vuln_post_processing/iot_vuln_post_processing_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_vuln_post_processing/iot_vuln_post_processing_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_vuln_post_processing/iot_vuln_post_processing_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import iot_vuln_post_processing
from iot_vuln_post_processing import iot_resolve_vuln
_INCIDENT = {
'id': 28862,
'labels': [
{
'type': 'zb_ticketid',
'value': 'vuln-99124066'
},
{
'type': 'vulnerability_name',
... | 27.023256 | 89 | 0.660069 |
c688d19f46d09a19a095646cc7f01b978b6daaba | 348 | py | Python | turngen/turn.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/turn.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/turn.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null |
from dataclasses import dataclass
@dataclass
class Turn:
from_x: int # from 0 to 7
from_y: int # from 0 to 7
to_x: int # ""
to_y: int # ""
give_up: bool = False
def __repr__(self):
if self.give_up:
return "Gave Up!"
return chr(ord('a')+self.from_x) + str(self.from_y+1) + \
"-" + chr(ord('a')+self.t... | 19.333333 | 59 | 0.62069 |
af81ab7186523ea65ec2b0582e8480ac8fcc0815 | 3,933 | py | Python | Database.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | Database.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | Database.py | bhemsen/bigBrother | 260f927fdcf6b6d43ec79a7a7ea4ba61a44c5e6d | [
"MIT"
] | null | null | null | import mysql.connector
import time
from mysql.connector import Error
class Database:
#this parameters needs to be strings
def __init__(self, host, user, passwd, database):
self.host = host
self.user = user
self.passwd = passwd
self.database = database
self.db = ... | 31.214286 | 126 | 0.529875 |
bbc38decc3ef683f7d92b805fdc789753c11adfb | 4,081 | py | Python | src/onegov/chat/models/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/chat/models/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/chat/models/message.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import sedate
from onegov.core.orm import Base
from onegov.core.orm.abstract import associated
from onegov.core.orm.types import JSON, UTCDateTime
from onegov.file import File
from sqlalchemy import Column, Text
from sqlalchemy import event
from sqlalchemy.ext.hybrid import hybrid_property
from ulid import ulid
clas... | 33.45082 | 78 | 0.685126 |
599c8b38220c5c88651f4dcf82acfc288eac16e3 | 5,805 | py | Python | BoxCoder.py | Xeit666h05t/BoxCoder | cfcf64086f039a56016ef2b83847d4e671dd19c8 | [
"Apache-2.0"
] | 1 | 2018-02-22T10:00:06.000Z | 2018-02-22T10:00:06.000Z | BoxCoder.py | Xeit666h05t/BoxCoder | cfcf64086f039a56016ef2b83847d4e671dd19c8 | [
"Apache-2.0"
] | null | null | null | BoxCoder.py | Xeit666h05t/BoxCoder | cfcf64086f039a56016ef2b83847d4e671dd19c8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
# Xeit666h05t
# Author: Xeit666h05t
# Email:xeitcyber@gmail.com
# Team: CoiZter_Team
# Hargai CopyRight Ya Bila Ingin Di Hargai
#*/kalau mau di hargain Hargai Copyright Yang Bikin
import os
import base64
os.system("clear")
print """
Xeit666h05t
Tools Box Sederhana
... | 35.181818 | 109 | 0.553488 |
758d533c1341a1d85afa96bbd004c27dec1e92f3 | 5,102 | py | Python | ppyt/rules/exit_rules/basic_exit_rules.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/rules/exit_rules/basic_exit_rules.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/rules/exit_rules/basic_exit_rules.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
import logging
from ppyt import const
from ppyt.rules.exit_rules import ExitBase
from ppyt.indicators.basic_indicators import MovingAverageIndicator
logger = logging.getLogger(__name__)
class SimpleExit(ExitBase):
"""(conditionsを覗いて)条件なしで手仕舞うクラスです。"""
_findkey = '条件なし' # exit_ruleを一意に特定できる名前... | 28.988636 | 89 | 0.628969 |
f96de44c3d6c8f475765c492a836406084fc57d1 | 495 | py | Python | frappe-bench/apps/erpnext/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.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/restaurant/doctype/restaurant_reservation/restaurant_reservation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/restaurant/doctype/restaurant_reservation/restaurant_reservation.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from datetime import timedelta
from frappe.utils import get_datetime
class Res... | 33 | 87 | 0.80202 |
7b31817152e5154b65149e0cf52302da9a1f4d5f | 1,426 | py | Python | ui/remoteTerminal.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/remoteTerminal.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/remoteTerminal.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/remoteTerminal.ui',
# licensing of 'ui/remoteTerminal.ui' applies.
#
# Created: Tue May 28 17:08:36 2019
# by: pyside2-uic running on PySide2 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCor... | 38.540541 | 93 | 0.718093 |
7b6a70b76da1b719d1e175dd54afb49c9166b630 | 218 | py | Python | python/pathlib/origin/list_dirs_and_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pathlib/origin/list_dirs_and_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pathlib/origin/list_dirs_and_files.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from pathlib import Path
path = Path('C:/Users/imdff/Documents')
dirs = [e for e in path.iterdir() if e.is_dir()]
print(f'디렉터리 목록: {dirs}')
files = [e for e in path.iterdir() if e.is_file()]
print(f'파일 목록: {files}') | 24.222222 | 50 | 0.66055 |
7ba7846a3bad14ca426a3318bd326dfdf6657599 | 1,062 | py | Python | Packs/NetCalc/Scripts/IPCalcReturnSubnetBroadcastAddress/IPCalcReturnSubnetBroadcastAddress.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/NetCalc/Scripts/IPCalcReturnSubnetBroadcastAddress/IPCalcReturnSubnetBroadcastAddress.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/NetCalc/Scripts/IPCalcReturnSubnetBroadcastAddress/IPCalcReturnSubnetBroadcastAddress.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import ipaddress
import traceback
''' COMMAND FUNCTION '''
def return_subnet_broadcast_address_command(args: Dict[str, Any]) -> CommandResults:
subnet = args.get('subnet', None)
broadcast_address = format... | 23.6 | 104 | 0.719397 |
a5d5fc898bf49bdd22d2db50c5d1b8044334f400 | 1,132 | py | Python | Test/testprediction.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | Test/testprediction.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | 7 | 2020-07-19T03:29:21.000Z | 2022-03-02T06:46:12.000Z | Test/testprediction.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | import requests
from RestAPI import RestAPI
class Testp:
def __init__(self, view_id, arch_conf_id):
self.__host = 'http://localhost:5000/'
self.__auth = requests.auth.HTTPBasicAuth(username='super', password='mario')
self.__api = RestAPI(domain='http://localhost:5000', fallback_domain='h... | 31.444444 | 117 | 0.65106 |
938a8b820b9b56832a57c3ba7b287dc4504fdd46 | 9,205 | py | Python | scripts/signal_marker_processing/geom_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/signal_marker_processing/geom_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/signal_marker_processing/geom_utils.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Authors : Daniele Borio, Csaba WIRNHARDT
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import geopandas as gpd
import numpy as np
from sha... | 31.523973 | 89 | 0.609886 |
93d3c8e7f59bb48785d8955324ad933627bf44ea | 241 | py | Python | etl/transforms/primitives/row/convert_gender_to_int.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/transforms/primitives/row/convert_gender_to_int.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/transforms/primitives/row/convert_gender_to_int.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import etl.mappings.confidence as confidence
def convert_gender_to_int(entry, log):
value = entry[-1]
if value == "Female":
return [0, confidence.VALUE_TRANSFORMED]
else:
return [1, confidence.VALUE_TRANSFORMED]
| 26.777778 | 48 | 0.692946 |
19344f548be229868515498a66d3c4c958d82eed | 2,445 | py | Python | Extensions/Moderation.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Moderation.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | Extensions/Moderation.py | Drageast/Die_Botin | b574166a37c0f92c34db99931c8c894390fbead9 | [
"BSD-3-Clause"
] | null | null | null | # Import
from discord.ext import commands
import discord
import asyncio
# Utils
import Utils
# Cog Initialising
class Moderation(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@commands.is_owner()
async def supporttell(self, ctx, user: discord.Member, *... | 28.764706 | 158 | 0.547648 |
2780feb26ec34d3266568a7f85b147ad4864bd2d | 927 | py | Python | euler/16:Power_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | euler/16:Power_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | euler/16:Power_digit_sum.py | Alexdelia/Puzzle_Solving | 620e07508cd36dba7b806040c36360b87eb4637e | [
"CC0-1.0"
] | null | null | null | # **************************************************************************** #
# #
# ::: :::::::: #
# 16:Power_digit_sum.py :+: :+: :+: ... | 66.214286 | 80 | 0.144552 |
27de45478841a9871bdb62117d4f60202a188389 | 133 | py | Python | Python/Courses/PythonPractice/LearnPythonHardWay3/junk.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 1 | 2022-02-02T21:56:08.000Z | 2022-02-02T21:56:08.000Z | Python/Courses/PythonPractice/LearnPythonHardWay3/junk.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | 27 | 2020-06-27T23:25:59.000Z | 2022-02-27T20:40:56.000Z | Python/Courses/PythonPractice/LearnPythonHardWay3/junk.py | JamieBort/LearningDirectory | afca79c5f1333c079d0e96202ff44ca21b2ceb81 | [
"Info-ZIP"
] | null | null | null | #print 11 % 4
#shoe = "hello world"
#print shoe
while True:
for i in ["/","-","|","\\","|"]:
print("%s\r" % i, end=' ')
| 16.625 | 36 | 0.428571 |
8b5b4f89057a7db529d17db3b65774aab87d8054 | 3,240 | py | Python | web/controllers/api/Cart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 1 | 2020-03-24T04:26:34.000Z | 2020-03-24T04:26:34.000Z | web/controllers/api/Cart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | web/controllers/api/Cart.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from web.controllers.api import route_api
from flask import request,jsonify,g
from common.models.food.Food import Food
from common.models.member.MemberCart import MemberCart
from common.libs.member.CartService import CartService
from common.libs.Helper import select_filter_obj,get_dict_filter_f... | 32.727273 | 98 | 0.599074 |
8bb545c9ba7330308564adffec0bc8d49cce18a7 | 287 | py | Python | Curso-Em-Video-Python/1Materias/04_primeiros_comandos/#04 - Primeiros comandos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/1Materias/04_primeiros_comandos/#04 - Primeiros comandos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/1Materias/04_primeiros_comandos/#04 - Primeiros comandos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | '''nome = input ('Qual seu nome? ')
idade = int(input ('Qual sua idade: '))
peso = input ('Qual seu peso: ')
salario = float(input('Quantos ganha: '))
# print(nome, idade, peso)
print(f'{nome}, {idade * 20}, {peso}')
print(f'O {nome: ^20} tem {idade} anos e ganha R$ {salario:.2f}')'''
| 31.888889 | 68 | 0.606272 |
3ea6d80ebb83ec21cb878bc296ea111dd6baa5ae | 639 | py | Python | example_code/python/read_write_csv_pandas.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | 1 | 2021-08-21T17:08:39.000Z | 2021-08-21T17:08:39.000Z | example_code/python/read_write_csv_pandas.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | example_code/python/read_write_csv_pandas.py | NicoJG/PraktikumPhysikRepoVorlage | b29a4302958edc6205e2b107f7253f614cea0181 | [
"MIT"
] | null | null | null | # Mehrere Ergebnisse als CSV Datei abspeichern
# um diese z.B. in eine Tabelle umzuwandeln
# mit pandas ist es z.B. einfacher einen Spalte mit Strings zu haben
# wechsle die Working Directory zum Versuchsordner, damit das Python-Script von überall ausgeführt werden kann
import os,pathlib
project_path = pathlib.Path(__... | 26.625 | 110 | 0.740219 |
19fdeba0a54840714aaa39ffc1b2437ac2fae417 | 7,141 | py | Python | tests/test_api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | 2 | 2019-11-17T06:38:56.000Z | 2019-12-01T15:32:03.000Z | tests/test_api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | tests/test_api.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | from http import HTTPStatus
from unittest.mock import AsyncMock, MagicMock
from spangle.api import Api
from spangle.component import AnyComponentProtocol, use_api, use_component
from spangle.exceptions import NotFoundError
from spangle.handler_protocols import RequestHandlerProtocol
from spangle.models.http import Res... | 22.961415 | 85 | 0.659992 |
266f0a4b6e4e2a613df6b36394941468f58e9b22 | 4,255 | py | Python | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/compass.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/compass.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/compass.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | import lvgl as lv
# RESOURCES_ROOT = "S:/Users/liujuncheng/workspace/iot/esp32/solution/MicroPython/smart_panel/smart_panel/"
RESOURCES_ROOT = "S:/data/pyamp/"
compass_ttf_alive = False
def compass_back_click_callback(e, win):
global compass_ttf_alive
if (compass_ttf_alive):
from smart_panel import l... | 38.681818 | 107 | 0.671915 |
e4ef0a5ea73e86d42b3eecd3ed513f7de3084e65 | 1,005 | py | Python | STIX/forTime.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | null | null | null | STIX/forTime.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | 2 | 2020-06-24T13:01:22.000Z | 2020-06-24T13:10:07.000Z | STIX/forTime.py | EnjoyFitness92/Praxisseminar-SS2020 | b5baba5d1512a5fad3391efc42f3ab232d79c4e2 | [
"MIT"
] | null | null | null |
def getMon(mon):
try:
if 'Jan' in mon:
return '01'
elif 'Feb' in mon:
return '02'
elif 'Mar' in mon:
return '03'
elif 'Apr' in mon:
return '04'
elif 'May' in mon:
return '05'
elif 'Jun' in mon:
... | 22.840909 | 108 | 0.429851 |
f2fca9f5f72b7c1fc42bda3a65661dc700639a63 | 4,664 | py | Python | apps/facedetector/snippets.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | apps/facedetector/snippets.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | apps/facedetector/snippets.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import cv2
import numpy as np
import os.path
from urllib.request import urlretrieve
from threading import Thread
import random
def download_xml(url, filename):
if os.path.isfile(filename):
print("{} already present, to re-download it remove the file.".format(filename))
else:
print("{} not foun... | 38.545455 | 119 | 0.589623 |
84293df1931a0ba24146ec478a411419aa610aa2 | 209 | py | Python | src/tokenizer/character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | src/tokenizer/character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | src/tokenizer/character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | # -*- coding: utf-8 -*-
class CharacterTokenizer(object):
'''
Character Tokenizer
'''
def __init__(self):
self.vocab = []
def encode(self, sentence):
return list(sentence)
| 19 | 33 | 0.574163 |
ffdbd7cb1613c181cbea07f9f3c6551f37f727ad | 236 | py | Python | Sorting/src/recursive_sorting/notes/problem_solving.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | null | null | null | Sorting/src/recursive_sorting/notes/problem_solving.py | tobias-fyi/02_algorithms | ab1a8a07c3560ad66712992e3af906e8fd316fe2 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/02_algorithms/Sorting/src/recursive_sorting/notes/problem_solving.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | # Print factorial of n
def recursive_factorial(n: int):
print(n)
# Base case
if n <= 1:
return 1
# Recursive case
prev = n * recursive_factorial(n - 1)
return n * prev
print(recursive_factorial(5))
| 13.882353 | 41 | 0.605932 |
4bc6490ceb72dcb124605cd9b0c081b62d5e2f08 | 479 | pyde | Python | sketches/codingtrain_unicorn_rainbow/codingtrain_unicorn_rainbow.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/codingtrain_unicorn_rainbow/codingtrain_unicorn_rainbow.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/codingtrain_unicorn_rainbow/codingtrain_unicorn_rainbow.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from unicornrainbow import UnicornRainbow
from codingtrain import CodingTrain
def setup():
global unicorn, train
size(940, 360)
this.surface.setTitle("Coding Train Unicorn Rainbow")
unicorn = UnicornRainbow()
train = CodingTrain()
def draw():
global unicorn, train
background(64)
tr... | 21.772727 | 57 | 0.68476 |
d9b20ed909606322dae0ed4b88dd39306d486d88 | 384 | py | Python | ISTp/2013/IVANOV_S_E/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2013/IVANOV_S_E/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2013/IVANOV_S_E/task_2_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 6.
# Напишите программу, которая будет выводить на экран наиболее понравившееся вам высказывание, автором которого является Иисус Христос. Не забудьте о том, что автор должен быть упомянут на отдельной строке.
# Ivanov S. E.
# 19.09.2016
print("Предоставь мертвым погребать своих мертвецов.")
prin... | 34.909091 | 206 | 0.770833 |
76e458ec546c7c6e0d339d525e83ed6fb716ecd3 | 673 | py | Python | lintcode/239-[DUP]-Sliding-Window-Maximum/SlidingWindowMaximum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/239-[DUP]-Sliding-Window-Maximum/SlidingWindowMaximum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/239-[DUP]-Sliding-Window-Maximum/SlidingWindowMaximum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
if nums == []:
return []
dq = [(nums[0], 0)]
for i in range(1, k):
while dq != [] and nums[i] > dq[-1][0]:... | 28.041667 | 51 | 0.377415 |
6a7b0735fe1a3d7f2e1dbeb8c900bf9c87ab7779 | 1,344 | py | Python | src/ztc/myrotatingfilehandler.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/myrotatingfilehandler.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/myrotatingfilehandler.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env
"""
MyRotatingFileHandler - python logger file handler with file rotation and
ability to set owner/permissons on created file
Copyright (c) 2009 Cory Engebretson,
http://stackoverflow.com/users/3406/cory-engebretson
http://stackoverflow.com/questions/1407474/
"""
from logging import handlers
i... | 27.428571 | 76 | 0.630952 |
0a94b89649e00636218b1b381d7e22a659feb83e | 539 | py | Python | showcase1/com/aaron/pysnooper_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/pysnooper_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/pysnooper_example.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""
pysnooper example
reference https://github.com/cool-RR/pysnooper
"""
__author__="aaron.qiu"
import pysnooper
@pysnooper.snoop()
def number_to_bits(number):
if number:
bits = []
while number:
number, remainder = divmod(number, 2)
bits.insert(0, re... | 17.387097 | 49 | 0.589981 |
7c2989087370c978a52a2a836299f527a133d699 | 3,270 | py | Python | Ventilasjonskalkulator.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | Ventilasjonskalkulator.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | Ventilasjonskalkulator.py | Tordja/VVS-Kalkulator | eb83454998bdd8b42363ad45ad3346dfd0fc3e9d | [
"MIT"
] | null | null | null | import math
from decimal import *
class Duct:
def __init__(self, airflow):
try:
airflow = int(airflow)
except ValueError:
airflow = 0
self._airflow = airflow/3600
def flowsetter(self, newflow):
try:
newflow = int(newflow)
except ... | 24.222222 | 105 | 0.561468 |
7c9baf37b2f2aeff76d43e5df8c0c9de36807b92 | 364 | py | Python | src/utils/maFancy.py | JoseFilipeFerreira/StockManagement | 9d619e014d894f4a580abf7cda32431ddbe0783c | [
"MIT"
] | 1 | 2019-06-19T00:02:57.000Z | 2019-06-19T00:02:57.000Z | src/utils/maFancy.py | jtexeira/SO_1819 | 929ff2e87344f97cb1b604919d180438d97152c9 | [
"MIT"
] | null | null | null | src/utils/maFancy.py | jtexeira/SO_1819 | 929ff2e87344f97cb1b604919d180438d97152c9 | [
"MIT"
] | null | null | null | import sys
from string import ascii_lowercase
from random import randint, choice
def main():
n = 25000
if len(sys.argv) > 1:
n = int(sys.argv[1])
for i in range(n):
print("i {0} {1}".format(i, 0))
for i in range(n):
print("n {0} {1}".format(i, i*10))
for i in range(n):
... | 21.411765 | 42 | 0.541209 |
6b09704d3aa87844b350f1f86ed2c5b40bacc5aa | 9,858 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/scripts/inventory/nsot.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/scripts/inventory/nsot.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/scripts/inventory/nsot.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
nsot
====
Ansible Dynamic Inventory to pull hosts from NSoT, a flexible CMDB by Dropbox
Features
--------
* Define host groups in form of NSoT device attribute criteria
* All parameters defined by the spec as of 2015-09-05 are supported.
+ ``--list``: Returns JSON hash of host groups -... | 28.573913 | 79 | 0.587442 |
d4f88433ac92826b4bf9202022ddf44867dae886 | 438 | py | Python | musterloesungen/4.1/vergleichen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/4.1/vergleichen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/4.1/vergleichen.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 4.1
def vergleiche(x,y):
if x > y:
return 1
elif x == y:... | 24.333333 | 76 | 0.611872 |
ed587420891975041ce5e88c1fa0c40e919b8b75 | 9,171 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_zone_domain.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_zone_domain.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/memset_zone_domain.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Simon Weald <ansible@simonweald.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata... | 34.092937 | 127 | 0.666558 |
9c6110a53a92ebfe0907e30be7882e687eee621a | 10,860 | py | Python | functions.py | plishing/Agena2 | 56f2f48a3bda4ff3d011d70e630cf6793995a239 | [
"Beerware"
] | 2 | 2016-03-17T09:39:34.000Z | 2016-03-17T11:26:19.000Z | functions.py | plishing/Agena2 | 56f2f48a3bda4ff3d011d70e630cf6793995a239 | [
"Beerware"
] | null | null | null | functions.py | plishing/Agena2 | 56f2f48a3bda4ff3d011d70e630cf6793995a239 | [
"Beerware"
] | null | null | null | #!/usr/bin/python
#Functions file to call different sensors
from datetime import timedelta
import sys
import os
import subprocess
from time import *
import time
import threading
import picamera
import dhtreader
#BMP180 sensor. icaddr = i2c bus address, mode = resulution mode, qnh is air pressure at sealevel.
#Retur... | 28.578947 | 120 | 0.604236 |
1318bd95b2236f7d829b130899e3f4967204db26 | 291 | py | Python | python/python_new/Python 3/member.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_new/Python 3/member.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_new/Python 3/member.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | x=4
y=8
list=[1,2,3,4,5]
if( x in list ):
print("Line 1 - x is available in the given list")
else:
print("Line 1 - x is not available in the given list")
if( y not in list ):
print("Line 2 - y is not available in the given list")
else:
print("Line 2 - y is available in the given list")
| 24.25 | 55 | 0.659794 |
1343000f69b4d5d7cf5a4ca99b939ff08371d138 | 7,349 | py | Python | internal/spell_ids.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | internal/spell_ids.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | internal/spell_ids.py | Saeldur/sl-shadow-priest | a7b027506e52db8e7786ed9d67971adbba7389bd | [
"MIT"
] | null | null | null | """spell ids to be used in json result files"""
racials = {
"Human": 20598,
"Blood_Elf": 28730,
"Vulpera": 312411,
"Maghar_Orc": 274738,
"Undead": 5227,
"Void_Elf": 255669,
"Dark_Iron_Dwarf": 265221,
"Troll": 26297,
"Lightforged_Draenei": 255647,
"Orc": 33697,
"Kul_Tiran": 29... | 34.341121 | 69 | 0.722275 |
1348401e627e28b1fa9fce396eef50dab91ea391 | 3,390 | py | Python | markdown_generator/load-media.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | null | null | null | markdown_generator/load-media.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | null | null | null | markdown_generator/load-media.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | 1 | 2021-06-09T04:30:16.000Z | 2021-06-09T04:30:16.000Z | import json
import frontmatter
import os
import urllib.request
from urllib.parse import urlparse
import yaml
from pprint import pprint
dirs = [x[0].split("/")[-1] for x in os.walk("../content/media")]
dirs = [x for x in dirs if x != "media"]
dirs = sorted(dirs)
out = []
with open("media2.jsonl", "r") as f:
for li... | 27.786885 | 82 | 0.455752 |
6a07d257819ad39110e657e01a6317b3ed3d2ac3 | 1,397 | py | Python | DataStructure/U1/Lecture/topoSort-mit-push-und-pop.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | DataStructure/U1/Lecture/topoSort-mit-push-und-pop.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | DataStructure/U1/Lecture/topoSort-mit-push-und-pop.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | import intReader
def TopoSort():
print ("Topologischen Sortieren.")
# Einlesen
input = intReader.readInt()
n = next(input)
# Inititalisieren array:
Knotenliste = [None] + [ Knoten(i) for i in range(1,n+1) ]
# Einlesen Kanten
try:
while True:
e = Knotenliste[nex... | 23.677966 | 62 | 0.531854 |
16d3c63aaf82ef2348b6b2433f6a8e52772681d8 | 250 | py | Python | Group7-module1-Smart/Pythonjpeg.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Group7-module1-Smart/Pythonjpeg.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Group7-module1-Smart/Pythonjpeg.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null |
# python JPEG Resize
from PIL import Image
# Image.open() can also open other image types
img = Image.open("some_random_image.jpg")
# WIDTH and HEIGHT are integers
resized_img = img.resize((WIDTH, HEIGHT))
resized_img.save("resized_image.jpg")
| 17.857143 | 46 | 0.752 |
4c25ceb4f89b5ec40aeb48bda972ae9f9e775d81 | 12,629 | py | Python | NN/PyTorch/Auto/Layers.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | NN/PyTorch/Auto/Layers.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | NN/PyTorch/Auto/Layers.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import torch.nn.functional as F
from torch.autograd import Variable
from NN.Errors import *
from NN.PyTorch.Optimizers import *
# Abstract Layers
class Layer:
LayerTiming = Timing()
def __init__(self, shape):
"""
:param shape: shape[0] = units of previous layer
... | 32.548969 | 120 | 0.60076 |
e6e30b91ee15ec969f8143114e366e03494d7c3a | 1,490 | py | Python | python/advanced_sw/Scrawll/setup.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | setup.py | Jimut123/Scrawll | 1cbe1eb27c24c49cf6553c2d8da3caab6ac4eff4 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | setup.py | Jimut123/Scrawll | 1cbe1eb27c24c49cf6553c2d8da3caab6ac4eff4 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | from setuptools import setup
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
if __name__ == '__main__':
setup(
name = 'Scrawll',
version="0.01",
description = 'A Python based wallpaper collecting tool',
author = 'Jimut Bahan Pal',
... | 34.651163 | 93 | 0.530201 |
e6ea6b89158d65eb272a775a896a9ccd866bb526 | 213 | py | Python | 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves/1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves/1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1509-minimum-difference-between-largest-and-smallest-value-in-three-moves/1509-minimum-difference-between-largest-and-smallest-value-in-three-moves.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def minDifference(self, nums: List[int]) -> int:
if len(nums)<=4: return 0
nums.sort()
return min(nums[-1]-nums[3], nums[-2]-nums[2], nums[-3]-nums[1], nums[-4]-nums[0]) | 42.6 | 90 | 0.568075 |
fc1a9c93526801c255a222aaccb97147337dae33 | 199 | py | Python | python/python_new/Python 3/break.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_new/Python 3/break.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_new/Python 3/break.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #Print out 0,1,2,3,4
count=0
while True:
print(count)
count+=1
if count>=5:
break
#Print out only odd numbers 1,3,5,7,9
for x in range(10):
#Check if x is even
if x%2==0:
continue
print(x)
| 14.214286 | 37 | 0.653266 |
fca4dd2a2c48207bdaec0dd7e3efafdd667a4b47 | 303 | py | Python | HSCTF/2021/crypto/aptenodytes-forsteri/aptenodytes-forsteri.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | HSCTF/2021/crypto/aptenodytes-forsteri/aptenodytes-forsteri.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | HSCTF/2021/crypto/aptenodytes-forsteri/aptenodytes-forsteri.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | flag = open('flag.txt','r').read() #open the flag
assert flag[0:5]=="flag{" and flag[-1]=="}" #flag follows standard flag format
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
encoded = ""
for character in flag[5:-1]:
encoded+=letters[(letters.index(character)+18)%26] #encode each character
print(encoded)
| 37.875 | 78 | 0.706271 |
5dea73da71c69619394c13e1318702a1d63b132a | 4,149 | py | Python | src/doc/tutorials/tutorial_examples/aneurysm/aneurysm_part3.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/doc/tutorials/tutorial_examples/aneurysm/aneurysm_part3.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/doc/tutorials/tutorial_examples/aneurysm/aneurysm_part3.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #
# file: aneurysm_part3.py
# info: Corresponds to actions taken in
# https://visit-sphinx-github-user-manual.readthedocs.io/en/develop/tutorials/Aneurysm.html
#
OpenDatabase("aneurysm.visit")
AddPlot("Mesh", "Mesh")
MeshAtts = MeshAttributes()
MeshAtts.opaqueColor = (204, 255, 255, 255)
MeshAtts.opacity = 0.25
SetPlo... | 30.284672 | 91 | 0.783803 |
5df8f1e80147a001e7f23f174a2a6cf26e223ad7 | 3,752 | py | Python | research/nlp/gpt2/src/utils/CrossEntropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/nlp/gpt2/src/utils/CrossEntropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/nlp/gpt2/src/utils/CrossEntropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 45.204819 | 114 | 0.615139 |
f8e858f08eb153b7fb6066e364f94bb2111af191 | 1,751 | py | Python | Crawler/links/views.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/views.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | Crawler/links/views.py | KelvinMarques/CrawlerPagerank | fa855cf9ee878108c03828db49bbb9403c674a43 | [
"MIT"
] | null | null | null | from fnmatch import translate
from bs4 import BeautifulSoup
from django.core.validators import URLValidator
from django.http import request, response
from django.shortcuts import redirect, render
from links.forms import UrlForm
import requests
import re
from links.utils import Crawler
import networkx as nx
from .utils ... | 30.189655 | 89 | 0.62707 |
53f9e42a58d823e3d06b1fef0f3dfb2cc2dc4d3f | 13,348 | py | Python | wz/local/grade_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/local/grade_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/local/grade_config.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
local/grade_config.py
Last updated: 2021-03-29
Configuration for grade handling.
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You ma... | 34.05102 | 79 | 0.572595 |
ab0c4a8a483ba0f8f2b3e57e4017d91833f8fe6e | 504 | py | Python | 523/tuwulisu_523_hashmap_math.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 523/tuwulisu_523_hashmap_math.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 523/tuwulisu_523_hashmap_math.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | class Solution(object):
def checkSubarraySum(self, nums, k):
if k == 0:
return any(nums[i] == 0 and nums[i + 1] == 0 for i in xrange(len(nums) - 1))
mods, cum_sum_mod_k = {0: -1}, 0
for i, n in enumerate(nums):
cum_sum_mod_k = (cum_sum_mod_k + n) % k
if cu... | 38.769231 | 88 | 0.535714 |
ab5cbc29481d8144d014b76c647fbb59e9b38796 | 2,408 | py | Python | four_wins.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | 1 | 2021-01-20T18:33:01.000Z | 2021-01-20T18:33:01.000Z | four_wins.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | null | null | null | four_wins.py | jorgeparavicini/FourWins | 1c5e8a23b4464ef6b71d70c9ff040aa004b9ca83 | [
"MIT"
] | 2 | 2019-09-04T08:27:14.000Z | 2019-09-06T20:32:30.000Z | import argparse
import sys
from bots import bot_manager
from tournamentmasters.command_tournament_master import CommandTournamentMaster
try:
from PyQt5.QtWidgets import QApplication
from interface.mainwindow import MainWindow
except ImportError:
QApplication = None
MainWindow = None
print("Graphic... | 39.47541 | 114 | 0.657807 |
915a31d990de6f1928e489af9ff7be2471e1980b | 1,435 | py | Python | rnn/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | rnn/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | rnn/dataloader.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | from torch import tensor
from numpy.random import choice,shuffle
def pad_sequence(sequences,padding = 0):
lens = [len(seq) for seq in sequences]
result = []
max_l = max(lens)
for seq,l in zip(sequences,lens):
result.append(seq+[padding]*(max_l-l))
return result
class Data... | 28.7 | 64 | 0.501045 |
5308b4d59c74f71135e5bd9f397998890439bd48 | 1,547 | py | Python | tp2/source/Map.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/source/Map.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp2/source/Map.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
Trabalho Pratico 2: Inteligência Artificial
Autor: Hugo Araujo de Sousa (2013007463)
Map.py: Pac-Maze 2D map with blocked, pill and ghost cells.
'''
import numpy as np
class Map():
def __init__(self, input_file):
'''
Initialize a map.
@input_file: (s... | 21.191781 | 79 | 0.532644 |
72b365e2cf3845b92f6d2c873431cab6c50215b0 | 3,030 | py | Python | research/cv/FaceRecognition/src/dataset_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/FaceRecognition/src/dataset_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/FaceRecognition/src/dataset_factory.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 45.909091 | 105 | 0.686139 |
f45908eed88e462bcad5f2f6db837e180fd98a49 | 518 | py | Python | doubanAPI.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | doubanAPI.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | doubanAPI.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
import httplib2
import json
class DoubanAPI():
def defaultAPI(self, url):
client = httplib2.Http()
response, content = client.request(url)
result = bytes.decode(content)
print('result:[{}]'.format(result))
return result
de... | 17.266667 | 62 | 0.586873 |
228daaab963baa9bbf9f69677544329ccc1d58f7 | 2,151 | py | Python | EN_solutions/QA_System/QA-search-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | EN_solutions/QA_System/QA-search-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | EN_solutions/QA_System/QA-search-server/src/pg_operating.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | import os
import time
import psycopg2
import numpy as np
import sys
def connect_postgres_server(PG_HOST, PG_PORT, PG_USER, PG_PASSWORD, PG_DATABASE):
try:
conn = psycopg2.connect(host=PG_HOST, port=PG_PORT, user=PG_USER, password=PG_PASSWORD, database=PG_DATABASE)
return conn
except:
... | 27.227848 | 117 | 0.589028 |
22a8d7241b1c787350cd0bb8ca958fca8c85bdcd | 1,929 | py | Python | kts/modelling/stacking.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/modelling/stacking.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/modelling/stacking.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from warnings import warn
import kts.stl.misc
from kts.validation.leaderboard import leaderboard as lb
from kts.validation.split import Refiner
from kts.validation.validator import Validator
def assert_splitters(exps):
"""
Args:
exps:
Returns:
"""
all_splitters = set()
for exp in ex... | 24.730769 | 104 | 0.63297 |
4a286abb08c68661cddf4eaedd2297becbadcc70 | 498 | py | Python | dcapy/console/console.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/console/console.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/console/console.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | from rich.console import Console
from rich.layout import Layout
from rich.panel import Panel
console = Console()
def schedule_layout():
layout = Layout()
layout.split_column(
Layout(name='header',size=3),
Layout(name='body'),
Layout(name='footer',size=3)
)
layout['bod... | 21.652174 | 43 | 0.624498 |
e805240a684c2ec18dd990b73f592ee3578c6dda | 700 | py | Python | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/memory_card_exposed1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/memory_card_exposed1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/FUND_OF_COMP_RICE/FUND_OF_COMPUTING_RICE2/week1/memory_card_exposed1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # simple state example for Memory
import simplegui
# define event handlers
def new_game():
global state
state = 0
def buttonclick():
global state
if state == 0:
state = 1
elif state == 1:
state = 2
else:
state = 1
def draw(canvas):
... | 20.588235 | 73 | 0.641429 |
e82b38797d3a89b040d8f42d9b2d800f24477612 | 780 | py | Python | kiosk/admin.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | kiosk/admin.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | kiosk/admin.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Produktpalette, Kioskkapazitaet, ProduktVerkaufspreise, Produktkommentar, Kontakt_Nachricht, Start_News
from .models import Einkaufsliste, ZumEinkaufVorgemerkt, Kiosk, Gekauft, Kontostand, EinkaufslisteGroups, GeldTransaktionen
# Register your models here.
admin.sit... | 43.333333 | 123 | 0.860256 |
e835151a7b3eeb7438e1e14a54b642f648e3d22b | 797 | py | Python | gemtown/advertisings/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/advertisings/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/advertisings/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
@admin.register(models.Advertising)
class AdvertisingAdmin(admin.ModelAdmin):
fields = [
'image',
'link',
'advertising_type',
'priority',
'activate',
'creator',
]
list_display = [
'id',
'... | 16.957447 | 41 | 0.468005 |
1c1d4a8633a9e5a863a35e81dcba0c8d41eda9c6 | 3,416 | py | Python | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/attack/inversion/gan_attack.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | import copy
import torch
from ..base_attack import BaseAttacker
class GAN_Attack(BaseAttacker):
"""GAN based model inversion attack (https://arxiv.org/abs/1702.07464)
Attributes:
model (torch.nn.Module):
target_label(int): index of target class
generator (torch.nn.Module): Generator... | 31.925234 | 99 | 0.60041 |
1c37d8ccc994b2bd1d945e8270c804c1e0702049 | 182 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C14Databases/questions/14.6-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 14.6 Entity-Relationship Diagram
# Draw an entity-relationship diagram for database with companies, people, and professionals.
# professionals = people who work for companies
| 36.4 | 93 | 0.785714 |
1c43c29935b123c3b372d55287a8e6ceb0dc1d18 | 1,596 | py | Python | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | import os
from flask_sqlalchemy import sqlalchemy
class TestDB:
def __init__(self):
self.db_name = os.environ['DATABASE_NAME'] + '_test'
self.db_host = os.environ['DB_HOST']
self.db_root_password = os.environ['POSTGRES_ROOT_PASSWORD']
if self.db_root_password:
self.db_us... | 38.926829 | 154 | 0.624687 |
40b18a21be7eea6accb0ba9927da2aa2fdcfa775 | 198 | py | Python | Chapter2_Python/Main.py | franneck94/UdemyAI | bb3decc35ec626a09edf0abdbfbe7c36dac6179a | [
"MIT"
] | 2 | 2021-02-10T19:50:27.000Z | 2021-12-30T06:15:55.000Z | Chapter3_Libraries/Main.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 1 | 2020-12-21T15:29:20.000Z | 2022-01-15T12:06:09.000Z | Chapter3_Libraries/Main.py | franneck94/UdemyPythonIntro | 4895a91a04eedce7d59b61bf12e5aa209fe60f85 | [
"MIT"
] | 4 | 2020-11-08T17:07:53.000Z | 2022-02-07T06:40:55.000Z | from MyModule import list_max
from MyModule import list_min
list1 = [-2, 1, 2, -10, 22, -10]
list_max(list1)
list_min(list1)
list2 = [-20, 123, 112, -10, 22, -120]
list_max(list2)
list_min(list2)
| 18 | 38 | 0.69697 |
40e188a63d28fd600b8cc5b4f0e457a6a774b226 | 1,841 | py | Python | documentation_src/doc_examples/parse_json_python.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | documentation_src/doc_examples/parse_json_python.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | documentation_src/doc_examples/parse_json_python.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""JSON-parser-example from the DHParser-manual"""
import sys, re
from DHParser.parse import Grammar, Forward, Whitespace, Drop, NegativeLookahead, \
ZeroOrMore, RegExp, Option, TKN, DTKN, Text
_element = Forward().name('_element', disposable=True)
_dwsp = Drop(Whitespace(r'\s*'))
_EOF = N... | 40.021739 | 100 | 0.604563 |
906ae8c8d011646b39d826e2c228628630be57fe | 2,202 | py | Python | scripts/qt1/pyqt_sw06_creator.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw06_creator.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | scripts/qt1/pyqt_sw06_creator.py | ProfJust/Ruhr-TurtleBot-Competition-RTC- | 5c2425bee331b4d5033757a9425676932d111775 | [
"Unlicense",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_sw06_qtcreator.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... | 40.036364 | 93 | 0.710718 |
90936bc02edcb25ed5a0e42ceac768201855cf66 | 1,228 | py | Python | official/cv/nima/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/nima/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/nima/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.933333 | 112 | 0.710912 |
463ccc953c19dde0144cff5c684ce4dca0821c7d | 3,320 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_ipv6security_raguard.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_ipv6security_raguard.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/netvisor/test_pn_ipv6security_raguard.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat.mock import patch
from ansible_coll... | 44.864865 | 149 | 0.674096 |
314955190212e3fbb12df76a955f8135f8d032aa | 115 | py | Python | doc/for_dev/cython_bugs/ctypedef_buffer/pure_ctype_memview.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/for_dev/cython_bugs/ctypedef_buffer/pure_ctype_memview.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/for_dev/cython_bugs/ctypedef_buffer/pure_ctype_memview.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z |
def mysum(arr):
ret = arr.dtype.type(0)
for i in range(arr.shape[0]):
ret += arr[i]
return ret | 19.166667 | 33 | 0.547826 |
31d24ca8e9e0a28355d9e21233b27b00dd09c9e6 | 19,100 | py | Python | Packs/X509Certificate/Scripts/CertificateExtract/CertificateExtract.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/X509Certificate/Scripts/CertificateExtract/CertificateExtract.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/X509Certificate/Scripts/CertificateExtract/CertificateExtract.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa # pylint: disable=unused-wildcard-import
from cryptography.hazmat import backends
from cryptography.hazmat.primitives import (
hashes,
asymmetric,
ser... | 39.381443 | 122 | 0.695183 |
b4158edb8cfa35c2f23a508eaa8354f0b1caa189 | 5,018 | py | Python | lda_model.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | lda_model.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | lda_model.py | Artemis-ii/LDA | 496e43f875ef35084cfb8539ee8bfe4e4fe68fb7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 16:29:00 2019
@author: Yoi
"""
import numpy as np
import lda
import lda.datasets
import jieba
import codecs
from text_parse import TEXT_parse
from cart_text_jieba import CART_text_jieba
class LDA_model():
def __init__(self, topics=2):
self.n_topic = topics
... | 32.584416 | 131 | 0.610602 |
6f12e58ffb8c2f7e915a3b1db0e8da94c7470487 | 1,431 | py | Python | test/test_tag07.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag07.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag07.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from io import StringIO
try:
from pyventskalender import tag07_loesung as heute
except ImportError:
from pyventskalender import tag07 as heute
class Tag07Tests(TestCase):
def test_10_kuehe_machen_muehe(self):
self.assertEqual(heute.ku... | 42.088235 | 87 | 0.651992 |
6f3aa4434b8393db6db04607b0a1a65d4d824caa | 3,649 | py | Python | Generators/python/docGenUtil.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 55 | 2021-05-11T16:01:59.000Z | 2022-03-30T14:30:33.000Z | Generators/python/docGenUtil.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 943 | 2021-05-10T14:00:02.000Z | 2022-03-31T21:28:15.000Z | Generators/python/docGenUtil.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 29 | 2021-05-10T11:33:16.000Z | 2022-03-30T21:01:54.000Z | import os
import json
import logging
"""
Utility steps for generation of docstring snippets into .json files - for use during Python code generation
"""
# json creation variables
# NOTE: these values are important for the assertNoChange=True behavior
_sort_keys = True
_indent = 1
def checkDir(theDir):
if not ... | 36.128713 | 108 | 0.628391 |
48eccb85e7744679566b3c277750850e3b3a79c6 | 548 | py | Python | data_tests/saved__backend__/numba/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/numba/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__/numba/block_fluidsim.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | # __protected__ from numba import njit
# __protected__ @njit(cache=True, fastmath=True)
def rk2_step0(state_spect_n12, state_spect, tendencies_n, diss2, dt):
# transonic block (
# complex128[][][] state_spect_n12, state_spect,
# tendencies_n;
# float64[][] diss2;
# ... | 28.842105 | 82 | 0.620438 |
5b247bce467766abaad2b3e1b48041d53206dfa5 | 72 | py | Python | test.py | chanchann/FlaskPP | 63efb0319c84a45b27b1c0bea667a71dfb120c83 | [
"MIT"
] | null | null | null | test.py | chanchann/FlaskPP | 63efb0319c84a45b27b1c0bea667a71dfb120c83 | [
"MIT"
] | null | null | null | test.py | chanchann/FlaskPP | 63efb0319c84a45b27b1c0bea667a71dfb120c83 | [
"MIT"
] | null | null | null | import urllib
d = urllib.urlopen('http://localhost:8080').read()
print d | 24 | 50 | 0.736111 |
82996c368c3696c7c9c2d306464766e326daacd7 | 33 | py | Python | jiuzhang/Nine Chapters/4 Dynamic Programming I/py/waiting/UniquePaths_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | jiuzhang/Nine Chapters/4 Dynamic Programming I/py/waiting/UniquePaths_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | jiuzhang/Nine Chapters/4 Dynamic Programming I/py/waiting/UniquePaths_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Calculate the results directly
| 16.5 | 32 | 0.818182 |
484134d63df1107dfebbb53b85c18802e29e2e21 | 3,390 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/connection/test_docker.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/connection/test_docker.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/plugins/connection/test_docker.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # (c) 2020 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 version.
#
# Ansible is di... | 54.677419 | 162 | 0.755162 |
4865db3a34b2c2f73221195248ca5c686c89ded9 | 6,494 | py | Python | bigbench/benchmark_tasks/unqover/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 460 | 2021-01-26T21:23:37.000Z | 2022-03-31T15:55:10.000Z | bigbench/benchmark_tasks/unqover/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 475 | 2021-01-27T01:29:01.000Z | 2022-03-30T20:23:56.000Z | bigbench/benchmark_tasks/unqover/task.py | lintangsutawika/BIG-bench | 230057960f8682b0051b2a1c4c3c6e0830f72769 | [
"Apache-2.0"
] | 305 | 2021-01-26T23:28:11.000Z | 2022-03-31T14:51:26.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 41.363057 | 150 | 0.629966 |
82f0434770fe56fe18f5d032e8deecdf208e3643 | 5,848 | py | Python | Utils/py/PathPlanner/BISEC.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/PathPlanner/BISEC.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/PathPlanner/BISEC.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from __future__ import division
import sys
import math
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
import matplotlib as mpl
import Queue as Q
import copy
robot_radius = 300
def stupid_experiment(start, target, obstacles):
return hit_obstacle(start, target, obstacl... | 34.60355 | 135 | 0.590629 |
736795fe74f591c5c171e283a71178cdd2971e54 | 426 | py | Python | scripts/coverage.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 15 | 2021-11-01T09:02:19.000Z | 2022-03-19T10:59:41.000Z | scripts/coverage.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 62 | 2021-09-20T14:09:59.000Z | 2022-03-30T19:03:22.000Z | scripts/coverage.py | ardunn/matbench | 7d11a2d63766339ec00e610e2255be29b81544d3 | [
"MIT"
] | 4 | 2021-03-22T10:37:42.000Z | 2021-07-20T14:11:28.000Z | """
for use with the coverage job in this repo's github workflows
"""
import os
from monty.serialization import loadfn
fname = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir), "coverage.json")
coverage = loadfn(fname)
total_percentage = coverage["totals"]["percent_covered"]
if tot... | 26.625 | 106 | 0.748826 |
73c32f4c8da3e23db98c08527ca025c81a75f6b1 | 8,674 | py | Python | python/tests/test_misc.py | derHahn/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 4 | 2015-02-20T09:20:10.000Z | 2018-02-05T10:54:10.000Z | python/tests/test_misc.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 80 | 2018-04-13T13:46:24.000Z | 2022-02-16T16:01:46.000Z | python/tests/test_misc.py | tlubitz/SBtab | da998eacc49f7f29d8168be366eb0c211c3adb5f | [
"MIT"
] | 6 | 2018-06-06T19:55:32.000Z | 2021-09-30T15:16:40.000Z | #!/usr/bin/env python
import unittest
import os
import sys
import libsbml
sys.path.insert(0,os.path.join(os.path.dirname(__file__), '..'))
import misc
import SBtab
class TestMiscFunctions(unittest.TestCase):
def setUp(self):
'''
setup SBtabTable class with files from test directory
'''
... | 38.551111 | 133 | 0.59638 |
83c4c889a690d2bc48e3458b37916b55a8cd10e4 | 567 | py | Python | Course_1/Week_03/1_naive_quick_sort.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | Course_1/Week_03/1_naive_quick_sort.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | 1 | 2020-07-16T08:03:22.000Z | 2020-07-16T08:09:34.000Z | Course_1/Week_03/1_naive_quick_sort.py | KnightZhang625/Stanford_Algorithm | 7dacbbfa50e7b0e8380cf500df24af60cb9f42df | [
"Apache-2.0"
] | null | null | null | def partition(array, start, end):
pivot = array[start]
while start < end:
while start < end and array[end] >= pivot:
end -=1
array[start] = array[end]
while start < end and array[start] <= pivot:
start +=1
array[end] = array[start]
array[start] = pivot
return start
def quickSort(array, left, right)... | 14.921053 | 46 | 0.622575 |
f7acc43d0de7259bce79d313d1d3af452b62c4be | 38,314 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/simulation/result_oglviewer.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/contributed/sumopy/coremodules/simulation/result_oglviewer.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/contributed/sumopy/coremodules/simulation/result_oglviewer.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) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 40.802982 | 174 | 0.580388 |
f70a21ed38d44e8d3f866d610001a211b803b1ce | 7,189 | py | Python | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/path.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot import Ballot
from onegov.ballot import BallotCollection
from onegov.ballot import Candidate
from onegov.ballot import CandidateCollection
from onegov.ballot import Election
from onegov.ballot import ElectionCollection
from onegov.ballot import ElectionCompound
from onegov.ballot import ElectionCompo... | 23.340909 | 78 | 0.717346 |
f77b9261e1be045c15e767fd494513cd161d585f | 336 | py | Python | Beginner/03. Python/qr-coder/qrdecoder.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 3 | 2021-03-16T16:44:04.000Z | 2021-06-07T17:32:51.000Z | Beginner/03. Python/qr-coder/qrdecoder.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/qr-coder/qrdecoder.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 2 | 2020-10-12T15:58:02.000Z | 2020-10-20T05:31:11.000Z | import os
from pyzbar.pyzbar import decode
from PIL import Image
res = ''
filenames = sorted([int(name.replace('.png', '')) for name in os.listdir('./qrs/')])
for filename in filenames:
if qr:=decode(Image.open('./qrs/'+str(filename)+'.png')):
res += qr[0].data.decode()
else: print(f'error with file {filenam... | 30.545455 | 84 | 0.66369 |
e3c19377701dd7ff3f5f5ebf10df49a668ac9f9e | 5,368 | py | Python | btshoufa/middlewares.py | siweilxy/btshoufa | e1466d9f1502912b1e619394b7f4c248c68dc321 | [
"Apache-2.0"
] | null | null | null | btshoufa/middlewares.py | siweilxy/btshoufa | e1466d9f1502912b1e619394b7f4c248c68dc321 | [
"Apache-2.0"
] | null | null | null | btshoufa/middlewares.py | siweilxy/btshoufa | e1466d9f1502912b1e619394b7f4c248c68dc321 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
import logging
import btshoufa
import scrapy
import re
from scrapy.http import Request
import urlparse
class BtshoufaSpider... | 39.762963 | 117 | 0.634873 |
5809be1d0f6746db924299934184038e5a50038b | 3,091 | py | Python | leetcode-and-lintcode/Stack/decode_string_394_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode-and-lintcode/Stack/decode_string_394_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode-and-lintcode/Stack/decode_string_394_leetcode.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | '''
Don't think this solution is good enough for the following reasons.
1. Don't need to check isnumeric and to concatenate string
'''
class SolutionWithOneStack:
def decodeString(self, s: str) -> str:
stack = []
num = ""
strs = ""
for c in s:
if c.isnumeric():
... | 22.896296 | 85 | 0.380136 |
54b877a1d961a11679011f5f70f02725aa3e39d9 | 583 | py | Python | _includes/snippets/python/monkey-patching/meta_information_decorator.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | 1 | 2020-02-02T16:09:43.000Z | 2020-02-02T16:09:43.000Z | _includes/snippets/python/monkey-patching/meta_information_decorator.py | MrNick7373/justusadam.github.io | 0660026a7846389647cb3ce52d9f776aab10e3cd | [
"CC-BY-4.0"
] | 1 | 2020-02-02T13:22:42.000Z | 2020-02-02T13:22:42.000Z | _includes/snippets/python/monkey-patching/meta_information_decorator.py | MarauderXtreme/justus | 229703abda2bd90d34232c97c64999c216d98239 | [
"CC-BY-4.0"
] | null | null | null | #! /usr/bin/env python3
def attach_meta(**arguments):
def _inner(function_or_class):
if hasattr(function_or_class, '_meta'):
raise AttributeError('Function already has meta information')
else:
function_or_class._meta = arguments
return function_or_class
return ... | 19.433333 | 73 | 0.638079 |
49a75faac82a0f86d30db75b643b8938885b7a2f | 60 | py | Python | database/db.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 76 | 2018-02-12T15:26:16.000Z | 2020-01-14T07:22:17.000Z | database/db.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 2 | 2018-02-19T16:17:39.000Z | 2018-02-19T16:19:36.000Z | database/db.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 34 | 2018-02-12T15:26:20.000Z | 2021-05-04T04:30:05.000Z | from peewee import *
db = SqliteDatabase('rulesbot.db')
| 15 | 35 | 0.7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.