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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aceb59e25b0dd75eb65101581e909f12f91491dc | 6,440 | py | Python | benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 5 | 2018-04-24T13:41:12.000Z | 2019-07-09T07:32:09.000Z | benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 14 | 2021-10-14T06:58:50.000Z | 2021-12-17T11:51:07.000Z | benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 7 | 2020-08-31T22:49:59.000Z | 2020-09-15T14:29:07.000Z | import torch
from torch.autograd import functional
import time
from argparse import ArgumentParser
from collections import defaultdict
from typing import NamedTuple, Callable, List, Any
import ppl_models
import vision_models
import audio_text_models
from utils import to_markdown_table, TimingResultType, InputsType, ... | 35.384615 | 115 | 0.670342 |
4f888a3f48542a490320182e2ec58dfaa34e06fc | 4,118 | py | Python | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/data_source_postgresql.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/data_source_postgresql.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage-postgresql/src/watchmen_storage_postgresql/data_source_postgresql.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional
from sqlalchemy import create_engine
from sqlalchemy.engine import Engine
from watchmen_model.common import DataModel
from watchmen_model.system import DataSource, DataSourceParam
from watchmen_storage import DataSourceHelper, UnexpectedStorageException
from watchmen_utilities import... | 33.754098 | 112 | 0.766391 |
8b383751dc8a622239dd746f7b037f2483d1d287 | 2,250 | py | Python | src/apps/TableEditor.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-26T16:16:14.000Z | 2020-05-26T16:16:14.000Z | src/apps/TableEditor.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/apps/TableEditor.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-16T20:09:17.000Z | 2020-05-16T20:09:17.000Z | import sys, os
import timeit
from PyQt5.QtWidgets import QApplication, QMainWindow, QDesktopWidget, \
QMessageBox
sys.path.append(os.getcwd()+'/../view')
from mzMLTableView import mzMLTableView # noqa E402
class TableEditor(QMainWindow):
def __init__(self):
self.testForTime = False
if self.t... | 27.108434 | 72 | 0.555556 |
0fc0f11704381d19e2918d7fd56df2efa1bbd89f | 786 | py | Python | diagonal_difference.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | diagonal_difference.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | diagonal_difference.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
def diagonalDifference(arr):
lrDiagonal = []
rlDiagonal = []
lr_a = 0
rl_a = n - 1
for i in arr:
lrDiagonal.append(i[lr_a])
rlDiagonal.append(i[rl_a])
lr_a += 1
rl_a -= 1
lr_total = sum(lr... | 16.723404 | 60 | 0.576336 |
e84c58bee92123dd347aae5e14a1f2b20ae4e088 | 1,613 | py | Python | Curso-Em-Video-Python/2Exercicios/092_cadastro_de_trabalhovem_python.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/092_cadastro_de_trabalhovem_python.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/092_cadastro_de_trabalhovem_python.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | '''
from datetime import date
atual = date.today().year
dados = {}
dados['nome'] = str(input('Nome: '))
nascimento = int(input('Ano de Nascimento: '))
dados['idade'] = atual - nascimento
dados['ctps'] = int(input('Carteira de Trabalho (0 não tem): '))
if dados['ctps'] == 0:
print('=-'*13)
print(f'{"Dados da Pe... | 36.659091 | 97 | 0.600744 |
e88a9d27ac899a3171b842431aebbc2268113490 | 7,566 | py | Python | src/Sephrasto/UI/CharakterMinderpakt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/CharakterMinderpakt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | src/Sephrasto/UI/CharakterMinderpakt.py | qeqar/Sephrasto | ce46d46299b2c793f015e25c98908773c39b1dee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterMinderpakt.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import ... | 51.469388 | 108 | 0.718213 |
fa451e37f7c8f9ed202f851818c592ec084db533 | 971 | py | Python | exercises/zh/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_04_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert len(pattern1) == 2, "pattern1应该描述了两个词符。"
assert len(pattern2) == 2, "pattern2应该描述了两个词符。"
assert (
len(pattern1[0]) == 1
), "pattern1的第一个词符只需要一个属性。"
assert any(
pattern1[0].get(l) == "iphone" for l in ("LOWER", "lower")
), "pattern1的第一个词符应该匹配到小写形式的`iphone`。"
... | 30.34375 | 68 | 0.577755 |
d74c36faf972659f0780571ad4b6736dbd785616 | 15,208 | py | Python | BitwardenDecryptBrute-main/BitwardenDecrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 32 | 2021-12-07T12:08:20.000Z | 2022-03-31T07:47:27.000Z | BitwardenDecryptBrute-main/BitwardenDecrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | BitwardenDecryptBrute-main/BitwardenDecrypt.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-12-07T11:55:26.000Z | 2021-12-07T12:34:01.000Z | #!/usr/bin/env python3
# Copyright © 2020-2021 Gurpreet Kang
# All rights reserved.
#
# Released under the "GNU General Public License v3.0". Please see the LICENSE.
# https://github.com/GurpreetKang/BitwardenDecrypt
# BitwardenDecrypt
#
# Decrypts an encrypted Bitwarden data.json file (from the desktop App).
#
# To... | 38.795918 | 206 | 0.636573 |
ad363ac3f494906d84f7105416cf0ba5f29ac9c3 | 650 | py | Python | zencad/examples/Models/organizer/case.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/Models/organizer/case.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/Models/organizer/case.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from zencad import *
def case(w, h, l, t, r, z, s):
w = w * s
h = h * 0.95
return (
box(w, l, h)
- box(w - 2 * t, l - 2 * t, h - t).translate(t, t, t)
- cylinder(r=r, h=t + 1).rotateX(deg(90)).translate(w / 2, t + 0.5, h)
+ box(w - 2... | 25 | 86 | 0.423077 |
adb15da5f1f383bb6ba24228d017357d18e5ae4a | 327 | py | Python | pages/themes/beginners/OOP/examples/dices_game.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/OOP/examples/dices_game.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | pages/themes/beginners/OOP/examples/dices_game.py | ProgressBG-Python-Course/ProgressBG-Python | 6429833696c2c50d9f902f62cc3a65ca62659c69 | [
"MIT"
] | null | null | null | from random import randint
from time import sleep
class Die():
"""docstring for Die"""
def __init__(self):
self.value = 555
def throw(self):
self.value = randint(1,6)
def show(self):
print(self.value)
die1 = Die()
print("I'm shuffling the die.")
die1.throw()
key = input("Press a key to stop...")
die1.... | 13.625 | 37 | 0.66055 |
ade0cde98bd884271a95869d569aa1b61bb39890 | 1,344 | py | Python | Archiv/Docker_Image_App/app_data/app.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | null | null | null | Archiv/Docker_Image_App/app_data/app.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | null | null | null | Archiv/Docker_Image_App/app_data/app.py | LennartFertig/BigData | e74761b16812fd034519c06897329ea9ba9968df | [
"Apache-2.0"
] | 1 | 2021-10-19T07:45:12.000Z | 2021-10-19T07:45:12.000Z |
from flask import Flask, render_template, request, redirect, url_for, flash
from flask_sqlalchemy import SQLAlchemy
import psycopg2
import psycopg2.extras
#Mappings
### Muss angepasst werden
class Flights(db.Model):
flight_no = db.Column(db.Integer, primary_key = True)
origin = db.Column(db.Strin... | 22.779661 | 78 | 0.667411 |
385e888a216d38830f691679da0eaf51cf88886c | 1,602 | py | Python | Backend.py | CorinnaJugendhackt/Strandempfehlung | a490a12763b7330befe4142511f94a961e14d9fd | [
"MIT"
] | null | null | null | Backend.py | CorinnaJugendhackt/Strandempfehlung | a490a12763b7330befe4142511f94a961e14d9fd | [
"MIT"
] | null | null | null | Backend.py | CorinnaJugendhackt/Strandempfehlung | a490a12763b7330befe4142511f94a961e14d9fd | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from flask import Flask
from flask import render_template
from flask import request
import pyowm
import os
import json
owm = pyowm.OWM(API_key = os.environ["APIKEY"])
def conversionTemp(kelvin):
celsius = kelvin-273.15
return celsius
def compareTemperature(temp1, temp2):
if (temp1 > temp2):
... | 28.607143 | 123 | 0.66417 |
38ae9bc83f7eb072a9fe4803e16e33f388329fe5 | 3,965 | py | Python | gdp1/assignment_4/student_db_extended.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_4/student_db_extended.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | gdp1/assignment_4/student_db_extended.py | einekatze/gdp1-homework | 28889dfa1863e1f1dee164e5b465dddb1cfacfcc | [
"MIT"
] | null | null | null | from peewee import *
from random import choice
# import logging
# logger = logging.getLogger("peewee")
# logger.setLevel(logging.DEBUG)
# logger.addHandler(logging.StreamHandler())
db = SqliteDatabase(":memory:")
class BaseModel(Model):
class Meta:
database = db
class Student(BaseModel):
name = Ch... | 31.220472 | 111 | 0.647415 |
935360ccb93fcf28a3b4b2b078ec9e76bd661dad | 2,423 | py | Python | research/cvtmodel/vgg/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/vgg/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/vgg/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.164179 | 117 | 0.74123 |
9360d198aea27d60c0003a87d7201071d9ef6ddc | 1,242 | py | Python | DeepRTS/python/_py_config.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 1 | 2020-01-08T22:20:37.000Z | 2020-01-08T22:20:37.000Z | DeepRTS/python/_py_config.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 1 | 2021-11-11T18:39:56.000Z | 2021-11-11T22:15:59.000Z | DeepRTS/python/_py_config.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | null | null | null |
class Config:
DEFAULTS = dict(
render=True,
view=False,
inputs=False,
caption=False,
unit_health=True,
unit_outline=True,
unit_animation=True,
audio=False,
audio_volume=50
)
class Map:
TEN = "10x10-2v2.json"
FIFTEEN ... | 27 | 54 | 0.566023 |
ea4136ebd700b9bca1fcdbb1ac83e92f5d119aee | 30 | py | Python | Ejericio.py | SantyCr/webtickers-1 | eb5a7ea326e435f701edd6a79745250c4b523be3 | [
"MIT"
] | null | null | null | Ejericio.py | SantyCr/webtickers-1 | eb5a7ea326e435f701edd6a79745250c4b523be3 | [
"MIT"
] | null | null | null | Ejericio.py | SantyCr/webtickers-1 | eb5a7ea326e435f701edd6a79745250c4b523be3 | [
"MIT"
] | 2 | 2021-09-20T01:40:50.000Z | 2021-10-01T23:22:14.000Z | println("Esto es un aprueba")
| 15 | 29 | 0.733333 |
17c3df5f26d1df3cc151a42218f9739549f8f93e | 310 | py | Python | tests/server/middleware/test_config.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | tests/server/middleware/test_config.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | tests/server/middleware/test_config.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import pytest
import server.config
def test_monosi_dir():
pass
def test_db_config_is_loaded():
pass
def test_db_config_incorrect_details():
pass
def test_config_base():
pass
def test_config_env_dev():
pass
def test_config_env_test():
pass
def test_config_env_prod():
pass
| 11.481481 | 39 | 0.725806 |
17d38f8b4d1ce5c3b1c324be6b5e20365cbc09b7 | 9,628 | py | Python | src/onegov/election_day/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/app.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import os
import re
from datetime import datetime
from dectate import directive
from more.content_security import SELF
from more.content_security.core import content_security_policy_tween_factory
from onegov.core import Framework
from onegov.core import utils
from onegov.core.datamanager import FileDataManager
from on... | 29.175758 | 79 | 0.680307 |
17f2f884f1e1b3a861c4043db10693a16df0937b | 349 | py | Python | ClusterInstallation/tf_test.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ClusterInstallation/tf_test.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | null | null | null | ClusterInstallation/tf_test.py | gian1312/suchen | df863140fd8df1ac2e195cbdfa4756f09f962270 | [
"Apache-2.0"
] | 1 | 2019-11-29T12:28:33.000Z | 2019-11-29T12:28:33.000Z | #/usr/bin/env python
from __future__ import print_function
import tensorflow as tf
vers = tf.__version__
print(vers)
hello = tf.constant('Hello, TensorFlow!')
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
sess = tf.Session()
print(sess.run(hello))
print(ses... | 21.8125 | 41 | 0.716332 |
a4b7f2517b7274fd62bc12ddaec580b6b9b6e9c8 | 3,194 | py | Python | server/tests/conftest.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/tests/conftest.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/tests/conftest.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | import pytest
from django.contrib.auth import get_user_model
from rest_framework.test import APIClient
from bumf.core.models import (
Dossier, Project, ProjectScopeChoices, RealAccount, RealAccountVariants,
RealTransaction, VirtualAccount, VirtualAccountVariants, VirtualTransaction,
)
@pytest.fixture
def use... | 22.814286 | 82 | 0.700063 |
eaedf1b860e8a3390e900638cf30f32bc66c6c44 | 3,053 | py | Python | src/data_type/data_type.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/data_type/data_type.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/data_type/data_type.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
a = 1425
print(type(a))
b = (-45263)
print(type(b))
c = 0
print(type(c))
g = 1.03
print(type(g))
h = -11.23
print(type(h))
i = .34
print(type(i))
j = 2.12e-10
print(type(j))
k = 5E220
print(type(k))
x = complex(1, 2)
print(type(x))
print(x)
z = 1 + 2j
print(type(z))
z = 1 + 2... | 18.391566 | 52 | 0.636096 |
f4b88bf7b5861c8a509aeef78cdf21afa1b023cf | 1,353 | py | Python | tests/services/test_notification.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/services/test_notification.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/services/test_notification.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from tests.seeder import Seeder
from tests.utils import UtilActions
def test_send_recycling_events(app, db, seeder: Seeder, utils: UtilActions):
app.config["SERVER_NAME"] = "127.0.0.1"
with app.app_context():
from project.dateutils import create_berlin_date
from project.services.notification i... | 39.794118 | 81 | 0.705839 |
76256c3072ce9c41d34209a4ad4de3e8a2313aa8 | 663 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_si7006.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_si7006.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/i2c/test_si7006.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | """
Testing si7006 python driver
The below i2c configuration is needed in your board.json.
"si7006": {
"type": "I2C",
"port": 1,
"addrWidth": 7,
"freq": 400000,
"mode": "master",
"devAddr": 64
}
"""
from si7006 import SI7006
print("Testing si7006 ...")
si7006Dev = SI7006()
si7006Dev.open("si7006")
versio... | 18.416667 | 57 | 0.687783 |
bfe0af89d911b2e19adae4688d65bbd41e22e4f0 | 1,612 | py | Python | server/apps/movie/migrations/0001_initial.py | Mayandev/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 129 | 2019-04-20T08:23:25.000Z | 2022-03-14T10:02:23.000Z | server/apps/movie/migrations/0001_initial.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 9 | 2019-05-19T15:06:17.000Z | 2021-12-14T06:47:14.000Z | server/apps/movie/migrations/0001_initial.py | heartplus/django_morec | 8d115f76ad69d7aa78b07dc06aa7047979ad134b | [
"MIT"
] | 34 | 2019-05-06T06:37:17.000Z | 2021-12-09T02:27:58.000Z | # Generated by Django 2.1.4 on 2019-04-22 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Actor',
fields=[
('id', models.AutoField(au... | 32.897959 | 114 | 0.516749 |
0d6523e0407c5ceedb66cb1ea754301895897a7f | 3,540 | py | Python | src/bo4e/bo/zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/bo/zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/bo/zeitreihe.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Zeitreihe class and corresponding marshmallow schema for de-/serialization
"""
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt, GeschaeftsobjektSchema
from bo4e... | 42.650602 | 172 | 0.760734 |
0dac741d38589cc197148b7bb5c44b3cd9affd60 | 8,923 | py | Python | fbtor/test/FBoolectorTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/test/FBoolectorTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/test/FBoolectorTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | from fbtor.BitVecConvert import BitVecConvStatic
from fbtor.FBoolectorTypes import WIDTH
import pytest
from fbtor.FBoolector import FBoolector
from pyboolector import Boolector, BTOR_OPT_MODEL_GEN
from .test_set import *
from .test_converter import set_fSign,set_fMantisse,set_fExponent
""" Test cases for the FBoolecto... | 44.839196 | 142 | 0.617842 |
21979c73202fb16cb81bde7c8a1e919d2f831e0d | 1,212 | py | Python | site/public/courses/DS-2.4/Notebooks/Advanced_Keras/NN_scratch_TF_4.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/DS-2.4/Notebooks/Advanced_Keras/NN_scratch_TF_4.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/DS-2.4/Notebooks/Advanced_Keras/NN_scratch_TF_4.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
# This code needs TF 2.0
inputs = tf.keras.Input(shape=(4,))
x = tf.keras.layers.Dense(3, activation=tf.nn.sigmoid)(inputs)
outputs = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid)(x)
model = tf.keras.Model(inputs=inputs, outputs=outputs)
# Instantiate a logis... | 34.628571 | 86 | 0.65264 |
df56899435fb5bdc1d107d217e43b9d278641b53 | 664 | py | Python | iablaka/core/models.py | mactov/iablaka | 7006782cf1a9843f2e5111235ce4c389186ecab9 | [
"MIT"
] | null | null | null | iablaka/core/models.py | mactov/iablaka | 7006782cf1a9843f2e5111235ce4c389186ecab9 | [
"MIT"
] | null | null | null | iablaka/core/models.py | mactov/iablaka | 7006782cf1a9843f2e5111235ce4c389186ecab9 | [
"MIT"
] | null | null | null | from django.db import models
class Company(models.Model):
name = models.CharField(max_length=32)
class Meta():
verbose_name_plural = "companies"
def __str__(self):
return self.name
class Partner(models.Model):
name = models.CharField(max_length=32)
def __str__(self):
ret... | 26.56 | 74 | 0.707831 |
33a0b1201fbeceaa5a32a04b7f10c663faff1889 | 92 | py | Python | 2015/02/nurse-body-weight/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/02/nurse-body-weight/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/02/nurse-body-weight/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 = '14Eb1DQmhNqZ7re5vnieiBM3XGx3hUnSWACIcc-0NTgY'
| 23 | 68 | 0.836957 |
1d334a501218fc9166afc9d0e0c886dd2199b8e1 | 172 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_1/set_budget_against_as_cost_center.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_1/set_budget_against_as_cost_center.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_1/set_budget_against_as_cost_center.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "budget")
frappe.db.sql("""
update
`tabBudget`
set
budget_against = 'Cost Center'
""")
| 15.636364 | 51 | 0.651163 |
d55e8207bf134cc27285716b6b3bd05decb96855 | 2,093 | py | Python | ProjectLib/Logger.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | ProjectLib/Logger.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | ProjectLib/Logger.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2021-Today
@author: marie-christin.wimmler@tu-dresden.de
Adopted from: https://dev.to/duyixian1234/three-ways-to-automatically-add-functions-and-methods-calling-log-for-python-code-5fd0
"""
import logging
logger = logging.getLogger(__name__)
## Decorator to ... | 29.069444 | 128 | 0.676063 |
c3a8952747824b9bd77974a3e7b62d1b2d568bb1 | 1,735 | py | Python | Packs/Base/Scripts/SearchIndicatorRelationships/SearchIndicatorRelationships_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Base/Scripts/SearchIndicatorRelationships/SearchIndicatorRelationships_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Base/Scripts/SearchIndicatorRelationships/SearchIndicatorRelationships_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import json
import io
import demistomock as demisto
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
return json.loads(f.read())
def test_to_context_verbose_false():
"""
Given:
- the data section of the contents of the servers response to the SearchRelationships... | 30.438596 | 98 | 0.74121 |
f67089f335adb9f5ce75fe1d65aa52aef0579191 | 800 | py | Python | utilities.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 5 | 2015-07-28T17:45:21.000Z | 2019-11-24T15:47:01.000Z | utilities.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-22T15:21:36.000Z | 2020-05-22T15:38:48.000Z | utilities.py | DanGrayson/cgc1 | b9d2de234694aa454248d9bc10ccb22ab92792cd | [
"MIT"
] | 1 | 2020-05-09T21:24:10.000Z | 2020-05-09T21:24:10.000Z | #Copyright (c) 2014 Gary Furnish
#Licensed under the MIT License (MIT)
import os, errno
def printing_chdir(path):
print("cd " + path)
os.chdir(path)
def printing_mkdir(path):
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise # raises the error ag... | 30.769231 | 76 | 0.6575 |
9c93ee65c9abe477cc1c7d1d371723d9c087cc69 | 1,319 | py | Python | Server/client/disease.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | Server/client/disease.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | Server/client/disease.py | TateYdq/DietRegimen | 66c88e84b7c4d9226db1d9567d300b1c6f7344b7 | [
"MIT"
] | null | null | null | import requests
import json
from utils.config import *
ss = requests.session()
def getDiseasesLists():
data = {
# "keyword":""
"keyword":"心脏"
}
url = URL.format(env=cur_url, term=client_url, action="/health/getDiseasesLists")
getReq(url,ss,data=data)
def searchDisease():
data = {
... | 23.553571 | 86 | 0.623958 |
14aeabb66e416123df754844b4e4fb53b0b0ad14 | 2,517 | py | Python | storage/emulated/0/qpython/lib/python3.2/site-packages/fuzzywuzzy/StringMatcher.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/fuzzywuzzy/StringMatcher.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | storage/emulated/0/qpython/lib/python3.2/site-packages/fuzzywuzzy/StringMatcher.py | wangkaibiao/SettlersFinancialData3 | 498249e14f24bfa3186f07e8f66ee624d08c6ff1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
StringMatcher.py
ported from python-Levenshtein
[https://github.com/miohtama/python-Levenshtein]
License available here: https://github.com/miohtama/python-Levenshtein/blob/master/COPYING
"""
from Levenshtein import *
from warnings import warn
class StringMa... | 31.074074 | 91 | 0.592372 |
2efdea515ae7a9b9608a772c97915ddba62484b9 | 1,741 | py | Python | src/onegov/form/submissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/submissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/form/submissions.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from inspect import getmembers
from wtforms.validators import DataRequired
from onegov.form.fields import UploadField
from onegov.form.validators import StrictOptional
def prepare_for_submission(
form_class,
for_change_request=False,
force_simple=True,
):
# force all upload fields to be ... | 30.54386 | 72 | 0.643308 |
25d464c2e91a33b758c2b734e67d67843b48359f | 9,977 | py | Python | course/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | course/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | course/views.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | from django.http import JsonResponse
from django.db import transaction
from django.shortcuts import get_object_or_404
from rest_framework.views import APIView
from rest_framework.parsers import JSONParser
from rest_framework.exceptions import ParseError
from rest_framework.response import Response
from user.models imp... | 42.455319 | 123 | 0.613311 |
25fde396ee3f0ccd8a7f9d2ac5da935931d5576c | 1,105 | py | Python | Lab7/ProcessGraph.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | Lab7/ProcessGraph.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | Lab7/ProcessGraph.py | zwimer/IntroToOpenSourceLabs | 2c8592d84355cd4c80b2693e08c931902bb85e6f | [
"MIT"
] | null | null | null | def Neighbor(aOld, bOld):
a = sorted(aOld)
b = sorted(bOld)
i = 0
for k in range(len(a)):
if a[i] in b:
b.remove(a[i])
a.remove(a[i])
else:
i += 1
i = 0
for k in range(len(b)):
if b[i] in a:
a.remove(b[i])
b.remo... | 22.55102 | 59 | 0.498643 |
d3a4ad162c900a4feb27182591096b5304172a7b | 202 | py | Python | src/onegov/stepsequence/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/stepsequence/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/stepsequence/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.stepsequence.core import (
Step, StepSequenceRegistry, as_step_registry_id
)
step_sequences = StepSequenceRegistry() # noqa
__all__ = ['Step', 'step_sequences', 'as_step_registry_id']
| 25.25 | 59 | 0.777228 |
6ca911b5e1d75d663cbfbddc09dbdc9297e2ddcb | 2,023 | py | Python | PINp/2014/Valkovskey_M_A/task_8_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Valkovskey_M_A/task_8_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Valkovskey_M_A/task_8_49.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 8. Вариант 49.
#Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавшие слово ... | 19.833333 | 355 | 0.675235 |
4c8e619d27222bb7d71965f821078291029d7dbf | 816 | py | Python | custom_user/admin.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/admin.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | custom_user/admin.py | EE/flexdb | 08a80b9e56201e678ef055af27bdefa6d52bcbf5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from custom_user.models import CustomUser, UsersPermissions
from custom_user.forms import UserCreationForm
class CustomUserAdmin(UserAdmin):
# The forms to add and change user instances
add_form = UserCreationForm
list_displa... | 29.142857 | 119 | 0.656863 |
4cd83a14eda0c5778865d8ccdbe6b90c0965584b | 1,736 | py | Python | spider_django/django_app/migrations/0003_auto_20200806_1123.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | spider_django/django_app/migrations/0003_auto_20200806_1123.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | spider_django/django_app/migrations/0003_auto_20200806_1123.py | Tiangewang0524/zzu_spider | eddd534f6a7bfb39eec5a7e240f830550b2285cb | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2020-08-06 11:23
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_app', '0002_auto_20200806_1022'),
]
operations = [
migrations.RenameField(
model_name='tspiderconf',
old_name='author... | 27.125 | 50 | 0.534562 |
1acd017049945f50dacf4900089ced2ba38b2fa7 | 4,407 | py | Python | geol/utils/utils.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | geol/utils/utils.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | geol/utils/utils.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
Utilies for general purposes
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com> Michele Ferretti <mic.ferretti@gmail.com>
import osmnx
from shapely import geometry
import geopandas as gpd
from geol.utils import constants
import json
import os
import errno
import re
import numpy as np
import pandas as p... | 25.622093 | 107 | 0.632176 |
b37a666baac31087775694031c19394730d20f39 | 364 | py | Python | collections_deque.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | collections_deque.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | collections_deque.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | from collections import deque
storage = deque()
N = int(input())
for i in range(N):
io = input().split()
if(io[0] == 'append'):
storage.append(io[1])
elif(io[0] == 'popleft'):
storage.popleft()
elif(io[0] == 'appendleft'):
storage.appendleft(io[1])
elif(io[0] == 'pop'):
... | 21.411765 | 33 | 0.546703 |
ff0123c6ca9d737252e05be75f641c63e02fa984 | 804 | py | Python | source/pkgsrc/finance/py-eth-keys/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/finance/py-eth-keys/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/finance/py-eth-keys/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2021/02/08 07:00:56 adam Exp $
setuptools-markdown is deprecated.
--- setup.py.orig 2021-02-08 06:23:00.000000000 +0000
+++ setup.py
@@ -45,12 +45,12 @@ setup(
# *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.
version='0.3.3',
descriptio... | 36.545455 | 90 | 0.692786 |
b3324bbd9956c4c26528567db9cda6fa758e8d63 | 3,244 | py | Python | Packs/PAN-OS/Scripts/PanoramaCVECoverage/PanoramaCVECoverage.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PAN-OS/Scripts/PanoramaCVECoverage/PanoramaCVECoverage.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PAN-OS/Scripts/PanoramaCVECoverage/PanoramaCVECoverage.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 *
OUTPUT_HEADERS = ['Threat Name', 'Link', 'Severity', 'Threat ID', 'Default Action']
def main():
try:
# Input arguments
args = demisto.args()
cve_list = argToList(args.get('CVE_List'))
pan_os_output = args.get('Result_... | 41.063291 | 121 | 0.552713 |
448dd1b9997a3cd8086464941612d989effd5734 | 496 | py | Python | utils/tb_logger.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | utils/tb_logger.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | utils/tb_logger.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | from tensorboardX import SummaryWriter
class TensorBoardLogger:
def __init__(self, log_dir):
self.summary_writer = SummaryWriter(log_dir)
def add_scalars(self, tag_step_value_dict):
"""
:param parent_tag: str, e.g. "Training Loss"
:param tag_step_value_dict: dict, e.g., {"key"... | 33.066667 | 93 | 0.65121 |
921c87d01ed3fd12f2727964dd246597865fe3b5 | 874 | py | Python | IVTa/2014/BRONNIKOV_I_S/task_7_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_7_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTa/2014/BRONNIKOV_I_S/task_7_50.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 50
# Создайте игру, в которой компьютер загадывает нназвание одной из пятнадцати республик,
# входящих в состав СССР, а игрок должен его угадать.
# Bronnikov I. S.
# 25.05.2016
import random
USSR = ["РСФСР", "Украинская ССР", "Белорусская ССР" "Узбекская ССР" "Казахская ССР" "Грузинская СС... | 41.619048 | 259 | 0.686499 |
5b53aa749d23736412644e05fe218007bdf98cf0 | 8,864 | py | Python | src/main/python/atorlib/guiiconvalue.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/guiiconvalue.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | src/main/python/atorlib/guiiconvalue.py | BikeAtor/WoMoAtor | 700cc8b970dcfdd5af2f471df1a223d2a38cb1bf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.path.append('..')
from abc import abstractmethod
import os
import logging
import threading
import time
# GUI
import tkinter as tk
import tkinter.font as tkFont
import cairosvg
import io
from PIL import Image, ImageTk
class GuiIconValue(tk.Canvas):
master = None
fontsiz... | 37.400844 | 109 | 0.502256 |
5b6b40092723e551bfda06d9730b8f11e2b06ba9 | 5,647 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/02_chapter_08_repetition_questions.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/02_chapter_08_repetition_questions.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_08_Dictionaries/02_chapter_08_repetition_questions.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 02_chapter_08_repetition_questions.py
# Project: Kapitel_08_Dictionaries
# Created Date: Thursday 07.03.2019, 12:23
# Author: Apop85
# -----
# Last Modified: Thursday 07.03.2019, 13:22
# -----
# Copyright (c) 2019 Apop85
# This software is published under the MI... | 59.442105 | 257 | 0.694882 |
7542090383dcdf66c8ff4648d51f018e129f187e | 507 | py | Python | Algorithms/027-Picking-Numbers.py | sadikkuzu/HackerRank | 2b1ed2cf41f6a5404c5b9293186f301b646b5d33 | [
"Apache-2.0"
] | 5 | 2019-03-09T22:44:01.000Z | 2021-09-14T00:11:38.000Z | Algorithms/027-Picking-Numbers.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 4 | 2018-08-16T09:39:47.000Z | 2018-09-14T17:37:07.000Z | Algorithms/027-Picking-Numbers.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 1 | 2020-06-01T23:38:35.000Z | 2020-06-01T23:38:35.000Z | # Complete the pickingNumbers function below.
def picking_numbers(a):
a.sort()
d = list() # differences list
for i in xrange(len(a) - 1):
d.append(a[i + 1] - a[i])
m = list() # max diffs list
for i in xrange(len(d)):
check = {0, 1}
m.append(1)
for j in xrange(i, len... | 26.684211 | 45 | 0.445759 |
f364ce486e2143e00f92176bec5652c596da6557 | 2,138 | py | Python | start-root-nginx.py | lxp521125/docker-to-nginxconf | 3528da017800fdb12479a551b7f0ded54207947c | [
"Apache-2.0"
] | null | null | null | start-root-nginx.py | lxp521125/docker-to-nginxconf | 3528da017800fdb12479a551b7f0ded54207947c | [
"Apache-2.0"
] | null | null | null | start-root-nginx.py | lxp521125/docker-to-nginxconf | 3528da017800fdb12479a551b7f0ded54207947c | [
"Apache-2.0"
] | null | null | null |
import commands
import json
import os
import re
print '''===========start============='''
getstr = commands.getstatusoutput('sudo docker ps |grep my-nginx')
if getstr[1] == '' :
print 'error the nginx is not running;'
exit()
confdir = '/root/nginxconf/'
print 'you will create conf at '+confdir
container_nam... | 29.694444 | 79 | 0.640318 |
f3aa5c35e883e07530a02fb0985fc45edfdc95b6 | 44 | py | Python | Licence 1/I11/TP3/tp3_4_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP3/tp3_4_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP3/tp3_4_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | for i in range(945, 970):
print(chr(i))
| 14.666667 | 25 | 0.590909 |
3438fea646fe117c4646cc00c616ba95b4dd3ecc | 1,685 | py | Python | leetcode/130-Surrounded-Regions/SurroundedRegions_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/130-Surrounded-Regions/SurroundedRegions_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/130-Surrounded-Regions/SurroundedRegions_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Here's the AC code. However, there's two tricky points
# Please refer to http://www.cnblogs.com/grandyang/p/4555831.html
class Solution(object):
def solve(self, board):
"""
:type board: List[List[str]]
:rtype: void Do not return anything, modify board in-place instead.
"""
... | 36.630435 | 131 | 0.445697 |
343b3dfb41b982e8114b9ec32076aa9ceee343a4 | 601 | py | Python | python/python_backup/PRAC_PYTHON/sin.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/sin.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/sin.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import math
def fun():
k1=0
for i in range(0,1000):
d=(int)(30*math.sin(3.14*i/180))
k1=int(d)
if(k1>0):
if i%9==0:
for k in range (35):
print(" ",end='')
if(i%9==0):
for j in range(k1):
print(">",end='')
print("*",end='')
print("\n",end='')
d1=k1;
... | 16.694444 | 35 | 0.409318 |
04f499b9f9ac40f6a2b86526fde1a70b923bb4c4 | 783 | py | Python | backend/alembic/versions/9fa155db53d8_added_user_solution_failed_attemptsn.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/alembic/versions/9fa155db53d8_added_user_solution_failed_attemptsn.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/alembic/versions/9fa155db53d8_added_user_solution_failed_attemptsn.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | """Added user solution failed attemptsn
Revision ID: 9fa155db53d8
Revises: 943cf797c278
Create Date: 2021-10-11 22:32:46.315055
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "9fa155db53d8"
down_revision = "943cf797c278"
branch_labels = None
depends_on = None
... | 23.727273 | 85 | 0.673052 |
1ea7b69e6e389d28c5a934841713303d42ad958e | 2,192 | py | Python | plan/admin.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/admin.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | null | null | null | plan/admin.py | MIXISAMA/MIS-backend | 7aaa1be773718de1beb3ce0080edca7c4114b7ad | [
"MIT"
] | 2 | 2020-04-20T07:26:51.000Z | 2020-04-30T11:51:54.000Z | from django.contrib import admin
from django.db.models import Q
from .models import RoughRequirement, DetailedRequirement, IndicatorFactor, FieldOfStudy, OfferingCourse, BasisTemplate
# Register your models here.
@admin.register(RoughRequirement)
class RoughRequirementAdmin(admin.ModelAdmin):
list_display = ('in... | 35.354839 | 119 | 0.714872 |
94ca9b2edf37d889ca5daed5a4683f9b8b8b4c0c | 5,633 | py | Python | deprecated/examples/distribute_ctr/sync_train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/examples/distribute_ctr/sync_train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/examples/distribute_ctr/sync_train.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | 37.059211 | 90 | 0.621694 |
7858fd5d7be6e29fa02f0eb3b3dbcc8cadbdd3be | 3,244 | py | Python | src/visitpy/visit_utils/src/exprs.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_utils/src/exprs.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_utils/src/exprs.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: exprs.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 4/9/2010
description:
... | 28.707965 | 81 | 0.646732 |
78bed14bc668d65bc61ce59814d71df855682532 | 480 | py | Python | 013/Dimkpa Chimenim/Task 8.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | 013/Dimkpa Chimenim/Task 8.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | 013/Dimkpa Chimenim/Task 8.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | # Python function to resize images
from PIL import Image # pil is a python extension for image manipulation
basewidth = 300 # This is our basewidth
img = Image.open('Dummy1.jpg') # name of image and extension
# to set the intended size of the image
wsize = (basewidth/float(img.size[0])) # for width size
hsize = i... | 43.636364 | 73 | 0.725 |
ec61349ca80549ae681d496ab1443590d5d8bf99 | 188 | py | Python | exercises/de/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/de/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/de/exc_01_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # Importiere spaCy
import ____
# Erstelle ein englisches nlp-Objekt
nlp = ____
# Verarbeite einen Text
doc = nlp("This is a sentence.")
# Drucke den Text des Dokuments
print(____.text)
| 15.666667 | 36 | 0.744681 |
ecee6bce5cb724a3279e4ea8ae41880e72a8ef38 | 1,052 | py | Python | spo/spo/doctype/beratungsplanung/beratungsplanung.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/spo/doctype/beratungsplanung/beratungsplanung.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/doctype/beratungsplanung/beratungsplanung.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from datetime import datetime
class Beratungsplanung(Document):
def on_submit(self):
#... | 30.057143 | 92 | 0.61692 |
bf1d2203d9d86a0889d3e32b35d7adf502e1e5bf | 437 | py | Python | ___Python/RomanS/untitled/p06_persistance/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p06_persistance/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p06_persistance/m02_json.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import json
import bson
from bson import json_util
from p01_kennenlernen.m01_kennenlernen import teilnehmerliste
# "Pickling" / Serilization / Marshalling / Flattening
with open("teilnehmer.json", "w") as datei:
json.dump(teilnehmerliste, datei)
# "Unpickling" / Unserilization / Unmarshalling / De? F... | 25.705882 | 65 | 0.718535 |
da57152e8b7c7533b5a0761450f9067dac4a87e3 | 508 | py | Python | Coursera/Interfacing with the Raspberry Pi/Week-2/Assignment/Server.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Interfacing with the Raspberry Pi/Week-2/Assignment/Server.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Interfacing with the Raspberry Pi/Week-2/Assignment/Server.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import socket
import sys
if __name__ == '__main__':
ms = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ip = 'x.x.x.x'
port = 1234
try:
ms.bind((ip, port))
except socket.error:
print('Failed to connect')
sys.exit()
ms.listen(5)
while True:
c... | 18.814815 | 58 | 0.521654 |
005efd5d4453277ad8bd6ab03a00981cfb04ef0c | 92 | py | Python | WD/Przyklady/Cw3/litery.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | 1 | 2020-02-29T14:38:33.000Z | 2020-02-29T14:38:33.000Z | WD/Przyklady/Cw3/teksty/litery.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | WD/Przyklady/Cw3/teksty/litery.py | galursa/UWM | b7ab4a275662764a91af6c5bc79da0d98177d0ac | [
"MIT"
] | null | null | null | #plik litery
def wyswietl(a):
print(a)
def dlugosc(a):
return len(a)
| 8.363636 | 18 | 0.532609 |
dae57dd9948faafe8aa8c37073f3802b99fd2e7b | 15,847 | py | Python | Packs/AnsibleLinux/Integrations/AnsibleLinux/AnsibleLinux.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/AnsibleLinux/Integrations/AnsibleLinux/AnsibleLinux.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/AnsibleLinux/Integrations/AnsibleLinux/AnsibleLinux.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import ssh_agent_setup
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Import Generated code
from AnsibleApiModule import * # noqa: E402
host_type = 'ssh'
# MAIN FUNCTION
def main() -> None:
"""main function, parses params and runs command functions
:return:
... | 61.185328 | 109 | 0.654824 |
975c94726aab913f77bd17d9337fa34bace9a83f | 439 | py | Python | sqllite_mem.py | mchackam/learn | d6307205884914deb2d5e78f0820eab2fb0e7166 | [
"BSD-2-Clause"
] | null | null | null | sqllite_mem.py | mchackam/learn | d6307205884914deb2d5e78f0820eab2fb0e7166 | [
"BSD-2-Clause"
] | null | null | null | sqllite_mem.py | mchackam/learn | d6307205884914deb2d5e78f0820eab2fb0e7166 | [
"BSD-2-Clause"
] | null | null | null | import sqlite3
conn = sqlite3.connect(":memory:")
cur = conn.cursor()
cur.execute("create table lang (name, first_appeared)")
cur.execute("insert into lang values (?, ?)",("C",1972))
lang_list = [
("Fortran", 1957),
("Python", 1991),
("Go", 2009)
]
cur.executemany("insert into lang values (?, ?)", lang... | 20.904762 | 75 | 0.653759 |
c14dc23509ffcd527c4f83afd04fccc295d7786d | 111 | py | Python | savageml/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | savageml/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | savageml/__init__.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | from test import *
import savageml.models
import savageml.simulations
from savageml.version import __version__
| 22.2 | 40 | 0.855856 |
c18e69f3e6c39e6c14c61bd14ecba31424ebebe2 | 342 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/add_agriculture_domain.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/add_agriculture_domain.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/add_agriculture_domain.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():
domain = 'Agriculture'
if not frappe.db.exists('Domain', domain):
frappe.get_doc({
'doctype': 'Domain',
'domain': domain
}).insert(ig... | 26.307692 | 57 | 0.736842 |
a9d868590aa26c1bf60a9dd3fd35d384c5865cb9 | 714 | py | Python | books/PythonCleanCode/ch8_unittest/test_refactoring_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch8_unittest/test_refactoring_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch8_unittest/test_refactoring_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chatper 8: Unit Testing
> Refactoring Code
- File under test: refactoring_1.py
"""
from unittest.mock import Mock
import pytest
from refactoring_1 import BuildStatus
@pytest.fixture
def build_status():
bstatus = BuildStatus(Mock())
bstatus.build_date = Mock(... | 20.4 | 66 | 0.661064 |
a9e0abf9578f6b954d9982f956a51e5295d88166 | 915 | py | Python | src/onegov/intranet/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/intranet/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/intranet/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
from onegov.core.security import Public
from onegov.intranet import IntranetApp
from onegov.org.views.exceptionviews import handle_forbidden
from onegov.user import Auth
from purl import URL
from webob.exc import HTTPForbidden
@IntranetApp.html(model=HTTPForbidden, permission=Public,
... | 30.5 | 75 | 0.744262 |
e7901458c0b42ecd633ba68de80b80fec872453e | 414 | py | Python | 04_SQL/commerce/auctions/migrations/0013_auto_20201120_0134.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0013_auto_20201120_0134.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0013_auto_20201120_0134.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-20 01:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0012_listing_is_closed'),
]
operations = [
migrations.AlterField(
model_name='listing',
name='category',... | 21.789474 | 75 | 0.613527 |
41a3b72c4aa0ee53271155d5cdbbc6ac8f843003 | 1,091 | py | Python | imwievaluation/tests/test_mail.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/tests/test_mail.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/tests/test_mail.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | import mail
import unittest
import os
import shutil
import re
# TODO: add more tests
class MailTest(unittest.TestCase):
maxDiff = None # enable output of long string
def setUp(self):
self.mail_server = mail.MailServer('from@domain.com',
'smtp.server.com',... | 27.275 | 78 | 0.60495 |
6b944a3161a0e331b6841625b092d43b0a3e046c | 5,631 | py | Python | config/job.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | config/job.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | config/job.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | import time
import farmhash
# type_main:社会招聘,校园招聘
class Job:
def __init__(
self,
name: str = None,
position: str = None,
job_id: str = None,
bank_name: str = None,
branch_name: str = None,
department: str = None,
type... | 23.365145 | 138 | 0.589593 |
2e3c075f81b9a3440931c52ca5e2e59ea7b386f6 | 4,058 | py | Python | typing-spoofer-main/typespoof.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | typing-spoofer-main/typespoof.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | typing-spoofer-main/typespoof.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests
from colorama import Fore, init
import os
init(convert=True)
intro = f"""
{Fore.RED}Made by REZIZT. {Fore.CYAN}Zwietracht nacheinander ausnutzen
{Fore.BLUE}https://discord.gg/XgpXMWk2bG
{Fore.RED} ▄▄▄█████▓▓██ ██▓ ██▓█... | 60.567164 | 110 | 0.214391 |
cf2485890c0a91e4713074cfd04025ebbdeb5198 | 2,111 | py | Python | SH33LL-master/sh33l.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | SH33LL-master/sh33l.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | SH33LL-master/sh33l.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import requests,sys
from multiprocessing.pool import ThreadPool
W = '\033[1;37m' # White bold
N = '\033[0m' # white (Normal)
R = '\033[31m' # red
G = '\033[1;32m' # green bold
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
terget=""
num=0
nums=""
def one(args):
globa... | 30.157143 | 96 | 0.568925 |
d84289bed840b88e9afeb4557aa04b66c881376d | 471 | py | Python | Algorithms/Implementation/divisible_sum_pairs.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/divisible_sum_pairs.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/divisible_sum_pairs.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from itertools import product
def divisibleSumPairs(n, k, ar):
# return len([p for p in product(ar, repeat=2) if p[0] < p[1] and (p[0] + p[1]) >= k and (p[0] + p[1]) % k == 0])
return len([i for i in range(0, n) for j in range(i + 1, n) if (ar[i] + ar[j]) % k == 0])
n, k =... | 27.705882 | 117 | 0.571125 |
d86e807284e1ab398aaf4fa70caaaaafe855870c | 1,425 | py | Python | pf.py | rec/pf | fb395496b2a1be4394388c913cc409a9fd3e4796 | [
"MIT"
] | null | null | null | pf.py | rec/pf | fb395496b2a1be4394388c913cc409a9fd3e4796 | [
"MIT"
] | null | null | null | pf.py | rec/pf | fb395496b2a1be4394388c913cc409a9fd3e4796 | [
"MIT"
] | null | null | null | from datetime import datetime
DATE_FORMAT = '%Y/%m/%d %H:%M:%S.%f'
# Includes ms so the roundtrip test works. I will probably turn that off for
# the test.
DOLLARS_FORMAT_ERROR = (
'Dollars must either be a whole number or have exactly two decimal places'
)
# it is a crime against nature to use floating point ... | 25 | 79 | 0.676491 |
99572abd124794f19c7307800ef15abe8ccff500 | 472 | py | Python | leetcode/135-Candy/Candy_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/135-Candy/Candy_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/135-Candy/Candy_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def candy(self, ratings):
"""
:type ratings: List[int]
:rtype: int
"""
nums = [1] * len(ratings)
for i in range(1, len(ratings)):
if ratings[i] > ratings[i - 1]:
nums[i] = nums[i - 1] + 1
for i in range(len(... | 27.764706 | 59 | 0.442797 |
9977daf1217cb1893f8e177b5b33afd11771794e | 2,307 | py | Python | Prototype/main prototype/CustomMiniWidgets.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/CustomMiniWidgets.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/CustomMiniWidgets.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | # This Python file uses the following encoding: utf-8
from PyQt5 import QtWidgets, QtCore, QtGui
class QHLine(QtWidgets.QFrame):
"""horizontal line used for dividers"""
def __init__(self):
QtWidgets.QFrame.__init__(self)
self.setFrameShape(QtWidgets.QFrame.HLine)
self.setFrameShadow(Qt... | 32.492958 | 106 | 0.642393 |
513c326318517ffdc78cdc2f1786df93b57a0036 | 1,330 | py | Python | webcam.py | lukexyz/iris | 7290525d15f5283dfdfb6bb9c53c5de479bf30cb | [
"MIT"
] | 1 | 2021-01-04T18:13:28.000Z | 2021-01-04T18:13:28.000Z | webcam.py | lukexyz/iris | 7290525d15f5283dfdfb6bb9c53c5de479bf30cb | [
"MIT"
] | null | null | null | webcam.py | lukexyz/iris | 7290525d15f5283dfdfb6bb9c53c5de479bf30cb | [
"MIT"
] | 1 | 2021-11-08T14:39:57.000Z | 2021-11-08T14:39:57.000Z | import streamlit as st
import codecs
import streamlit.components.v1 as stc
# Custom component
def html_component(path, width=500, height=500):
"""
Custom component to open hmtl with codecs util
path = "webcam2.html"
"""
calc_file = codecs.open(path, 'r')
page = calc_file.re... | 35.945946 | 107 | 0.604511 |
5a9d159a5e71f18e1a4470dc53c071b446c05be6 | 369 | py | Python | sort/bubble_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | sort/bubble_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | sort/bubble_sort.py | imttx/awesome-algorithm | d72277cc278131ae670bea74db4283b02f362758 | [
"MIT"
] | null | null | null | # 冒泡排序
# 核心:冒泡,持续比较相邻元素,大的挪到后面,因此大的会逐步往后挪,故称之为冒泡。
def bubble(list):
length = len(list)
for x in range(length):
for y in range(1, length-x):
if list[y-1] > list[y]:
list[y-1], list[y] = list[y], list[y-1]
return list
if __name__ == '__main__':
list = [10, 4, 8, 2, ... | 20.5 | 55 | 0.539295 |
5aeea8bf4906e57b5ca5ef3b2438bb238e9708dc | 849 | py | Python | Backend/migrations/alembic/versions/4fcda072e8c6_create_bed_capacity2landkreise_extended_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | Backend/migrations/alembic/versions/4fcda072e8c6_create_bed_capacity2landkreise_extended_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | Backend/migrations/alembic/versions/4fcda072e8c6_create_bed_capacity2landkreise_extended_.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | """create bed_capacity2landkreise_extended table
Revision ID: 4fcda072e8c6
Revises: f8791d49d830
Create Date: 2020-11-26 15:23:00.162009
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '4fcda072e8c6'
down_revision = 'b84312f6532e'
branch_labels = None
depends_on = None
def upgrade():... | 24.257143 | 85 | 0.777385 |
51ab4cd579d4fcb495f35b3ddc8e3695ad038c63 | 3,762 | py | Python | scripts/gn_complete/test_complete.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | scripts/gn_complete/test_complete.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 1 | 2022-01-14T23:38:40.000Z | 2022-01-14T23:38:40.000Z | scripts/gn_complete/test_complete.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 4 | 2020-12-28T17:04:45.000Z | 2022-03-12T03:20:44.000Z | #!/usr/bin/env python3
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import complete
import unittest
class TestLabelSplitting(unittest.TestCase):
def test_absolute(self):
self.assertEqual(complete... | 41.8 | 80 | 0.637161 |
8fdad53669e8c696c2f72919dcf50f92ffb5539f | 762 | py | Python | Lec5.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec5.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | Lec5.py | JSliman948/IA241 | 57e8441ed0a8236e08308c6ed18b7555d76fd739 | [
"MIT"
] | null | null | null | '''
If Statements (digital notes)
'''
import this
print(1+2)
print (1 + 2)
print ([1,
2,
3])
m = 1+2
print(m)
m = 1+\
2
print(m)
a = [1, 2, 3]
b = [1, 2, 3]
print(id([1, 2, 3]))
print(id(a))
print(id(b))
print(a is b)
print(a == b)
x = None
print(id(None))
print(id(x))
print(x == ... | 13.607143 | 29 | 0.514436 |
855cf91b326008b0845aa880cc5838690e9aa06b | 6,560 | py | Python | SmartMirror/weather_api/weather.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | SmartMirror/weather_api/weather.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | 3 | 2018-11-22T09:49:52.000Z | 2019-05-29T14:43:52.000Z | SmartMirror/weather_api/weather.py | beckstev/PiShop | ab990c3a787f1811ff0da650f79dbd8bb28c00f7 | [
"MIT"
] | null | null | null | from requests import get
# from datetime import datetime, timedelta, date
import datetime
# from json import loads, dumps
import json
import os
# from pprint import pprint
today = datetime.date.today()
today_str = today.strftime(format='%Y-%m-%d')
yesterday = today - datetime.timedelta(1)
yesterday_str = yesterday.... | 40.745342 | 176 | 0.68003 |
74843ca65ec7bbc7f84f9e2405c780d6eddeba1d | 1,719 | py | Python | spo/spo/doctype/abschlussbericht/abschlussbericht.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | null | null | null | spo/spo/doctype/abschlussbericht/abschlussbericht.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/doctype/abschlussbericht/abschlussbericht.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.data import formatdate
class Abschlussbericht(Document):
pass
@frappe.white... | 36.574468 | 81 | 0.623037 |
77c1c5ea4359953cf2b3e2ea3aaf6f8177af7feb | 1,666 | py | Python | PythonTest/bound_image.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | PythonTest/bound_image.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | 1 | 2017-11-03T06:59:55.000Z | 2017-11-04T02:10:14.000Z | PythonTest/bound_image.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | import pygame
from pygame.locals import *
import sys
SCR_WIDTH,SCR_HEIGHT = 640,480
pygame.init()
screen = pygame.display.set_mode((SCR_WIDTH,SCR_HEIGHT))
pygame.display.set_caption(u"画像の移動と跳ね返り処理")
img = pygame.image.load("img/my_python.png").convert()
colorkey = img.get_at((0, 0))
img.set_colorkey(c... | 31.433962 | 70 | 0.656062 |
77d83c9315e985b2cd134cc07693af2638b90635 | 123 | py | Python | python/coursera_python/TORONTO/test/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/TORONTO/test/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/TORONTO/test/5.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def odd(n):
if n%2 != 0:
return 1
a=1523
sum1=0
while(a<=10503):
if(odd(a)==1):
sum1=sum1+a
a=a+1
print(sum1)
| 8.785714 | 16 | 0.552846 |
70296a7759a2912440a2787c0e415f2486106755 | 16,188 | py | Python | Packs/Base/Scripts/DBotFindSimilarIncidents/DBotFindSimilarIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Base/Scripts/DBotFindSimilarIncidents/DBotFindSimilarIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Base/Scripts/DBotFindSimilarIncidents/DBotFindSimilarIncidents_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # from CommonServerPython import *
import pytest
from DBotFindSimilarIncidents import normalize_command_line, main, demisto, keep_high_level_field, \
preprocess_incidents_field, PREFIXES_TO_REMOVE, check_list_of_dict, REGEX_IP, match_one_regex, \
SIMILARITY_COLUNM_NAME_INDICATOR, SIMILARITY_COLUNM_NAME, euclidi... | 48.467066 | 116 | 0.621572 |
8dc6c808e4572609aa1f5d7da9386f59f34c93eb | 245 | py | Python | 02_Python/dictionaries.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/dictionaries.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/dictionaries.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | def main():
heroes = {"Batman": "Bruce Wayne", "Superman": "Clark Kent"}
print(heroes["Batman"])
heroes["Batgirl"] = "Barbara Gordon"
for hero in heroes.keys():
print(heroes[hero])
if __name__ == '__main__':
main()
| 22.272727 | 64 | 0.591837 |
5c2abc65756eaa972fd963fd64c9eac1ae9d221b | 8,409 | py | Python | approvati_durata.py | obujor/PalMaS | 229e565072b4783bbe09b6a635219347f3be40e5 | [
"MIT"
] | 3 | 2016-11-21T21:10:42.000Z | 2022-01-22T16:25:44.000Z | approvati_durata.py | obujor/PalMaS | 229e565072b4783bbe09b6a635219347f3be40e5 | [
"MIT"
] | null | null | null | approvati_durata.py | obujor/PalMaS | 229e565072b4783bbe09b6a635219347f3be40e5 | [
"MIT"
] | null | null | null | import csv
import igraph as G
from SPARQLWrapper import SPARQLWrapper, JSON
from datetime import datetime
import sys
def getIddlList(LEGISLATURA,sparql):
# ddl e legislatura
maxIdDdl = -1
idddlList=[]
Found = True
while Found:
print "chunk offset %s" % (maxIdDdl)
q_idddl = """PRE... | 33.237154 | 295 | 0.631228 |
ebb9030c73a55feaca6327a034c2824b107de283 | 4,187 | py | Python | Computerorietierte_Mathematik/U1/U1_A3.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | 1 | 2019-10-29T08:21:41.000Z | 2019-10-29T08:21:41.000Z | Computerorietierte_Mathematik/U1/U1_A3.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | Computerorietierte_Mathematik/U1/U1_A3.py | qiaw99/Data-Structure | 3b1cdce96d4f35329ccfec29c03de57378ef0552 | [
"MIT"
] | null | null | null | '''
import pysnooper
@pysnooper.snoop()
'''
__author__ = "Qianli und Nazar"
__copyright__ = "Copyright (c) 2019 qiaw99"
# https://github.com/qiaw99/WS2019-20/blob/master/LICENSE
# Task a)
def ntobasetwo(n, c):
# To guarantee that n and c are natural numbers <=> instance of Integer
if(n >= 0 and isinstance(n, i... | 28.875862 | 93 | 0.490327 |
693167b6bbaf1f603a50c9592c861a3713318861 | 1,357 | py | Python | tests/onegov/winterthur/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/winterthur/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/winterthur/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import math
import pytest
from onegov.winterthur.collections import AddressCollection
@pytest.mark.xfail(reason="the remote host providing the csv might be down")
def test_download_addresses(session):
addresses = AddressCollection(session)
addresses.update()
assert addresses.query().count() >= 18_000
... | 30.840909 | 76 | 0.712601 |
d6ebd98e9bb460bf79ecb3828bc552f4b6c6e6cc | 337 | py | Python | ACN expts/expt 1/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | 2 | 2019-01-27T14:16:09.000Z | 2019-05-25T10:05:24.000Z | ACN expts/expt 1/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | null | null | null | ACN expts/expt 1/run.py | MU001999/codeex | 23e300f9121a8d6bf4f4c9ec103510193808e9ba | [
"MIT"
] | 1 | 2020-11-05T05:17:28.000Z | 2020-11-05T05:17:28.000Z | from flask import Flask, render_template
import json
app = Flask(__name__)
def loadInfo():
with open("data/info.json") as f:
info = json.load(f)
return info
@app.route('/')
def homepage():
return render_template("homepage.html", info = loadInfo())
if __name__ == '__main__':
app.run(host = ':... | 19.823529 | 62 | 0.646884 |
ba41b80ec36f028516539ad4c0de8307db3d686e | 1,104 | py | Python | alembic/versions/97d93ee5aec8_added_guild_id_column_to_reminders_table.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | alembic/versions/97d93ee5aec8_added_guild_id_column_to_reminders_table.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | alembic/versions/97d93ee5aec8_added_guild_id_column_to_reminders_table.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | """added guild_id column to reminders table
Revision ID: 97d93ee5aec8
Revises: 213b2c97361f
Create Date: 2021-09-19 14:22:15.752826
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '97d93ee5aec8'
down_revision = '213b2c97361f'
branch_labels = None
depends_on = N... | 28.307692 | 65 | 0.678442 |
cc98aa58afdf7a4d6675f61530bcbe58a4ea6c09 | 1,464 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex07_braces_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex07_braces_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex07_braces_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.ex07_braces import check_parentheses, check_parentheses_v2, CheckResult
@pytest.mark.parametrize("values, expected",
[("()", True), ("()[]{}", True),
... | 35.707317 | 106 | 0.526639 |
aee82c7c11d781b8abf15444517848812007cb40 | 169 | py | Python | src/nfz_module/helper/TimeFunction.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/helper/TimeFunction.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/helper/TimeFunction.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null |
class TimeFunction:
def __init__(self):
pass
@classmethod
def calculate_time_diff(self, t1, t2):
return (t2 - t1).microseconds / (1 * 10**6) + (t2 - t1).seconds | 21.125 | 65 | 0.674556 |
06136a0c79cd11b35a12ee5d6631c5f44b93c3ef | 904 | py | Python | andinopy/interfaces/andino_temp_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/interfaces/andino_temp_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | andinopy/interfaces/andino_temp_interface.py | andino-systems/andinopy | 28fc09fbdd67dd690b9b3f80f03a05c342c777e1 | [
"Apache-2.0"
] | null | null | null | # _ _ _
# / \ _ __ __| (_)_ __ ___ _ __ _ _
# / _ \ | '_ \ / _` | | '_ \ / _ \| '_ \| | | |
# / ___ \| | | | (_| | | | | | (_) | |_) | |_| |
# /_/ \_\_| |_|\__,_|_|_| |_|\___/| .__/ \__, |
# |_| |___/
# by Jakob Groß
import abc
class ... | 32.285714 | 70 | 0.54646 |
ae4af0f58b5e929d0b7cfca25ff9f4632dce417b | 1,051 | py | Python | sso-db/ssodb/common/models/user_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/user_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/user_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | import datetime
from ..core import db
from ..models import Country, City, Service
import json
from bson import ObjectId
class User(db.Document):
created_at = db.StringField(default=str(datetime.datetime.utcnow()))
updated_at = db.StringField(default=str(datetime.datetime.utcnow()))
phone = db.StringField(u... | 37.535714 | 85 | 0.675547 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.