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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b2a5974930afcf1eaf89c55e0e3f2f5ab710baf0 | 658 | py | Python | backend/migrations/versions/a8045d00ed67_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/a8045d00ed67_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | backend/migrations/versions/a8045d00ed67_.py | davidoesch/platform | 1eb6f98568cab82e28bd5350beab2042b22d99ed | [
"MIT"
] | null | null | null | """empty message
Revision ID: a8045d00ed67
Revises: dbcd7d8df928
Create Date: 2018-08-30 15:18:47.746581
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a8045d00ed67'
down_revision = 'dbcd7d8df928'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.689655 | 82 | 0.693009 |
0c5ec8881bf9fbdf46d828da00dc4b8e2088167e | 9,896 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/layerindexlib/tests/layerindexobj.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/layerindexlib/tests/layerindexobj.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/layerindexlib/tests/layerindexobj.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) 2017-2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: GPL-2.0-only
#
import unittest
import tempfile
import os
import bb
from layerindexlib.tests.common import LayersTest
import logging
class LayerIndexObjectsTest(LayersTest):
def setUp(self):
from layerindexlib import LayerInd... | 45.603687 | 121 | 0.662692 |
cbfe14edbc32f5edda1a3a9b4870067b07d8226d | 5,877 | py | Python | raw_code/pulson440/constants.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | 1 | 2020-02-09T19:09:27.000Z | 2020-02-09T19:09:27.000Z | raw_code/pulson440/constants.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/constants.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PulsON 440 constants module."""
__author__ = "Ramamurthy Bhagavatula, Michael Riedl"
__version__ = "1.0"
__maintainer__ = "Ramamurthy Bhagavatula"
__email__ = "ramamurthy.bhagavatula@ll.mit.edu"
# Import required modules and method
from collections import OrderedDict
... | 44.18797 | 114 | 0.628212 |
026e8b2714afe9f095b832b7230acb4780083345 | 1,864 | py | Python | skilldb.py | Aldemerian/RLP-XML | 89a04f1a5deac488e7006731b390fd890af7dd29 | [
"MIT"
] | 1 | 2021-08-18T02:59:14.000Z | 2021-08-18T02:59:14.000Z | skilldb.py | Aldemerian/RLP-XML | 89a04f1a5deac488e7006731b390fd890af7dd29 | [
"MIT"
] | null | null | null | skilldb.py | Aldemerian/RLP-XML | 89a04f1a5deac488e7006731b390fd890af7dd29 | [
"MIT"
] | null | null | null | import sqlite3
import uuid
'''
sqliteConnection = sqlite3.connect('SQLite_Python.db')
cursor = sqliteConnection.cursor()
sql_command = """
CREATE TABLE SqliteDb_developers (
id VARCHAR(36) PRIMARY KEY,
name VARCHAR(128),
email VARCHAR(128),
joining_date VARCHAR(128),
salary VARCHAR(128));"""
cu... | 34.518519 | 102 | 0.673283 |
5a84b2afb1618e139fa5065b251ec3cb2a297fbc | 180 | py | Python | src/ztc/java/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/java/__init__.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
"""
ZTC Java monitoring package
Copyright (c) 2009 Vladimir Rusinov <vladimir@greenmice.info>
Copyright (c) 2009 Murano Software [http://muranosoft.com]
"""
| 22.5 | 61 | 0.744444 |
e7fe168257e4204246f321d89a01cff13599c20f | 544 | py | Python | Data Structures/Python/Trees/inorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/inorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | Data Structures/Python/Trees/inorder-traversal-recursion.py | anberlin-mudasir/hakerrank | 7ea076bf959f942dfb7a97ba2dc8074147b610be | [
"MIT"
] | null | null | null | """
Input Format
Our hidden tester code passes the root node of a binary tree to your inOrder function.
Constraints
1 Nodes in the tree 500
Output Format
Print the tree's inorder traversal as a single line of space-separated values.
"""
class Node:
def __init__(self,data):
self.left=None
... | 16.484848 | 86 | 0.670956 |
b2bb1234c17accaa6981e12ca00271b71fb2946b | 5,745 | py | Python | project/forms/widgets.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/forms/widgets.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/forms/widgets.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from datetime import datetime
from flask_babelex import gettext, to_user_timezone
from markupsafe import Markup
from wtforms import DateTimeField, SelectField, SelectMultipleField
from wtforms.fields.core import StringField
from wtforms.validators import Length, StopValidation
from wtforms.widgets import CheckboxInput... | 28.300493 | 168 | 0.554569 |
d7a3454c617c8f3013c10876252890c2429afea6 | 1,876 | py | Python | user/urls_registration.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/urls_registration.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | user/urls_registration.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
from django.urls import path
from .forms import UserPasswordResetForm
from .views import UserRegistrationFormView
from .views import CustomLoginView
from .views import RegistrationDoneView
app_na... | 24.684211 | 78 | 0.637527 |
cc117c448ba22a512cad5e637bd95bc9e618b362 | 335 | py | Python | sources/stage06/vector1.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage06/vector1.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | sources/stage06/vector1.py | kantel/pythonschulung2 | b13fb24770dd7789f3845aeb147a720dff272951 | [
"MIT"
] | null | null | null | class Vector():
def __init__(self, x, y):
self.x = x
self.y = y
def add(self, v):
self.x += v.x
self.y += v.y
def print_vector(self):
print("(" + str(self.x) + ", " + str(self.y) + ")")
p1 = Vector(3, 4)
p2 = Vector(5.0, 7.3)
p1.add(p2)
p1.print_vector... | 17.631579 | 59 | 0.462687 |
0bd3992f86f6a44899a53ee6476db9875847da21 | 84 | py | Python | Licence 2/I33/TP 3/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 3/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 3/ex_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def decompose(n):
T = []
while n != 0:
T += [n % 2]
n = n // 2
return T[::-1] | 14 | 17 | 0.416667 |
0b111ede5c133d6611bac2a352813cefa28820b7 | 505 | py | Python | Python/Exercícios_Python/041_aquele_classico_da_média.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/041_aquele_classico_da_média.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/041_aquele_classico_da_média.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""041 - Aquele classico da Média
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1lAdEToVojYRaZ7h_STIlpAfxlmzMJbNX
"""
n1 = float(input('Primeira nota: '))
n2 = float(input('Segunda nota: '))
media = (n1 + n2) / 2
if media < 5.... | 28.055556 | 77 | 0.669307 |
0b134493dd8ef642dcda8304fa692456098b4dfb | 3,090 | py | Python | frappe-bench/apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/education/doctype/program_enrollment_tool/program_enrollment_tool.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.education.api import enroll_student
class ProgramEnrollmentTool(Doc... | 46.119403 | 119 | 0.749191 |
a84e434c7a3adb90df30a7ed4106c5dbac2b73fb | 8,853 | py | Python | tests/test_vertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_vertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_vertrag.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
import pytest # type:ignore[import]
from bo4e.bo.geschaeftspartner import Geschaeftspartner
from bo4e.bo.vertrag import Vertrag, VertragSchema
from bo4e.com.adresse import Adresse
from bo4e.com.unterschrift import Unterschrift
from bo4e.com.vertragskonditionen import Vertragsk... | 42.5625 | 110 | 0.671298 |
766cbcabff6a7e33c01bfe8125d6b629f583b492 | 2,118 | py | Python | ZLogger-master/zlogger.py | Zusyaku/Hacking-Software-V3 | 3a8dfccd7d00e5e29fc12da9462e06a556f67256 | [
"Apache-2.0"
] | 1 | 2022-02-23T07:16:59.000Z | 2022-02-23T07:16:59.000Z | ZLogger-master/zlogger.py | Zusyaku/Hacking-Software-V3 | 3a8dfccd7d00e5e29fc12da9462e06a556f67256 | [
"Apache-2.0"
] | null | null | null | ZLogger-master/zlogger.py | Zusyaku/Hacking-Software-V3 | 3a8dfccd7d00e5e29fc12da9462e06a556f67256 | [
"Apache-2.0"
] | 2 | 2022-03-04T15:08:37.000Z | 2022-03-06T13:10:51.000Z | #!/usr/bin/env python
import argparse
import subprocess
import os
WINDOWS_PYTHON_INTERPRETER_PATH = os.path.expanduser("~/.wine/drive_c/Python27/Scripts/pyinstaller.exe")
def get_arguments():
parser = argparse.ArgumentParser(description='ZLogger v2.0')
parser._optionals.title = "Optional Arguments"
parse... | 46.043478 | 137 | 0.721435 |
7679fabbec788e5e9f67766d43364c3a417b4ddd | 3,933 | py | Python | bawwab/oauth2.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 2 | 2021-07-06T06:00:22.000Z | 2022-01-15T09:29:44.000Z | bawwab/oauth2.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 11 | 2020-11-26T10:53:44.000Z | 2022-03-31T09:42:51.000Z | bawwab/oauth2.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 1 | 2022-01-15T09:30:46.000Z | 2022-01-15T09:30:46.000Z | # Copyright 2019–2020 Leibniz Institute for Psychology
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... | 30.253846 | 98 | 0.712942 |
4f2bf391b19164da50b5068fd4c98c3fff171ad2 | 161 | py | Python | src/scheduler/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | src/scheduler/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | src/scheduler/__init__.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import os
import sys
curr_path = os.path.dirname(os.path.abspath(__file__))
src_path = os.path.abspath(os.path.join(curr_path, "../"))
sys.path.append(src_path) | 26.833333 | 58 | 0.751553 |
96c7de39be6cfe3e6f48e5e1675c3dc88e864972 | 1,306 | py | Python | python/oneflow/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/env.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
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... | 50.230769 | 87 | 0.841501 |
8c17e91185a7f614b99362acc610ac20a77e7ea8 | 4,700 | py | Python | graph/astar/astar.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | graph/astar/astar.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | graph/astar/astar.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/env python3
import sys
import copy
from maze import mazes
from node import Node
from common import *
PRINT_MAZE = False
PRINT_PATH = True
PRINT_STEP = False
PRINT_MOVE = True
PRINT_COLOUR = True
# look neighbor order
NEIGHBOR_ORDER_MODE = None
# set to None, 'cost' or 'move'
SET_LOWEST_TYPE = None
de... | 31.125828 | 98 | 0.626383 |
8c1c7867d3e878bcaa3ab045e93a46afe48f78ed | 271 | py | Python | exercises/es/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/solution_01_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | # Importa la clase de lenguaje "English"
from spacy.lang.en import English
# Crea el objeto nlp
nlp = English()
# Procesa un texto (aquí dice "Esto es una frase." en inglés)
doc = nlp("This is a sentence.")
# Imprime en pantalla el texto del documento
print(doc.text)
| 22.583333 | 61 | 0.726937 |
8c2155133985e2b003173de2616e8b3fafba5bd7 | 2,002 | py | Python | python/data_sutram/pypath/PyPath/json_sqlite/3_get_all_stoppages_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/pypath/PyPath/json_sqlite/3_get_all_stoppages_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/pypath/PyPath/json_sqlite/3_get_all_stoppages_sqlite.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
"""
__author__ : Jimut Bahan Pal
It has been found that most of the data are not there, so try and except is used for every data-fetch.
This program converts the get_all_stoppages() JSON object to sqlite database.
Stores in db.sqlite under the table get_all_stoppages
TOTAL OF 1673 entries found.
"""
import sqlit... | 23.011494 | 127 | 0.605395 |
4fddcbc325815f5a15a0a295b7ecf60c47fadf62 | 415 | py | Python | BITs/2014/Baybulatova_K_V/task3_3.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Baybulatova_K_V/task3_3.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Baybulatova_K_V/task3_3.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача3. Вариант 3
#Программа, которая выводит имя "Чарльз Лютвидж Доджсон", и запрашивает его псевдоним.
#Байбулатова К.В.
#13.03.2016
print("Герой нашей сегодняшней программы- Чарльз Лютвидж Доджсон")
psev=input("Под каким же псевдонимом он известен? Ваш ответ:")
if(psev)==("Льюис Кэрролл"):
print("Все верно: Ча... | 29.642857 | 86 | 0.744578 |
8ce53e927af722214eaf8290240ae54adadb2325 | 1,478 | py | Python | BigData_exp/exp3/exp3/my_count.py | DolorHunter/hfut-exp-archived | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | 12 | 2020-12-07T05:49:05.000Z | 2022-03-25T09:09:36.000Z | BigData_exp/exp3/exp3/my_count.py | DolorHunter/hfut-exp | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | null | null | null | BigData_exp/exp3/exp3/my_count.py | DolorHunter/hfut-exp | c67e26c1f4fba550c8974eaba10dfa302b928868 | [
"BSD-2-Clause"
] | 1 | 2021-01-08T08:53:53.000Z | 2021-01-08T08:53:53.000Z | import csv
# Count school and schooltypes
def count(schooltimes, schooltypestimes, schooltimes_list, schooltypestimes_list):
with open('re_html_info.csv', 'rt', encoding='utf-16') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
# Count school
for school in ... | 30.791667 | 82 | 0.620433 |
5069b8219646c1ae85397eb4f233668512f3df82 | 2,266 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/intro/intro_mergesort.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/intro/intro_mergesort.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch09_search_and_sort/intro/intro_mergesort.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch09_search_and_sort.intro.intro_insertion_sort import insertion_sort
def merge_sort(to_sort):
# Rekursiver Abbruch: Länge 0 (nur wenn initial leeres Array) oder 1
if len(to_sort) <= 1:
return to_sort
# ... | 23.122449 | 74 | 0.629303 |
50a75943448b4345f9334318be5f7fe2b2349789 | 1,052 | py | Python | python/python_backup/PRAC_PYTHON/ceaserCipher.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ceaserCipher.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ceaserCipher.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class ceaserCipher:
def __init__(self):
self.encoded_text=""
self.decoded_text=""
def encode(self,some_text,key):
for iter in str(some_text):
#print(iter)
t = chr(ord(iter)+int(key))
if t>'z' and iter.islower():
t = chr(ord(t) - o... | 32.875 | 57 | 0.499049 |
50b466ad6b4cb623b7215d4215498d11f2ec9d31 | 650 | py | Python | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P06_AreaOfFigures.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P06_AreaOfFigures.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L02_ConditionalStatements/Lab/Solutions/P06_AreaOfFigures.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | import math
item = input()
square = 0
rectangle = 0
circle = 0
triangle = 0
if item == 'square':
square_item = float(input())
size = square_item ** 2
print(f'{size:.3f}')
if item == 'rectangle':
rectangle_item1 = float(input())
rectangle_item2 = float(input())
size = rectangle_item1 * rectang... | 24.074074 | 48 | 0.627692 |
50c14266345b942470ca65da2548943b63137b4e | 868 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/driver/gyroscope/main.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/gyroscope/main.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/gyroscope/main.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | import sh1106
import utime
from driver import SPI
from driver import GPIO
from mpu6050 import MPU6050
mpu6050Dev = MPU6050()
mpu6050Dev.open("mpu6050")
mpu6050Dev.init()
print("mpu6050 init finished")
spi0 = SPI()
spi0.open("oled_spi")
gpio_dc = GPIO()
gpio_dc.open("oled_dc")
gpio_res = GPIO()
gpio_res.open("oled_r... | 24.111111 | 89 | 0.684332 |
e893e6f55bfb6fc8ac36760cf616719c510fc7b3 | 915 | py | Python | 2020-09-02-1123-gma_maximum3.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-02-1123-gma_maximum3.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-02-1123-gma_maximum3.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 11:00:10 2020
@author: Georg Maubach
Schreiben Sie eine Funktion maximum, die zwei nummerische Werte
übergeben werden, und die dann den größeren der beiden Werte
zurückliefert.
"""
#-----------------------------------------------------------------------------... | 27.727273 | 80 | 0.484153 |
d14b0e59417f02b8f85669b7e3559c28a61aafed | 5,120 | py | Python | Tests/sdknightly/create_entities_for_nightly_sdk.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/sdknightly/create_entities_for_nightly_sdk.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/sdknightly/create_entities_for_nightly_sdk.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import argparse
import json
import os
import shutil
import subprocess
from pathlib import Path
from typing import Tuple
def run_command(cmd: str) -> Tuple[str, str]:
return subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8').communicate()
def create_incident_field(pat... | 31.219512 | 120 | 0.657031 |
d1708574297a0944952999afed547472bb5dc9e8 | 695 | py | Python | Python_DF_Aggregations.py | mattblasa/Azure-Databricks-Experiments | 7d72966a1b4f3878dec24a9b0c55e01ece071204 | [
"MIT"
] | null | null | null | Python_DF_Aggregations.py | mattblasa/Azure-Databricks-Experiments | 7d72966a1b4f3878dec24a9b0c55e01ece071204 | [
"MIT"
] | null | null | null | Python_DF_Aggregations.py | mattblasa/Azure-Databricks-Experiments | 7d72966a1b4f3878dec24a9b0c55e01ece071204 | [
"MIT"
] | null | null | null | # COMMAND ----------
#PySpark Functions
from pyspark.sql.functions import col, when, lead, expr
from pyspark.sql.window import Window
# COMMAND ----------
######## Load DF from blob storage ##############
df = spark.read.format("csv") \
.options(header='true', delimiter = ',') \
.schema(customSchema) \
.load("/mnt/fi... | 23.965517 | 55 | 0.638849 |
7e63d1a7ce2f90b64a6dabc25b90639d0698737f | 7,462 | py | Python | run_fscn.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | run_fscn.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | run_fscn.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import math
import sys
import time
import numpy
import portalocker
import scipy.interpolate
import ephem
import oskar
def element_area_and_temperature(freq_hz):
"""Return element effective area and system temperauture at given frequency.
Effective area and temperature values for SKA1-LOW ... | 37.878173 | 80 | 0.628786 |
bc1311511b2d0810b83e0a66d1049797f75749cb | 217 | py | Python | tuta/model/act_funcs.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/model/act_funcs.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/model/act_funcs.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | # -*- coding: utf-8 -*-
""" Activation Functions """
import math
import torch
# %% activation functions
def gelu(x):
return (torch.erf(x/math.sqrt(2.0)) + 1.0) * x * 0.5
ACT_FCN = {"gelu": gelu}
| 15.5 | 57 | 0.562212 |
381f6ed09f7a2c3a457307acd5b1071f8275cf59 | 188 | py | Python | Tests/testing_constants.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/testing_constants.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | Tests/testing_constants.py | savagewil/SavageML | d5aa9a5305b5de088e3bf32778252c877faec41d | [
"MIT"
] | null | null | null | import numpy as np
from savageml.simulations import BinaryXorSimulation
def GET_RNG():
return np.random.default_rng(0)
RNG = GET_RNG()
PRECISION = 0.0000001
LEARNING_RATE = 0.01
| 13.428571 | 52 | 0.755319 |
2a23107049a15dc6eb279ae5f95ad2885d66d6f4 | 640 | py | Python | elements/python/13/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/13/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/13/8/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def closest_repeat(words):
last_position = dict()
d = float('inf')
i, j = None, None
for idx, word in enumerate(words):
last_idx = last_position.get(word, None)
if last_idx is not None and idx - last_idx < d:
i, j, d = last_idx, idx, idx - last_idx
last_position[word]... | 22.857143 | 82 | 0.579688 |
35541d1ee4edd403efe6cd4f21c04b0ba359a443 | 1,402 | py | Python | src/beads.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/beads.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/beads.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | """
ID: isaiahl1
LANG: PYTHON2
TASK: beads
"""
fin = open ('beads.in', 'r')
fout = open ('beads.out', 'w')
def main():
with fin:
with fout:
N = int(fin.readline())
S = fin.readline().strip()
res = solve(N, S)
# print 'res', res
print >>fout, res
def solve(N, S):
if not N:
return 0
S = list(S +... | 13.480769 | 44 | 0.506419 |
ea4007551786dbdffcda4ed98e18d1940d6dd754 | 596 | py | Python | exercises/pt/solution_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/solution_01_04.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Processar o texto
doc = nlp(
"Em 1990, mais de 60% da população da Ásia Oriental estava em situação de extrema pobreza."
"Agora, menos de 4% está nessa situação."
)
# Iterar os tokens de um documento doc
for token in doc:
# Checar se o token é composto por algaris... | 31.368421 | 95 | 0.657718 |
579f2f6ee7bd7ddbd0e08295c41682826838697d | 360 | py | Python | Chapter2_Python/Libraries/MyModule.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/Libraries/MyModule.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | Chapter2_Python/Libraries/MyModule.py | derfabs/UdemyGAN_Template | 1c7d263d22ccf1ba580c71befe71e3bf6e2facb6 | [
"MIT"
] | null | null | null | def list_max(input_list):
result = input_list[0]
for i in range(len(input_list)):
if input_list[i] > result:
result = input_list[i]
print(result)
def list_min(input_list):
result = input_list[0]
for i in range(len(input_list)):
if input_list[i] < result:
re... | 21.176471 | 36 | 0.605556 |
17d40e0dd70fbf793809d011baf156a68e00eb87 | 7,216 | py | Python | research/cv/IRN/src/network/Invnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/IRN/src/network/Invnet.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/IRN/src/network/Invnet.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... | 33.877934 | 94 | 0.569429 |
109e9896726250008875b9dbc6ce555b8cc9d991 | 299 | py | Python | examples/python/hello_hokchew.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 1 | 2020-07-23T14:18:25.000Z | 2020-07-23T14:18:25.000Z | examples/python/hello_hokchew.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 6 | 2020-04-25T05:20:04.000Z | 2021-08-30T09:08:50.000Z | examples/python/hello_hokchew.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | null | null | null | import sys
from python.pyhokchew.parser import parse_foochow_romanized_phrase as parse
from python.pyhokchew.version import VERSION
print("Hello Hokchew")
print("Python version:", sys.version)
print("PyHokchew version:", VERSION)
print()
print("Parsing Foochow Romanized:")
print(parse("cṳ̄ng"))
| 23 | 75 | 0.789298 |
eae6975fbdc61164cdef1dd94a96f1acbcdfdf14 | 938 | py | Python | Algorithms/Sorting/ClosestNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Sorting/ClosestNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Sorting/ClosestNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
N = int(raw_input())
ar = map(int, raw_input().split())
def insert_sort(ar):
for i in xrange(N):
key = ar[i]
j = i
while j > 0 and ar[j-1] > key:
ar[j] = ar[j-1]
j -= 1
ar[j] = key
return ar
def quick_sort(ar, lo, hi):
if hi > lo:
... | 19.541667 | 39 | 0.404051 |
d82e916ae4a30bd707e50b9685ac0e13f9494657 | 11,573 | py | Python | src/onegov/agency/data_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/data_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/data_import.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import defaultdict
from datetime import datetime
from onegov.agency.collections import ExtendedAgencyCollection, \
ExtendedPersonCollection
from onegov.core.csv import CSVFile
from onegov.core.orm.abstract.adjacency_list import numeric_priority
from onegov.core.utils import linkify
def with_open... | 30.616402 | 79 | 0.617126 |
dc4d797fd7902e39079a12ca52288e24918385f0 | 1,228 | py | Python | robot/wahson/wahson2.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | robot/wahson/wahson2.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | robot/wahson/wahson2.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #coding=utf-8
from selenium import webdriver
import time
import xlwt
from xlwt import Workbook,easyxf,Formula
browser = webdriver.Firefox()
browser.maximize_window()
browser.get("http://www.jd.com/pinpai/751-8544.html")
time.sleep(5)
links = browser.find_elements_by_css_selector("li.gl-item div.p-name a")
items=[]
fo... | 23.615385 | 93 | 0.671824 |
762c460fd50634058ea43b36f6070e9b11062422 | 1,396 | py | Python | exercises/fr/test_01_12_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/test_01_12_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/test_01_12_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(pattern) == 3
), "Le motif doit décrire trois tokens (trois dictionnaires)."
assert (
isinstance(pattern[0], dict)
and isinstance(pattern[1], dict)
and isinstance(pattern[2], dict)
), "Chaque élément d'un motif doit être un dictionnaire."
asse... | 43.625 | 89 | 0.626791 |
870bd85af084bd9de08fd6e354793b8c85a10ffe | 831 | py | Python | showcase9/com/aaron/mydict_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase9/com/aaron/mydict_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase9/com/aaron/mydict_test.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""
unit test
"""
__author__="aaron.qiu"
import unittest
from com.aaron.mydict import Dict
class TestDict(unittest.TestCase):
def test_init(self):
d = Dict(a=1,b='test')
self.assertEqual(d.a,1)
self.assertEqual(d.b,'test')
self.assertTrue(isinstance(d,dict)... | 21.868421 | 47 | 0.56077 |
87227ab3ed415a1aefe3ff6fe28df004e406ac1c | 144 | py | Python | python/primary/模块/mymodule_demo.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | 1 | 2020-07-29T16:43:46.000Z | 2020-07-29T16:43:46.000Z | python/primary/模块/mymodule_demo.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | python/primary/模块/mymodule_demo.py | EstherLacan/jiangfw | a449b1925742873c76dc1b3284aedb359204bc76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Filename: mymodule_demo.py
import mymodule as md
import using_name
md.sayhi()
print('Version is ',md.version)
#dir(md)
| 12 | 31 | 0.722222 |
21b1f3ab82aa1b12a806c160a12d79e26a4b399e | 8,846 | py | Python | nettests/launch_nodes.py | Laighno/evt | 90b94e831aebb62c6ad19ce59c9089e9f51cfd77 | [
"MIT"
] | 1,411 | 2018-04-23T03:57:30.000Z | 2022-02-13T10:34:22.000Z | nettests/launch_nodes.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 27 | 2018-06-11T10:34:42.000Z | 2019-07-27T08:50:02.000Z | nettests/launch_nodes.py | Zhang-Zexi/evt | e90fe4dbab4b9512d120c79f33ecc62791e088bd | [
"Apache-2.0"
] | 364 | 2018-06-09T12:11:53.000Z | 2020-12-15T03:26:48.000Z | import json
import os
import sys
import time
import click
import docker
from pyevt import ecc, libevt
from pyevtsdk import action, api, base, transaction
class command():
"""docstring for command."""
def __init__(self, cmd):
self.content = cmd
def add_option(self, option):
self.content ... | 38.798246 | 160 | 0.523513 |
df576bb275a4d6af9ce934b3e4c66aeb8e6685b3 | 449 | py | Python | Python/Exercícios_Python/061_cálculo_do_fatorial.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/061_cálculo_do_fatorial.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | Python/Exercícios_Python/061_cálculo_do_fatorial.py | vdonoladev/aprendendo-programacao | 83abbcd6701b2105903b28fd549738863418cfb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""061 - Cálculo do Fatorial
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1rJmXAOCqkk-aX42u_d7rjnL3WhE6ScBH
"""
f = fator = int(input('Resolver o fatorial de: '))
resultado = 1
fatorial = ''
for i in range(fator, 0, -1):
... | 22.45 | 77 | 0.654788 |
10f4f67ea4a14c43e0d6e8839cc10ddf5bb46909 | 96 | py | Python | src/onegov/feriennet/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.feriennet.theme.feriennet_theme import FeriennetTheme
__all__ = ['FeriennetTheme']
| 24 | 65 | 0.833333 |
803bc224cbe351eff736ff245e32aaabaf8da51f | 556 | py | Python | Algorithms/Python/climbStairs.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 2 | 2021-12-13T10:09:47.000Z | 2022-01-05T11:04:31.000Z | Algorithms/Python/climbStairs.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 1 | 2021-10-15T17:55:47.000Z | 2021-10-17T20:43:15.000Z | Algorithms/Python/climbStairs.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 4 | 2021-10-12T13:05:10.000Z | 2021-10-16T19:31:46.000Z | def climbStairs(n, dic = {0:0,1:1,2:2}):
"""
LeetCode-Problem:
You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Solution:
Exploring all possible ways to climb the stairs in 1 or 2 s... | 30.888889 | 101 | 0.636691 |
33dc5192d1b705837f660da38fc8e68353abcb74 | 282 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_0/remove_non_existing_warehouse_from_stock_settings.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
def execute():
default_warehouse = frappe.db.get_value("Stock Settings", None, "default_warehouse")
if default_warehouse:
if not frappe.db.get_value("Warehouse", {"name": default_warehouse}):
frappe.db.set_value("Stock Settings", None, "default_warehouse", "") | 40.285714 | 85 | 0.751773 |
1d322b94858298b56eadde1ddcb1f3468902c9e0 | 2,981 | py | Python | gemtown/modelers/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/modelers/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/modelers/serializers.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from gemtown.users import models as user_models
from gemtown.modelphotos import models as modelphoto_models
from . import models
import time
class TimestampField(serializers.Field):
def to_representation(self, value):
return int(time.mktime(value.timetuple()))
class ... | 24.040323 | 62 | 0.550822 |
1d716a8ea191bbc2a37ef73042577f336f731a7a | 406 | py | Python | venv/lib/python3.9/site-packages/timer/__version__.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/timer/__version__.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/timer/__version__.py | mamenglong/StockFund | e80d8a185c37023c3e7849a1b7b03d81a165af6f | [
"Apache-2.0"
] | null | null | null | __name__ = 'timer'
__description__ = 'Python Code Timer'
__url__ = 'https://github.com/LucienShui/timer'
__version_info__ = (0, 1, 2)
__version__ = '.'.join(map(str, __version_info__))
__build__ = eval(f"0x{''.join(map(lambda x: f'{int(x):02d}', __version_info__))}")
__author__ = 'Lucien Shui'
__author_email__ = 'lucie... | 36.909091 | 82 | 0.726601 |
98abc29b0d43f62cff9b9f5a8a7e69a59d22695c | 2,779 | py | Python | SC101_Assignments/SC101_Assignment5/anagram.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment5/anagram.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment5/anagram.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | """
File: anagram.py
Name:
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each word liste... | 23.956897 | 85 | 0.562073 |
7f553d04be4246ba596778cfffb0afe9b3702399 | 1,666 | py | Python | docker/django/restaurant/restapi/views/foodmenu_views.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapi/views/foodmenu_views.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapi/views/foodmenu_views.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from restapi.models import FoodMenu
from restapi.serializers import FoodMenuSerializer
class FoodMenuView(APIView):
permission_classes = (IsAuthenticated,)
def get(self... | 33.32 | 77 | 0.62605 |
7fb516412b9bf86aa46b9f5a4e6dafaec9b992f6 | 6,467 | py | Python | lib/dex.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | 1 | 2022-03-09T20:44:33.000Z | 2022-03-09T20:44:33.000Z | lib/dex.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | null | null | null | lib/dex.py | jxtrbtk/bindex | 8feee8ff9db371d9e691e10ea70467446c0412b1 | [
"MIT"
] | null | null | null | ## from https://github.com/sammchardy/python-binance-chain
## I've broke the object model from it to understand how it works...
import math
import json
import requests
import binascii
from decimal import Decimal
from collections import OrderedDict
from secp256k1 import PrivateKey
BROADCAST_SOURCE = 0
from . impor... | 31.70098 | 94 | 0.643884 |
63f1da9fc1153b4bc8b1bcaffd99adf73c0e5d92 | 953 | py | Python | source/pkgsrc/graphics/mypaint/patches/patch-lib_meta.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/graphics/mypaint/patches/patch-lib_meta.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/graphics/mypaint/patches/patch-lib_meta.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-lib_meta.py,v 1.1 2020/03/04 13:51:51 wiz Exp $
Fix error with python-3.7:
File "/scratch/graphics/mypaint/work/mypaint-2.0.0/lib/meta.py", line 411, in _get_release_info_script
base, formal, ceremonial = _get_versions(gitprefix=gitprefix)
File "/scratch/graphics/mypaint/work/mypaint-2.0.0/lib/... | 41.434783 | 104 | 0.670514 |
1272bcfa43802d9cb8098362989c7d6817f02c49 | 619 | py | Python | tests/test_tipc/benchmark/utils/record.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/test_tipc/benchmark/utils/record.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/test_tipc/benchmark/utils/record.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | class AverageStatistical(object):
def __init__(self):
self.reset()
def reset(self):
self.total_cnt = 0
self.time = 0
def record(self, val, cnt=1):
self.time += val
self.total_cnt += cnt
def get_average(self):
if self.total_cnt == 0:
return ... | 19.967742 | 48 | 0.573506 |
89ee926d55ad9a3db213875087b9f9a515737994 | 7,802 | py | Python | frappe-bench/apps/erpnext/erpnext/hub_node/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hub_node/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/hub_node/__init__.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, requests, json
from frappe.utils import now, nowdate, cint
from frappe.utils.nestedset import get_root_of
from frappe.contacts.d... | 28.064748 | 94 | 0.732248 |
f60881ba58eac3bf7d2d3de7379654dba0bfc751 | 636 | py | Python | packages/watchmen-pipeline-kernel/test/watchmen_pipeline_kernel_test/test_get_external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/test/watchmen_pipeline_kernel_test/test_get_external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/test/watchmen_pipeline_kernel_test/test_get_external_writer.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from unittest import TestCase
from watchmen_data_kernel.external_writer import ask_external_writer_creator, find_external_writer_create, \
register_external_writer_creator
from watchmen_model.system import ExternalWriterType
from watchmen_pipeline_kernel.boot import init_prebuilt_external_writers
class GetExternalW... | 35.333333 | 108 | 0.858491 |
f635c65d0e524234c86856bec0112a5c109968c0 | 2,293 | py | Python | prep/util/layerToWGS.py | Empythy/geometry-learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 21 | 2018-10-09T08:15:29.000Z | 2022-03-16T08:23:08.000Z | prep/util/layerToWGS.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 31 | 2017-09-20T13:30:37.000Z | 2018-03-01T13:24:58.000Z | prep/util/layerToWGS.py | reinvantveer/Topology-Learning | 5300d421ef848c2748a2ba41ced5c6e2fba93200 | [
"MIT"
] | 7 | 2018-11-29T11:39:02.000Z | 2022-01-12T07:10:26.000Z | from osgeo import osr, gdal
def gdal_error_handler(err_class, err_num, err_msg):
err_type = {
gdal.CE_None: 'None',
gdal.CE_Debug: 'Debug',
gdal.CE_Warning: 'Warning',
gdal.CE_Failure: 'Failure',
gdal.CE_Fatal: 'Fatal'
}
err_msg = err_msg.replace('\n', ' ')
err_... | 33.720588 | 103 | 0.695595 |
f65875ebf1c86c220efd7b03365cb6c1d534d227 | 499 | py | Python | leetcode/152-Maximum-Product-Subarray/MaxProdSubarr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/152-Maximum-Product-Subarray/MaxProdSubarr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/152-Maximum-Product-Subarray/MaxProdSubarr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param A, a list of integers
# @return an integer
def maxProduct(self, A):
if len(A) == 0:
return 0
min_tmp = A[0]
max_tmp = A[0]
result = A[0]
for i in range(1, len(A)):
a = A[i] * min_tmp
b = A[i] * max_tmp
... | 27.722222 | 60 | 0.456914 |
149995d9add0a9f8a6e965493902a716162d6e82 | 3,059 | py | Python | tests/login/test_login_redirect.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | tests/login/test_login_redirect.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | tests/login/test_login_redirect.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | """
Fence's login endpoints must redirect only to valid URLs:
- the same application (``BASE_URL``)
- registered in the configuration
- registered for an OAuth client
Mocking `get_value_from_discovery_doc` for RAS because
https://sts.nih.gov is not stable and causes test failures.
"""
import mock
import ... | 31.864583 | 92 | 0.716247 |
1af22bbe8f0d1afa606fd8eb455941078abea84b | 946 | py | Python | Python/Topics/AsyncIO/03-http-request.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Python/Topics/AsyncIO/03-http-request.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | Python/Topics/AsyncIO/03-http-request.py | shihab4t/Software-Development | 0843881f2ba04d9fca34e44443b5f12f509f671e | [
"Unlicense"
] | null | null | null | import time
import asyncio
from aiohttp import ClientSession
async def call_api():
url = "http://httpbin.org/delay/4"
print("getting with 4 seconds dealy")
async with ClientSession() as session:
async with session.get(url) as response:
response = await response.read()
print... | 24.894737 | 60 | 0.662791 |
1af725d0b2e33636718fbe06f063e5c3521a1cf6 | 249 | py | Python | dash/admin.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/admin.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | dash/admin.py | bdioui/DashboardFeder | 455737c828f1c04651af495f60d6637131b911f5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Profile, Dossier, Enveloppe, Indicateur
admin.site.register(Profile)
admin.site.register(Dossier)
admin.site.register(Enveloppe)
admin.site.register(Indicateur)
# Register your models here.
| 17.785714 | 59 | 0.803213 |
dcd3fef41e3a794e2f004587ea6cff1d58986cf4 | 641 | pyde | Python | sketches/SierpinskiDreickeRekursiv/SierpinskiDreickeRekursiv.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/SierpinskiDreickeRekursiv/SierpinskiDreickeRekursiv.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/SierpinskiDreickeRekursiv/SierpinskiDreickeRekursiv.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # Sierpinski Dreieck
# nach Peter Farrell: Math Adventures with Python, p. 214ff.
from math import sqrt
def setup():
size(500, 440)
background(234, 218, 184)
this.surface.setTitle("Sierpinski Dreieck rekursiv")
noLoop()
def draw():
# background(234, 218, 184)
translate(50, 380) # links un... | 23.740741 | 60 | 0.581903 |
0d058014c7bf8c877de5aeaff0c928f71fd8f810 | 756 | py | Python | src/examples/GUI_ErrorWidget.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-26T16:16:14.000Z | 2020-05-26T16:16:14.000Z | src/examples/GUI_ErrorWidget.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | null | null | null | src/examples/GUI_ErrorWidget.py | wrthfl/pyopenms-tewb | f02ab0393df746846c26ed6c812964f9da355b99 | [
"Zlib",
"Apache-2.0"
] | 1 | 2020-05-16T20:09:17.000Z | 2020-05-16T20:09:17.000Z | import sys
from PyQt5.QtWidgets import QApplication
import numpy as np
from GUI_EXAMPLE_BASE import GUI_EXAMPLE_BASE
sys.path.insert(0, '../view')
from ErrorWidget import ErrorWidget
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = GUI_EXAMPLE_BASE() # plain QMainWindow with basic layout and menu... | 30.24 | 91 | 0.675926 |
25c093c3fb4d67a5ce2593e9272bdbf52361f20d | 269 | py | Python | Python/Strings/designer_door_mat.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/designer_door_mat.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/designer_door_mat.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | N, M = map(int,input().split()) # More than 6 lines of code will result in 0 score. Blank lines are not counted.
for i in range(1,N,2):
print ((i*".|.").center(M,"-"))
print ("WELCOME".center(M,"-"))
for i in range(N-2,-1,-2):
print ((i*".|.").center(M,"-"))
| 38.428571 | 112 | 0.568773 |
d36e419d6e9969d098d71dfd48780ad4f9bc4151 | 513 | py | Python | src/api/tests.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/api/tests.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/api/tests.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
# Create your tests here.
from labtest.models import Location
class LocationTestCase(TestCase):
def setUp(self):
Location.objects.create(name="CovidLab San Diego",
slug="sandiego", longitude=1, latitude=1,
... | 27 | 73 | 0.62963 |
6cd286d2bdb7d28d8d0de6b186a020933bb85355 | 2,035 | py | Python | preprocess.py | mishra-rajeev/Movie_recommendation_system | 1f899c97bc18c5e5542f13ca3e05ba90d795d997 | [
"MIT"
] | null | null | null | preprocess.py | mishra-rajeev/Movie_recommendation_system | 1f899c97bc18c5e5542f13ca3e05ba90d795d997 | [
"MIT"
] | null | null | null | preprocess.py | mishra-rajeev/Movie_recommendation_system | 1f899c97bc18c5e5542f13ca3e05ba90d795d997 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
data = pd.read_csv('movie_metadata.csv')
# Extracting columns that are useful in recommndation system
data = data.loc[:, ['movie_title', 'director_name', 'language',
'country', 'genres', 'actor_1_name', 'actor_2_name', 'actor_3_name']]
# replacing n... | 40.7 | 96 | 0.699754 |
e292774d8877bb2ebd67842f15d0de2c814a47de | 32,771 | py | Python | sandbox/graphviz_2.py | harrywright/topologence | 413f965803385351070e5cffcdf3b8f6f79fd6b1 | [
"Apache-2.0"
] | null | null | null | sandbox/graphviz_2.py | harrywright/topologence | 413f965803385351070e5cffcdf3b8f6f79fd6b1 | [
"Apache-2.0"
] | null | null | null | sandbox/graphviz_2.py | harrywright/topologence | 413f965803385351070e5cffcdf3b8f6f79fd6b1 | [
"Apache-2.0"
] | null | null | null | # Based on http://matthiaseisen.com/articles/graphviz/
import graphviz as gv
styles = {
'graph': {
'fontname' : 'sans',
'fontsize': '16',
'fontcolor': 'black',
#'bgcolor': '#dddddd',
'rankdir': 'LR',
'margin': '20',
},
'nodes': {
'fontname': 'sans',... | 46.417847 | 113 | 0.553813 |
2c5807909c1b4f5d4be74fb916a882e537017e5a | 7,303 | py | Python | Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/DuoAdminApi/Integrations/DuoEventCollector/DuoEventCollector.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | from collections import deque
from enum import Enum
import duo_client
from pydantic import BaseModel # pylint: disable=E0611
from CommonServerPython import *
class LogType(str, Enum):
"""
A list that represent the types of log collecting
"""
AUTHENTICATION = 'AUTHENTICATION'
ADMINISTRATION = 'ADM... | 36.883838 | 119 | 0.601944 |
39238fb462cc689a749b5ac0f4d07f2591132964 | 4,007 | py | Python | biowardrobe_airflow_advanced/utils/utilities.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | biowardrobe_airflow_advanced/utils/utilities.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | 1 | 2018-09-30T16:57:06.000Z | 2018-09-30T16:57:06.000Z | biowardrobe_airflow_advanced/utils/utilities.py | Barski-lab/biowardrobe-airflow-advanced | e43aa268fd05635e8356788b8e814279b698263f | [
"Apache-2.0"
] | null | null | null | import os
import re
import argparse
import subprocess
from json import loads
from functools import partial
from collections import OrderedDict
from schema_salad.ref_resolver import file_uri
from cwltool.pathmapper import adjustFileObjs, adjustDirObjs, normalizeFilesDirs
from cwltool.process import compute_checksums
f... | 32.577236 | 133 | 0.668081 |
1a59770f392180aa2b9a468493cec38a16435429 | 1,901 | py | Python | save_codes.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | save_codes.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | save_codes.py | nullputra/nlptr-lib | 618c2c74c3d3033bae04de9ba9a253bb6eb31a6c | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python3
import getopt
import os
import sys
import json
usage = """USAGE: $ python3 save_codes.py https://atcoder.jp/contests/abc244/tasks/abc244_a bin/out/v220314.py
Options:
-h --help print this help and exit
"""
opt_list = {"help": "h"}
json_path = "./bin/codes.json"
def kill(s, status):
i... | 23.469136 | 110 | 0.591268 |
b3c2796b296ee2a9f2149806b075845a28d72f5b | 200 | py | Python | pset1_prob2.py | realomgitsdave/mit-6.00.1x | d12a0c6a0b063133e57969e1b0b9d2781231a234 | [
"MIT"
] | null | null | null | pset1_prob2.py | realomgitsdave/mit-6.00.1x | d12a0c6a0b063133e57969e1b0b9d2781231a234 | [
"MIT"
] | null | null | null | pset1_prob2.py | realomgitsdave/mit-6.00.1x | d12a0c6a0b063133e57969e1b0b9d2781231a234 | [
"MIT"
] | null | null | null | bob = 'bob'
count = 0
idx = 0
while True:
idx = s.find(bob, idx)
if idx >= 0:
count += 1
idx += 1
else:
break
print ('Number of times bob occurs is: ' + str(count)) | 18.181818 | 54 | 0.505 |
80c1e65caf80907ad0bbbe77672677be9c08c841 | 387 | py | Python | python/coursera_python/IBM/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/IBM/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/IBM/1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import requests
wikipedia_link='https://en.wikipedia.org/wiki/Special:Random'
raw_random_wikipedia_page = requests.get(wikipedia_link)
page = raw_random_wikipedia_page.text
f1 = page.find('<title>')
f2 = page.find('</title>')
title_string = page[f1+7:f2]
print(title_string)
img=display_cover(top='top',bottom='bottom')
... | 32.25 | 61 | 0.775194 |
80f13ad99c23813f2bc6597a7f089552eda0a10a | 374 | py | Python | Variablen und Operatoren/Eingabe/zufallszahl.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/Eingabe/zufallszahl.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | Variablen und Operatoren/Eingabe/zufallszahl.py | DietrichPaul/Einstieg-in-Python | 0d28402f962773274d85e6bb169ae631c91f66ce | [
"CC0-1.0"
] | null | null | null | # Modul "random" importieren
import random
# Zufallsgenerator initialisieren
random.seed()
# Zufallswerte und Berechnung
a = random.randint(1, 10) # Zwischen 1 und 10
b = random.randint(1, 10)
c = a + b
print("Die Aufgabe:", a, "+", b)
# Eingabe
print("Bitte eine Zahl eingeben:")
z = input()
zahl = int(z)
# Ausgab... | 17.809524 | 46 | 0.681818 |
038f6b2710e22d144664bc76c5732f01a8707758 | 381 | py | Python | setup.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | setup.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | setup.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import sys
from setuptools import setup
min_version = (3, 8)
if sys.version_info < min_version:
error = f"""
bo4e needs Python {min_version} or above.
You are using Python {sys.version_info}
""".format(
".".join(str(n) for n in min_version),
".".join(str(n) for n in sys.version_info[:3]),
)
... | 21.166667 | 55 | 0.658793 |
20a25a8eb646f1149efd1e128134084dea2ff4df | 1,965 | py | Python | pycsw/tests/unittests/test_metadata.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 118 | 2015-01-07T00:24:09.000Z | 2022-03-19T15:35:43.000Z | pycsw/tests/unittests/test_metadata.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 319 | 2015-01-06T23:51:46.000Z | 2022-03-20T11:22:57.000Z | pycsw/tests/unittests/test_metadata.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 113 | 2015-01-07T00:42:23.000Z | 2022-02-19T18:05:08.000Z | # =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the... | 35.089286 | 74 | 0.666667 |
442d13b7a5971edb4d01044451f8c4d6a718911b | 694 | py | Python | api/utils/coloring.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 2 | 2021-03-23T20:32:38.000Z | 2021-04-21T11:20:12.000Z | api/utils/coloring.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | 4 | 2021-04-19T11:00:55.000Z | 2021-04-20T08:21:48.000Z | api/utils/coloring.py | healthIMIS/aha-kompass | 7b7cae24502c0c0e5635c587cfef797a93ae02b5 | [
"MIT"
] | null | null | null | def coloring(incidence):
if incidence >= 500:
return "#d80182"
elif incidence > 250:
return "#651212"
elif incidence > 100:
return "#921214"
elif incidence > 50:
return "#d03523"
elif incidence > 5:
return "#faee7d"
elif incidence > 0:
return "#faf... | 26.692308 | 49 | 0.492795 |
44643b7c73d787ff61653a8dbea5aa48f9722e1c | 225 | py | Python | Licence 2/I33/TP 4/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 4/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 4/ex_3.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | import random
def gentrianginf(n, t):
N = [0] * n
for i in range(0, n):
N[i] = [0] * n
for j in range(0, i + 1):
N[i][j] = random.randrange(0, t)
return N
print(gentrianginf(4, 7))
| 16.071429 | 44 | 0.484444 |
a65080cc00b5f4593389c3ff4a76dc32024d94da | 14,510 | py | Python | Templates/Integrations/CaseManagement/CaseManagement.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Templates/Integrations/CaseManagement/CaseManagement.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Templates/Integrations/CaseManagement/CaseManagement.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
''' IMPORTS '''
from typing import Dict, Tuple, List, AnyStr, Optional, Union
import urllib3
# Disable insecure warnings
urllib3.disable_warnings()
"""GLOBALS/PARAMS
Attributes:
INTEGRATION_NAME:
Name of the integration as shown in the integration UI, for example: Microso... | 34.796163 | 113 | 0.633012 |
750375287e54c6c7ba17fe012181886b62b858c2 | 3,282 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-6_modeling_with_cnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-6_modeling_with_cnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-refactorized/pnlp-4_english-6_modeling_with_cnn-refactored.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pnlp-4_english-6_modeling_with_cnn-refactored.py
pnlp-4_text_classification-english_sentiment_analysis-...
This is a refactorized version.
There're some minor changes in the variable names and so on.
Source: Python Natural Language Processing
Advanced machine learnin... | 27.35 | 86 | 0.666362 |
f382a79b5f50a059cfb6037284bf855c9e492108 | 3,006 | py | Python | examples/dialogue/plato-2/interaction.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dialogue/plato-2/interaction.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dialogue/plato-2/interaction.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import json
import argparse
from collections import namedtuple
from termcolor import colored, cprint
import paddle
from utils.args import parse_args, str2bool
from utils import gen_inputs
from readers.nsp_reader import NSPReader
from readers.plato_reader import PlatoReader
from model import Plato2InferModel
def set... | 33.032967 | 92 | 0.639055 |
cad979deabad9e3e3e78cf0bbdbf6833cb930eca | 278 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v9_2/rename_net_weight_in_item_master.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/v9_2/rename_net_weight_in_item_master.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v9_2/rename_net_weight_in_item_master.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 frappe.model.utils.rename_field import rename_field
def execute():
frappe.reload_doc("stock", "doctype", "item")
if frappe.db.has_column('Item', 'net_weight'):
rename_field("Item", "net_weight", "weight_per_unit")
| 30.888889 | 56 | 0.773381 |
1b4da301286c3328df456c1bf07acc55d7ee417f | 1,257 | py | Python | packages/OpenCV/nodes/OpenCV___YUV_IYUV0/OpenCV___YUV_IYUV0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___YUV_IYUV0/OpenCV___YUV_IYUV0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/OpenCV/nodes/OpenCV___YUV_IYUV0/OpenCV___YUV_IYUV0.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
import cv2
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
class YUV_IYUV_Node... | 27.326087 | 85 | 0.652347 |
1b92a5bce4d7869e4b7d0f140b556d3e10a0d6f5 | 519 | py | Python | DataStructures/Tree/PostorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/PostorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/PostorderTraversal.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def postOrder(root):
if root is not None:
postOrder(root.left)
postOrder(root.right)
print root.data,
def postOrder(root):
stack = [root]
while stack:
node = stack.pop()
if node.left:
stack.append(node)
stack.append(node.le... | 21.625 | 36 | 0.520231 |
1ba85f1ec093b38d8ef3fee9e7d3b613a3f16b67 | 765 | py | Python | ProtoActions.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:22:59.000Z | 2020-11-22T22:22:59.000Z | ProtoActions.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | null | null | null | ProtoActions.py | Az107/Quark | 10c0c953143fb9fc3351dbad9418880aeb5d5a56 | [
"MIT"
] | 1 | 2020-11-22T22:24:19.000Z | 2020-11-22T22:24:19.000Z | import ctypes
import asyncio
import concurrent.futures
class ActionsMaster():
websocket_pointer = None
def fun(self,command):
websocket = ctypes.cast(self.websocket_pointer, ctypes.py_object).value
pool = concurrent.futures.ThreadPoolExecutor()
pool.submit(asyncio.get_event_loop().run... | 24.677419 | 94 | 0.647059 |
1bcdbd5ef30a6a47501ea56206500ec5dbc2e903 | 173 | py | Python | Online-Judges/CodingBat/Python/String-02/String_2-04-count_code.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/String-02/String_2-04-count_code.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/String-02/String_2-04-count_code.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def count_code(str):
count_code = 0
for i in range(len(str)-3):
if str[i:i+2] == "co" and str[i+3] == "e":
count_code += 1
return count_code
| 24.714286 | 50 | 0.526012 |
b620b2f957e297a4525650410fc3f8652f59987a | 104 | py | Python | Tensorflow_basic_test/WF_test.py | TrunkingW/Deep_Learning | 85add772a2c613f8034985872eb3e44683d47bee | [
"MIT"
] | null | null | null | Tensorflow_basic_test/WF_test.py | TrunkingW/Deep_Learning | 85add772a2c613f8034985872eb3e44683d47bee | [
"MIT"
] | null | null | null | Tensorflow_basic_test/WF_test.py | TrunkingW/Deep_Learning | 85add772a2c613f8034985872eb3e44683d47bee | [
"MIT"
] | null | null | null | import numpy
a = numpy.asarray([ [1,2,3], [4,5,6], [7,8,9] ])
numpy.savetxt("foo.csv", a, delimiter=",") | 34.666667 | 48 | 0.586538 |
44d29750e85e4870f43b816bc1b91af22483e538 | 3,842 | py | Python | SmartCare/SmartCarePi/smarthome.py | REMEXLabs/SmartHome_SomSe2016 | 80cce8364f20f50df83b6596cd5b02e43f753fc7 | [
"Apache-2.0"
] | null | null | null | SmartCare/SmartCarePi/smarthome.py | REMEXLabs/SmartHome_SomSe2016 | 80cce8364f20f50df83b6596cd5b02e43f753fc7 | [
"Apache-2.0"
] | null | null | null | SmartCare/SmartCarePi/smarthome.py | REMEXLabs/SmartHome_SomSe2016 | 80cce8364f20f50df83b6596cd5b02e43f753fc7 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import pifacedigitalio as p
import requests
from socketIO_client import SocketIO, LoggingNamespace
p.init()
# BASE-URL
BURL = "http://smartcare.mi.hdm-stuttgart.de"
# SOCKET-PORT
PORT = 8080
# REST-URL
URL = "http://smartcare.mi.hdm-stuttgart.de/api/public/patientdevice.json"
# Patient... | 31.235772 | 120 | 0.593701 |
7808c96776571e8dcf65d3de7f8b12c54e1dc2a5 | 4,637 | py | Python | pymdown_include/__init__.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | pymdown_include/__init__.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | pymdown_include/__init__.py | supcik/pymdown-include | fe426425e646d9111d230885b96d605fa78a62c0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Jacques Supcik
#
# 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 writin... | 33.121429 | 113 | 0.516498 |
78bb72136181784cb920e91fa1bbebff2c4d2ad0 | 1,483 | py | Python | src/test/tests/databases/moab.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/moab.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/moab.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: moab.py
#
# Tests: mesh - 3D unstructured,multi-domain,
# plots - Pseudocolor, mesh
#
# Programmer: Mark C Miller
# Date: August 10, 2016
# ---------------------------... | 24.311475 | 78 | 0.610924 |
ecc5de4cfdcfa75df6eede05cbf1ab431ed4eeef | 2,522 | py | Python | transformer/Decoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/Decoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | null | null | null | transformer/Decoder.py | DragonYong/Sklearn | b604c4bc41ecfa5c10613f713d6ca5c73214c07c | [
"Apache-2.0"
] | 1 | 2021-02-03T07:35:20.000Z | 2021-02-03T07:35:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2020-06-20-20:06
# @Author : TuringEmmy
# @Email : yonglonggeng@163.com
# @WeChat : csy_lgy
# @File : Decoder.py
# @Project : PaperProject
from tensorflow import keras
from Encoder import EncoderLayer
from MultiHeadAttention import MultiHeadAtten... | 38.8 | 112 | 0.71253 |
171dbc51cb103fe17bbd4f158bc216df39aec75c | 639 | py | Python | environment/gazebo_ros_pkgs/gazebo_plugins/scripts/test_range.py | Seongwoo-Moon/test | 0ae00d22e7ebdd9e1d305302fd42be8b2a38c593 | [
"BSD-2-Clause"
] | 4 | 2020-12-16T17:00:17.000Z | 2022-03-08T12:50:28.000Z | e-yantra_data/vb_simulation_pkgs/gazebo_ros_pkgs/gazebo_plugins/scripts/test_range.py | CH13F-1419/MTE-Robotics-Lab | 228b7246927726b20ad1d3a584f6eb7bd939f384 | [
"MIT"
] | 1 | 2021-06-05T07:58:03.000Z | 2021-06-05T07:58:03.000Z | vb_simulation_pkgs/gazebo_ros_pkgs/gazebo_plugins/scripts/test_range.py | ROBODITYA/Eyantra-2021-Vargi-Bots | f1c6a82c46e6e84486a4832b3fbcd02625849447 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from sensor_msgs.msg import Range
import unittest
class TestRangePlugin(unittest.TestCase):
def test_max_range(self):
msg = rospy.wait_for_message('/sonar2', Range)
self.assertAlmostEqual(msg.range, msg.max_range)
def test_inside_range(self):
msg = rospy.wait_for_m... | 27.782609 | 97 | 0.740219 |
17478241abefd571e20c88dbd74cd88251470bb8 | 3,002 | py | Python | src/onegov/election_day/views/manage/screens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/screens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/views/manage/screens.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ The manage screen views. """
from morepath import redirect
from onegov.election_day import _
from onegov.election_day import ElectionDayApp
from onegov.election_day.collections import ScreenCollection
from onegov.election_day.forms import ScreenForm
from onegov.election_day.layouts import ManageScreensLayout
from ... | 24.809917 | 60 | 0.614923 |
e5b0346c930cf051cc0cae701a10d7d8eee8ec45 | 717 | py | Python | lintcode/000-Count-of-Smaller-Number/CountofSmallerNum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/000-Count-of-Smaller-Number/CountofSmallerNum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/000-Count-of-Smaller-Number/CountofSmallerNum_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
"""
@param A: A list of integer
@return: The number of element in the array that
are smaller that the given integer
"""
def binSearch(self, nums, q):
if len(nums) == 0 or nums[-1] < q:
return len(nums)
l, r, res = 0, len(nums) - 1, 0
... | 25.607143 | 53 | 0.44212 |
dac3770c406f615cfae23cf3bf501757fc38cef5 | 850 | py | Python | Webpage/web/migrations/0004_auto_20210616_1733.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/web/migrations/0004_auto_20210616_1733.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/web/migrations/0004_auto_20210616_1733.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.12 on 2021-06-16 17:33
from django.db import migrations
import django_resized.forms
class Migration(migrations.Migration):
dependencies = [
('web', '0003_sponsoren'),
]
operations = [
migrations.AlterField(
model_name='sponsoren',
name='... | 34 | 196 | 0.643529 |
c141539ef5758d578969e91d416ab91d4ba0c1d7 | 1,131 | py | Python | challenges/seatsInTheater/python3/seatsInTheater.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 5 | 2020-05-21T03:02:34.000Z | 2021-09-06T04:24:26.000Z | challenges/seatsInTheater/python3/seatsInTheater.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 6 | 2019-04-24T03:39:26.000Z | 2019-05-03T02:10:59.000Z | challenges/seatsInTheater/python3/seatsInTheater.py | jimmynguyen/codefights | f4924fcffdb4ff14930618bb1a781e4e02e9aa09 | [
"MIT"
] | 1 | 2021-09-06T04:24:27.000Z | 2021-09-06T04:24:27.000Z | def seatsInTheater(nCols, nRows, col, row):
return (nCols - col + 1) * (nRows - row)
if __name__ == '__main__':
input0 = [16, 1, 13, 60, 1000]
input1 = [11, 1, 6, 100, 1000]
input2 = [5, 1, 8, 60, 1000]
input3 = [3, 1, 3, 1, 1000]
expectedOutput = [96, 0, 18, 99, 0]
assert len(input0) == len(expectedOutput), '#... | 66.529412 | 159 | 0.656057 |
c198460f3c5bfe2a6418960520b5a2df5430e742 | 1,762 | py | Python | tools/ftp.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/ftp.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | tools/ftp.py | madkarl/scmt | 1250eb4681f1a5dac91c5a75f15af5b2a9ae0cd5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding : utf8 -*-
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from ftplib import FTP
from tools import utils
import os
def _ftp_return_success(ret_string):
if ret_string[0:3] == "220" or ret_string[... | 27.107692 | 116 | 0.662316 |
e7aa15382993826dea0897b83c6f63370e5be358 | 663 | py | Python | DataStructures/Tree/HuffmanDecode.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/HuffmanDecode.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/Tree/HuffmanDecode.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
from __future__ import print_function
def docode(S, root):
cur = root
for char in S:
if char == '0':
if cur.data == 'ϕ':
cur = cur.left
else:
cur = root
print(cur.data, end='')
elif char == '1':
i... | 22.862069 | 52 | 0.428356 |
99afafa3f3aa274453a9bb85b86db947e4c8908c | 581 | py | Python | lang-python/basics/03-procedures/procedures.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/03-procedures/procedures.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | lang-python/basics/03-procedures/procedures.py | xd23fe39/technical-notes | bb6348705a95db24d07b1081b1aa0265dda131ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Prozeduren definieren und aufrufen
# Zeichenkette oder String (string)
text = "Umfang bei Durchmesser[cm]"
# Fließkommazahl oder Float pi (float, real)
pi = 3.1415
# Definition der Funktion/Prozedur 'umfang' mit Parameter 'd'
# für Durchmesser in Zentimeter.
def ... | 24.208333 | 61 | 0.717728 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.