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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6c93451b990c8943299dfb00bbe17de21075011f | 2,063 | py | Python | server/bumf/core/models/project.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/bumf/core/models/project.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/bumf/core/models/project.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.db import models
from bumf.core.models.account import (
validate_budget_account, validate_expense_account, validate_income_account,
)
from bumf.core.models.utils import Choices
class ProjectScopeChoices(Choices):
PRIVATE = 'private'
BUSINESS = 'business'
... | 33.819672 | 79 | 0.675715 |
6ce19a778d4968594674c722a4f72917527dea59 | 364 | py | Python | tensorflow/basic-rl/tutorial11/code/enjoy_cartpole_dqn.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | tensorflow/basic-rl/tutorial11/code/enjoy_cartpole_dqn.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | tensorflow/basic-rl/tutorial11/code/enjoy_cartpole_dqn.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import gym
from baselines import deepq
env = gym.make("CartPole-v0")
act = deepq.load("models/cartpole_model_DQN_[128, 128].pkl")
while True:
obs, done = env.reset(), False
episode_rew = 0
while not done:
env.render()
obs, rew, done, _ = env.step(act(obs[None])[0])
episode_rew += r... | 24.266667 | 60 | 0.64011 |
e2df693e5ceee4c75b16ee2c29d88d0a3194d73f | 12,337 | py | Python | tuta/model/heads.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 36 | 2021-06-15T01:04:27.000Z | 2022-03-19T16:36:54.000Z | tuta/model/heads.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 6 | 2021-09-03T11:29:36.000Z | 2021-12-15T11:33:57.000Z | tuta/model/heads.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | 8 | 2021-11-03T04:32:36.000Z | 2022-02-02T13:43:47.000Z | # -*- coding: utf-8 -*-
"""
Heads of Pre-training Objectives
MLM: Masked Language Modeling
CLC: Cell-Level Cloze
TCR: Table Context Retrieval
"""
import torch
import torch.nn as nn
import model.act_funcs as act
# %% Pre-training Objective
class MlmHead(nn.Module):
def __init__(self, ... | 48.762846 | 112 | 0.605577 |
e2ed645dd51d7611cd18dbc7466f02a884a82094 | 1,255 | py | Python | src/onegov/onboarding/views/step.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/views/step.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/views/step.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import morepath
from onegov.core.security import Public
from onegov.onboarding import _
from onegov.onboarding import OnboardingApp
from onegov.onboarding.layout import DefaultLayout
from onegov.onboarding.models import Assistant, DefaultAssistant
from webob.exc import HTTPMethodNotAllowed
@OnboardingApp.view(model=... | 32.179487 | 79 | 0.715538 |
377258ee79a2b7e3ff51b18f9875a82a58c881e8 | 1,657 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex01_basics.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex01_basics.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch02_math/solutions/ex01_basics.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def calc(m, n):
return m * n // 2 % 7
def calc_v2(m, n):
return int(m * n / 2) % 7
def calc_sum_and_count_all_numbers_div_by_2_or_7(max_exclusive):
count = 0
sum = 0
for i in range(1, max_exclusive):
... | 20.974684 | 71 | 0.598069 |
37cc69419d965f44417f608878b72024fbfbc249 | 2,286 | py | Python | HeuristicIncoming.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | 1 | 2019-12-21T02:32:07.000Z | 2019-12-21T02:32:07.000Z | HeuristicIncoming.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | HeuristicIncoming.py | sdimitro/zfas | 4116072225f71415105b70e12aa461fc7466617a | [
"MIT"
] | null | null | null | from Model import Pool, MetaslabGroup, LogSpaceMapGroup
#
# This heuristic works like this:
# Flush exactly as many metaslabs as many incoming blocks
# we've had.
#
class HeuristicIncoming(object):
def __init__(self, nmetaslabs):
self.nmetaslabs = nmetaslabs
self.pool = Pool(nmetaslabs)
... | 36.285714 | 97 | 0.643045 |
207ddda6d262d5f93717d29a0a5b502c8e060abf | 3,548 | py | Python | chillow/controller/online_controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/controller/online_controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/controller/online_controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import asyncio
import multiprocessing
from datetime import datetime, timezone
import requests
import websockets
from requests import RequestException
from chillow.controller.controller import Controller
from chillow.model.action import Action
from chillow.model.game import Game
from chillow.service.data_loader import ... | 37.347368 | 117 | 0.634442 |
20f07c09fdf837bfbce49cef2af88a65d3c6df70 | 12,325 | py | Python | tests/onegov/fsi/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/fsi/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import timedelta
from uuid import uuid4
import pytest
import transaction
from faker import Faker
from sedate import utcnow
from sqlalchemy import desc
from onegov.fsi.models import CourseAttendee, Course, CourseEvent
from onegov.fsi.models.course_notification_template import InfoTemplate, \
Subscrip... | 28.931925 | 79 | 0.641379 |
ffa70b3bf8087395a96ed7086edc290fc7697d99 | 860 | py | Python | exercises/zh/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Doc.has_extension(
"author"
), "你有在Doc上面设置好author扩展了吗?"
ext = Doc.get_extension("author")
assert all(
v is None for v in ext
), "你有给author扩展设置默认值了吗?"
assert Doc.has_extension("book"), "你有在Doc上面设置好book扩展了吗?"
ext = Doc.get_extension("book")
assert all(
... | 29.655172 | 60 | 0.648837 |
92b36e2abe62f77607be2cac6e1c273b5ea89af7 | 1,621 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch01_introduction/programming_style.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch01_introduction/programming_style.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch01_introduction/programming_style.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def reverse_string(input):
# rekursiver Abbruch
if len(input) <= 1:
return input
first_char = input[0]
remaining = input[1:]
# rekursiver Abstieg
return reverse_string(remaining) + first_char
def ... | 26.145161 | 61 | 0.671191 |
a65e3d3a23613b9b8fb164d47c17e1e4f5316b7b | 320 | py | Python | createFile.py | GarnetSunset/GSLibs | 3bc05fac258580d5eb29c0079b21cec6dd0e5393 | [
"MIT"
] | null | null | null | createFile.py | GarnetSunset/GSLibs | 3bc05fac258580d5eb29c0079b21cec6dd0e5393 | [
"MIT"
] | null | null | null | createFile.py | GarnetSunset/GSLibs | 3bc05fac258580d5eb29c0079b21cec6dd0e5393 | [
"MIT"
] | null | null | null | def createFile(fileName):
global flNm
if(os.path.isfile(fileName)):
with open(fileName, 'r') as myfile:
flNm=myfile.read().replace('\n', '')
else:
flNm = input("Type the Server URL\n> ")
flNmfile = open(fileName, "w")
flNmfile.write(flNm)
flNmfile.close()
| 29.090909 | 48 | 0.565625 |
a6c9972d322ba555eff61bf7076da57d9a8efa49 | 1,294 | py | Python | FighterClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | FighterClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | FighterClass.py | Mathias-Mo/Zauberwald_v05 | 7c67b7ed086feb8e3897f4b6c2122b8b66256331 | [
"MIT"
] | null | null | null | from Character import Character
from data import features
class FighterClass(Character):
def __init__(self, params):
super().__init__(params)
# self.stamina = params['stamina']
# self.combat_skill = params['combat_skill']
def fight_auto_attack(self, enemy):
damage = 0
... | 32.35 | 98 | 0.564142 |
a6fecab061066140e40957b87c2564248e8acc64 | 731 | py | Python | fuzzsvc/controller/Update.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | 53 | 2016-08-26T02:51:45.000Z | 2021-05-24T21:05:44.000Z | controller/Update.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | null | null | null | controller/Update.py | FingerLeakers/FuzzFlow | 3f2de617c3658904f9640f53a05d5e4e90634e32 | [
"MIT"
] | 31 | 2016-08-26T04:08:31.000Z | 2021-05-24T21:05:54.000Z | from flask_restful import Resource
from flask import request
from app.config import CLIENT_FOLDER
import os, zipfile, hashlib
class UpdateCtrl(Resource):
def get(self, hash):
path = 'static' + os.sep + 'client.zip'
try:
os.remove(path)
except:
None
zip = zipf... | 28.115385 | 62 | 0.578659 |
7518dcdd8601fbea2fdf7b3a2eb80279175603ff | 5,390 | py | Python | research/cv/DeepID/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/DeepID/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/DeepID/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.774194 | 112 | 0.646568 |
f361cf086d2228ffe2e0540612312a1c79c1b3a7 | 92 | py | Python | 2014/10/bookdata-value-headline/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/10/bookdata-value-headline/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/10/bookdata-value-headline/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1iRY6W2Dit5ueXAzE0Z1WGhqxTEK8xqckSXMrmFS_BD8'
| 23 | 68 | 0.847826 |
f3bd44e4faea7f88845c362b7ea54c6717154bfe | 630 | py | Python | Zhihu/NN/_extra/two/Test.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | Zhihu/NN/_extra/two/Test.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | Zhihu/NN/_extra/two/Test.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | from Zhihu.NN._extra.two.Networks import *
from Util.Util import DataUtil
np.random.seed(142857) # for reproducibility
def main():
nn = NNDist()
epoch = 1000
timing = Timing(enabled=True)
timing_level = 1
nn.feed_timing(timing)
x, y = DataUtil.gen_spiral(100)
nn.ad... | 20.322581 | 86 | 0.607937 |
eded27a807cd38c2e01c009de6c54158aa93a563 | 1,528 | py | Python | exercises/de/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/de/test_01_12_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/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
), "Das Pattern sollte drei Tokens beschreiben (drei Dictionaries)."
assert (
isinstance(pattern[0], dict)
and isinstance(pattern[1], dict)
and isinstance(pattern[2], dict)
), "Jeder Eintrag im Pattern sollte ein Dictionary sein."
... | 41.297297 | 89 | 0.629581 |
1e968c76aef644802e67d03cacb23700ffa5defc | 77 | py | Python | Python/Strings/mutations.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/mutations.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Strings/mutations.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | s = input()
a = input().split()
n = int(a[0])
print(s[:n] + a[1] + s[n+1:]) | 12.833333 | 29 | 0.454545 |
bf40c3a4baf371b00ef9b4d0aafc03b450fe14e8 | 858 | py | Python | src/server/bo/BusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/BusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | src/server/bo/BusinessObject.py | muenstermannmarius/ElectionSystem | a6e60d9147423787e869587b808def4771f89cb7 | [
"RSA-MD"
] | null | null | null | from abc import ABC, abstractmethod
class BusinessObject(ABC):
"""Collective base class for the implementation of all relevant classes
within this project.
A central attribut of all business objects is the id, which is the primary key
in a relational database.
Another attribute of all busine... | 26.8125 | 82 | 0.637529 |
449f2582fd118d9b3d9e7863bbc456f70ddfdb59 | 2,229 | py | Python | packages/watchmen-meta/src/watchmen_meta/console/connected_space_graphic_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/console/connected_space_graphic_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/console/connected_space_graphic_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Optional, Union
from watchmen_meta.common import UserBasedTupleService, UserBasedTupleShaper
from watchmen_model.common import ConnectedSpaceId
from watchmen_model.console import ConnectedSpaceGraphic, SubjectGraphic, TopicGraphic
from watchmen_storage import EntityRow, EntityShaper
from watchmen_ut... | 35.951613 | 116 | 0.814266 |
44d0cb18fdddb99ff82c899a9257b8a64c2d571b | 5,331 | py | Python | RDS/circle3_central_services/research_manager/src/lib/Project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle3_central_services/research_manager/src/lib/Project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle3_central_services/research_manager/src/lib/Project.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | from lib.EnumStatus import Status
from lib.Port import Port
import json
import logging
logger = logging.getLogger()
class Project:
def __init__(self, user, status=Status.CREATED, portIn=None, portOut=None, researchname=None):
if portIn is None:
portIn = []
if portOut is None:
... | 26.655 | 127 | 0.545301 |
44e3e19ac990a3da822b17738ab339f90f3d566b | 4,709 | py | Python | classification_snips/classifier/cos_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/cos_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | classification_snips/classifier/cos_context.py | Ilgmi/IWIbot | c5ac71865fbb11f1676ec3239b96bab8e22257ee | [
"Apache-2.0"
] | null | null | null | import ibm_boto3
from ibm_botocore.client import Config
from ibm_botocore.client import ClientError
DEFAULT_BUCKET_NAME = "engine"
class CosContext:
"""Setup to IBM Cloud Object Storage"""
bucket_name = ""
cos_res = ""
cos_client = ""
#init cos client, create default bucket
def __init__(self,... | 34.123188 | 144 | 0.568061 |
15ab89444f2f61ce376aeddb9714f1939b35dc4e | 1,335 | py | Python | skills/nlu.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | 4 | 2021-01-08T21:08:50.000Z | 2021-12-08T15:30:50.000Z | skills/nlu.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | skills/nlu.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | import json, re
from rhasspyhermes.nlu import NluIntent
from rhasspyhermes_app import EndSession, ContinueSession
def get_slot_value_by_slot_name(intent, slot_name, default_value):
messurable_units = [
'money', 'meters', 'inches', 'minutes', 'hours', 'days', 'seconds', 'pieces', 'degrees', 'meters', 'temp... | 37.083333 | 120 | 0.474906 |
019f7d5ad148d7b1495986680e96e4b707a114cc | 1,897 | py | Python | results/xlights/city-backend/xlight/xlight_core.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | results/xlights/city-backend/xlight/xlight_core.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | results/xlights/city-backend/xlight/xlight_core.py | Rebstorm/dthack17 | 41cea4804fefe6a397114056c43d17c54b8e979d | [
"MIT"
] | null | null | null | from xlight.models import TrafficLight
from random import randint
import sched
import time
import threading
class XLightHandler ():
SIMULATION_INTERVAL_S = 15
def run_simulator(self):
while True:
# select a random traffic light
len_x = len(self.xlights)
rand = ran... | 30.111111 | 78 | 0.566684 |
1769eb860d840cb2f77c732944c744ed624fba5c | 2,969 | py | Python | python/en/_pandas/Pandas for Everyone/p4e-2_6_exporting_and_importing_data-pickle.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_pandas/Pandas for Everyone/p4e-2_6_exporting_and_importing_data-pickle.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_pandas/Pandas for Everyone/p4e-2_6_exporting_and_importing_data-pickle.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pandas_for_everyone-2_6_exporting_and_importing_data-pickle.py
2.6.Exporting and Importing data
2.6.1. pickle
The pickle files are saved with an extension of .p, .pkl, or .pickle.
"""
####################################
# 2.6.Exporting and Importing data #
##########... | 36.207317 | 88 | 0.550354 |
8aed2f46507887e7640e854cf681ec019d0538c5 | 1,086 | py | Python | migrations/versions/dddeceadde74_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/dddeceadde74_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/dddeceadde74_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: dddeceadde74
Revises: 31b60d93351d
Create Date: 2020-12-30 16:44:29.013647
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from sqlalchemy.dialects import postgresql
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "dddeceadde74... | 24.681818 | 84 | 0.6814 |
8af35d10f5f5d6f7ba5ca61cda5a9a366c980ed5 | 2,962 | py | Python | hello/hello_ml/kmeans.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | 1 | 2017-10-23T14:58:47.000Z | 2017-10-23T14:58:47.000Z | hello/hello_ml/kmeans.py | East196/hello-py | a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21 | [
"Apache-2.0"
] | null | null | null | hello/hello_ml/kmeans.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 sys
import imp
imp.reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
from sklearn.cluster import KMeans
from sklearn.preprocessing import Imputer
import numpy as np
import pandas as pd
import jieba
import jieba.posseg as pseg
import gensim
from .tool impor... | 25.534483 | 128 | 0.648548 |
e7696f91c99c87dd3c6777fe8fea412979091659 | 2,061 | py | Python | packages/watchmen-rest-dqc/src/watchmen_rest_dqc/util/trans.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-dqc/src/watchmen_rest_dqc/util/trans.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-dqc/src/watchmen_rest_dqc/util/trans.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from logging import getLogger
from typing import Callable, Tuple, TypeVar
from fastapi import HTTPException
from watchmen_meta.common import StorageService
from watchmen_rest.util import raise_500
# noinspection DuplicatedCode
logger = getLogger(__name__)
TransReturned = TypeVar('TransReturned')
# noinspection Dup... | 27.118421 | 110 | 0.788937 |
99ad2a2079b95028e481233fa377a1787898ca77 | 3,613 | py | Python | pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | 1 | 2020-09-23T21:03:00.000Z | 2020-09-23T21:03:00.000Z | pyToTeX.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | import os
import sys
from docBuilder import *
from extractor import *
FILENAME_RE = re.compile(r'(\w+)\.py$')
PATH_RE = re.compile(r'(.*)?(\w+)\.py$')
OVERRIDE_OPTION_RE = re.compile(r'-o$')
def convert(fileName: str, override=False):
name = re.search(FILENAME_RE, fileName).group(1)
texName = name + ".tex"
... | 38.43617 | 148 | 0.567949 |
416faa108d2d2d98d44e17c4478dfbd0026deccb | 7,149 | py | Python | bolt/discord/websocket.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 9 | 2019-02-17T06:33:14.000Z | 2021-10-05T02:19:00.000Z | bolt/discord/websocket.py | ns-phennessy/Bolt | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 28 | 2019-02-10T07:48:05.000Z | 2021-12-20T00:15:37.000Z | bolt/discord/websocket.py | ph7vc/CL4M-B0T | e992cf63b1215ea7c241cab94edc251653dbaed7 | [
"MIT"
] | 4 | 2015-03-13T03:58:55.000Z | 2015-05-27T08:29:46.000Z | """
Description:
Provides functionality for connecting to Discord chat server
Contributors:
- Patrick Hennessy
"""
from bolt.discord.events import Subscription
from bolt.discord.events import EventHandler
from bolt.discord import events
from bolt.discord.cache import Cache
from bolt.utils impo... | 29.912134 | 102 | 0.576025 |
5cfddedfc27797c4aff2b6446918583d6f0245c4 | 743 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex07_spiral_traversal_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex07_spiral_traversal_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex07_spiral_traversal_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch06_arrays.solutions.ex07_spiral_traversal import spiral_traversal
def main():
numbers = [[1, 2, 3, 4],
[12, 13, 14, 5],
[11, 16, 15, 6],
[10, 9, 8, 7]]
print(spiral_tr... | 20.638889 | 72 | 0.483176 |
cf12953ba1d890cd5e58a6d22caa4006b073a65b | 1,721 | py | Python | tests/views/test_oauth.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/views/test_oauth.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/views/test_oauth.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from tests.seeder import Seeder
from tests.utils import UtilActions
def test_authorize_unauthorizedRedirects(seeder: Seeder, utils: UtilActions):
url = utils.get_url("authorize")
response = utils.get(url)
assert response.status_code == 302
assert "login" in response.headers["Location"]
def test_aut... | 27.758065 | 77 | 0.747821 |
cf412b3ed4e3de35fcfd38b05a4bc1f0d420efbb | 570 | py | Python | Algorithms/Search/MissingNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Search/MissingNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Search/MissingNumbers.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
A = [0] * 10001
B = [0] * 10001
n = raw_input()
for x in map(int, raw_input().split()):
A[x] += 1
m = raw_input()
for x in map(int, raw_input().split()):
B[x] += 1
for i in xrange(1, 10001):
if B[i] > A[i]:
print i,
'''
#python版
from collections import Counter
... | 19 | 61 | 0.577193 |
9944dcb474d006fed33df4981d974a7da8053181 | 376 | py | Python | imgFilter/filter/urls.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | 1 | 2020-10-21T07:18:00.000Z | 2020-10-21T07:18:00.000Z | imgFilter/filter/urls.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | imgFilter/filter/urls.py | xiang2002/Web | f12393c38ea3e88ceb67d270d707f3df0cf5e05a | [
"MIT"
] | null | null | null | from django.urls import path,include
from filter import views
app_name = 'filter'
urlpatterns = [
# path('admin/', admin.site.urls),
path("", views.index, name='index'),
path("logout/", views.logout, name="logout"),
path("del/", views.delete, name="delete"),
path("move/", views.move, name=... | 31.333333 | 50 | 0.614362 |
517f9a715fba98ff0b7a2835128f8beae84b7f41 | 6,978 | py | Python | main.py | outout14/a2gen | ef13befd936ebb0059e2a2dd47c60e930a3f78aa | [
"MIT"
] | null | null | null | main.py | outout14/a2gen | ef13befd936ebb0059e2a2dd47c60e930a3f78aa | [
"MIT"
] | null | null | null | main.py | outout14/a2gen | ef13befd936ebb0059e2a2dd47c60e930a3f78aa | [
"MIT"
] | null | null | null | import sys, os
agenversion = "0.1b"
class txtcolor:
CEND = '\33[0m'
CRED = '\33[31m'
CGREEN = '\33[32m'
CBLUE = '\33[34m'
CGREY = '\33[90m'
def color_input(txt):
return input(txtcolor.CBLUE + txt + txtcolor.CGREEN + txtcolor.CEND)
def print_split():
return print(txtcolor.CGREY + "\n-----... | 38.131148 | 138 | 0.589137 |
5c565620c5ee62b93411cdaec7e9efdd5e72be87 | 12,228 | py | Python | xmlTools.py | dfdean/mlLib | 3ea535c6b032f61e91f2d16ff75bf2796ef1a27f | [
"MIT"
] | null | null | null | xmlTools.py | dfdean/mlLib | 3ea535c6b032f61e91f2d16ff75bf2796ef1a27f | [
"MIT"
] | null | null | null | xmlTools.py | dfdean/mlLib | 3ea535c6b032f61e91f2d16ff75bf2796ef1a27f | [
"MIT"
] | null | null | null | ################################################################################
#
# Copyright (c) 2020 Dawson Dean
#
# 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, in... | 28.570093 | 97 | 0.531076 |
8f300e5db4e4d3dbcec9b54ab83bcacdf7cec077 | 11,738 | py | Python | verto/tests/ExternalLinkTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/ExternalLinkTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/ExternalLinkTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
import re
from unittest.mock import Mock
from verto.processors.ExternalLinkPattern import ExternalLinkPattern
from verto.tests.ProcessorTest import ProcessorTest
class ExternalLinkTest(ProcessorTest):
'''Tests to check the 'external-link' pattern works as intended.
This class is unique to othe... | 53.598174 | 129 | 0.744164 |
a44620d9dbac8c3ce3cdbd7c51dd6a781116078d | 8,002 | py | Python | src/onegov/ballot/models/election/list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/election/list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/ballot/models/election/list.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.ballot.models.election.election_result import ElectionResult
from onegov.ballot.models.election.list_result import ListResult
from onegov.ballot.models.mixins import summarized_property
from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
... | 33.066116 | 79 | 0.575231 |
749336fea552fb19639457cf0e78106951b77cfc | 1,052 | py | Python | qmk_firmware/lib/python/qmk/cli/generate/docs.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/generate/docs.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | qmk_firmware/lib/python/qmk/cli/generate/docs.py | DanTupi/personal_setup | 911b4951e4d8b78d6ea8ca335229e2e970fda871 | [
"MIT"
] | null | null | null | """Build QMK documentation locally
"""
import shutil
from pathlib import Path
from subprocess import DEVNULL
from milc import cli
DOCS_PATH = Path('docs/')
BUILD_PATH = Path('.build/docs/')
@cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True)
def generate_docs(cli):
"... | 26.3 | 103 | 0.657795 |
77f541ffc4168581d3d548a7bb3faddedeed1e3b | 81 | py | Python | load_config.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | load_config.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | load_config.py | lonelyion/TweetToBot-Docker | ea91a9d93bad2b757c2ba0923ae9f1cd0f5ac278 | [
"MIT"
] | null | null | null | import hjson
config = hjson.load(open("./conf/config.hjson", encoding='utf-8'))
| 20.25 | 66 | 0.703704 |
7060577e05c347a73b6a3e2978f1c72e3e070171 | 192 | py | Python | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao4-Python-introducao-a-programacao-orientada-a-objetos-POO/000Exercicios/02aluno/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from aluno import Aluno
a1 = Aluno('Pedro', 8)
a1.total(7)
a1.total(7)
a1.total(7)
print(a1.resultado())
a2 = Aluno('Henrique', 5)
a2.total(5)
a2.total(5)
a2.total(5)
print(a2.resultado()) | 12.8 | 25 | 0.671875 |
56665075cdaba7fe819e7fe01f4d1c14c6da8c6d | 5,591 | py | Python | src/onegov/core/orm/mixins/content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/mixins/content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/mixins/content.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm.types import JSON
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import deferred
from sqlalchemy.schema import Column
IMMUTABLE_TYPES = (int, float, complex, str, tuple, frozenset, bytes)
class ContentMixin(object):
""" Mixin providing a meta/content JSON pair. Met... | 27.955 | 78 | 0.653014 |
569b01a10469b9dbb35473b920df34137af484b6 | 1,532 | py | Python | string_manipulation/valid_palindrome.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/valid_palindrome.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | string_manipulation/valid_palindrome.py | daesookimds/Algorithm | 76f4cbfe9000e8c1736f470138499e7c735fecaa | [
"MIT"
] | null | null | null | import re
import timeit
import collections
from typing import Deque
def is_palindrome_using_list(s: str) -> bool:
strs = []
for char in s:
if char.isalnum():
strs.append(char.lower())
# recognize valid palindrome
while len(strs) > 1:
if strs.pop(0) != strs.pop():
... | 24.31746 | 83 | 0.618799 |
3b88ac41aea208140f7f139006f4ed5796efe0b2 | 3,546 | py | Python | project/api/news_feed/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | project/api/news_feed/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | project/api/news_feed/resources.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | from flask import make_response
from flask_apispec import doc, marshal_with, use_kwargs
from sqlalchemy import func
from project import db
from project.api import add_api_resource
from project.api.news_feed.schemas import (
NewsFeedIdSchema,
NewsFeedListRequestSchema,
NewsFeedListResponseSchema,
NewsFe... | 29.305785 | 87 | 0.667231 |
79831b8c661cbf75f7623b062d50b759a999a017 | 521 | py | Python | bsp2_9.py | Nabizeus/merkmalskonstruktion | e6553a290d36b3bb4079e0ba21989e192d70eb6b | [
"Apache-2.0"
] | null | null | null | bsp2_9.py | Nabizeus/merkmalskonstruktion | e6553a290d36b3bb4079e0ba21989e192d70eb6b | [
"Apache-2.0"
] | null | null | null | bsp2_9.py | Nabizeus/merkmalskonstruktion | e6553a290d36b3bb4079e0ba21989e192d70eb6b | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import json
import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
from sklearn.model_selection import cross_val_score
# Beispiel 2.9 - Online News
# Datensatz
df = pd.read_csv('data/OnlineNewsPopularity.csv', delimiter=',')
df.head()
# Bilde die Logarithmustransf... | 20.84 | 74 | 0.767754 |
8dfe0358e09777526e596731f034ef716b621833 | 1,272 | py | Python | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionUser/ExpanseAggregateAttributionUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionUser/ExpanseAggregateAttributionUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionUser/ExpanseAggregateAttributionUser_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa
import ExpanseAggregateAttributionUser
INPUT = [
{"user": "lmori", "count": 10},
{"srcuser": "fvigo"},
{"source_user": "DEVREL\\lmori"},
]
CURRENT = [
{"username": "fvigo", "sightings": 1, "groups": [], "description": None, "domain": ""}
]
RESULT = [
{"user... | 28.909091 | 97 | 0.616352 |
15e6123bf9d0817a68f5333f9b1c8f4bfc8f4e2b | 1,904 | py | Python | skattmestring/banopata.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | skattmestring/banopata.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | skattmestring/banopata.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# PEP 263 -- Defining Python Source Code Encodings https://www.python.org/dev/peps/pep-0263/
# PEP 3120 -- Using UTF-8 as the default source encoding https://www.python.org/dev/peps/pep-3120/
"""
banopata - Banking Nordea Parse T... | 40.510638 | 117 | 0.534139 |
15f358689fc5ffa212e4962d6f833ff4e6252608 | 2,910 | py | Python | src/nfz_module/examples/LabelCount.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/examples/LabelCount.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | src/nfz_module/examples/LabelCount.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | __author__ = 'Hans-Werner Roitzsch'
import os, sys
import numpy as np
import cv2 as opencv
from scipy import ndimage
from datetime import datetime
from TimeFunction import TimeFunction
allowed_formats = ['png', 'jpg', 'jpeg']
# lower_blinker_hsv = np.uint8([260, 150, 220])
# upper_blinker_hsv = np.uint8([280, 220... | 27.980769 | 131 | 0.749485 |
032d0fe41a41bcf36d7b11c716e5ee2fa4be1ce9 | 7,891 | py | Python | src/gui.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | src/gui.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | src/gui.py | ahmadnaufalhakim/rsa-algorithm | 40b8a0d0531620221318146dd6c800a592cb4390 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import scrolledtext
from tkinter import ttk
from tkinter import filedialog
from tkinter import messagebox
from time import time
from rsa import *
import string
class Gui:
def __init__(self):
self.window = Tk()
self.window.title("Tugas Kecil 3 II4031 - 13517055 13517139")
self.... | 39.064356 | 128 | 0.717526 |
033a72a05405a3cfcca0a8cbb851f13cc1b157d4 | 1,360 | py | Python | official/nlp/textcnn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/textcnn/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/textcnn/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... | 36.756757 | 106 | 0.668382 |
30007b0dab5b9f7f41ffbc418de7a4a2514abb99 | 404 | py | Python | exercises/zh/solution_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/solution_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/solution_03_10_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.zh import Chinese
from spacy.tokens import Doc
nlp = Chinese()
# 定义取值器函数
def get_has_number(doc):
# 返回是否doc中的任一个词符的token.like_num返回True
return any(token.like_num for token in doc)
# 注册Doc的扩展属性"has_number"及其取值器get_has_number
Doc.set_extension("has_number", getter=get_has_number)
# 处理文本,检查定制化... | 22.444444 | 54 | 0.782178 |
d1c0d29021ef8931db9c23ca002d0f7092e93fde | 3,094 | py | Python | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_eps_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_eps_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/reads_varying_parameters_statistics/varying_eps_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os, json, decimal
from data_analysis.reads_varying_parameters_statistics.varying_c_statistics_reads import has_infeasible_on_line_rand_walk_num
reads_tag = 'reads-s'
reads_d_tag = 'reads-d'
reads_rq_tag = 'reads-rq'
suffix_str = '-rand-bench.txt'
eps_lst = [0.001 * (i + 1) for i in range(30)]
def format_str(... | 36.4 | 125 | 0.681319 |
ae5dea60143803813d3cb5ef65cf6ed86ef8b568 | 131 | py | Python | LaTeX/table/generate_data.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 4 | 2018-11-14T12:03:05.000Z | 2019-09-03T14:33:28.000Z | LaTeX/table/generate_data.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | null | null | null | LaTeX/table/generate_data.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 1 | 2018-11-17T14:39:22.000Z | 2018-11-17T14:39:22.000Z |
f=open("data.txt",'w')
for i in range(0,100):
f.write(str(i))
if i>0 and i%10==9:
f.write('\n');
else:
f.write(' ')
| 14.555556 | 22 | 0.503817 |
ee486575c7bcaa39b9ff11145a8d3b2bd5db6fae | 368 | py | Python | decodemysql/decrypt.py | Majornevermore/Algorithm | 662a28a3278e1cbcf25647b46e78047fe20451a5 | [
"Apache-2.0"
] | 1 | 2020-11-28T10:54:03.000Z | 2020-11-28T10:54:03.000Z | decodemysql/decrypt.py | Majornevermore/Algorithm | 662a28a3278e1cbcf25647b46e78047fe20451a5 | [
"Apache-2.0"
] | null | null | null | decodemysql/decrypt.py | Majornevermore/Algorithm | 662a28a3278e1cbcf25647b46e78047fe20451a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python2.7
#coding:utf8
import sys,base64,pyDes
def __encrypt(data):
try:
k = pyDes.des('whGcZugH', pyDes.ECB, '\0'*8, pad=None, padmode=pyDes.PAD_PKCS5)
d = base64.b64decode(data)
ret = k.decrypt(d)
return ret
except Exception, e:
return 1, e
s=open(sy... | 23 | 87 | 0.622283 |
14e5e34b3136d3083eeff5d36c5388472cdb6de1 | 786 | py | Python | ___Python/KarPoo/po1_kennenlernen/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/KarPoo/po1_kennenlernen/p04_oop/m03_uhr.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | class Uhr(object):
# Konstruktor
def __init__(self, stunden, minuten, sekunden):
self.sekunden = sekunden
self.minuten = minuten
self.stunden = stunden
def __repr__(self):
return "%02i:%02i:%02i" % (self.stunden, self.minuten, self.sekunden)
def naechsteSeku... | 27.103448 | 78 | 0.512723 |
14e899ae6561a6d67845e231a68035c6588e3daa | 3,150 | py | Python | project/cli/seo.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/cli/seo.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/cli/seo.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import os
import shutil
from io import StringIO
import click
import requests
from flask import url_for
from flask.cli import AppGroup, with_appcontext
from sqlalchemy import and_
from sqlalchemy.orm import load_only
from project import app, cache_path, robots_txt_path, sitemap_path
from project.dateutils import get_t... | 30.582524 | 86 | 0.659683 |
11cdfba9b6637f3e6360e9043354b49ee423d28c | 153 | py | Python | exercises/ja/solution_01_02_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/solution_01_02_04.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/solution_01_02_04.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オブジェクトを作成
nlp = Japanese()
# テキストを処理
doc = nlp("有難うございます。")
# docのテキストをプリント
print(doc.text)
| 12.75 | 34 | 0.738562 |
eec95145c0d0b0a3a73e10f9664385fa0356bf50 | 4,535 | py | Python | pyScript_NodeManager/DSL/dslInterpreter.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/DSL/dslInterpreter.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/DSL/dslInterpreter.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | # path: python dslInterpreter.py metaCodeText.txt
from textx import metamodel_from_str, get_children_of_type
import sys
import os
import pathlib
class Interpreter:
def __init__(self, _dsl_code=None, dsl_code_filename=None):
self.dsl_code = ''
self.dir = str(pathlib.Path(__file__).parent.absolut... | 35.992063 | 120 | 0.570011 |
3a1157402bfe5ac456b0b29c03f8c0976bc939f1 | 2,218 | py | Python | top/clearlight/base/youtube/Regex.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/youtube/Regex.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/youtube/Regex.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | # 简单匹配
import re
pattern1 = 'dog'
pattern2 = 'bird'
string = 'dog r2ns to eat'
print(pattern1 in string)
print(pattern2 in string)
print(re.search(pattern1, string))
print(re.search(pattern2, string))
print(re.search(r'r[0-9a-z]n', string))
# \d:匹配一个数字 等价于[0-9]
print(re.search(r'r\dn', 'run r3n'))
# \D:匹配任意非数字
prin... | 22.632653 | 86 | 0.623084 |
e9180d5a739ea3fc9cfd40b9030bd3aa22f0e1e0 | 712 | py | Python | setup.py | ChenchaoZhao/torch-model-parts | e35ce58e6621d4245f9584a671dbc35b862570bc | [
"MIT"
] | null | null | null | setup.py | ChenchaoZhao/torch-model-parts | e35ce58e6621d4245f9584a671dbc35b862570bc | [
"MIT"
] | null | null | null | setup.py | ChenchaoZhao/torch-model-parts | e35ce58e6621d4245f9584a671dbc35b862570bc | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
from modeldepot import __version__
# load readme
with open("README.md", "r") as f:
long_description = f.read()
def load_requirements():
with open("requirements.txt", "r") as f:
r = [name.split()[0] for name in f.readlines() if not name.startswith("#")]
... | 25.428571 | 83 | 0.700843 |
c95239adabf0ccc6ab686ee2583eee4f42161e90 | 131 | py | Python | Webpage/blog/admin.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/blog/admin.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/blog/admin.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import blogPost
# Register your models here.
# News
admin.site.register(blogPost)
| 14.555556 | 32 | 0.78626 |
28280fc9411c87246f2d3562788a19e946388117 | 510 | py | Python | demos/Multiscale/ThreeSidedBasic/model/parts/investors.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/investors.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/ThreeSidedBasic/model/parts/investors.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z |
# Behaviors
def investors(params, step, history, current_state):
# Pay relevant parties
if current_state['timestep'] == 1:
return {'Invest': 1}
elif current_state['timestep'] == 10:
return {'Invest': 1}
else:
return {'Invest': 0}
# Mechanisms
def receive_fiat_from_investors(... | 22.173913 | 61 | 0.590196 |
956d27152de9486f36ff8febd1c016fc9acc7b28 | 2,489 | py | Python | frds/measures/func_mes.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 31 | 2020-06-17T13:19:12.000Z | 2022-03-27T08:56:38.000Z | frds/measures/func_mes.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/measures/func_mes.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | 8 | 2020-06-14T15:21:51.000Z | 2021-09-29T06:28:53.000Z | import numpy as np
def marginal_expected_shortfall(
firm_returns: np.ndarray, market_returns: np.ndarray, q: float = 0.05
) -> float:
"""Marginal Expected Shortfall (MES).
The firm's average return during the 5% worst days for the market.
MES measures how exposed a firm is to aggregate tail shocks a... | 43.666667 | 110 | 0.682603 |
6c0d9c0cdb95684fc329207acabe7204b03296b0 | 7,690 | py | Python | python/en/archive/dropbox/sagemaker_hyperparametertuning/sagemaker_exercise.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/sagemaker_hyperparametertuning/sagemaker_exercise.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/sagemaker_hyperparametertuning/sagemaker_exercise.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | '''
TensorFlow + SageMaker = love by Enias Cailliau
https://medium.com/radix-ai-blog/tensorflow-sagemaker-d17774417f08
Github: https://github.com/radix-ai/sagemaker-tensorflow-tutorial
pipe input mode
https://aws.amazon.com/about-aws/whats-new/2018/05/pipe-input-mode-is-now-supported-in-amazon-sagemaker-algori... | 43.942857 | 148 | 0.641612 |
6c104ca1e2a8d9bc157e51671ab57d6283d6d441 | 418 | py | Python | source/pkgsrc/devel/py-lama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/py-lama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/py-lama/patches/patch-setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setup.py,v 1.1 2018/11/20 14:14:16 adam Exp $
Do not install tests.
--- setup.py.orig 2018-11-20 13:13:48.000000000 +0000
+++ setup.py
@@ -35,7 +35,7 @@ meta = dict(
author_email='horneds@gmail.com',
url=' https://github.com/klen/pylama',
- packages=find_packages(exclude=['plugins']),
+ ... | 26.125 | 60 | 0.638756 |
06e6de0a0fd0cf1b2cdf66d652b0608332a27e82 | 186 | py | Python | exercises/es/exc_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
# Crea un modelo "es" en blanco
nlp = ____
# Crea un nuevo entity recognizer y añádelo al pipeline
ner = ____
____
# Añade el label "ROPA" al entity recognizer
____.____
| 15.5 | 55 | 0.741935 |
598c63a225bbd26734ee3e19e0c0cc2cdc13509c | 3,293 | py | Python | code/globals.py | zauberwild/paamestia | 88ba643d6d9dc14d8abc686d464f723ea840e4f6 | [
"MIT"
] | 1 | 2020-12-24T12:20:26.000Z | 2020-12-24T12:20:26.000Z | code/globals.py | zauberwild/paamestia | 88ba643d6d9dc14d8abc686d464f723ea840e4f6 | [
"MIT"
] | null | null | null | code/globals.py | zauberwild/paamestia | 88ba643d6d9dc14d8abc686d464f723ea840e4f6 | [
"MIT"
] | null | null | null | """
this file stores all global variables and constants
"""
""" imports """
from pathlib import Path # used to get the complete path of the working directory
from os import path # used to get the complete path of the working directory
import pygame
import pygame.freetype
""" file paths """
gen_path =... | 37.850575 | 124 | 0.722138 |
abf5e49f75fc0e65b44ba66a5f2e614ea0da4f5d | 8,580 | py | Python | models/syntaxsql/modules/col_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/syntaxsql/modules/col_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | models/syntaxsql/modules/col_predictor.py | inyukwo1/qgm_decoder | 70e60afec140ec3e2ee04f980a384e1cf28d761c | [
"MIT"
] | null | null | null | import os
import torch
import numpy as np
import torch.nn as nn
from torch.autograd import Variable
from commons.utils import run_lstm, col_tab_name_encode, seq_conditional_weighted_num, SIZE_CHECK
from models.syntaxsql.net_utils import to_batch_from_candidates, to_batch_seq, to_batch_tables
class ColPredictor(nn.Mod... | 40.093458 | 146 | 0.593473 |
55a817fa6f139c9e6ece3b7684853e9e4232029d | 2,266 | py | Python | backend/api/btb/api/__init__.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/__init__.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/__init__.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | from flask import Flask, request, g, current_app, jsonify
from btb.api.auth import load_principal_from_serverless
from btb.api.graphql import graphql_view
from btb.api.models import db
from os import environ
from btb.api.datasources import instanciate_datasources
from flask_cors import CORS
import logging
import json
f... | 23.604167 | 84 | 0.664607 |
e9be18fa4c276a4478c91eafcd2ac7ec7ba5a138 | 111,247 | py | Python | Dashboard4.py | nitinjndal/Dashboard | fa9e89a9bc20a87ef29275bddb58a2aaa1a7d901 | [
"MIT"
] | null | null | null | Dashboard4.py | nitinjndal/Dashboard | fa9e89a9bc20a87ef29275bddb58a2aaa1a7d901 | [
"MIT"
] | null | null | null | Dashboard4.py | nitinjndal/Dashboard | fa9e89a9bc20a87ef29275bddb58a2aaa1a7d901 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
##! /usr/bin/arch -x86_64 /usr/bin/env python
from logging import error
import dash
import dash_table
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
f... | 40.117923 | 183 | 0.543952 |
e9c18e4a61cabc240f71b1d17aa81656f0a832f1 | 1,778 | py | Python | aoc2020/day_08/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_08/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_08/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
from .part_1 import Solution as Part1
class Interpreter(Part1):
"""Override part1 program loading to allow for patching"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._resource_lines = []
def set_program(self, resource_lines):
... | 34.862745 | 116 | 0.64117 |
75e4936c56f865ac94dc7f264bc68964de318fab | 2,157 | py | Python | vanilla_cnn.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | vanilla_cnn.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | vanilla_cnn.py | charliezjw/Neural-Signal-Decoder | fb0df09ba0314724c7c90141bd47cc8fb0201b7a | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from pre_processing import get_data
X_test, y_test, X_train, y_train = get_data()
print(X_test.shape)
print(y_test.shape)
print(X_train.shape)
print(y_train.shape)
x_in = tf.placeholder(tf.float32, [None, 22, 1000], name="input_x")
y_real = tf.placeholder(tf.int32, [None], ... | 32.19403 | 95 | 0.675475 |
f98d1b2b14ba20da2356cefab76b5490e36bc8a9 | 651 | py | Python | train_model/constants.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | 4 | 2019-06-03T19:31:47.000Z | 2019-06-13T13:38:58.000Z | train_model/constants.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | null | null | null | train_model/constants.py | liwde/ArtOrTrash | 75d6aa0da53b7dd2ef328150afa4b0cb7d8c458a | [
"Apache-2.0"
] | null | null | null | IMAGE_SIZE = 224 # Default image size for use with MobileNetV2
BATCH_SIZE = 32 # Function to load and preprocess each image
IMG_SHAPE = (IMAGE_SIZE, IMAGE_SIZE, 3)
IMAGE_MEAN = 127.5 # Needed as input for MobileNet
IMAGE_STD = 127.5
LEARNING_RATE = 0.0001
LEARNING_RATE_FINETUNE = LEARNING_RATE / 10
NUM_EPOCHS = 30
V... | 26.04 | 62 | 0.772657 |
f99fb6a6311335d16fab57650641d6f2a85d9f18 | 1,204 | py | Python | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Discriminator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | from tensorflow.keras.layers import *
from tensorflow.keras.models import *
from tensorflow.keras.optimizers import *
def build_discriminator(img_shape):
model = Sequential() #32x32
model.add(Conv2D(32, kernel_size=3, strides=2, input_shape=img_shape, padding="same")) #16x16
model.add(LeakyReL... | 34.4 | 98 | 0.668605 |
dde5c221cdd2eb243e8fbbb753c959d8155f52a5 | 7,568 | py | Python | autofile.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autofile.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autofile.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import logging
import os.path
from pathlib import Path
from automate.utils import fix_symlinks
from automate.utils.network import rsync
from invoke import task
ROOT_PATH = Path(os.path.dirname(os.path.abspath(__file__)))
JAILHOUSE_REPO = "https://github.com/siemens/jailhouse.git"
JAILHOUSE_COMMIT = "master" # GIT br... | 34.09009 | 117 | 0.524709 |
fb2f36c55ee709bbb12f57c7b9adb84785a45d5e | 11,429 | py | Python | tuta/trainers.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | null | null | null | tuta/trainers.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | null | null | null | tuta/trainers.py | PseudoLabs-Demo/TUTA_table_understanding | d0f3fe2f15c56a5ea9f593b210296f170fc74558 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Trainers for Pre-training Model Variants
"""
import time
import torch
from utils import save_model
def train_base(args, gpu_id, rank, loader, model, optimizer, scheduler):
model.train()
start_time = time.time()
total_loss = 0.
total_ml... | 40.672598 | 113 | 0.550967 |
20f8919e2ae2494d3ed77f435dc9392468cb4d02 | 259 | py | Python | python/coursera_python/MICHIGAN/DataStructures/week2/file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DataStructures/week2/file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DataStructures/week2/file.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #To take the name of a file and print all the line in upper case
try:
fname= input("Enter a file name :")
except:
print("File ",fname," not present :(\n ...quitting")
quit()
fh = open(fname)
for line in fh:
line = line.upper().rstrip()
print(line)
| 15.235294 | 64 | 0.65251 |
c80a94a2c13c8630c7bb4693bfa83177c525e0e1 | 610 | py | Python | evaluation-webapp/reposynergy/PAGES.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | 5 | 2021-05-09T12:51:32.000Z | 2021-11-04T11:02:54.000Z | evaluation-webapp/reposynergy/PAGES.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | null | null | null | evaluation-webapp/reposynergy/PAGES.py | DLR-SC/repository-synergy | 115e48c37e659b144b2c3b89695483fd1d6dc788 | [
"MIT"
] | 3 | 2021-05-12T12:14:05.000Z | 2021-10-06T05:19:54.000Z | LOGIN_PAGE = "reposynergy/index.html"
DASHBOARD_PAGE = "reposynergy/dashboard.html"
ANNOTATION_PAGE = "reposynergy/annotation.html"
UPLOAD_REPO_PAIRS = "reposynergy/uploader_repo_pairs.html"
USERS_PAGES = "reposynergy/users.html"
VIEW_ANNOTATIONS_PAGE = "reposynergy/view_annotations.html"
ADMIN_DASHBOARD_PAGE ="reposyn... | 43.571429 | 59 | 0.829508 |
c0f34680a566dfcff465af439865047c9ce164fc | 578 | py | Python | beispielanwendungen/pythonqml2/main2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/pythonqml2/main2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/pythonqml2/main2.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | #!/usr/bin/env python
import sys, os, traceback
from PySide import QtCore, QtGui, QtDeclarative
def main(argv):
app = QtGui.QApplication(argv)
view = QtDeclarative.QDeclarativeView()
colors = [
{ "color": "red", "text": "Zeile 1" },
{ "color": "green", "text": "Zeile 2" },
{ "... | 23.12 | 52 | 0.596886 |
2397255661efb8da31b86e41ed4f0a298f099387 | 1,104 | py | Python | HW2/nonmaxsuppts.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/nonmaxsuppts.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | HW2/nonmaxsuppts.py | kvswim/kv_jhu_cv | 2ddf7a9d497aef116a7c043157b8631cea45000d | [
"MIT"
] | null | null | null | # Author: TK
from scipy.ndimage import filters, interpolation
import numpy as np
import cv2
import matplotlib.pyplot as plt
def nonmaxsuppts(cim,radius,threshold):
# Extract local maxima by performing a grey scale morphological
# dilation and then finding points in the corner strength image that
# match t... | 28.307692 | 72 | 0.648551 |
23abd438ccbcda72380db5893eccfb2d00acfda3 | 3,993 | py | Python | main.py | Vindicta-Team/Automated-Ace-No-Medical | 7baf9be2f9b1e8db80bdef2cf2eadda2aa75774b | [
"MIT"
] | 1 | 2020-07-31T23:54:13.000Z | 2020-07-31T23:54:13.000Z | main.py | Vindicta-Team/Automated-Ace-No-Medical | 7baf9be2f9b1e8db80bdef2cf2eadda2aa75774b | [
"MIT"
] | 2 | 2021-02-24T20:08:24.000Z | 2021-11-28T00:37:21.000Z | main.py | Vindicta-Team/Automated-Ace-No-Medical | 7baf9be2f9b1e8db80bdef2cf2eadda2aa75774b | [
"MIT"
] | null | null | null | import os
import json
import hashlib
import shutil
import glob
import constants
import datetime
from git import Repo
from packaging import version
####### Functions
def readDatasFromFile(filePath):
return json.loads(open(filePath, 'rb').read())
def writeDatasIntoFile(filePath, datas):
with open(filePath, 'w')... | 32.729508 | 273 | 0.66842 |
f19c8b97274fe0f646b040b7a13c4cc3620cf830 | 65,586 | py | Python | repo/service.vpn.manager/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/service.vpn.manager/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/service.vpn.manager/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 Zomboided
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | 63.245902 | 260 | 0.542768 |
9ebce4682b18aa1f900be8246dd9a97f1ce6a57f | 958 | py | Python | day20/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day20/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day20/snake/game.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from turtle import Screen
from snake import Snake
import time
class Game():
def __init__(self):
self.gameRunns = True
self.gamePaused = True
self.screen = Screen()
self.screen.setup(width=600, height=600)
self.screen.bgcolor("black")
self.screen.tracer(0)
s... | 22.809524 | 71 | 0.579332 |
cdbc660761a50c11c38a434b4150db09496e1883 | 810 | py | Python | quant/observers/t_lq_eth.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 7 | 2017-10-22T15:00:09.000Z | 2019-09-19T11:45:43.000Z | quant/observers/t_lq_eth.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 1 | 2018-01-19T16:19:40.000Z | 2018-01-19T16:19:40.000Z | quant/observers/t_lq_eth.py | doubleDragon/QuantBot | 53a1d6c62ecece47bf777da0c0754430b706b7fd | [
"MIT"
] | 5 | 2017-12-11T15:10:29.000Z | 2018-12-21T17:40:58.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import division
from .t_lq import T_Lq
class T_Lq_ETH(T_Lq):
"""
bch:
python -m quant.cli -mBitfinex_ETH_USD,Liqui_ETH_BTC,Bitfinex_BTC_USD -o=T_Lq_ETH -f=liqui_eth -v
目前的限制:
"""
def __init__(self):
base_pair = "Bitfinex_... | 24.545455 | 101 | 0.561728 |
a919019f3ec271a8efb203a29b4d9fc328269734 | 1,486 | py | Python | server/bumf/core/migrations/0006_auto_20170108_1023.py | bumfiness/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | 6 | 2017-01-07T17:59:46.000Z | 2017-02-10T13:19:46.000Z | server/bumf/core/migrations/0006_auto_20170108_1023.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | server/bumf/core/migrations/0006_auto_20170108_1023.py | rixx/bumf | 71c404c0a8f804b8f0e127df3de6d8916db4c660 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-08 10:23
from __future__ import unicode_literals
import bumf.core.models.account
from django.db import migrations, models
import django.db.models.deletion
import functools
class Migration(migrations.Migration):
dependencies = [
('core', '00... | 43.705882 | 244 | 0.677658 |
a9a40731fdfe0bc1bb3061f755cb81813ba0053c | 2,211 | py | Python | sshAttack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | sshAttack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | sshAttack.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/env python
# encoding: utf-8
# author: Lock
# time: 2016/11/7 14:48
import optparse
from pexpect import pxssh
import time
import threading
maxConnections = 5
connection_lock = threading.BoundedSemaphore(value=maxConnections)
Found = False
Fails = 0
def connect(host, user, password, release):
global Fou... | 34.015385 | 116 | 0.602895 |
5734a3382937051c57d63cc6ecfbdb390f05eefd | 56,355 | py | Python | wz/timetable/basic_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable/basic_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | wz/timetable/basic_data.py | gradgrind/WZ | 672d93a3c9d7806194d16d6d5b9175e4046bd068 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TT/basic_data.py - last updated 2021-08-28
Read timetable information from the various sources ...
==============================
Copyright 2021 Michael Towers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | 43.416795 | 79 | 0.507391 |
2716990f69fc9b43232049e232b80a0aec0d4ff8 | 2,175 | py | Python | begin-python/cp7/chapter7.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp7/chapter7.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp7/chapter7.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
# ##更加抽象
# ###对象的魔力
# * 多态: 可以对不同类的对象使用相同的操作
# * 封装: 对外部世界隐藏对象的工作细节
# * 继承: 以通用的类为基础建立专门的对象
# ####7.1.1 多态
# 下面是一些多态函数
print 'abc'.count('a')
print [1, 2, 3, 1].count(1)
1 + 1
[1, 2, 3] + ['a']
# ####7.1.2 封装
class OpenObject:
def setName(self, name):
self.name = nam... | 16.992188 | 74 | 0.665287 |
8b4fcfe0d6d04a64c2d056a331feda3a05f3119c | 12,546 | py | Python | imbiss.py | Steinheilig/Imbiss | 49f6ae865cef05b4999569cecaf5931db0fb2113 | [
"MIT"
] | null | null | null | imbiss.py | Steinheilig/Imbiss | 49f6ae865cef05b4999569cecaf5931db0fb2113 | [
"MIT"
] | null | null | null | imbiss.py | Steinheilig/Imbiss | 49f6ae865cef05b4999569cecaf5931db0fb2113 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 29 21:41:02 - 00:10:00 2021 ;)
@author: Steinheilig
Dieses Programm ist eine 1:1 Implementation (der Spielmechanik) von
"Imbiss-Bude" von F. Brall 1983 für Apple II, Homecomputer 8/1983, S. 37-41
"Imbiss" von O. Schwald 1984 für Commodore C64, Homecomputer 10/1... | 35.340845 | 175 | 0.457516 |
8b9b896107f7936e2dad57b40b5feee02eb21336 | 179 | py | Python | Online-Judges/DimikOJ/Python/36-number-disaster.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/36-number-disaster.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/36-number-disaster.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | t = int(input())
for _ in range(t):
n = int(input())
n = str(n)
new_n = ""
for i in range(len(n)-1, -1, -1):
new_n += n[i]
print(int(new_n))
| 16.272727 | 37 | 0.435754 |
47abd552804a9f444892b92b847b8242da95d231 | 6,221 | py | Python | markdown_generator/media2.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | null | null | null | markdown_generator/media2.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | null | null | null | markdown_generator/media2.py | yesiknowjava/theodorecaputihugo | 95aa4391a2edd0cc03774384cdc52f45efc85835 | [
"MIT"
] | 1 | 2021-06-09T04:30:16.000Z | 2021-06-09T04:30:16.000Z | import sys
import time
import json
from bs4 import BeautifulSoup
import frontmatter
import pandas as pd
import os
from newsfetch.news import newspaper
from tqdm import tqdm
from pprint import pprint
from newspaper import Article
import waybackpy
import requests
import random
import datetime
import article_parser
from ... | 37.475904 | 166 | 0.484649 |
4bf1165a69ca9d91f97f28ec3e1b604643991c5b | 30,002 | py | Python | Packs/AzureStorageContainer/Integrations/AzureStorageContainer/AzureStorageContainer.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/AzureStorageContainer/Integrations/AzureStorageContainer/AzureStorageContainer.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/AzureStorageContainer/Integrations/AzureStorageContainer/AzureStorageContainer.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import shutil
from typing import Callable
from requests import Response
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'
account_sas_token = ""
storage_account_name = ""
class Client:
"""
API Client
"""
def __init_... | 32.225564 | 121 | 0.635558 |
32a5e83d5696d693b2a0496b80ca900aa5a33f60 | 3,526 | py | Python | gui.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | gui.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | gui.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | from log import Log
from data import *
from rocket_view import RocketView
from prompter import Prompter
import tkinter as tk
import time
import numpy as np
import re
class SimGUI:
def __init__(self):
self.root = tk.Tk()
self.root.config(Aspect.frame_opt())
self.init_window()
self... | 37.115789 | 89 | 0.675269 |
0872898223ccc9712db1fff825976828ddb76b4f | 426 | py | Python | books/PythonAutomate/webscrap/submitting_forms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/submitting_forms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/submitting_forms.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """submitting_forms.py"""
from selenium import webdriver
browser = webdriver.Chrome()
browser.get("https://login.metafilter.com")
# id가 user_name인 태그 검색 후 문자열 입력
user_elem = browser.find_element_by_id("user_name")
user_elem.send_keys("your_read_username_here")
# id가 user_pass인 태그 검색 후 문자열 입력
password_elem = browser.... | 28.4 | 55 | 0.800469 |
f5b6ca28e05ea0afeb02bd83583783de7f6240e5 | 817 | py | Python | Project Euler Qusetions 51 - 60/Project Euler Question 59.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 51 - 60/Project Euler Question 59.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 51 - 60/Project Euler Question 59.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 59
#XOR decryption
import itertools
cipher_file = open(r"C:\Users\Clayton\Documents\Python Other Files\p059_cipher.txt")
content = cipher_file.read()
content = content.split(",")
cipher_list = list(itertools.product("abcdefghijklmnopqrstuvwxyz", repeat=3))
ascii_value_list = {i for i in range(... | 25.53125 | 84 | 0.660955 |
f5e25355739712d0d57f4e44a8de35c0d16baf14 | 4,457 | py | Python | research/audio/wavenet/datasets/wavallin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/audio/wavenet/datasets/wavallin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/audio/wavenet/datasets/wavallin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.532787 | 85 | 0.67265 |
debdadf3082ba42a68877c520afe3d94423bacc2 | 1,753 | py | Python | main.py | kleberbaum/TU-P1.2b | 2b40e59992784596a797b887e13cae443be45aa7 | [
"Unlicense"
] | null | null | null | main.py | kleberbaum/TU-P1.2b | 2b40e59992784596a797b887e13cae443be45aa7 | [
"Unlicense"
] | null | null | null | main.py | kleberbaum/TU-P1.2b | 2b40e59992784596a797b887e13cae443be45aa7 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
'''
Einfuhrung in die Programmierung 1.2b
'''
workArray = [[0, 4, 8], [1, 5, 9], [2, 6, 10], [3,7,11]]
filterArray = [[1, 1, 0], [0, 2, 0], [0, 0, 3]]
def applyFilter(workArray, filterArray):
filter_range=int((len(filterArray)-1)/2)+1
resa = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
... | 28.737705 | 91 | 0.495151 |
defebe7ed400a182e11eae087c594332d360f4a8 | 733 | py | Python | 1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def goodNodes(self, root: TreeNode) -> int:
result = 0 # root
stack=[(root, root.val)]
... | 30.541667 | 55 | 0.492497 |
720dd373bcc6a9042edc1eb357e33a7481eeeae5 | 476 | py | Python | AsyncWrite.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | AsyncWrite.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | AsyncWrite.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import threading,time
class AsyncWrite(threading.Thread):
def __init__(self):
super(AsyncWrite,self).__init__()
#threading.Thread.__init__(self)
def run(self):
time.sleep(2)
print 'This thread is running'
print "the program can continue to run while it writes abother thread"
print 100+4... | 23.8 | 70 | 0.766807 |
26052eeca16ddd60511fc5bdda7ae81f9abaa232 | 1,176 | py | Python | package.py | Klamann/tpf-bigger-stations | 0def02ec9a4cd50f501108fc15713e10bce674d8 | [
"BSD-3-Clause"
] | null | null | null | package.py | Klamann/tpf-bigger-stations | 0def02ec9a4cd50f501108fc15713e10bce674d8 | [
"BSD-3-Clause"
] | null | null | null | package.py | Klamann/tpf-bigger-stations | 0def02ec9a4cd50f501108fc15713e10bce674d8 | [
"BSD-3-Clause"
] | null | null | null | import shutil, errno, os
author = "klamann"
app_name = "bigger train stations"
version = "1.2.0"
build_dir = "./.build"
dist_dir = "./dist"
app_dir_base = "_".join((author, app_name.replace(" ", "_"), "1"))
app_dir = os.path.join(build_dir, app_dir_base)
zip_name = "_".join((app_name.replace(" ", "-"), version))
zip... | 24.5 | 83 | 0.64881 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.