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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3d317cc437b7d81405457828c4c3ddbef98aeb12 | 1,003 | py | Python | Packs/PaloAltoNetworks_IoT/Scripts/iot_alert_post_processing/iot_alert_post_processing.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_alert_post_processing/iot_alert_post_processing.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworks_IoT/Scripts/iot_alert_post_processing/iot_alert_post_processing.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: E402 lgtm [py/polluting-import]
def _get_incident():
return demisto.incidents()[0]
def iot_resolve_alert():
incident = _get_incident()
_id = ""
for label in incident['labels']:
if label['type'] == 'id':
_id ... | 25.075 | 95 | 0.627119 |
c5477f45e6dfa2badd5339c1d180bcbf0140f2f9 | 5,102 | py | Python | Packs/CommonScripts/Scripts/RemoveKeyFromList/RemoveKeyFromList_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/RemoveKeyFromList/RemoveKeyFromList_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/RemoveKeyFromList/RemoveKeyFromList_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from RemoveKeyFromList import remove_key_from_list_command
import demistomock as demisto # noqa # pylint: disable=unused-wildcard-import
from typing import List, Dict, Any
import json
MOCK_LIST_NAME = "TestList"
MOCK_KEY_NAME = "TestKey"
def test_remove_nonexisting_key_in_nonempty_list(mocker):
"""
Given:
... | 34.241611 | 110 | 0.649353 |
3dd9b08eb8d8c30fc329e82fe3ed8e172239604d | 1,140 | py | Python | SECCON/2020/Quals/Yet2AnotherPySandbox/run.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 3 | 2020-11-02T06:53:39.000Z | 2021-12-10T00:59:01.000Z | sandbox/yet-yet-another-py-sandbox/dist/run.py | SECCON/SECCON2020_online_CTF | dd639d140ad61ea0fbfadb7827157ca53f7b88b2 | [
"Apache-2.0"
] | null | null | null | sandbox/yet-yet-another-py-sandbox/dist/run.py | SECCON/SECCON2020_online_CTF | dd639d140ad61ea0fbfadb7827157ca53f7b88b2 | [
"Apache-2.0"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python2.7
from sys import modules
del modules['os']
del modules['sys']
del modules
keys = list(__builtins__.__dict__.keys())
EVAL = eval
LEN = len
RAW_INPUT = raw_input
TRUE = True
FALSE = False
TYPE = type
INT = int
for k in keys:
if k not in []: # Goodbye :)
del __builtins__.__dict__[k]
... | 21.923077 | 67 | 0.62193 |
9adad4470287c534e6d8ec7767c8452f726456c8 | 502 | py | Python | 7-assets/past-student-repos/_DS-Python/Algorithms-master/making_change/making_change.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-master/making_change/making_change.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-master/making_change/making_change.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
def making_change(amount, denominations):
pass
if __name__ == "__main__":
# Test our your implementation from the command line
# with `python making_change.py [amount]` with different amounts
if len(sys.argv) > 1:
denominations = [1, 5, 10, 25, 50]
amount = int(sys.argv... | 29.529412 | 123 | 0.697211 |
b8e8317679c6ca9341acdc1350ea62d4df1cc8e7 | 10,795 | py | Python | kts/core/feature_constructor/base.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/feature_constructor/base.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/feature_constructor/base.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import time
from abc import ABC
from contextlib import redirect_stdout, contextmanager, redirect_stderr
from io import StringIO
from typing import Tuple, Union, Dict, List
import numpy as np
import ray
from ray._raylet import ObjectID
import kts.core.backend.signal as rs
import kts.ui.components as ui
from kts.core.b... | 37.482639 | 145 | 0.648912 |
7733d72dc95d7c4e26a1bc4d51a319675b0f4da6 | 6,849 | py | Python | src/train_pix2pix.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/train_pix2pix.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/train_pix2pix.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import numpy as np
import keras.backend as K
from keras.optimizers import Adam
from keras.utils import generic_utils
from keras.callbacks import ModelCheckpoint
import nets
def load_img_and_dct_data(dataset_path):
files = os.listdir(dataset_path)
X = np.zeros((len(files), 224, 224... | 37.839779 | 129 | 0.655132 |
02943749beb22be28ade97b28f0265af2fa71cc0 | 5,892 | py | Python | lbry/lbry/blob_exchange/downloader.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | null | null | null | lbry/lbry/blob_exchange/downloader.py | Nykseli/lbry-sdk | 07afc0aa0a1e6c0ef6aa284fb47513af940440c1 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/blob_exchange/downloader.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | import asyncio
import typing
import logging
from lbry.utils import cache_concurrent
from lbry.blob_exchange.client import request_blob
if typing.TYPE_CHECKING:
from lbry.conf import Config
from lbry.dht.node import Node
from lbry.dht.peer import KademliaPeer
from lbry.blob.blob_manager import BlobManage... | 44.977099 | 111 | 0.631704 |
029b95efcf604ff454ca9bd8e142863b2768d463 | 2,207 | py | Python | frappe-bench/env/lib/python2.7/site-packages/stdnum/exceptions.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | frappe-bench/env/lib/python2.7/site-packages/stdnum/exceptions.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/stdnum/exceptions.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # exceptions.py - collection of stdnum exceptions
# coding: utf-8
#
# Copyright (C) 2013 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the Licen... | 32.940299 | 75 | 0.739012 |
b840310b4ad75a02caebfcd34b9eb30a74907b68 | 2,983 | py | Python | src/test_caption_net.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/test_caption_net.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | src/test_caption_net.py | 0shimax/chainer-caption-generator | 56f9d2984c245bc75787c4d4e1593e302fbf84b0 | [
"MIT"
] | null | null | null | import sys
sys.path.append('./src/common')
sys.path.append('./src/common/image_processor')
sys.path.append('./src/common/model_preparator')
sys.path.append('./src/net')
sys.path.append('./experiment_settings')
from mini_batch_loader import DatasetPreProcessor
from sample import get_args
from model_loader import prepare... | 31.734043 | 85 | 0.627221 |
b850fdfc8731b73f0a220ff8dba111b97d2fa243 | 2,746 | py | Python | pocketthrone/widgets/bottombar.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | 4 | 2016-06-05T16:48:04.000Z | 2020-03-23T20:06:06.000Z | pocketthrone/widgets/bottombar.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | pocketthrone/widgets/bottombar.py | herrschr/pocket-throne | 819ebae250f45b0a4b15a8320e2836c0b5113528 | [
"BSD-2-Clause"
] | null | null | null | __all__ = ('BottomBar')
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.core.image import Image as CoreImage
from kivy.uix.image import Image
from kivy.graphics import *
from pocketthrone.managers.pipe import L
... | 30.853933 | 93 | 0.773125 |
a2d00de25998c8e4c3213d35dd273d9891b55336 | 19,304 | py | Python | src/server/db/ProjectMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/ProjectMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/db/ProjectMapper.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | from server.bo.Project import Project
from server.db.Mapper import Mapper
class ProjectMapper(Mapper):
"""Mapper class that maps project objects to a relational database.
database. For this a set of methods is made available, with
methods, which can be used to search for, create, modify and delete ob... | 45.314554 | 173 | 0.646964 |
023041296746845b12bda386e7d64adaaff14816 | 1,017 | py | Python | packages/watchmen-data-kernel/src/watchmen_data_kernel/service/service_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/service/service_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-data-kernel/src/watchmen_data_kernel/service/service_helper.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from watchmen_auth import PrincipalService
from watchmen_data_kernel.storage.data_service import TopicDataService
from watchmen_data_kernel.storage.raw_data_service import RawTopicDataService
from watchmen_data_kernel.storage.regular_data_service import RegularTopicDataService
from watchmen_data_kernel.storage_bridge.t... | 46.227273 | 110 | 0.870206 |
0258daa08914f77690ce873b04caccf3edf12034 | 83 | py | Python | python_gui_tkinter/KALU/DATA_IMPORT/read_xls.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/DATA_IMPORT/read_xls.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/DATA_IMPORT/read_xls.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import pandas as pd
x1 = pd.ExcelFile("test.xls")
df = x1.parse()
print(df.head())
| 16.6 | 29 | 0.674699 |
5a6f70a821be014a43272211fdb34817dfd19340 | 677 | py | Python | leetcode/104-Maximum-Depth-of-Binary-Tree/MaxDepthBT_001_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/104-Maximum-Depth-of-Binary-Tree/MaxDepthBT_001_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/104-Maximum-Depth-of-Binary-Tree/MaxDepthBT_001_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return an integer
def maxDepth(self, root):
if root == None:
return 0
... | 23.344828 | 41 | 0.447563 |
cebf7636e5129e3bb88e50a14531b68917eb2728 | 97 | py | Python | notemanager/apps.py | muhammadsiraf/Maktub | eac81395a3347e567b3ba117414698230982bf0c | [
"MIT"
] | null | null | null | notemanager/apps.py | muhammadsiraf/Maktub | eac81395a3347e567b3ba117414698230982bf0c | [
"MIT"
] | null | null | null | notemanager/apps.py | muhammadsiraf/Maktub | eac81395a3347e567b3ba117414698230982bf0c | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class NotemanagerConfig(AppConfig):
name = 'notemanager'
| 16.166667 | 35 | 0.773196 |
0bbe0b1a266d4e1c81d95483f09c7e7711fbe770 | 6,905 | py | Python | test/test_context.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | test/test_context.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | test/test_context.py | arcticle/Quark | 17aa5b5869a9e9c7a04c1a371fef5998f33dc319 | [
"MIT"
] | null | null | null | import pytest
from test.testsetup import mock, builtins
from quark_core_api.context import ApplicationContext, WorkspaceContext, ExperimentContext
from quark_core_api.common import ContextInitializer
app_ctx_init = {
"workspaces": [{"id":1, "name":"ws-1", "dir":"home"}]
}
ws_ctx_init = {
"experiments": ["xpr-... | 41.10119 | 90 | 0.74685 |
f018cef58d82211b03e79d9a94eba81c6a8df616 | 824 | py | Python | Grundgeruest/migrations/0007_auto_20170510_1657.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Grundgeruest/migrations/0007_auto_20170510_1657.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Grundgeruest/migrations/0007_auto_20170510_1657.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.11 on 2017-05-10 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Grundgeruest', '0006_auto_20170510_1642'),
]
operations = [
migrations.Alte... | 27.466667 | 133 | 0.591019 |
332a894977ac2923eede95b3c909dffc2c26255a | 3,664 | py | Python | upload_images.py | pzhokhov/pzhokhov.github.io | 84f9979a1953bc36aee959cc6142454de0fb3ed5 | [
"MIT"
] | 1 | 2019-11-20T22:24:25.000Z | 2019-11-20T22:24:25.000Z | upload_images.py | pzhokhov/pzhokhov.github.io | 84f9979a1953bc36aee959cc6142454de0fb3ed5 | [
"MIT"
] | 1 | 2019-05-12T17:00:16.000Z | 2019-05-12T17:00:16.000Z | upload_images.py | pzhokhov/pzhokhov.github.io | 84f9979a1953bc36aee959cc6142454de0fb3ed5 | [
"MIT"
] | 2 | 2018-12-19T14:40:45.000Z | 2019-05-12T16:22:22.000Z | import glob
import re
import os
import subprocess
from concurrent.futures import ThreadPoolExecutor
from PIL import Image
import tempfile
GS_BUCKET = "slingalongblog-images"
THUMB_SIZE = 128
THUMB_SUFFIX = "_thumb"
tempdir = tempfile.gettempdir()
def upload_file(local_link):
file_path = local_link
if os... | 31.316239 | 96 | 0.637828 |
6825f19d74d67497d3f6febc9b8ba3aa6ff1bb1c | 932 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_numeric_ranges_in_template_if_blank.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
item_numeric_attributes = frappe.db.sql("""
select name, numeric_values, from_range, to_range, increment
from `tabItem Attribute`
where nu... | 26.628571 | 70 | 0.694206 |
d799ca34f49462f43a0f5e64c76f1eeffdd5d29c | 50 | py | Python | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/types.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Any
SQLAlchemyStatement = Any
| 12.5 | 25 | 0.82 |
acd9bfce4c8d6c41a73311219cc7332ad82f1c5f | 744 | py | Python | Agent1/RandomPolicy.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent1/RandomPolicy.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | Agent1/RandomPolicy.py | schigeru/Bachelorarbeit_Code | 261b2552221f768e7022abc60a4e5a7d2fedbbae | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''Implementiert zufällige Robotersteuerung'''
import gym
from stable_baselines.common.policies import MlpPolicy
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines import PPO2
from gym_Agent1_rewards import PandaRobotGymEnv
import rospy
import numpy as np
import os
from... | 21.882353 | 57 | 0.715054 |
c5a88d5736292ee1e043d022f45beed66d726a73 | 5,534 | py | Python | plotting/scripts/plot_contour_etgm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_contour_etgm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_contour_etgm.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""Saved contour plots for the ETGM paper"""
# Standard Packages
import sys; sys.path.insert(0, '../'); sys.path.insert(0, '../../')
import logging
# 3rd Party Packages
import matplotlib.pyplot as plt
# Local Packages
import modules.options # Import here even though it's unused to avoid issues
f... | 35.025316 | 117 | 0.58258 |
c5f753fd60e0a31b396f41806a4fac56f19e14c6 | 4,809 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_user_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_user_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_user_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, sky-joker
# 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_version': '1.1',
... | 27.323864 | 108 | 0.601788 |
a86d3a0327fa88fa158f58b7d130f915398f9751 | 8,587 | py | Python | webinterface/email_sending.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 2 | 2021-11-28T23:04:00.000Z | 2022-01-13T19:47:45.000Z | webinterface/email_sending.py | monoclecat/Cleaning-Schedule-generator | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 25 | 2020-03-29T14:40:46.000Z | 2021-09-22T17:37:15.000Z | webinterface/email_sending.py | monoclecat/cleaning-schedule-management-system | b12fa8a6f834a89b805bf062a0df45279a7a8796 | [
"MIT"
] | 1 | 2020-07-04T11:42:17.000Z | 2020-07-04T11:42:17.000Z | from webinterface.models import *
from markdown import markdown
from django.core import mail
from django.template.loader import get_template
from cleansys.settings import EMAIL_FROM_ADDRESS, HOST
def create_email_message(subject, rendered_markdown, to):
admin = User.objects.filter(is_superuser=True).first()
h... | 43.368687 | 117 | 0.669617 |
4fa2c2a442f75b717590b57383e95bbc11952bad | 1,285 | py | Python | wk-sentiment/app/main/api/sentiment/controller.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 4 | 2020-10-08T15:05:02.000Z | 2021-08-03T01:00:08.000Z | wk-sentiment/app/main/api/sentiment/controller.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | null | null | null | wk-sentiment/app/main/api/sentiment/controller.py | wkabbani/microservices | 3b2956084880b6bc0b255a53493bec39c7bbf513 | [
"MIT"
] | 1 | 2020-10-08T15:05:04.000Z | 2020-10-08T15:05:04.000Z | from flask import request
from flask_restplus import Resource, abort
from werkzeug.exceptions import BadRequest
from main.service.sentiment_service import SentimentService
from main.api.sentiment.serializers import sentiment_request, sentiment_response
from main.api.restplus import api
ns = api.namespace(
'sentim... | 28.555556 | 80 | 0.649027 |
96eef3c65102b6c360ed9d0e355c773631a81b18 | 831 | py | Python | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-02/processa-numeros/view/paineis/painel_multiplicado_por_fator.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício Processa Números
# --------------------------
# Classe responsável por criar uma nova lista multiplicada por um fator.
from view.paineis.painel_abstrato import PainelAbstrato
from model.processa_numeros import multiplicado_por_fator
class PainelMul... | 37.772727 | 109 | 0.638989 |
4ff0bffaefabcf244fb662d822d756cfbbd0e9ef | 14,634 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/tools/genboardscfg.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/genboardscfg.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/tools/genboardscfg.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
#
# Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
#
"""
Converter from Kconfig and MAINTAINERS to a board database.
Run 'tools/genboardscfg.py' to create a board database.
Run 'tools/genboardscfg.py -h' for available options.
Python 2.6 or later, but ... | 32.959459 | 79 | 0.589518 |
4ffad3ee192cc4fd7ee8f93683c49fb384615bbc | 1,495 | py | Python | src/onegov/pdf/signature.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/signature.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/pdf/signature.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from base64 import b64decode
from base64 import b64encode
from requests import get
from requests import post
class LexworkSigner(object):
""" Allows the sign PDFs using the lexwork PDF signing interface. """
def __init__(self, host, login, password):
self.host = host.rstrip('/')
self.login = ... | 28.75 | 79 | 0.578595 |
0fb1f7c1956835299fa0d690a47593c64adde03f | 2,791 | py | Python | Code_Knacken.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Code_Knacken.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | Code_Knacken.py | UlrichBerntien/Uebungen-Python | 67e6d885dd2319e999979410448364ec4d59dc51 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Code knacken
https://www.programmieraufgaben.ch/aufgabe/code-knacken/d4kocgvt
"""
# Programmieraufgabe:
# Hannas fünfstelliges Zahlenschloss wurde verstellt. Das Zahlenschloss
# besteht aus fünf Ringen mit je zehn möglichen Einstellungen ('0', '1', '2',
# ... | 41.656716 | 120 | 0.702257 |
0fbe222c98df74b786f841c8d2660d09dc153bf4 | 663 | py | Python | exercises/de/test_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/test_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/test_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
"if token.like_num" in __solution__
), "Benutzt du das Token-Attribut like_num?"
assert (
'next_token.text == "%"' in __solution__
), "Testest du, ob der Text des nächsten Tokens ein Prozentzeichen ist?"
assert (
next_token.text == "%"
), "Testest du,... | 33.15 | 78 | 0.631976 |
ba2d6140619cdccf0009b77c69759311e81a3e4b | 177 | py | Python | Contrib-Inspur/openbmc/poky/scripts/lib/wic/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/wic/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/scripts/lib/wic/__init__.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | #!/usr/bin/env python -tt
#
# Copyright (c) 2007 Red Hat, Inc.
# Copyright (c) 2011 Intel, Inc.
#
# SPDX-License-Identifier: GPL-2.0-only
#
class WicError(Exception):
pass
| 16.090909 | 39 | 0.666667 |
3afb48eeda8d1f7a9d91d217c8d46a2484acdaa2 | 623 | py | Python | exercises/pt/solution_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_01_11.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Importe o comparador - Matcher
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
doc = nlp("Upcoming iPhone X release date leaked as Apple reveals pre-orders")
# Inicialize o comparador com o vocabulário compartilhado
matcher = Matcher(nlp.vocab)
# Crie uma expressão que faça a co... | 29.666667 | 78 | 0.743178 |
d797194099e7c11bbfae7fe1b5b0334b90b86972 | 6,259 | py | Python | research/gnn/sgcn/src/signedsageconvolution.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/gnn/sgcn/src/signedsageconvolution.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/gnn/sgcn/src/signedsageconvolution.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.162921 | 119 | 0.636523 |
ad0357bc0f9759a4fafea11e81cf843da3648710 | 3,488 | py | Python | haas_lib_bundles/python/docs/examples/epidemic_prevention_control/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/epidemic_prevention_control/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/epidemic_prevention_control/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件
import network # Wi-Fi功能所在库
import ujson # json字串解析库
import utime # 延时API所在组件
from driver import GPIO # GPIO类,用于控制微处理器的输入输出功能
import hcsr04 # hcsr04超声波传感器类... | 21.937107 | 68 | 0.614679 |
0f2be7e26e7b9ee747a76c894a82de0ce3e6eede | 118 | py | Python | Curso_Python/Secao5-modulos-uteis/127_CSV_Comma_Separated_Values/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/127_CSV_Comma_Separated_Values/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/127_CSV_Comma_Separated_Values/teste.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import csv
with open('aaa.csv', 'r') as file:
dice = csv.reader(file)
for dices in dice:
print(dices) | 19.666667 | 34 | 0.601695 |
bc36ff0840ae793306552c7428552e09bdc66168 | 1,040 | py | Python | autojail/model/parameters.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/model/parameters.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/model/parameters.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | from typing import Any, List, Optional
from pydantic import BaseModel
from .datatypes import ByteSize
class ChoiceList(BaseModel):
choices: List[Any]
min: int
max: int
class ScalarChoice(BaseModel):
# lower bound if any
lower: Optional[float] = None
# upper bound if any
upper: Optiona... | 20.392157 | 57 | 0.695192 |
cb14bc270c17e7f61338d81b493a5712a8bd43dc | 2,263 | py | Python | oldp/apps/lib/templatetags/qstring.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/lib/templatetags/qstring.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/lib/templatetags/qstring.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | """
Templatetags/filters for working with query strings
taken from https://djangosnippets.org/snippets/553/
version: 0.3
"""
from django import template
from django.http import QueryDict
class GetRequestQueryStringNode(template.Node):
def __init__(self, asvar=None):
self.asvar = asvar
def __repr__(... | 25.715909 | 80 | 0.643394 |
69f9b05af53975fa368601d6d52f41a487c19fe5 | 708 | py | Python | apps/quiver/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2018-05-18T08:38:29.000Z | 2018-05-22T08:26:09.000Z | apps/quiver/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/quiver/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.urls import path
from apps.quiver import views
app_name = 'quiver'
urlpatterns = [
path('', views.MyAnalyticsService.as_view(), name ='index'),
path('page/<int:page>', views.MyAnalyticsService.as_view(), name='index_paginated'),
path('new/', views.NewAnalyticsService.as_view(), name='new'),
... | 47.2 | 109 | 0.728814 |
9304840514f7f9d09356db4d0264a9bf32a6f504 | 2,865 | py | Python | skimind/kernel/pdfManag/main.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/pdfManag/main.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/pdfManag/main.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | # pdf data extractor
from . import data_extractor
# interfacedb
from . import interfacedb
# tools
from . import tools
# page split
from . import page_spliter
def bet_file_manag(filename, numlist, date_format, flag, *args, **kwargs):
"""
traite les donnees contenues dans un fichier de type resultat
... | 31.483516 | 92 | 0.593368 |
35cf02f4ddd1ff669db7160a818c95e922737ca5 | 4,317 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/simpla/__init__.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/__init__.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/__init__.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) 2017-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.... | 36.897436 | 117 | 0.752606 |
ea040089c0be9d9f4713df1d7ea7509a75ea8c60 | 6,949 | py | Python | research/cv/advanced_east/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/advanced_east/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/advanced_east/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.401163 | 116 | 0.584832 |
5773f170222762ad07476b0872509df7a32090d6 | 31,784 | py | Python | BRUTAL-main/Cr4ck.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | BRUTAL-main/Cr4ck.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | BRUTAL-main/Cr4ck.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python2
# coding=utf-8
#Import module
import os,sys,time,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib
from multiprocessing.pool import ThreadPool
from datetime import datetime
try:
import mechanize
except ImportError:
os.system("pip2 install mechanize")
try:
import bs4
except Impor... | 36.118182 | 299 | 0.602756 |
1088d702dd0cf91e046d51cb20350764cb9c0237 | 301 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/enable_booking_asset_depreciation_automatically.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.set_value("Accounts Settings", None,
"book_asset_depreciation_entry_automatically", 1) | 33.444444 | 71 | 0.79402 |
52c17eaee161d43e864cf68930d6fb0b91aa5b24 | 2,986 | py | Python | marsyas-vamp/marsyas/scripts/regtest_sanity.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/regtest_sanity.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/regtest_sanity.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys
import os
import filecmp
print "This is no longer used. File only exists for archival interest"
sys.exit(1)
LOG_FILE = 'results.log'
# chdir to test directory
marsyasBaseDir = os.path.dirname(sys.argv[0])
marsyasBaseDir = os.path.abspath( marsyasBaseDir )
marsyasBaseDir = os.path.join(m... | 28.711538 | 90 | 0.653717 |
52cabb76479caf6275d93cc3460254aa41bcbc2e | 1,354 | py | Python | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/FileWriter.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/FileWriter.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.1/Projects/herdimmunity_starter_term2_2019/FileWriter.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | class FileWriter:
'''Helper class to write the results to a file'''
def __init__(self, filename):
self.results_file_name = filename
def init_file(self, virus, population_size, initial_vaccinated, initial_healthy, initial_infected):
'''Write the simulation initilization information t... | 48.357143 | 120 | 0.692024 |
eace8c1e5da96d4869d83c9607e87dcd673dab33 | 3,204 | py | Python | autofit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | autofit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | autofit.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import uncertainties
from scipy.optimize import curve_fit
from uncertainties import ufloat
from uncertainties.unumpy import uarray
maxfev = 1000000
# by Max Pernklau
def autofit(x, y, fitFunction, p0_=None, weights=None, bounds=(... | 57.214286 | 462 | 0.694444 |
d81ab9dc06587337ada3cedb4f03729ee646fdf5 | 928 | py | Python | BSE NSE.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | BSE NSE.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | BSE NSE.py | Yashraj890/StockAnalyzer | 96311362c85a224833a23c08148df956a64e177c | [
"MIT"
] | null | null | null | import pandas as pd
from ExcelHelper import ExcelHelper
NSEFilePath = r'D:\\NSEData\\NSE.xlsx'
BSEFilePath = r'D:\\NSEData\\BSE.xlsx'
excelHelperNSE = ExcelHelper(NSEFilePath, 'NSE')
nsewb = excelHelperNSE.LoadExcelWorkBook()
nsedf = excelHelperNSE.GetExcelDataFrame()
nsecolumn = excelHelperNSE.GetExcelDataColumns()... | 38.666667 | 204 | 0.74569 |
52588acb45945fe814584c0539ae64037e4e9907 | 1,422 | py | Python | bot/exts/fun/catify.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/catify.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/fun/catify.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import random
from typing import Optional
import re
import discord
from discord.ext import commands
from bot.bot import Bot
from bot.constants import Colours, Cats
class Catify(commands.Cog):
def __init__(self, bot: Bot):
self.bot = bot
@commands.command(name="catify")
async def catify(self, ct... | 27.346154 | 74 | 0.54993 |
bfff32ab3a9f715aa7abca3e2754ab21efedb57c | 7,847 | py | Python | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Qintel/Integrations/QintelQWatch/QintelQWatch.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
''' IMPORTS '''
import urllib3
from typing import Dict, Any
from datetime import datetime
from dateutil.parser import parse as parse_dt
from pytz import utc as pyutc
from dateparser import parse as parse_da... | 27.630282 | 81 | 0.604307 |
5ebe63242f37412b73370d6df6e3b90365c000c0 | 625 | py | Python | nz_django/day2/db_demo1/article/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/db_demo1/article/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/db_demo1/article/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
from django.utils.timezone import now
# Create your models here.
class Article(models.Model): #article_article
# 主键 自增 int 类型
id = models.AutoField(primary_key=True)
# 图书名字 name varchar(60)
name = models.CharField(max_length=100, null=False,db_column='title',unique=True)
... | 34.722222 | 85 | 0.7168 |
21b7f2a1946177e868d186758974100eabf210b1 | 875 | py | Python | guess the number.py | K11N4L2/sf | d151ee4a730e586e5597c82e9064987bb70319b5 | [
"MIT"
] | null | null | null | guess the number.py | K11N4L2/sf | d151ee4a730e586e5597c82e9064987bb70319b5 | [
"MIT"
] | null | null | null | guess the number.py | K11N4L2/sf | d151ee4a730e586e5597c82e9064987bb70319b5 | [
"MIT"
] | null | null | null | import random
print("Hi, please enter your name")
name = input() #input 1
secretNumber = random.randint(1, 50)
print(name + ' Guess the number between 1 & 50', '\nYou have 4 tries')
attempts = 0
for attempts in range(1, 5):
print('Take a guess')
while True:
try:
guess... | 28.225806 | 81 | 0.582857 |
df3b22155f89f5ee748f6999a0b7cc9a0620f038 | 9,556 | py | Python | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/renovate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/renovate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/KALU/GARBAGE1/ALLOUTDATED/TESTING2/TEST/renovate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import tkinter as tk
from tkinter import *
from tkinter import font
from tkinter.filedialog import askopenfilename
from tkinter import ttk
from AppOperations import AppOperations as ao # the class build for this purpose
data_valid = 0 # to check if the data was sucessfully inserted or not!
info = [
... | 41.189655 | 142 | 0.595751 |
804f8385671735fb2f9328e9c91fb091be17a907 | 5,211 | py | Python | mk-upgrade-package.py | derUli/ulicms | 4a5fb4b468f5c862644955cad61caa7de90f5bd5 | [
"BSD-3-Clause"
] | 14 | 2016-02-06T01:41:17.000Z | 2022-02-12T20:36:17.000Z | mk-upgrade-package.py | derUli/ulicms | 4a5fb4b468f5c862644955cad61caa7de90f5bd5 | [
"BSD-3-Clause"
] | 608 | 2015-04-23T21:38:08.000Z | 2022-03-15T13:43:45.000Z | mk-upgrade-package.py | derUli/ulicms | 4a5fb4b468f5c862644955cad61caa7de90f5bd5 | [
"BSD-3-Clause"
] | 3 | 2016-12-04T16:48:22.000Z | 2022-03-16T23:39:43.000Z | #!/usr/bin/python
# coding: utf8
import shutil
import argparse
import os
import platform
import codecs
from contextlib import closing
from zipfile import ZipFile, ZIP_DEFLATED
import time
def zipdir(basedir, archivename):
assert os.path.isdir(basedir)
with closing(ZipFile(archivename, "w", ZIP_DEFLATED)) as z... | 39.778626 | 112 | 0.612358 |
983acc84faae87781695c4227ce872e8eecf13f5 | 802 | py | Python | Prediction.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | 4 | 2021-02-26T15:47:28.000Z | 2021-03-04T16:46:00.000Z | Prediction.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | null | null | null | Prediction.py | JugendForscht-CoLoS/SunDetection-NeuralNetwork | 139bcc314cf6b5b84a82b08fda8b1e4455f7cf93 | [
"MIT"
] | 1 | 2021-02-24T13:01:21.000Z | 2021-02-24T13:01:21.000Z | import tensorflow as tf
from model.unet import getModel
from losses.losses import TverskyLoss
model = getModel()
model.compile(optimizer=tf.keras.optimizers.Adam(lr=0.0005),
loss=TverskyLoss(alpha=0.9835, smooth=2e4),
metrics=['acc'])
model.load_weights('neuralnet/saved_weights')
def displ... | 26.733333 | 74 | 0.710723 |
7f738b800052b7a0c2c463c5d362664a11bc1d90 | 551 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/parse-weka.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/parse-weka.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/parse-weka.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
filename = sys.argv[1]
lines = open(filename).readlines()
print " const mrs_real svm_weights[] = {"
print " ",
count = 0
for line in lines:
sl = line.split()
if len(sl) < 2:
continue
if sl[0] == '+':
val = sl[1]
else:
val = sl[0]
... | 16.69697 | 48 | 0.441016 |
1000ccad037a74c29be1dc4f764e36664e6d061e | 1,036 | py | Python | Problems/Depth-First Search/easy/SumLeftLeaves/sum_left_leaves.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/SumLeftLeaves/sum_left_leaves.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/easy/SumLeftLeaves/sum_left_leaves.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
# Tail Recursive DFS
def sumOfLeftLeaves(self, root: Optional[TreeNode]) -> int:
self.sum_left_leaves ... | 25.9 | 85 | 0.638031 |
d64db0c7eafb419e3cc0571430c97fc3a2a3b75d | 455 | py | Python | hrsdb/log.py | sirboldilox/hrsdb | 1f8373081e4cceb77892581fb5a3fe1f53bf984d | [
"MIT"
] | null | null | null | hrsdb/log.py | sirboldilox/hrsdb | 1f8373081e4cceb77892581fb5a3fe1f53bf984d | [
"MIT"
] | null | null | null | hrsdb/log.py | sirboldilox/hrsdb | 1f8373081e4cceb77892581fb5a3fe1f53bf984d | [
"MIT"
] | null | null | null | """
Logging for HRSDB
"""
import logging
# Log output format
LOG_FORMAT_CONSOLE = "%(asctime)s %(name)-20s %(levelname)-8s %(message)s"
LOG_FORMAT_DATE = "%m-%d %H:%M"
def init_log():
"""Initialise system logging"""
logging.basicConfig(level=logging.DEBUG,
format=LOG_FORMAT_CONS... | 20.681818 | 74 | 0.626374 |
d652880eef78088dd9ce7bd29ba716b797027e8e | 1,874 | py | Python | test/test_utils.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | test/test_utils.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | test/test_utils.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import pytest
from autojail.utils import SortedCollection, get_overlap, remove_prefix
@pytest.mark.parametrize(
"a, b, res",
[
((0, 1), (1, 2), 0),
((0, 2), (1, 2), 1),
((0, 2), (0, 2), 2),
((0, 5), (1, 3), 2),
],
)
def test_overlap(a, b, res):
assert res == get_overla... | 24.025641 | 76 | 0.605656 |
c3a6b20fad03fd7b927ddbb379123f5abfda5365 | 2,555 | py | Python | Packs/WebScraper/Scripts/WebScraper/WebScraper.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/WebScraper/Scripts/WebScraper/WebScraper.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/WebScraper/Scripts/WebScraper/WebScraper.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 *
from typing import Dict, Any
import traceback
from bs4 import BeautifulSoup
from operator import attrgetter
import xmltodict
''' STANDALONE FUNCTION '''
def nested_dict_pairs_iterator(dict_obj):
for key, value in... | 26.894737 | 100 | 0.674364 |
7f0ccf23ed94687caeb212f852cf57308ea4179f | 803 | py | Python | other/is_ipv4_string.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | other/is_ipv4_string.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | other/is_ipv4_string.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/python3
import sys, re
def main(argv_list):
if len(argv_list) == 1:
print("Please enter at least a IPv4 address.")
return 2
argv_item = argv_list[1:]
re_str1 = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
re_str2 = "^(?:[0-9... | 28.678571 | 109 | 0.503113 |
7f22de19e944fe8293c9d30dd9545398243b31e8 | 682 | py | Python | skimind/kernel/useCases/buildTicket/config.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/useCases/buildTicket/config.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/useCases/buildTicket/config.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-*-coding:utf-8 -*-
from . import interfacedb
#---------------------------------------------------------------------------
# TICKET CONFIGURATION
#---------------------------------------------------------------------------
CONST_TICKET_MATCH_MIN = 3 # nombre minimal
CONST_TICKET_MATCH_MAX = 12 # nombre maxima... | 25.259259 | 76 | 0.612903 |
1aee4fe619fbb901ab288da5dc18b1f3f2ca3525 | 727 | py | Python | pupil_invisible_monitor/setup.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/setup.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | pupil_invisible_monitor/setup.py | JuBepy/Gaze_Mouse | 4ddea30b4f53deb744dac3f370e7f48baa3b99c2 | [
"MIT"
] | null | null | null | from setuptools import setup
from deployment._packaging.utils import get_version
# Libs with Windows wheels need a fixed version to install the wheels automatically.
PYGLUI_VERSION = "1.29"
requirements = [
"numpy",
"glfw>=1.8.4",
"PyOpenGL",
"pyglui",
"ndsi",
]
package = "pupil_i... | 24.233333 | 85 | 0.657497 |
0d1b946e0bf365256f413b6ae203d971cc1f5624 | 969 | py | Python | ilswbot/subscriber.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/subscriber.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | ilswbot/subscriber.py | Nukesor/ilswach-bot | 2e3e9dfa8f43b07caab79f2e94686557dc808731 | [
"MIT"
] | null | null | null | """The sqlite model for a subscriber."""
from ilswbot.db import base
from sqlalchemy import Column, String, Boolean
class Subscriber(base):
"""The sqlite model for a subscriber."""
__tablename__ = 'subscriber'
chat_id = Column(String(100), primary_key=True)
active = Column(Boolean(), nullable=False... | 30.28125 | 67 | 0.661507 |
25e954c7f74928b4575f6290ab96d94c3f02e1d1 | 343 | py | Python | models/hr_employee_decoration_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_employee_decoration_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | null | null | null | models/hr_employee_decoration_type.py | aroodooteam/aro_hr | bf26f026593493486b4b5c13b26b9b47b9fe3825 | [
"BSD-2-Clause"
] | 3 | 2017-09-11T08:02:11.000Z | 2020-04-04T08:13:23.000Z | # -*- coding: utf-8 -*-
from openerp import fields, models, _
class HrEmployeeDecorationType(models.Model):
"""gestion des types de decoration existant chez ARO."""
_name = 'hr.employee.decoration.type'
_description = "Decoration"
code = fields.Char(string='Code', size=16)
name = fields.Char(st... | 24.5 | 60 | 0.682216 |
25f642e69a3ccb14360ba5e18910627e1d0979b2 | 1,835 | py | Python | workshop_petstagram/workshop_petstagram/main/views/profiles.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | workshop_petstagram/workshop_petstagram/main/views/profiles.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | workshop_petstagram/workshop_petstagram/main/views/profiles.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from workshop_petstagram.main.forms import CreateProfileForm, EditProfileForm, DeleteProfileForm
from workshop_petstagram.main.helpers import get_profile
from workshop_petstagram.main.models import Pet, PetPhoto, Profile
from workshop_petstagram.main.templatetags.profiles ... | 30.081967 | 100 | 0.715531 |
9f8ce6e32d32c38ecec929a508978ff0fd84a474 | 1,776 | py | Python | migrations/versions/fd7794ece0b3_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/fd7794ece0b3_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/fd7794ece0b3_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: fd7794ece0b3
Revises: 975c22ae802b
Create Date: 2020-07-17 19:51:08.457429
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "fd7794ece0b3"
down_revision = "975c22ae802b"
branch_lab... | 30.62069 | 84 | 0.625 |
2cbda791bb0d55d09fc14547c362689ab42a31b6 | 12,069 | py | Python | web/src/monitor.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | 1 | 2016-05-31T06:52:53.000Z | 2016-05-31T06:52:53.000Z | web/src/monitor.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | web/src/monitor.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import subprocess,re,sys,etcdlib
import time,threading,json,traceback
from log import logger
class Container_Collector(threading.Thread):
def __init__(self,etcdaddr,cluster_name,host,cpu_quota,mem_quota):
threading.Thread.__init__(self)
self.thread_stop = False
self... | 37.598131 | 136 | 0.563178 |
39329445e37e2f7720fb93ec596474da1b9290c2 | 450 | py | Python | gshiw/quotes_web/quotes_web/adminx.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes_web/adminx.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | gshiw/quotes_web/quotes_web/adminx.py | superlead/gsw | fc2bb539e3721cc554b4116b553befd653d2ec74 | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
from __future__ import unicode_literals
class BaseAdmin(object):
def get_queryset(self, request):
qs = super(BaseAdmin, self).get_queryset(request)
if request.user.is_superuser:
return qs
return qs.filter(owner=request.user)
def save_model(self, re... | 30 | 69 | 0.666667 |
645488ce3f835be22ff69e3a3a16f4b60fdfa58c | 757 | py | Python | old_app.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | old_app.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | old_app.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | from flask import Flask
import sqlite3
app = Flask(__name__)
#testi
def taxes2html(taxes):
html = '<h1>Top 100 tax paying companies in 2020</h1>'
html += '<table>'
for tax in taxes:
html += '<tr><td>{}</td><td>{}</td></tr>'.format(tax[0], tax[1])
html += '</table>'
return html
@app.rou... | 21.027778 | 72 | 0.610304 |
649530603899de55277c8845cdbe9d4223cd2bef | 4,263 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOselectpolygon.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOselectpolygon.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/mActionGTOselectpolygon.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QAction
from qgis.core import QgsProject, QgsWkbTypes, QgsCoordinateTransform, QgsPointXY, QgsPoint
from qgis.gui import QgsMapToolIdentify, QgsMapMouseEvent
class run(QObject):
def __init_... | 42.63 | 113 | 0.541637 |
45dc1ed1ded692850724e73f6e50878b1cefcb19 | 1,234 | py | Python | samplecode.py | papaniivanderpuye/bjlb | 5cf31864c0f0dffdc876352153bd1b781908c842 | [
"Apache-2.0"
] | null | null | null | samplecode.py | papaniivanderpuye/bjlb | 5cf31864c0f0dffdc876352153bd1b781908c842 | [
"Apache-2.0"
] | null | null | null | samplecode.py | papaniivanderpuye/bjlb | 5cf31864c0f0dffdc876352153bd1b781908c842 | [
"Apache-2.0"
] | null | null | null | ''' quiz_dictionary_style101.py
using a keyword:definitions_list dictionary for a flashcard-like quiz
tested with Python27 and Python33 by vegaseat 08nov2013
'''
import random
# make string input work with Python2 or Python3
try: input = raw_input
except: pass
# a simple sample dictionary 'pick the right color'
# ke... | 28.045455 | 69 | 0.639384 |
b30489b99a29f2e7f7ce7c2caa1aef2fc004e635 | 369 | py | Python | count-primes/count-primes.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | count-primes/count-primes.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | count-primes/count-primes.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def countPrimes(self, n: int) -> int:
if n<=3:
return max(n-2,0)
dp=[0]*n
start=1
while(start*start<n):
start+=1
if dp[start]==1:
continue
for mul in range(start, int((n-1)/start)+1):
... | 26.357143 | 56 | 0.430894 |
4427c80127324b880becf43f0802e3195beff41c | 2,174 | py | Python | official/cv/sphereface/src/losses/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/sphereface/src/losses/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/sphereface/src/losses/crossentropy.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.821429 | 105 | 0.642594 |
92b9a0e1800006e8d53cb22e67623adc1e6ce774 | 125 | py | Python | ejemplo2.py | Hercita/POO | 879d1e5462619579a5aec710bf3bc3ec6232de72 | [
"CC0-1.0"
] | null | null | null | ejemplo2.py | Hercita/POO | 879d1e5462619579a5aec710bf3bc3ec6232de72 | [
"CC0-1.0"
] | null | null | null | ejemplo2.py | Hercita/POO | 879d1e5462619579a5aec710bf3bc3ec6232de72 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Escribir un programa
"""
name = input("Introduce tu nombre:...")
print("¡Hola..." + name +"!")
| 13.888889 | 39 | 0.536 |
7554b2ea043caaaa60322f4907d8342e0958bb4f | 654 | py | Python | Packs/Carbon_Black_Enterprise_Response/Scripts/CBFindIP/CBFindIP.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Carbon_Black_Enterprise_Response/Scripts/CBFindIP/CBFindIP.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Carbon_Black_Enterprise_Response/Scripts/CBFindIP/CBFindIP.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 *
t = [] # type: list
found = []
ips = argToList(demisto.args()['ip'])
for ip in ips:
for e in demisto.executeCommand('cb-get-processes', {'query': 'ipaddr:' + ip}):
if isError(e):
return_error(e['... | 36.333333 | 119 | 0.616208 |
7562828a937b54e1dfd24a9cbe024bc85d3b50ea | 36,037 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/sys_works.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/sys_works.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/sys_works.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
import os... | 40.354983 | 136 | 0.559564 |
f3a71430467ec3a5e5d2c8b204ec250a4c449b59 | 7,533 | py | Python | dialogs/personaldata.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | dialogs/personaldata.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | null | null | null | dialogs/personaldata.py | Maxwingber/corobot | a959e0deba734d3900d7b8a826b3fb56964db4c6 | [
"MIT"
] | 2 | 2020-03-22T11:38:54.000Z | 2020-03-24T11:11:56.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import List
from botbuilder.dialogs import (
WaterfallDialog,
WaterfallStepContext,
DialogTurnResult,
ComponentDialog, ListStyle)
from botbuilder.dialogs.prompts import ChoicePrompt, PromptOptions... | 45.932927 | 131 | 0.669056 |
1b3c01c9ef46e8f22b3e52ff0066c69169fb093f | 3,553 | py | Python | Classification/Live Kidney Classification/lib/utils.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | 7 | 2020-03-06T05:53:43.000Z | 2022-01-30T17:31:18.000Z | Classification/Live Kidney Classification/lib/utils.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | Classification/Live Kidney Classification/lib/utils.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | import re
from time import time
from glob import glob
from os.path import isfile
import pandas as pd
import numpy as np
def normalize(x):
# x = re.sub("[\uAC00-\uD7A3]+", "\uAC00", x) £ convert Hangeul to 가
# x = re.sub("[\u3040-\u30FF]+", "\u3042", x) # convert Hiragana and Katakana to あ
# x = re.sub("[\u... | 45.551282 | 137 | 0.533915 |
ca32716577359667eadbb3ae8ee7b3c138a946dd | 1,093 | py | Python | crack/hashing/hashider.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | crack/hashing/hashider.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | crack/hashing/hashider.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import hashtest
import re
from passwdformats import FILE_FORMAT
file_format = 'custom'
methods = 'methods'
target = 'target.passwd'
usr = ''
hashlist = {}
pattern = r'([^#].*)(:)(.*)(:)(.*)(:)(.*)(:)(.*)(:)'
f = open(target)
for line in f:
match = re.match(pattern, line, re.I | re.U)
if hasattr(match, 'group'... | 22.306122 | 82 | 0.576395 |
f3ec628374c8d97ef1ff793aab285c29ecec6f5d | 534 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_2/make_all_assessment_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v7_2/make_all_assessment_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_2/make_all_assessment_group.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if not frappe.db.exists({"doctype": "Assessment Group","assessment_group_name": "All Assessment Groups"}):
frappe.reloa... | 38.142857 | 107 | 0.7603 |
fce49f7364c7e2d61c97c90455ade18253360d81 | 1,182 | py | Python | elements/python/7/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/7/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/7/11/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
def elias_encode(a):
"""
Elias gamma encode the integer a.
"""
e = ''
n = 0
while a != 0:
e = str(a&1) + e
a >>= 1
n += 1
return '0'*(n-1) + e
def elias_encode_seq(A):
"""
Elias gamma encode the integer sequence A.
"""
return ''.join(... | 17.641791 | 67 | 0.472081 |
a2294eb438c4c4b605da5d5ea8f7ab34919808f7 | 4,546 | py | Python | src/main/apps/authentication/email.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/apps/authentication/email.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/apps/authentication/email.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | import uuid
from .models import User
from datetime import (
datetime,
timedelta,
timezone,
)
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import EmailMessage
from django.urls import reverse
from main.exceptions import CustomError
from main.settings import DEBUG
from thr... | 35.515625 | 383 | 0.641003 |
bf1b9ded06d2d758334946d38151278cc6860495 | 1,050 | py | Python | sketches/box2dtest/box.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/box2dtest/box.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/box2dtest/box.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('box2d_processing')
# add_library('jbox2d')
class Box():
def __init__(self, box2d, x, y):
self.x = x
self.y = y
self.w = 16
self.h = 16
bd = BodyDef()
bd.type = BodyType.DYNAMIC
bd.position.set(box2d.coordPixelsToWorld(self.x, self.y... | 25.609756 | 65 | 0.515238 |
e53b006a5e3999dd4a84738c8aa7aa0b5294ba0d | 2,599 | py | Python | tp1/source/IDS.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp1/source/IDS.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | tp1/source/IDS.py | ha2398/ia-tps | 3696c92c8e2549aab6ac83da317cef8e15762eea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
Trabalho Pratico 1: Inteligência Artificial
Autor: Hugo Araujo de Sousa (2013007463)
IDS.py: Iterative deepening depth-first search.
'''
from GraphSearch import GraphSearch
from Node import Node
import time
class IDS(GraphSearch):
def __init__(self, initial, goal, problem_map):
'''... | 21.658333 | 71 | 0.676029 |
e5d8cf8567abddfca4f440d150c3781a6dd987f7 | 4,218 | py | Python | project/cli/scrape_weather_warnings.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/cli/scrape_weather_warnings.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/cli/scrape_weather_warnings.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | import re
from datetime import datetime
import requests
from bs4 import BeautifulSoup
from sqlalchemy.sql import not_
from project import app, db
from project.dateutils import create_berlin_date, get_now
from project.models import Place, WeatherWarning
from project.utils import get_content_from_response
def scrape(... | 29.089655 | 98 | 0.551446 |
00ac7c76aa92c3d5476bd6f4150294b82fbbc6ba | 579 | py | Python | src/unittest/python/GK/test_read.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | src/unittest/python/GK/test_read.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | src/unittest/python/GK/test_read.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | import pytest
import server.site
@pytest.fixture
def client():
server.site.app.testing = True
client = server.site.app.test_client()
yield client
def test_readall(client):
res = client.get('/user')
assert res.json == [{"username": "eecevit", "email": "eecevit@student.tgm.ac.at", "picture": "ds"}... | 30.473684 | 188 | 0.654577 |
c1b430f6d8e030694f37a30da5d62725eb869fb4 | 5,194 | py | Python | 10.3389/fgene.2020.567262/local/scripts/create_go_annotations.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fgene.2020.567262/local/scripts/create_go_annotations.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | 10.3389/fgene.2020.567262/local/scripts/create_go_annotations.py | jqsunac/doi | c5912a40c7bfda8270e5d51fbdd82a9f0650bd23 | [
"MIT"
] | null | null | null | import os
import sys
import re
import argparse
#
# ptyhon $this --obo go.obo --goslim ATH_GO_GOSLIM.txt --ann chi_m25.txt
#
def get_parental_goterms(goterm, go, del_targets):
if goterm in go:
parental_goterms = go[goterm]
del_targets.extend(parental_goterms)
parental_parental_gote... | 32.666667 | 99 | 0.556989 |
6b882b77825d59b09d1218848887dca75afffab8 | 9,152 | py | Python | skripte_datensammlung/tweet_extractor.py | TimSchmittmann/ML2-Project | 7ad01366f2322018065efcae542ae75786b3c0ec | [
"MIT"
] | null | null | null | skripte_datensammlung/tweet_extractor.py | TimSchmittmann/ML2-Project | 7ad01366f2322018065efcae542ae75786b3c0ec | [
"MIT"
] | null | null | null | skripte_datensammlung/tweet_extractor.py | TimSchmittmann/ML2-Project | 7ad01366f2322018065efcae542ae75786b3c0ec | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
@author: Tim Schmittmann
'''
from __future__ import print_function
import twitter
import time
from langdetect import detect
import csv
import config
import math
import sys
import subprocess
from enum import Enum
Mode = Enum('Mode', 'PAST RECENT')
# Create an Api instance... | 40.495575 | 322 | 0.602054 |
6bdea42ebbcd11af50adc3a7162473879416da48 | 2,518 | py | Python | Packs/CommonScripts/Scripts/MatchRegexV2/MatchRegexV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/MatchRegexV2/MatchRegexV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/MatchRegexV2/MatchRegexV2.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 typing import Dict
import re
LETTER_TO_REGEX_FLAGS = {
'i': re.IGNORECASE,
'm': re.MULTILINE,
's': re.DOTALL,
'u': re.UNICODE,
}
def parse_regex_flags(raw_flags: str = 'gim'):
"""
parse flags user input and convert them to ... | 28.613636 | 94 | 0.623114 |
d440c6859e39070df434285cacfccc162f6c8051 | 882 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/remove_fiscal_year_from_holiday_list.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/remove_fiscal_year_from_holiday_list.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v6_20x/remove_fiscal_year_from_holiday_list.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Holiday List")
default_holiday_list = frappe.db.get_value("Holiday List", {"is_default": 1})
if default_holiday_list:
for company in frappe.get_all("Company", fields=["name", "default_holiday_list"]):
if not company.de... | 44.1 | 136 | 0.763039 |
d457961d5f68eece1a4b1db351c3ac34e6dd2ead | 500 | py | Python | ertragswert.py | Zipano/Ertragswerte | 57887dbf151e85758225cf46b1bd993ac72c60f8 | [
"CC0-1.0"
] | null | null | null | ertragswert.py | Zipano/Ertragswerte | 57887dbf151e85758225cf46b1bd993ac72c60f8 | [
"CC0-1.0"
] | null | null | null | ertragswert.py | Zipano/Ertragswerte | 57887dbf151e85758225cf46b1bd993ac72c60f8 | [
"CC0-1.0"
] | null | null | null | # 20.05.2020
ro = 8.80 * 430 * 12 # Rohertrag (Monatsmiete * WFL * Monate)
bw = 170000 # Bodenwert (Bodenrichtwert: 550€/m²)
n = 30 # Restnutzungsdauer
bk = 0.20 # Bewirtschaftungskosten %/100
z = 0.03 # Liegenschaftszinssatz %/100
# Ertragswertberechnung
ew = (ro - ro ... | 33.333333 | 77 | 0.574 |
d45d06d3a79b7e0c91f87ac2d3e0aea5d43cdbb2 | 3,777 | py | Python | tests/test_html_entry.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | tests/test_html_entry.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | tests/test_html_entry.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ tests of publ.html_entry module """
# pylint:disable=missing-function-docstring
from . import PublMock
def test_process_passthrough():
from publ.html_entry import process
app = PublMock()
passthrough = '''<!DOCTYPE html>
<html><head>
<link rel="alternate" href="//example.com/" />
<title>This entry s... | 32.843478 | 91 | 0.621393 |
2e13850a8a521a6f74c77ee8dd867a6770f87611 | 2,397 | py | Python | pyventskalender/tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag17.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | # Heute soll es darum gehen, eigene Typen zu erstellen.
# %%
# In Python wird ein Typ, eine Klasse, mit `class <Name>` angelegt.
# Per Konvention schreibt man Typen groß.
# Der Typ wird dadurch nutzbar, dass man ihm eigene Daten und Methoden gibt --
# das sind die Dinge, die man mit ihm machen kann.
# Eine Methode ist... | 32.835616 | 79 | 0.726742 |
2b5cb81b956912bd0d7c0ebb1a727fead6ae1e44 | 1,554 | py | Python | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/controller.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/controller.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-hs-redez-sem/groups/02-unionDir/filesystem-redez-server/net/controller.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import json
import os
from utils import create
def add_user(client_file, server_file, user, ip, hash):
client_json = open(client_file, "r")
client_list = json.load(client_json)
client_json.close()
if client_list.get(hash):
print("returning")
return
client_json = open(client_file, "w... | 32.375 | 107 | 0.63964 |
41e5908dc1d5c364dada6bf8a1d9585f64022fa6 | 22,728 | py | Python | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/knowbe4Phisher/Integrations/knowbe4Phisher/knowbe4Phisher.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
# noqa: F401
# noqa: F401
import json
import urllib3
import traceback
from typing import Tuple
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 format with UTC, default in XSOAR
ALL_EVENTS_PAYLOAD = """query {{
... | 29.78768 | 124 | 0.608765 |
5152113c0f3c0b7bc2490c69715b70c005fce815 | 199 | py | Python | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/build_everything.py | mariaschopp/SABER | 1d289c29d33d91fab1e2da15378601f540c9da28 | [
"Unlicense"
] | 5 | 2020-08-28T04:44:22.000Z | 2021-09-16T18:33:56.000Z | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/build_everything.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | null | null | null | Cortex-M_Implementation_KEM/Cortex-M4/benchmark/build_everything.py | cothan/SABER | 4743134da0e4a695491b6c2de60e17f21d2d241f | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
"""
Builds all of the binaries without flashing them.
"""
from interface import M4Settings
import mupq
if __name__ == "__main__":
mupq.BuildAll(M4Settings()).test_all()
| 16.583333 | 49 | 0.723618 |
cfaa6a55e03f4cd388799055d2282aab18a7ae68 | 22,539 | py | Python | data_utils.py | ipashchenko/bsc | 04d36db88fcd0ec2e4b7da4b0c68085491d653b4 | [
"MIT"
] | null | null | null | data_utils.py | ipashchenko/bsc | 04d36db88fcd0ec2e4b7da4b0c68085491d653b4 | [
"MIT"
] | null | null | null | data_utils.py | ipashchenko/bsc | 04d36db88fcd0ec2e4b7da4b0c68085491d653b4 | [
"MIT"
] | null | null | null | import numpy as np
import astropy.io.fits as pf
from astropy.time import Time
from astropy import units as u
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
label_size = 16
matplotlib.rcParams['xtick.labelsize'] = label_size
matplotlib.rcParams['ytick.labelsize'] = label_size
matplotlib.rcParams[... | 39.472855 | 117 | 0.59701 |
856c89966b7b8e3d30f8d86f2724e21b4d230f31 | 23,410 | py | Python | Apps/Auswertung/compare_annotations.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | 1 | 2021-04-13T10:00:46.000Z | 2021-04-13T10:00:46.000Z | Apps/Auswertung/compare_annotations.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | Apps/Auswertung/compare_annotations.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import python libs
import re
import json
import argparse
import json
import collections
import copy
from os import listdir
from os.path import isfile, join
from pprint import pprint as pp
from operator import itemgetter
# import project libs
from constants import *
f... | 50.236052 | 205 | 0.6956 |
74340a038b912b3ed7d012d31e4380eb1f9c43d4 | 747 | py | Python | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P07_ToyShop.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P07_ToyShop.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P07_ToyShop.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | puzzle = 2.60
doll = 3
bear = 4.10
minion = 8.20
truck = 2
trip_price = float(input())
num_puzzle = int(input())
num_doll = int(input())
num_bear = int(input())
num_minion = int(input())
num_truck = int(input())
total_toys = num_puzzle + num_doll + num_bear + num_minion + num_truck
total_price = float(num_puzzle * pu... | 24.9 | 146 | 0.689424 |
7494779ee3853e12e6c75ef48a61c3ac39372ea7 | 1,066 | py | Python | common/models/pay/PayOrderItem.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 2 | 2019-06-10T08:57:47.000Z | 2021-06-12T16:22:15.000Z | common/models/pay/PayOrderItem.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | common/models/pay/PayOrderItem.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from sqlalchemy import BigInteger, Column, DateTime, Integer, Numeric, Text
from sqlalchemy.schema import FetchedValue
from application import db
class PayOrderItem(db.Model):
__tablename__ = 'pay_order_item'
id = db.Column(db.Integer, primary_key=True)
pay_order_id = db.Column(db.Integer... | 53.3 | 102 | 0.75985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.