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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
af6a9265acd53cba43e34a883d82347ace5809a4 | 7,024 | py | Python | plugins/FeedBack.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | plugins/FeedBack.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | 1 | 2020-09-22T02:30:40.000Z | 2020-09-22T02:30:40.000Z | plugins/FeedBack.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | from pluginsinterface.PluginLoader import on_message, Session, on_preprocessor, on_plugloaded
from pluginsinterface.PluginLoader import PlugMsgReturn, plugRegistered, PlugMsgTypeEnum, PluginsManage
from pluginsinterface.PluginLoader import PlugArgFilter
from pluginsinterface.PluginLoader import SendMessage
import time... | 33.447619 | 103 | 0.552534 |
bb9eaed1b413899f8485f302b050035343dfdd3d | 4,307 | py | Python | lale/lib/sklearn/multi_output_regressor.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 265 | 2019-08-06T14:45:43.000Z | 2022-03-30T23:57:48.000Z | lale/lib/sklearn/multi_output_regressor.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 467 | 2019-08-08T02:01:21.000Z | 2022-03-25T16:12:00.000Z | lale/lib/sklearn/multi_output_regressor.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 81 | 2019-08-07T19:59:31.000Z | 2022-03-31T09:11:58.000Z | # Copyright 2021 IBM Corporation
#
# 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 in writing, ... | 31.669118 | 157 | 0.504063 |
598474d52db11a40037900ffd6beaf02edcac021 | 8,467 | py | Python | verto/tests/ConditionalTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/ConditionalTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/ConditionalTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
from unittest.mock import Mock
from verto.VertoExtension import VertoExtension
from verto.processors.ConditionalProcessor import ConditionalProcessor
from verto.errors.TagNotMatchedError import TagNotMatchedError
from verto.tests.ProcessorTest import ProcessorTest
class ConditionalTest(ProcessorTest)... | 53.588608 | 210 | 0.72753 |
59e9d30596d01da0d6c47ea769bda369ccdb69c9 | 330 | py | Python | tests/cli/test_event.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/cli/test_event.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/cli/test_event.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def test_update_recurring_dates(client, seeder, app):
user_id, admin_unit_id = seeder.setup_base()
seeder.create_event(admin_unit_id, "RRULE:FREQ=DAILY;COUNT=7")
runner = app.test_cli_runner()
result = runner.invoke(args=["event", "update-recurring-dates"])
assert "1 event(s) were updated." in resu... | 41.25 | 68 | 0.730303 |
abc9c01ed893bcff7f894ae2c2b576b573e2e6ab | 2,950 | py | Python | Packs/FeedIntel471/Integrations/Intel471WatcherAlerts/Intel471WatcherAlerts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedIntel471/Integrations/Intel471WatcherAlerts/Intel471WatcherAlerts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedIntel471/Integrations/Intel471WatcherAlerts/Intel471WatcherAlerts_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import json
import io
import Intel471WatcherAlerts as feed
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
GET_REPORT_TYPE_DATA = [
(
'https://titan.intel471.com/report/inforep/fd1636d9f5a66098bcea8ae341b0304d', # inpu... | 30.102041 | 130 | 0.631525 |
053a0b47a34b1863e31e24433b85d54ca6bf3dac | 466 | py | Python | src/server/app/endpoints/presentation/presentor/controller.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/presentation/presentor/controller.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/presentation/presentor/controller.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Flask, Blueprint, render_template, abort, g, request
from flask_jwt_extended.utils import get_jwt_identity
from flask_jwt_extended.view_decorators import jwt_required
import json
from bson import json_util
presentor_view = Blueprint("presentor", __name__,
static_folder="stat... | 22.190476 | 71 | 0.772532 |
55be0b5b9eeb2d388f0ee27f1442417647603e06 | 261 | py | Python | redpwn/2021/crypto/scissor/encrypt.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | redpwn/2021/crypto/scissor/encrypt.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | redpwn/2021/crypto/scissor/encrypt.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
key = random.randint(0, 25)
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shifted = alphabet[key:] + alphabet[:key]
dictionary = dict(zip(alphabet, shifted))
print(''.join([
dictionary[c]
if c in dictionary
else c
for c in input()
]))
| 18.642857 | 41 | 0.678161 |
e9dd927bbb7d3db7c5812b799a9b41a125ae5779 | 927 | py | Python | src/test/tests/databases/Fluent.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/Fluent.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/Fluent.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: Fluent.py
#
# Programmer: Hank Childs
# Date: September 8, 2006
#
# Modifications:
# Jeremy Meredith, Tue Jul 15 10:43:58 EDT 2008
# Changed number of vectors in vector plot to match the ol... | 21.55814 | 109 | 0.601942 |
9b47cf75b0058c8e31e912603ae313b5915f9ef2 | 9,917 | py | Python | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/dataLoader.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 123 | 2017-10-05T00:29:34.000Z | 2022-03-28T14:16:06.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/dataLoader.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 13 | 2017-10-23T09:33:33.000Z | 2022-01-05T09:42:29.000Z | mltrain-nips-2017/lu_jensen/visdial_workshop.pytorch/misc/dataLoader.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 37 | 2017-10-06T09:47:05.000Z | 2020-06-27T21:06:01.000Z | import torch.utils.data as data
from PIL import Image
import torch
import numpy as np
import h5py
import json
import pdb
import random
from misc.utils import repackage_hidden, clip_gradient, adjust_learning_rate, decode_txt
class train(data.Dataset): # torch wrapper
def __init__(self, input_img_h5, input_ques_h5, ... | 35.544803 | 102 | 0.573561 |
fd137aea6fbb9fe47d9dd6e7dbab27bbfd484e1d | 625 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/68_zip_e_zip_longest/zip_e_zip.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/68_zip_e_zip_longest/zip_e_zip.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/68_zip_e_zip_longest/zip_e_zip.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
zip - Unindo iteráveis so une ate a menor lista
zip_longest - Itertools
"""
### Código
from itertools import zip_longest, count
""" junta as cidade com o estado
cidades_estados = zip(cidades, estados)
print(list(cidades_estados))
print(dict(cidades_estados))
"""
"""junta as cidade com o estado
for valor in cidades... | 25 | 67 | 0.7216 |
1f89a8cc46b63655f1c86197b07ef775ef10417f | 6,452 | py | Python | CheckMate/sendmail.py | eaydin/checkmate | 6a9cad7599c8c3e2087cb83b544368fdf69f6147 | [
"MIT"
] | null | null | null | CheckMate/sendmail.py | eaydin/checkmate | 6a9cad7599c8c3e2087cb83b544368fdf69f6147 | [
"MIT"
] | null | null | null | CheckMate/sendmail.py | eaydin/checkmate | 6a9cad7599c8c3e2087cb83b544368fdf69f6147 | [
"MIT"
] | null | null | null | import smtplib
import argparse
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formataddr
from email.header import Header
from datetime import datetime
import threading
import time
from CheckMate.log import logger
class MailObject(object):
"""
This o... | 37.730994 | 128 | 0.610353 |
2f222d46f5b9d7f86deb7ac3561a3ff405028ee3 | 5,527 | py | Python | 2018/quals/crypto-perfect-secrecy/healthcheck/solution.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2018/quals/crypto-perfect-secrecy/healthcheck/solution.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2018/quals/crypto-perfect-secrecy/healthcheck/solution.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | #!/usr/bin/env python3
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 31.947977 | 84 | 0.583137 |
9e46d34b3ac63621506b87b13c64ff3549deab56 | 495 | py | Python | src/GarbageAndTests/cvTest.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/GarbageAndTests/cvTest.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/GarbageAndTests/cvTest.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | import cv2
if __name__ == "__main__":
im = cv2.imread('test_black.png')
gray=cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
contours, hierarchy = cv2.findContours(gray,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)[-2:]
idx =0
for cnt in contours:
print(cnt)
idx += 1
x,y,w,h = cv2.boundingRect... | 30.9375 | 91 | 0.593939 |
c8a2f33baa5a21772edcb14ea81884e3bbfbc832 | 593 | py | Python | udacity course code/01-03-numpyarrayaccess.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 1 | 2021-03-22T22:25:54.000Z | 2021-03-22T22:25:54.000Z | udacity course code/01-03-numpyarrayaccess.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | 6 | 2017-01-16T09:53:21.000Z | 2017-01-18T12:20:09.000Z | udacity course code/01-03-numpyarrayaccess.py | bluemurder/mlfl | b895b2f1d01b0f6418a5bcee2f204dd7916062f0 | [
"MIT"
] | null | null | null | """Accessing array elements."""
import numpy as np
def test_run():
a = np.random.rand(5, 4)
print "Array:\n", a
# Element in a specified position
element = a[3, 2]
print element
# Elements in range
print a[0, 1:3]
# Slicing
# Note: slice n:m:t specifies a range that starts at n,... | 24.708333 | 94 | 0.623946 |
c8a53a0cb9860d964255469b4c43501a6f77a7d8 | 3,540 | py | Python | wgt/types.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | null | null | null | wgt/types.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | null | null | null | wgt/types.py | fgoettel/wgt | e093e2a003fa6c9d4c2082cebbc95701d7f9089d | [
"Unlicense"
] | 1 | 2022-01-29T12:01:47.000Z | 2022-01-29T12:01:47.000Z | """Define types for the different states of the WGT."""
from abc import ABC
from dataclasses import dataclass
from enum import Enum, unique
@dataclass
class Unit(ABC):
"""Abstract class to derive units."""
value: float
unit: str = ""
@property
def name(self) -> str:
"""Return the string... | 17.7 | 70 | 0.656497 |
a90e096390ac0f11de4abfa6186727432331dfd0 | 1,314 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.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_default_payment_terms_based_on_company.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_default_payment_terms_based_on_company.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
from erpnext.patches.v8_10.change_default_customer_credit_days import make_payment_term, make_template
def execute():
for dt in ("Company", "Customer Group"):
frappe.reload_doc("setup", "doctype", frappe.scrub(dt))
credit_records = frappe.db.sql("""
SELECT... | 35.513514 | 102 | 0.747336 |
a9539656dbfe0959e599071a1a309508d5ec663e | 837 | py | Python | blender/addon/ui/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | blender/addon/ui/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | blender/addon/ui/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | import bpy
class DMOD_PT_SETTINGS(bpy.types.Panel):
bl_label = "DMOD Canvas"
bl_idname = "DMOD_PT_Settings"
bl_category = "vvvv | VL"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
def draw(self, context):
scene = context.scene
layout = self.layout
row = lay... | 31 | 94 | 0.639188 |
93c0147baf109e4046607a5fc529c112f75c96f2 | 2,668 | py | Python | src/onegov/feriennet/collections/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.activity import Booking, Attendee, Occasion
from onegov.core.utils import toggle
from onegov.core.orm import as_selectable_from_path
from sqlalchemy import func
from sqlalchemy import select, and_
from onegov.core.utils import module_path
from statistics import mean
class MatchCollection(object):
def... | 28.382979 | 78 | 0.616192 |
e3044249426b06a8e6b093d354b853ec263ec544 | 15,390 | py | Python | examples/LaTeX/LaTeXServer.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | examples/LaTeX/LaTeXServer.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | examples/LaTeX/LaTeXServer.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""LaTeXServer.py - starts a server (if not already running) for the
compilation of LaTeX
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2019 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this... | 35.542725 | 113 | 0.607472 |
47e37bbeb036599ad84b46ab420f49360785aac0 | 298 | py | Python | marsyas-vamp/marsyas/src/django/birdsong/application/birdsong/playback/views.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/django/birdsong/application/birdsong/playback/views.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/django/birdsong/application/birdsong/playback/views.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render_to_response
import subprocess
import re
import marsyas
def index(request):
return render_to_response('playback/index.html',
{},
{}, mimetype="application/xhtml+xml")
| 27.090909 | 67 | 0.54698 |
08f2110676d3b3ab3ce71760501da9b17f708459 | 2,715 | py | Python | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/look_up_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse
from .models import Article,Category
from django.utils.timezone import make_aware
# Create your views here.
def index(request):
# article = Article(title='有了金刚钻我们再揽瓷器活',content='金刚钻都是磨出来的,所以有人成为钢板君')
# category = Category(name='热门文章')
# category.save()
# category.art... | 33.9375 | 87 | 0.719337 |
de73aa144d6108c116b1a90dda66ff228f8751d0 | 679 | py | Python | Curso-Em-Video-Python/2Exercicios/073_Tupla_com_Times_de_Futebol.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/073_Tupla_com_Times_de_Futebol.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/073_Tupla_com_Times_de_Futebol.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | n = 0
print('------Campeonato Brasileiro------')
classificação = ('Cruzeiro', 'São Paulo', 'Internacional', 'Corinthians', 'Atletico-Mg', 'Fluminense', 'Grêmio', 'Athletico-Pr', 'Santos', 'Flamengo', 'Sport Recife', 'Goias', 'Figueirense', 'Coritiba', 'Chapecoense', 'Palmeiras', 'EC Vitoria','Bahia', 'Botafogo', 'Crici... | 45.266667 | 276 | 0.665685 |
26188368818109dfcf61461e9f1d1c03a72b5686 | 1,719 | py | Python | Packs/IvantiHeat/Scripts/IvantiHeatCreateIncidentExample/IvantiHeatCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/IvantiHeat/Scripts/IvantiHeatCreateIncidentExample/IvantiHeatCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/IvantiHeat/Scripts/IvantiHeatCreateIncidentExample/IvantiHeatCreateIncidentExample.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import demistomock as demisto
from CommonServerPython import *
"""
Use the IvantiHeatCreateIncidentExample script to create a incident object (JSON) in Ivanti Heat.
The script gets the arguments required to create the incident, such as category, summary, and so on.
It creates the JSON object and sets it i... | 39.976744 | 116 | 0.721931 |
cd99aac1d719be37370658a1549be589fcf1ca15 | 40,874 | py | Python | BlackMafiaTool-main/lovehacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | BlackMafiaTool-main/lovehacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | BlackMafiaTool-main/lovehacker.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # uncompyle6 version 3.7.4
# Python bytecode 2.7
# Decompiled from: Python 2.7.18 (default, Jan 8 2021, 21:22:55)
# [GCC 4.2.1 Compatible Android (6454773 based on r365631c2) Clang 9.0.8 (https:/
# Embedded file name: <BlackMafia>
'''
Decrypted By Mr. Error (Azim-Vau)
'''
try:
import os, sys, time, datetime, re,... | 44.331887 | 6,231 | 0.498385 |
f8bfa19a68a396f891a3276dfee96887850b1cca | 10,500 | py | Python | tests/onegov/ticket/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/test_collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ticket import Handler, Ticket, TicketCollection
from onegov.user import UserCollection
from unittest.mock import Mock
class EchoHandler(Handler):
@property
def deleted(self):
return False
@property
def email(self):
return self.data.get('email')
@property
def titl... | 27.202073 | 79 | 0.611429 |
e415b1ee83ba1ad6718080cedbd92dd4aa9b75d9 | 471 | py | Python | 1200-minimum-absolute-difference/1200-minimum-absolute-difference.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1200-minimum-absolute-difference/1200-minimum-absolute-difference.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1200-minimum-absolute-difference/1200-minimum-absolute-difference.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def minimumAbsDifference(self, arr: List[int]) -> List[List[int]]:
sarr = sorted(arr)
minval = sarr[1]-sarr[0]
output=[[sarr[0], sarr[1]]]
for i in range(2, len(arr)):
if sarr[i]-sarr[i-1] < minval:
minval = sarr[i]-sarr[i-1]
... | 39.25 | 70 | 0.494692 |
e47550e59ca2416650643ceb417860a6af4542a0 | 1,270 | py | Python | rating/https.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/https.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/https.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
This looks at all HTTPS URLs we checked for reachability.
If all of them were reachable without errors, we give full score.
If some or all had errors, or no HTTPS URL is reachable, we give zero.
"""
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
defau... | 26.458333 | 80 | 0.59685 |
29aad580cf352781f421f0101cf246fb46f48461 | 51 | py | Python | src/semver/__init__.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | src/semver/__init__.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | src/semver/__init__.py | HazelTheWitch/SemVer | 3ca3663990b1e0451b9eab25d411a68d50c90554 | [
"MIT"
] | null | null | null | from .version import *
version = Version(1, 1, 0)
| 12.75 | 26 | 0.666667 |
8abc18c7958683066fe0a5afc341542f1c8700f9 | 1,228 | py | Python | showcase4/com/aaron/gzipziptarexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase4/com/aaron/gzipziptarexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase4/com/aaron/gzipziptarexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""
gzip zipfile tarfile example
"""
__author__="aaron.qiu"
import os, shutil, glob
from pprint import pprint
import zlib, gzip, bz2, zipfile, tarfile
def zlib_showcase():
"""
zlib 提供了对字符串进行压缩和解压缩的功能
"""
orginal = "this is a test string"
compressed = zlib.com... | 22.327273 | 82 | 0.607492 |
0a6e837593a024263f524314b57188a9c3c84dd7 | 3,638 | py | Python | examples/adminEx2/reverse_filter_query/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/adminEx2/reverse_filter_query/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/adminEx2/reverse_filter_query/views.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.shortcuts import render, HttpResponse
from .models import SimulateContentType, SimulatePermission
def index_view(request):
"""
四种查询方式, 同一时间仅能选择其中一种
当前函数不能直接运行,需要对模型进行相应操作, 并注释掉其中三种查询方式, 才能运行.
"""
# 查询方式-1
# 1). 取消模型中的定义 ForeignKey.related_name = "sp_set"
# 2). 取消模型中的定义 Foreig... | 46.050633 | 173 | 0.686916 |
7ca267e6dd11fac2ea54644519eb8deccc6ea0a9 | 6,817 | py | Python | Packs/NetskopeV2/Integrations/NetskopeV2/NetskopeV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/NetskopeV2/Integrations/NetskopeV2/NetskopeV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/NetskopeV2/Integrations/NetskopeV2/NetskopeV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import traceback
from typing import Any, Dict
import demistomock as demisto # noqa: F401
import urllib3
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
urllib3.disable_warnings()
''' CONSTANTS '''
''' CLIENT CLASS '''
class Client(BaseClient):
"""Client class to interact with the... | 24.970696 | 90 | 0.611559 |
86e1aaf003a1e95924802689b244f5e23e5c3806 | 19,659 | py | Python | Licence 2/I32/Projet-Camping/main.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I32/Projet-Camping/main.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I32/Projet-Camping/main.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | from interface import *
from menus import *
from database import *
import datetime
def main():
"""
Charge le premier menu et redirige l'utilisateur
vers le sous-menu qu'il sélectionne.
"""
choice = show_basic_menu("BIENVENUE", first_menu)
if compare_ids(choice, first_menu, "CLIENTS"):
... | 32.38715 | 356 | 0.629788 |
d4b6d292a706a0c78a9d2b9a79b8e1e656baf5fd | 575 | py | Python | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P02_ExamPreparation.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P02_ExamPreparation.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L05_WhileLoop/Exercises/Solutions/P02_ExamPreparation.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | max_bad_scores = int(input())
bad_scores = 0
tasks = 0
total_score = 0
last_problem = 0
while True:
name_task = input()
if name_task == "Enough":
print(f"Average score: {total_score / tasks:.2f}")
print(f"Number of problems: {tasks}")
print(f"Last problem: {last_problem}")
brea... | 21.296296 | 61 | 0.601739 |
be27040ed5fccbd56db4a99331a15c05bd1a7d16 | 1,132 | py | Python | src/change_sampling_factor.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | 10 | 2018-01-11T01:15:15.000Z | 2020-06-22T15:03:31.000Z | src/change_sampling_factor.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | src/change_sampling_factor.py | misogil0116/Biscotti | 010ef0f29fbd5d33c9870ce249f1a9824f3471c4 | [
"Apache-2.0"
] | null | null | null | # To make dataset, change sampling factor with Imagemagick.
import argparse
import os
import subprocess
def main(args):
input_dir = args.input_images
sampling_factor = args.sampling_factor
output_dir = args.output_images
for i_path in os.listdir(input_dir):
if sampling_factor == 420:
# command = ["c... | 41.925926 | 104 | 0.70318 |
07f673296eb86ef63f7bc43ee814608213c697f4 | 92 | py | Python | 2015/04/cervical-cancer-rate-20140410/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/04/cervical-cancer-rate-20140410/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/04/cervical-cancer-rate-20140410/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1uz4NpvZCT2yldcMdQ3b0fP8YOXy-CFWBMVFUCs8-mzk'
| 23 | 68 | 0.826087 |
b97fa5e4b837cdf8c3afd0a4edc1deecc25dc98e | 3,746 | py | Python | ETL/etl-framework-master (5)/etl-framework-master/Python ETL Scripts/ReloadFromArchive.py | DIBASSI/ZEUS | e5cc995dc232813636850e961e2a7bb8d1443a45 | [
"MIT"
] | null | null | null | ETL/etl-framework-master (5)/etl-framework-master/Python ETL Scripts/ReloadFromArchive.py | DIBASSI/ZEUS | e5cc995dc232813636850e961e2a7bb8d1443a45 | [
"MIT"
] | null | null | null | ETL/etl-framework-master (5)/etl-framework-master/Python ETL Scripts/ReloadFromArchive.py | DIBASSI/ZEUS | e5cc995dc232813636850e961e2a7bb8d1443a45 | [
"MIT"
] | null | null | null | ##Author: Reece Colbus
##Contact: rcolbus@mac.com as of 2Oct18
##Date Created: 16Sept18
##Description: Reloads data from archive.
##Modification log:
##20190220: Script generalized. - Bob Wakefield
##
## 1. Get list of.zip files in C:/InterfaceAndExtractFiles/../Archive/
## 2. Unzip each zip file in C:/InterfaceAndExt... | 31.478992 | 134 | 0.683396 |
b997b1e5ddba3cda479ffc7f9f33754bc8f942bc | 8,406 | py | Python | oneflow/python/test/ops/test_global_function_input_output.py | caishenghang/oneflow | db239cc9f98e551823bf6ce2d4395bd5c339b1c5 | [
"Apache-2.0"
] | 2 | 2021-09-10T00:19:49.000Z | 2021-11-16T11:27:20.000Z | oneflow/python/test/ops/test_global_function_input_output.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/ops/test_global_function_input_output.py | duijiudanggecl/oneflow | d2096ae14cf847509394a3b717021e2bd1d72f62 | [
"Apache-2.0"
] | 1 | 2021-11-10T07:57:01.000Z | 2021-11-10T07:57:01.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.624 | 97 | 0.644778 |
b9ae8a1c679708666941910cc49b7f8b8de14d67 | 775 | pyde | Python | sketches/geometrie/geometrie.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/geometrie/geometrie.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/geometrie/geometrie.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | t = 0
def setup():
size(600, 600)
this.surface.setTitle("Rotationen")
rectMode(CENTER)
def draw():
global t
colorMode(RGB)
background("#2b3e50")
translate(width/2, height/2)
strokeWeight(2)
colorMode(HSB)
fill(0.5*t%255, 255, 0.1*t%255)
ellipse(0, 0, 60, 60)
rotate(radi... | 22.794118 | 39 | 0.508387 |
b9d7ab6b02513480dff6622b197a3b43106c21f4 | 479 | py | Python | weibo/testMySQL/test_connect.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/testMySQL/test_connect.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | weibo/testMySQL/test_connect.py | haiboz/weiboSpider | 517cae2ef3e7bccd9e1d328a40965406707f5362 | [
"Apache-2.0"
] | null | null | null | #coding:utf8
'''
Created on 2016年4月20日
@author: wb-zhaohaibo
'''
import MySQLdb
print MySQLdb
conn = MySQLdb.Connect(
host="127.0.0.1",
port=3306,
user="root",
passwd="admin",
db="testsql... | 16.517241 | 41 | 0.421712 |
e02faa322a4c4b45561165ac53eaea46bc833342 | 6,712 | py | Python | huTools/http/tools.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/http/tools.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | huTools/http/tools.py | gadventures/huTools | 8bc58d63491bcd3cfc3e78d219be703d943ffeb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
tools.py - various helpers for HTTP access
Created by Maximillian Dornseif on 2010-10-24.
Copyright (c) 2010, 2011 HUDORA. All rights reserved.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from future import standard_library
standard_lib... | 36.677596 | 106 | 0.635876 |
0ee44e97edcd3b2893cc05240bb08b214d45af87 | 1,147 | py | Python | features/rainbowclock.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | 1 | 2019-04-27T07:28:52.000Z | 2019-04-27T07:28:52.000Z | features/rainbowclock.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | features/rainbowclock.py | BogyMitutoyoCTL/Riesen-Tetris | 8bbbaf0b7aeae7890da724d3d72719a7d068237a | [
"MIT"
] | null | null | null | from time import sleep
from features.clock import Clock
from field import Field
from multiply import multiply
from painter import Led_Matrix_Painter, RGB_Field_Painter
from rainbow import rainbowcolors
class Rainbowclock(Clock):
def __init__(self, field_leds: Field, field_matrix: Field, rgb_field_painter: RGB_Fi... | 35.84375 | 107 | 0.691369 |
1646c349cb3fe56facacce4e3c52fee2a0855f5d | 717 | py | Python | pyLS/notes/imageOverlap.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 4 | 2017-06-20T19:56:22.000Z | 2021-05-29T10:07:47.000Z | pyLS/notes/imageOverlap.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 11 | 2017-05-31T19:14:32.000Z | 2018-09-12T23:44:11.000Z | pyLS/notes/imageOverlap.py | swharden/ROI-Analysis-Pipeline | e83d96c43fdd50cb44be365289e964576492617e | [
"MIT"
] | 2 | 2017-06-20T17:14:38.000Z | 2017-06-20T19:51:34.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
imageData=plt.imread("../../data/linescan/example/green.tif")
trace=np.average(imageData,axis=1)
plt.figure(figsize=(4,2))
plt.plot(trace,alpha=.5,color='y',lw=.5) # plot the data first
plt.margins(0,.1) # adjust margins so it's f... | 47.8 | 101 | 0.754533 |
4c1f9c80f3c739c5b5a657bff4d493183af44ae1 | 3,865 | py | Python | spangle/parser.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | 2 | 2019-11-17T06:38:56.000Z | 2019-12-01T15:32:03.000Z | spangle/parser.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | spangle/parser.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | """Types to parse user uploads."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable
from functools import partial
from json import loads
from tempfile import SpooledTemporaryFile
from typing import TYPE_CHECKING, Literal, NamedTuple, Optional, Union
from urllib.parse i... | 26.655172 | 83 | 0.658732 |
d5e356d092b97c6a121fccf51803a79fa960f6b4 | 10,635 | py | Python | PyTorchStuff/pytorch_lightning/pytorch_lightning_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | PyTorchStuff/pytorch_lightning/pytorch_lightning_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | PyTorchStuff/pytorch_lightning/pytorch_lightning_regression.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Trying out PyTorch Lightning
# In this post I was trying out PyTorch Lightning to see if it's a library that should be used by default alongside PyTorch.
# I will create the same nonlinear probabilistic network from before, but this time using Lightning.
# Hence the first few steps are the same as p... | 32.325228 | 134 | 0.692901 |
912950812c5cace43ef693144807c7bf4870879f | 662 | py | Python | utils/keys.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | utils/keys.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | utils/keys.py | nebulousdog/catcobralizard | 0be598b9e76addbe25684ca60aa5ae324cc42183 | [
"MIT"
] | null | null | null | """
SSH Key related utils
"""
import requests
from utils.requests import headers
def get_key_fingerprints(token):
"""
Using ssh_key fingerprints because array of ids seems broken on Digital
Ocean's side.
"""
request = requests.get('https://api.digitalocean.com/v2/account/keys', headers=headers(to... | 27.583333 | 98 | 0.697885 |
e68307f0e9e86d7aeaa439096bc1037ff77bc3af | 678 | py | Python | src/test/tests/unit/namescheme.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/unit/namescheme.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/unit/namescheme.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: namescheme.py
#
# Tests: Namescheme_test unit test
#
# Mark C. Miller, Tue Jan 11 10:19:23 PST 2011
#
# Modifications:
# Kathleen Biagas, Mon Oct 26, 2020
# Retrieve correct path on Windows.... | 25.111111 | 78 | 0.513274 |
fc72bd191e2aff8cd06f44f17773bdf94247e949 | 114,537 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/plugins/prt/prt-14-progdelay.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/plugins/prt/prt-14-progdelay.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/plugins/prt/prt-14-progdelay.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 ... | 46.408833 | 253 | 0.581777 |
5db1164c3d0f6345c6646e50042db7b868e67407 | 68 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/monitor_log/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/monitor_log/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/monitor_log/__init__.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from .monitor_log_data_service import PipelineMonitorLogDataService
| 34 | 67 | 0.926471 |
5dd6e97626f3e2b5e667104a1109974942d75fa5 | 12,842 | py | Python | countdown_controller.py | zapfdk/broadcast-clock | b88d8daad784bc9fe06b00b50d3f56ceb16dfc96 | [
"MIT"
] | null | null | null | countdown_controller.py | zapfdk/broadcast-clock | b88d8daad784bc9fe06b00b50d3f56ceb16dfc96 | [
"MIT"
] | null | null | null | countdown_controller.py | zapfdk/broadcast-clock | b88d8daad784bc9fe06b00b50d3f56ceb16dfc96 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 29 20:18:49 2016
@author: Dominik
"""
import tkinter as tk
from functools import partial
import socket
from datetime import datetime, timedelta
import traceback
EXPAND_GRID_CELL = tk.N + tk.E + tk.W + tk.S
class CountdownController(tk.Tk):
de... | 40.383648 | 118 | 0.631911 |
5d4dd7b5fa321fcb46ef5a297821d034139babfd | 544 | py | Python | exercises/ja/exc_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import json
from spacy.matcher import Matcher
from spacy.lang.ja import Japanese
with open("exercises/ja/iphone.json", encoding="utf8") as f:
TEXTS = json.loads(f.read())
nlp = Japanese()
matcher = Matcher(nlp.vocab)
# 小文字が"iphone"と"x"にマッチする2つのトークン
pattern1 = [{____: ____}, {____: ____}]
# 小文字が"iphone"と数字にマッチする... | 25.904762 | 68 | 0.720588 |
537015089f9bcdb2ba5efd44bc7a8d13606bab40 | 2,074 | py | Python | Liquid-experiments/share/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-experiments/share/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-experiments/share/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | import random
import time
import json
def train(jm=None, api=None, seed=2020, case=None):
api.conf_reset()
api.conf_update('pool.share.enable_threshold', 1.75)
conf = {
'candidates': ['cnn'],
'jm': jm,
'api': api,
'seed': seed,
'job_num': 200,
}
launch(conf)
def test(jm=None, api=... | 22.06383 | 108 | 0.58486 |
4af64ab112ed360f6b12f0fdb0638e9f3a83f55e | 163 | py | Python | exercises/en/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_03_14_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
"docs = list(nlp.pipe(TEXTS))" in __solution__
), "Are you using nlp.pipe wrapped in a list?"
__msg__.good("Great work!")
| 27.166667 | 54 | 0.607362 |
dba0e80df43dfa85874c62240a75a31261530e92 | 1,315 | py | Python | backend/match4healthcare/views.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/match4healthcare/views.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/match4healthcare/views.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.template import loader
def home(request):
context = {}
template = loader.get_template("home.html")
return HttpResponse(template.render(context, request))
def about(request):
context = {}
template = loader.get_template("about.html")
return H... | 23.482143 | 65 | 0.722433 |
91c101c11805609c6207bbbaf7eef4c89bf9cea9 | 28 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 2/2.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | 50-Python-Exercises/Exercises/Exercise 2/2.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | 50-Python-Exercises/Exercises/Exercise 2/2.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | a = 1
_a = 2
_a2 = 3
2a = 4
| 5.6 | 7 | 0.428571 |
7256c39dd80a3e11970260b7c0edb3f22948512a | 1,084 | py | Python | basic_analysis.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | basic_analysis.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | basic_analysis.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | from sklearn.preprocessing import scale,normalize
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score,confusion_matrix
import pandas as pd
... | 24.636364 | 71 | 0.680812 |
4aa477a0ea3ed3e8c8bc71d19c404a50176a2d1f | 2,544 | py | Python | MA/draw_matches.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/draw_matches.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | MA/draw_matches.py | mirrorcoloured/slcypi | c47975b3523f770d12a521c82e2dfca181e3f35b | [
"MIT"
] | null | null | null | def draw_matches(img1, kp1, img2, kp2, matches, color=None):
"""Draws lines between matching keypoints of two images.
Keypoints not in a matching pair are not drawn.
Places the images side by side in a new image and draws circles
around each keypoint, with line segments connecting matching pairs.
... | 49.882353 | 100 | 0.656053 |
436f70f6e434fb2df2d5e970e579d5df1792b87b | 4,434 | py | Python | python/oneflow/compatible/single_client/test/ops/test_cast_to_static_shape.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_cast_to_static_shape.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_cast_to_static_shape.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.590909 | 86 | 0.681326 |
601d8f381bf8a957d5efc5a9ad21d3d356f7acb7 | 1,075 | py | Python | comp/twosigma/FriendCycle/FriendCycle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | comp/twosigma/FriendCycle/FriendCycle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | comp/twosigma/FriendCycle/FriendCycle_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class UnionFind:
def __init__(self, n):
self.fathers = range(n)
self.nsets = n
def find(self, idx):
return self.compressed_find(idx)
def compressed_find(self, idx):
fidx = self.fathers[idx]
if fidx != idx:
self.fathers[idx] = self.compressed_find(fidx)
... | 21.078431 | 58 | 0.513488 |
e08bcd1ad98c87aa99efe951d6754ed5c4cb0518 | 3,529 | py | Python | spotify_gender_ex/workdir.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 1 | 2022-02-05T16:40:13.000Z | 2022-02-05T16:40:13.000Z | spotify_gender_ex/workdir.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | 31 | 2021-06-17T11:59:33.000Z | 2022-03-19T07:05:18.000Z | spotify_gender_ex/workdir.py | Theta-Dev/Spotify-Gender-Ex | 4e5360f115cb3302397b8e1ad1b11ad96b887ad2 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import shutil
import subprocess
class Workdir:
def __init__(self, pathin, ks_password='12345678', key_password='12345678'):
"""Create the required files and directories if needed"""
self.ks_password = ks_password
self.key_password = key_password
self.dir_r... | 36.381443 | 116 | 0.625106 |
e0ae98d3b7ed2a3be31768cbde839d417ac4c1b1 | 14,480 | py | Python | applications/doc_vqa/Extraction/docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/doc_vqa/Extraction/docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/doc_vqa/Extraction/docvqa.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import os
import cv2
import sys
import json
import copy
import collections
import numpy as np
from tqdm import tqdm
import paddle
from paddle.io import Dataset
sys.path.insert(0, "../")
class DocVQAExample(object):
def __init__(self,
question,
doc_tokens,
doc_... | 39.241192 | 85 | 0.539572 |
e0f22fc917c8880257976a7503de22b7a57b65ff | 169 | py | Python | m5-101/content/solutions/web-crawler-changed/section7.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:15:38.000Z | 2021-11-10T12:29:19.000Z | m5-101/content/solutions/web-crawler-changed/section7.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | null | null | null | m5-101/content/solutions/web-crawler-changed/section7.py | PaulCCCCCCH/m5-101 | 81201b00cd81c1747ea0cd5f042a09eda02d6d1c | [
"MIT"
] | 4 | 2021-03-25T13:18:10.000Z | 2021-04-08T13:44:48.000Z | import pickle
import json
import re
# 参照 Section 4 的代码,使用新的索引,搜索文件内容。
########################
### Section 7 Starts ###
### Section 7 Ends ###
###################### | 14.083333 | 33 | 0.47929 |
98f15a831af4078d4a04ef8665915ca4a0646cbb | 15,009 | py | Python | frappe-bench/apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/stock/doctype/serial_no/serial_no.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # 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
from frappe.utils import cint, cstr, flt, add_days, nowdate, getdate
from frappe import _, ValidationError
from erpnext.controllers.stoc... | 39.497368 | 148 | 0.73376 |
c73847d42512530d80a9eb8e53437355be65b08d | 627 | py | Python | envs/rpg/level.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | 2 | 2021-01-07T01:10:49.000Z | 2022-01-21T09:37:16.000Z | envs/rpg/level.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | envs/rpg/level.py | etigerstudio/zilong-on-fire | 5144a471b2d39ea38a47d394e648de00dd13cd8b | [
"MIT"
] | null | null | null | class Level:
@staticmethod
def init():
"""Initialize this level.
Returns:
level_width: The width of the level.
level_height: The height of the level.
time_limit: The timestep limit of the level.
entities: All entities. The Actor entity must be pla... | 31.35 | 78 | 0.572568 |
c77a55fecb733c99b27ce4d3bbce30f284a87945 | 3,666 | py | Python | Kaggle-Competitions/CrowdFlower/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/CrowdFlower/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/CrowdFlower/scripts/models.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import SelectPercentile, chi2
from sklearn.decomposition import TruncatedSVD
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
from sklearn.naive_bayes import MultinomialNB
from sklearn.neighbors import... | 32.442478 | 99 | 0.740044 |
dc05b852fa242449ce70a71c8b39eee529058639 | 2,011 | py | Python | 7-assets/_SNIPPETS/bryan-guner-gists/_python/simple-python-game.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/_python/simple-python-game.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/_SNIPPETS/bryan-guner-gists/_python/simple-python-game.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | game_running = True
while game_running == True:
player = {'name': "Pratikshya", "attack": 10, "heal": 16, "health": 100}
monster = {"name": "Aakash", "attack": 12, "heal": 16, "health": 100}
print('------'*7)
print('enter player name')
player['name'] = input()
print('------'*7)
print(pla... | 30.469697 | 76 | 0.478369 |
31045b73a56b1b4580fffa042d3037e2eb4c9b1d | 11,114 | py | Python | frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # 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
from frappe import _
from frappe.utils import get_fullname, flt, cstr
from frappe.model.document import Document
from erpnext.hr.utils imp... | 33.781155 | 134 | 0.752474 |
733ed697c05688e481ae32815994c57bf322aa7d | 1,788 | py | Python | app/freelancer/serializers.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/serializers.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | null | null | null | app/freelancer/serializers.py | mshirzad/find-my-job | 7dca88d6233649952f0b948156a91af5b96352ff | [
"MIT"
] | 1 | 2022-03-06T17:44:49.000Z | 2022-03-06T17:44:49.000Z | from django.contrib.auth import get_user_model
from rest_framework import serializers
from drf_writable_nested import WritableNestedModelSerializer
from core.models import Profile, Address, Education, Gig
class AddressSerializer(serializers.ModelSerializer):
class Meta:
model = Address
fields ... | 22.35 | 84 | 0.532998 |
b41f4d40276b65442a10e82b690d9f4c80b77874 | 1,034 | py | Python | python/advanced_sw/GIT-SCRAPER/preprocessing.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/GIT-SCRAPER/preprocessing.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/GIT-SCRAPER/preprocessing.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import sqlite3
import json
from pprint import pprint
from selenium import webdriver
from bs4 import BeautifulSoup
from pathlib import Path
from tqdm import tqdm
import json
import time
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import wget
import os
conn = sqlite3.conn... | 21.541667 | 90 | 0.642166 |
b438c413b62043eede6e74e099f0dcf3e60ee92c | 550 | py | Python | Chapter2_Python/Logic.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/Logic.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter2_Python/Logic.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | am_i_broke = False # bool
if am_i_broke is True:
print("I have no money!")
else:
print("I have money!")
my_bank_account = 1000 # int
if my_bank_account < 10000:
print("You have to earn money!")
else:
print("Cool for you!")
# == (Equal)
# < (Less than)
# > (Greater than)
# != (Not eq... | 18.333333 | 37 | 0.581818 |
6f535f2c2a7622d1e2f2b54db58be3ff2cbb8569 | 716 | py | Python | test/test_character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 6 | 2018-12-20T06:50:52.000Z | 2021-12-16T13:08:38.000Z | test/test_character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2020-06-29T07:00:51.000Z | 2020-06-29T07:00:51.000Z | test/test_character_tokenizer.py | katsugeneration/schuss | 30e2303aa0646f0a4424cbc4b5422acc58a06218 | [
"Apache-2.0"
] | 1 | 2022-03-04T07:29:55.000Z | 2022-03-04T07:29:55.000Z | from parameterized import parameterized
from nose.tools import assert_equal, assert_true
import os
import sys
dir_path = os.path.dirname(os.path.abspath(__file__))
module_path = os.path.join(dir_path, "../src/tokenizer")
if module_path not in sys.path:
sys.path.append(module_path)
os.chdir(dir_path)
class TestS... | 28.64 | 58 | 0.73324 |
7d7bd0731e7e638c7b39ee260dc11f3af1184b7c | 1,053 | py | Python | Graphs/graph_AI.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | 2 | 2020-11-25T07:53:48.000Z | 2021-09-19T14:19:51.000Z | Graphs/graph_AI.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null | Graphs/graph_AI.py | Tocha4/-Displacement--Chromatography | 0baf4f9e2d23b39f610217b048d799c6403a259e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'graph_AI.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Graph_AI(object):
def setupUi(self, Graph_AI):
Graph_AI.setOb... | 35.1 | 67 | 0.718898 |
7da815705bc9a2009b98e5fbd5b195c881b30fcd | 3,828 | py | Python | src/visitpy/visit_flow/flow/src/filters/pyocl_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_flow/flow/src/filters/pyocl_ops.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: pyocl_ops.py
author: Cyrus Harrison <cyrush@llnl.gov>
Maysam Moussalem <maysam... | 31.121951 | 73 | 0.617032 |
81c629edd6152aaf5879f59ffd00b4cc2196f88d | 1,605 | py | Python | PYTHON/Regex_and_Parsing/validating_credit_card_number.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/validating_credit_card_number.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Regex_and_Parsing/validating_credit_card_number.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
# It is amazing
TESTER = re.compile(
r"^"
r"(?!.*(\d)(-?\1){3})"
r"[456]"
r"\d{3}"
r"(?:-?\d{4}){3}"
r"$")
for _ in range(int(input().strip())):
print("Valid" if TESTER.search(input().strip()) else "Invalid")
def normal_answer():
for _ in range(int(inp... | 27.20339 | 79 | 0.409346 |
483f69de32be878fe4330d66ed99d8051d6bf8c7 | 81 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C05BitManipulation/questions/5.5-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C05BitManipulation/questions/5.5-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C05BitManipulation/questions/5.5-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 5.5 Debugger
# Explain what the following code does:
# ((n & (n-1)) == 0)
| 16.2 | 39 | 0.555556 |
6f9ed562b3d4355534148ab72674806357180864 | 195 | py | Python | meerkat_consul/test/test_export.py | meerkat-code/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | null | null | null | meerkat_consul/test/test_export.py | meerkat-code/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | 1 | 2018-07-18T16:36:12.000Z | 2018-07-18T16:36:12.000Z | meerkat_consul/test/test_export.py | fjelltopp/meerkat_consul | 983851b360f330ad258e15d45d98251e0fe21100 | [
"MIT"
] | null | null | null | from unittest import TestCase
class LocationTreeTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_should_pass(self):
assert True | 15 | 37 | 0.651282 |
6fdac782bcd03262341ec2eb50b2633dcad02fbb | 996 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex12_list_merge_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex12_list_merge_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex12_list_merge_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch05_datastructures.solutions.ex12_list_merge import merge, merge_with_iter
def inputs_and_expected():
return [([1, 4, 7, 12, 20], [10, 15, 17, 33],
[1, 4, 7, 10, 12, 15, 17, 20, 33]),
... | 27.666667 | 80 | 0.569277 |
d218ad95800e7a2a6da451c967255ca475d573e3 | 1,162 | py | Python | 05.Greedy/HG/P42860.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 1 | 2021-11-21T06:03:06.000Z | 2021-11-21T06:03:06.000Z | 05.Greedy/HG/P42860.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | 2 | 2021-10-13T07:21:09.000Z | 2021-11-14T13:53:08.000Z | 05.Greedy/HG/P42860.py | SP2021-2/Algorithm | 2e629eb5234212fad8bbc11491aad068e5783780 | [
"MIT"
] | null | null | null | def solution(name):
answer = 0
data = []
visited = []
for el in name:
tmp = ord(el) - ord('A')
if tmp > 13:
tmp = 26 - tmp
data.append(tmp)
if tmp > 0:
visited.append(False)
else:
visited.append(True)
answer += sum(data)
... | 23.24 | 43 | 0.39759 |
d25f3de9b085d316a5335b4e4f9de0afb256e42d | 6,465 | py | Python | web-brutator-master/lib/core/Controller.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | web-brutator-master/lib/core/Controller.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | web-brutator-master/lib/core/Controller.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/env python3
# -*- coding: utf-8 -*-
import importlib
import threading
import urllib3
import requests
import sys
import traceback
from lib.core.Bruteforcer import Bruteforcer
from lib.core.Config import *
from lib.core.Exceptions import RequestException
from lib.core.Logger import logger
from lib.core.Output... | 34.388298 | 108 | 0.55406 |
967af0fd0f5bcb18fe6435431e8d6438d215729d | 546 | py | Python | PyStellar/stellar/Git/serializers.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 3 | 2021-01-24T17:07:55.000Z | 2021-02-20T20:11:13.000Z | PyStellar/stellar/Git/serializers.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 61 | 2021-01-10T12:59:01.000Z | 2021-06-24T09:19:20.000Z | PyStellar/stellar/Git/serializers.py | psgstellar/Stellar | 947d4b3d9d6b9c74d4c9ebd29683793a8d86fad2 | [
"Apache-2.0"
] | 1 | 2021-01-14T05:23:32.000Z | 2021-01-14T05:23:32.000Z | from rest_framework import serializers
class GitCommitCheckSerializer(serializers.Serializer):
""" Github Commit Check Parameters """
owner = serializers.CharField(max_length=50, help_text='Git Owner')
repo = serializers.CharField(max_length=50, help_text='Repository')
token = serializers.CharField(ma... | 49.636364 | 96 | 0.761905 |
9688a5df76cd3a23501a01071105eeee0f65a869 | 324 | py | Python | Rofiat055/project8/055.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Rofiat055/project8/055.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | Rofiat055/project8/055.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | import cv2
path = "C:\Users\User\Desktop\Rofiat055\project8\aboutpic.jpg"
img = cv2.imread("aboutpic.jpg");
print(img)
width , height =500 , 500
imgresize = cv2.resize(img , (width , height))
print(imgresize.shape)
print(imgresize)
cv2.imgshow("aboutpic", img)
cv2.imgshow("about resized" , imgresize)
cv2.waitke... | 18 | 62 | 0.722222 |
73db5ef79dd9b4e59cdf6914f0812f8d512c56c9 | 15,845 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/httpapi/ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/httpapi/ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/httpapi/ftd.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | 40.943152 | 149 | 0.67687 |
73eed0840b752468d5a0f6798da5e3794a73cf5e | 5,543 | py | Python | lale/lib/autogen/orthogonal_matching_pursuit.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 265 | 2019-08-06T14:45:43.000Z | 2022-03-30T23:57:48.000Z | lale/lib/autogen/orthogonal_matching_pursuit.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 467 | 2019-08-08T02:01:21.000Z | 2022-03-25T16:12:00.000Z | lale/lib/autogen/orthogonal_matching_pursuit.py | vishalbelsare/lale | 654ca29ec0234b478d26724a25df28b28f5c0bc0 | [
"Apache-2.0"
] | 81 | 2019-08-07T19:59:31.000Z | 2022-03-31T09:11:58.000Z | from numpy import inf, nan
from sklearn.linear_model import OrthogonalMatchingPursuit as Op
from lale.docstrings import set_docstrings
from lale.operators import make_operator
class _OrthogonalMatchingPursuitImpl:
def __init__(self, **hyperparams):
self._hyperparams = hyperparams
self._wrapped_mo... | 34.428571 | 169 | 0.467797 |
73ff3268aaddd37fc85f4d8c4aa8430d7e25ec12 | 141 | py | Python | aws/lambda/python/3/index.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 2 | 2017-07-07T21:47:22.000Z | 2017-07-12T05:04:11.000Z | aws/lambda/python/3/index.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 5 | 2017-09-08T04:16:48.000Z | 2017-11-01T17:21:41.000Z | aws/lambda/python/3/index.py | jwoos/dockerfiles | 9a3e08a004eb9e6a15c2a212edc12a7893b6143e | [
"MIT"
] | 1 | 2019-01-14T16:03:45.000Z | 2019-01-14T16:03:45.000Z | import os
import sys
def lambda_handler(event, context):
print('event:', event)
print('context:', context)
return 'It works!'
| 14.1 | 35 | 0.659574 |
fb88c90d07558d553cdc82d85f29ff3073dca273 | 2,154 | py | Python | src/config_db/ska_sdp_config/entity/deployment.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/config_db/ska_sdp_config/entity/deployment.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/config_db/ska_sdp_config/entity/deployment.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | """Deployment configuration entities."""
import re
import copy
# Permit identifiers up to 96 bytes in length
_DEPLOY_ID_RE = re.compile("^[A-Za-z0-9\\-]{1,96}$")
# Supported deployment types
DEPLOYMENT_TYPES = {
'process-direct', # Directly spawn local processes
'kubernetes-direct', # Workflow directly c... | 27.265823 | 78 | 0.597493 |
f7fba69c4135fc23e640d964279a52b9682f3836 | 1,110 | py | Python | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/_PYTHON/code-examples-master/aws/python/dynamodb/create_and_tag_table.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z | # Creates a DynamoDB Table: test_20181030 and Tags it
import boto3
import time
session = boto3.Session(region_name='eu-west-1', profile_name='test')
resource = session.resource('dynamodb')
client = session.client('dynamodb')
def create_table():
table_name = "test_{0}".format(time.strftime("%Y%m%d"))
response... | 27.073171 | 74 | 0.581081 |
f754d55ff2b664acf18674f9f89557b909f8fb07 | 2,077 | py | Python | research/cv/Pix2Pix/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-07-03T06:52:20.000Z | 2021-07-03T06:52:20.000Z | research/cv/Pix2Pix/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/Pix2Pix/postprocess.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... | 34.04918 | 110 | 0.646124 |
f7601325705c91358b07693d12d41fd7d95fde71 | 2,305 | py | Python | 2019/finals/misc-stuffed-finals/bomb_creation/huffman.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | 2019/finals/misc-stuffed-finals/bomb_creation/huffman.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | 2019/finals/misc-stuffed-finals/bomb_creation/huffman.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.328947 | 79 | 0.707592 |
f77bd063e3c72586bf7b1209f1f1b13577090050 | 917 | py | Python | tests/data/test_wrds_comp_anncomp.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | tests/data/test_wrds_comp_anncomp.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | tests/data/test_wrds_comp_anncomp.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | import unittest
import pandas as pd
from frds.data.wrds.execucomp import Anncomp
from frds.io.wrds import load
class AnncompLoadTestCase(unittest.TestCase):
def setUp(self) -> None:
self.ANNCOMP = load(Anncomp, use_cache=False, save=False, obs=100)
def test_load_anncomp(self):
self.assertIsIn... | 29.580645 | 74 | 0.664122 |
58858a02f7aeb475fbf2ae07db427887b058638f | 7,024 | py | Python | Textadventure/inventory.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/inventory.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | Textadventure/inventory.py | clemens2107/textadventure | 870f3ff98accdadad386a2cae4bd4328341f7eb9 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from items.items import drop_list
game_inventory = []
armor_categorys = ["helm", "chest_armor", "belt",
"boot", "glove", "pant",
"shield", "shoulder"]
non_armor_categorys = ["amulet", "ring"]
weapon_categorys = ["sword", "axe", "mace",
... | 36.020513 | 95 | 0.628132 |
54384813ba463f525b74a0e7347afe9bcba698a3 | 1,188 | py | Python | Packs/ConvertTimezoneFromUTC/Scripts/ConvertTimezoneFromUTC/ConvertTimezoneFromUTC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ConvertTimezoneFromUTC/Scripts/ConvertTimezoneFromUTC/ConvertTimezoneFromUTC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ConvertTimezoneFromUTC/Scripts/ConvertTimezoneFromUTC/ConvertTimezoneFromUTC.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
import pytz
''' GLOBAL VARIABLES '''
args = demisto.args()
''' Helper Code '''
def determine_correct_format(time, fmt):
time = datetime.strptime(time, fmt)
return time
def convert_UTC_Timezone(tim... | 21.6 | 79 | 0.666667 |
546ac4c33e0f6d1dae82d0b811fa91fc4e256573 | 1,608 | py | Python | Packs/CommonScripts/Scripts/Jmespath/Jmespath_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/Jmespath/Jmespath_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/Jmespath/Jmespath_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from Jmespath import jmespath_search, main
import demistomock as demisto
import json
def test_search():
expression = "AutoFocus.IP[?IndicatorType=='IPV4_ADDRESS'].{Value: IndicatorValue, Type: IndicatorType}"
value = {
"AutoFocus": {
"IP": [{
"IndicatorType": "IPV4_ADDRESS"... | 27.254237 | 108 | 0.485697 |
3fe83936eef8c2cab0380ec4d648bd0306e4e3c1 | 7,232 | py | Python | tools/codegen/api/lazy.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | tools/codegen/api/lazy.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | tools/codegen/api/lazy.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | from typing import List, Union, Tuple
from tools.codegen.model import (Type, BaseTy, BaseType, OptionalType,
ListType, OperatorName, FunctionSchema,
Return)
from tools.codegen.api.types import (BaseCppType, BaseCType, OptionalCType,
... | 41.803468 | 99 | 0.631775 |
4d6f4aa06eae6926c5f0b0eb55a92df2e03fbee7 | 18,877 | py | Python | fhirclient/r4models/riskevidencesynthesis.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/riskevidencesynthesis.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/riskevidencesynthesis.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class RiskEvidenceSynthesis(domainresource.DomainResource):
""" A quantified esti... | 41.216157 | 136 | 0.60783 |
c437d5d299f7913b50f19ea8a8d64c5bd94aebd5 | 164 | py | Python | diversos/lista2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/lista2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/lista2.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | lista = [124,345, 75,46,6,7,3,1,7,0,999,66,888]
lista2 = sorted(lista)
print(lista)
lista.sort()
print(lista)
print(lista2)
lista.sort(reverse=True)
print(lista) | 16.4 | 48 | 0.707317 |
c03e017f1398b139c10d6810b5aba2462e6252b0 | 120 | py | Python | python/unittest/mock/medium/06_class_attributes/pricer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/06_class_attributes/pricer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/unittest/mock/medium/06_class_attributes/pricer.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Pricer:
DISCOUNT = 0.80
def get_discounted_price(self, price):
return price * self.DISCOUNT
| 20 | 43 | 0.641667 |
58e3ea074ba2da9dab7a87971e43fb9f9e0d3353 | 5,761 | py | Python | prep/vectorize_brt_osm.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | prep/vectorize_brt_osm.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | prep/vectorize_brt_osm.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | import numpy as np
import pandas
from model.topoml_util.GeoVectorizer import GeoVectorizer, GEO_VECTOR_LEN, RENDER_INDEX, FULL_STOP_INDEX, STOP_INDEX
TOPOLOGY_TRAINING_CSV = '../files/brt_osm/brt_osm.csv'
GEODATA_VECTORIZED = '../files/brt_osm/brt_osm_vectorized.npz'
MAX_SEQUENCE_LEN = 300
print('Reading data...')
t... | 51.4375 | 118 | 0.745183 |
3dc40f28e1088ed93a2d9e11c150192e53bc0291 | 1,153 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/ExampleTrees.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/ExampleTrees.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch08_binary_trees/intro/ExampleTrees.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.util import TreeUtils
from ch08_binary_trees.intro.intro_binary_search_tree import insert
from ch08_binary_trees.intro.intro_binary_tree_node import BinaryTreeNode
def create_example_tree():
a1 = Binary... | 18.901639 | 73 | 0.64961 |
9acc15d25beb3d8b314c4de4bc0686cf915606c2 | 1,372 | py | Python | loesungsvorschlaege/ml_3_kuenstliche_neuronale_netze/praxis/04/main.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_3_kuenstliche_neuronale_netze/praxis/04/main.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | loesungsvorschlaege/ml_3_kuenstliche_neuronale_netze/praxis/04/main.py | severinhaller/einf-machinelearning | 4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import neural_network_mnist
mnist_train = pd.read_csv("mnist_train.csv", header=None)
train_set_size = len(mnist_train.index)
print(train_set_size)
matrix_pixel = mnist_train.iloc[0:train_set_size, 1:785].values
matrix_pixel = (matrix_pixel / 255.0 * 0.99) + 0.01
vektor_ziffern =... | 34.3 | 76 | 0.712828 |
492642c8123d0b6fd2c22b57823184acc30cc904 | 147 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/list_concatenate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/list_concatenate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/list_concatenate.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def concatenate_list_data(list):
result=''
for element in list:
result+=str(element)
return result
print(concatenate_list_data([1,5,12,2,7]))
| 21 | 42 | 0.748299 |
3be3ffc2117827f46fb01be913a193963f7e43ed | 567 | py | Python | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def letterCombinations(self, digits: str) -> List[str]:
di = {"2": "abc", "3": "def", "4":"ghi", "5": "jkl", "6": "mno", "7":"pqrs","8":"tuv", "9":"wxyz"}
if digits=="":
return []
output = [alph for alph in di[digits[0]]]
# 23
for digit in digits[1... | 35.4375 | 106 | 0.428571 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.