hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a1a5f97d2b356e735d40f301af546f938382c01 | 9,684 | py | Python | egg/zoo/systematicity/calculate_TRE.py | XeniaOhmer/SystematicRepresentations | 825208d1be659dc820e61f577cdb53afc47302f4 | [
"MIT"
] | null | null | null | egg/zoo/systematicity/calculate_TRE.py | XeniaOhmer/SystematicRepresentations | 825208d1be659dc820e61f577cdb53afc47302f4 | [
"MIT"
] | null | null | null | egg/zoo/systematicity/calculate_TRE.py | XeniaOhmer/SystematicRepresentations | 825208d1be659dc820e61f577cdb53afc47302f4 | [
"MIT"
] | null | null | null | from egg.zoo.systematicity.metrics.tre import *
from typing import Iterable, Type
import torch
import os
from abc import ABC
import argparse
import copy
import pickle
def get_protocol(interaction, vocab_size):
sender_in = interaction.sender_input.cpu()
n_atts = int(sum(sender_in[0]))
n_vals = int(len(send... | 43.426009 | 119 | 0.604709 |
4a1a60d958da7b3e4e95656f042d140f590977ac | 3,476 | py | Python | salt/states/keystone_group.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/states/keystone_group.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | salt/states/keystone_group.py | ipmb/salt | 699912ef9cde28040378aa53d6c7a12d8af756b1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Management of OpenStack Keystone Groups
=======================================
.. versionadded:: Oxygen
:depends: shade
:configuration: see :py:mod:`salt.modules.keystoneng` for setup instructions
Example States
.. code-block:: yaml
create group:
keystone_group.present:
... | 24.652482 | 106 | 0.569908 |
4a1a61298fd488865f439c918e78abc7d1a64a35 | 1,980 | py | Python | users/migrations/0010_auto_20200418_2304.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | users/migrations/0010_auto_20200418_2304.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | users/migrations/0010_auto_20200418_2304.py | andywar65/rp_repo | 726c1426d738b962cabeabd8995aa35767df0c41 | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-18 21:04
from django.db import migrations, models
import users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_profile_is_trusted'),
]
operations = [
migrations.AddField(
model_name='profile',
... | 39.6 | 330 | 0.589899 |
4a1a6239b22d83eef3de71706341aa33456278c0 | 4,119 | py | Python | train.py | iShohei220/svm | 738e350f93228865ed423a9bbf661f9c182bd71f | [
"MIT"
] | null | null | null | train.py | iShohei220/svm | 738e350f93228865ed423a9bbf661f9c182bd71f | [
"MIT"
] | null | null | null | train.py | iShohei220/svm | 738e350f93228865ed423a9bbf661f9c182bd71f | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from SVM import SVM
np.random.seed(0)
def linear_data(N):
X_1_pos = np.random.rand(N)
X_2_pos = X_1_pos + np.random.normal(0, 0.3, N) + 0.5
X_pos = np.array([[x_1, x_2, 1] for x_1, x_2 in zip(X_1_pos, X_2_pos)])
X_1_neg = np.random.... | 32.179688 | 77 | 0.584365 |
4a1a62b9e57ece83c844824e3f11933923a575ba | 3,172 | py | Python | cpo/lib/fyre/data/openshift_version_data.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | 9 | 2020-08-21T08:46:34.000Z | 2021-09-02T15:47:41.000Z | cpo/lib/fyre/data/openshift_version_data.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | 10 | 2020-11-26T15:31:43.000Z | 2021-11-08T15:00:01.000Z | cpo/lib/fyre/data/openshift_version_data.py | IBM/data-gate-cli | fc0cb1a560a0156c71eb63a550e198d0cd36e1df | [
"Apache-2.0"
] | 1 | 2022-03-10T07:14:49.000Z | 2022-03-10T07:14:49.000Z | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 36.045455 | 112 | 0.692308 |
4a1a63f80d29ab94150b21b7883017f177955c02 | 668 | py | Python | test/read_img.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | test/read_img.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | test/read_img.py | ethan4335/pytorch-YOLOv4 | 44f67130d83fc2949efb50afe67337735836169b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__title__ = 'pytorch-YOLOv4'
__author__ = 'deagle'
__date__ = '11/15/2020 23:27'
# code is far away from bugs with the god animal protecting
I love animals. They taste delicious.
"""
import datetime
import cv2
img_path = 'D:/work_source/CV_Project/datasets/footbrid... | 22.266667 | 96 | 0.697605 |
4a1a6409b635c40302aa1ee9c39aadbb8b4f2c1c | 901 | py | Python | 1/sjb.py | xuegao-tzx/Python-exampe | f757c2e3292e883826185a55f6a61f7127cc03bb | [
"Apache-2.0"
] | 2 | 2021-06-20T09:23:36.000Z | 2021-12-13T08:34:26.000Z | 1/sjb.py | xuegao-tzx/Python-exampe | f757c2e3292e883826185a55f6a61f7127cc03bb | [
"Apache-2.0"
] | null | null | null | 1/sjb.py | xuegao-tzx/Python-exampe | f757c2e3292e883826185a55f6a61f7127cc03bb | [
"Apache-2.0"
] | null | null | null | import random
import requests
import json
import datetime
from urllib import parse
#数据包的POST请求
head={
'Content-Type': '网络文件的类型和网页的编码',
'Accept-Encoding': 'gzip'#浏览器发给服务器,声明浏览器支持的编码类型
'User-Agent':'eg:Mozilla/5.0 (Linux; Harmony 2; ***-**** Build/HUAWEI***-****; wv) AppleWebKit/537.36 (KHTML, like G... | 25.742857 | 209 | 0.570477 |
4a1a647c6129765555c2b3afe7458681fa4d7b0f | 33,390 | py | Python | tests/test_sns/test_publishing_boto3.py | orenmazor/moto | 4778377e8ecaf729d26602a2c5202b72c1438503 | [
"Apache-2.0"
] | null | null | null | tests/test_sns/test_publishing_boto3.py | orenmazor/moto | 4778377e8ecaf729d26602a2c5202b72c1438503 | [
"Apache-2.0"
] | 4 | 2017-09-30T07:52:52.000Z | 2021-12-13T06:56:55.000Z | tests/test_sns/test_publishing_boto3.py | orenmazor/moto | 4778377e8ecaf729d26602a2c5202b72c1438503 | [
"Apache-2.0"
] | 2 | 2021-11-24T08:05:43.000Z | 2021-11-25T16:18:48.000Z | from __future__ import unicode_literals
import base64
import json
import boto3
import re
from freezegun import freeze_time
import sure # noqa
from botocore.exceptions import ClientError
import pytest
from moto import mock_sns, mock_sqs, settings
from moto.core import ACCOUNT_ID
from moto.core.models import response... | 33.490471 | 496 | 0.645343 |
4a1a65a3405fabd6e5dc6ce3a56a8139491f5eb4 | 11,986 | py | Python | custom_components/alexa_media/alexa_entity.py | JoshuaGarrison27/Home-Assistant-Configuration | 18d1b7df7d15400008bc93c40d7f0fb5babc90fa | [
"MIT"
] | 27 | 2018-10-13T10:00:53.000Z | 2022-02-07T23:33:12.000Z | custom_components/alexa_media/alexa_entity.py | JoshuaGarrison27/Home-Assistant-Configuration | 18d1b7df7d15400008bc93c40d7f0fb5babc90fa | [
"MIT"
] | 3 | 2018-10-03T03:13:21.000Z | 2019-11-11T22:16:26.000Z | custom_components/alexa_media/alexa_entity.py | JoshuaGarrison27/Home-Assistant-Configuration | 18d1b7df7d15400008bc93c40d7f0fb5babc90fa | [
"MIT"
] | 5 | 2019-06-01T10:27:37.000Z | 2020-09-18T14:14:56.000Z | """
Alexa Devices Sensors.
SPDX-License-Identifier: Apache-2.0
For more details about this platform, please refer to the documentation at
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639
"""
from datetime import datetime
import json
import logging
import re
from typing imp... | 36.431611 | 153 | 0.661689 |
4a1a67116e1697ed19728189b38f94e83e10adca | 304 | py | Python | ledger/__init__.py | Funk66/ledger | b06f39281b81cebb75a6c5f92fa3b8e47b65800c | [
"MIT"
] | null | null | null | ledger/__init__.py | Funk66/ledger | b06f39281b81cebb75a6c5f92fa3b8e47b65800c | [
"MIT"
] | 3 | 2021-11-16T06:38:48.000Z | 2021-11-16T06:43:18.000Z | ledger/__init__.py | Funk66/ledger | b06f39281b81cebb75a6c5f92fa3b8e47b65800c | [
"MIT"
] | null | null | null | from logging import getLogger
from pathlib import Path
__author__ = "Guillermo Guirao Aguilar"
__email__ = "contact@guillermoguiraoaguilar.com"
__license__ = "MIT"
__version__ = "0.2.1"
log = getLogger('ledger')
home = Path(Path.home() / '.config' / 'ledger')
home.mkdir(parents=True, exist_ok=True)
| 21.714286 | 48 | 0.743421 |
4a1a6737321fc88873cec88540448bfcf7787054 | 790 | py | Python | Tests/Validation/Material/M400_50A.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Material/M400_50A.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Tests/Validation/Material/M400_50A.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | from pyleecan.Classes.Material import Material
from pyleecan.Classes.MatLamination import MatLamination
from pyleecan.Classes.ImportMatrixXls import ImportMatrixXls
from os.path import dirname, abspath, join
file_path = abspath(join(dirname(__file__), "M400-50A.xlsx"))
M400_50A = Material(name="M400-50A")
M400_50A.ma... | 31.6 | 72 | 0.794937 |
4a1a6aa72e0d5c104455a233e7bfe231e6485944 | 3,677 | py | Python | src/gameobjects/players/player.py | Isaac-Muscat/Pygame-Smash-Bros-Platformer | 1e527efabc9252de8e8cdf5dfc1fb3623f8b00e8 | [
"MIT"
] | null | null | null | src/gameobjects/players/player.py | Isaac-Muscat/Pygame-Smash-Bros-Platformer | 1e527efabc9252de8e8cdf5dfc1fb3623f8b00e8 | [
"MIT"
] | null | null | null | src/gameobjects/players/player.py | Isaac-Muscat/Pygame-Smash-Bros-Platformer | 1e527efabc9252de8e8cdf5dfc1fb3623f8b00e8 | [
"MIT"
] | 1 | 2021-05-21T16:10:29.000Z | 2021-05-21T16:10:29.000Z | # Imports from other modules
from physics.rigidbody import Rigidbody
from physics.collider2 import BoxCollider2
import settings as s
from physics.vector2 import Vector2
import physics.vector2 as vec
class Player(Rigidbody):
'''
This class handles the generic makeup of a character/player.
This should be u... | 40.855556 | 126 | 0.644275 |
4a1a6ac065146619777ac795268f62a704014ede | 11,623 | py | Python | cwr/grammar/factory/adapter.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 37 | 2015-04-21T15:33:53.000Z | 2022-02-07T00:02:29.000Z | cwr/grammar/factory/adapter.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 86 | 2015-02-01T22:26:02.000Z | 2021-07-09T08:49:36.000Z | cwr/grammar/factory/adapter.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 27 | 2015-01-26T16:01:09.000Z | 2021-11-08T23:53:55.000Z | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from cwr.grammar.field import basic, special, table, filename
"""
CWR fields grammar adapters.
These classes allow the factories to create rules in an homogeneous way,
by setting a basic interface which will wrap around field rules, giving
a basic comm... | 27.220141 | 78 | 0.677364 |
4a1a6ba3b936d0ce79c49141fda740d3a10ea993 | 8,362 | py | Python | processor/processor.py | WangTaoAs/PFD_Net | 14a598108e4b16772273057ac7a8fa8674dfc35f | [
"MIT"
] | 39 | 2021-12-06T02:02:13.000Z | 2022-03-30T13:00:45.000Z | processor/processor.py | WangTaoAs/PFD-Net-Pose-guided-feature-distangling | 14a598108e4b16772273057ac7a8fa8674dfc35f | [
"MIT"
] | 5 | 2021-12-13T03:12:07.000Z | 2022-03-24T13:22:56.000Z | processor/processor.py | WangTaoAs/PFD-Net-Pose-guided-feature-distangling | 14a598108e4b16772273057ac7a8fa8674dfc35f | [
"MIT"
] | 5 | 2021-12-20T07:47:04.000Z | 2022-03-09T07:44:46.000Z | import logging
import os
import time
import torch
import torch.nn as nn
from utils.meter import AverageMeter
from utils.metrics import R1_mAP_eval
from torch.cuda import amp
import torch.distributed as dist
from loss.pose_push_loss import Push_Loss_batch, Push_Loss
def do_train(cfg,
model,
... | 38.182648 | 142 | 0.544009 |
4a1a6cce5a786933a2616476be952f412ff5fac4 | 2,602 | py | Python | src/edubot/snapext/joystick/mappings.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/mappings.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | src/edubot/snapext/joystick/mappings.py | wendlers/edubot-snap | 09c471ef8738a3fc2aae6772a1e02ef8e15d5737 | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | 27.680851 | 79 | 0.534589 |
4a1a6d403e6805470528914f154178cdf5c71f42 | 2,981 | py | Python | setup.py | tobias-urdin/cinder-auto-snapshot | 0b136c42be0aca2017b416f56f84e35712a2762b | [
"Apache-2.0"
] | null | null | null | setup.py | tobias-urdin/cinder-auto-snapshot | 0b136c42be0aca2017b416f56f84e35712a2762b | [
"Apache-2.0"
] | null | null | null | setup.py | tobias-urdin/cinder-auto-snapshot | 0b136c42be0aca2017b416f56f84e35712a2762b | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
# cinder-auto-snapshot
# Copyright (C) 2015 Tobias Urdin
#
# 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
#
# Unle... | 24.841667 | 77 | 0.621939 |
4a1a6ec889f51461d2f21c1f4a6757912b8bda49 | 66 | py | Python | dict_hash/__version__.py | KairosAerospace/dict_hash | 8c6343639cc66d46f7ec6621f27792d4ce56ad22 | [
"MIT"
] | 11 | 2020-09-01T20:17:17.000Z | 2022-01-27T08:45:21.000Z | dict_hash/__version__.py | KairosAerospace/dict_hash | 8c6343639cc66d46f7ec6621f27792d4ce56ad22 | [
"MIT"
] | 4 | 2020-05-28T08:46:02.000Z | 2021-10-03T15:57:54.000Z | dict_hash/__version__.py | KairosAerospace/dict_hash | 8c6343639cc66d46f7ec6621f27792d4ce56ad22 | [
"MIT"
] | 2 | 2021-10-02T12:41:49.000Z | 2022-01-19T03:21:14.000Z | """Current version of package dict_hash"""
__version__ = "1.1.20"
| 22 | 42 | 0.712121 |
4a1a6ed4bed1b4a60130338a30dc8b7a302232d3 | 1,629 | py | Python | profiles_api/models.py | abdulbasidh/profiles-rest-api | b97fad3d2588f92abeb0c78897838d6f93c86074 | [
"MIT"
] | null | null | null | profiles_api/models.py | abdulbasidh/profiles-rest-api | b97fad3d2588f92abeb0c78897838d6f93c86074 | [
"MIT"
] | null | null | null | profiles_api/models.py | abdulbasidh/profiles-rest-api | b97fad3d2588f92abeb0c78897838d6f93c86074 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def create_user(self, email, name, pas... | 28.578947 | 63 | 0.674647 |
4a1a6f1f8799e7096e391137961093d55cb289cb | 372 | py | Python | mushroom/__init__.py | ML2R-center/mushroom | 07fe4f43fd7bb7ebdec71db8f75e0a9b87573e00 | [
"MIT"
] | 2 | 2019-02-28T04:56:29.000Z | 2020-09-01T07:52:35.000Z | mushroom/__init__.py | ML2R-center/mushroom | 07fe4f43fd7bb7ebdec71db8f75e0a9b87573e00 | [
"MIT"
] | 1 | 2020-02-15T03:15:04.000Z | 2022-03-24T05:21:08.000Z | mushroom/__init__.py | ML2R-center/mushroom | 07fe4f43fd7bb7ebdec71db8f75e0a9b87573e00 | [
"MIT"
] | 2 | 2019-12-05T03:15:46.000Z | 2021-01-12T11:23:35.000Z | from mushroom.result_analysis import get_accuracy_precision_recall_from_series
from mushroom.result_analysis import analysis_with_different_length_stems
from mushroom.result_analysis import get_accuracy_precision_recall_from_series_with_stem_length
from mushroom.core import mushroom_triple_classification_with_different... | 74.4 | 95 | 0.935484 |
4a1a704c81f45b2d6ff90141933b441cf59e8e06 | 10,448 | py | Python | foo/comm.py | ThomasZh/legend-league-portal | df06ac05ea506c3e257517716b6d692b69c8bf6b | [
"Apache-2.0"
] | null | null | null | foo/comm.py | ThomasZh/legend-league-portal | df06ac05ea506c3e257517716b6d692b69c8bf6b | [
"Apache-2.0"
] | null | null | null | foo/comm.py | ThomasZh/legend-league-portal | df06ac05ea506c3e257517716b6d692b69c8bf6b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# Copyright 2016 planc2c.com
# thomas@time2box.com
#
# 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/LICENS... | 34.710963 | 129 | 0.584992 |
4a1a7058a8ffe5b60680836ac2a1f0dc268ff553 | 525 | py | Python | Build_Web_With_Flask/Building web applications with Flask_Code/chapter10/chapter10/fabfile.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | Build_Web_With_Flask/Building web applications with Flask_Code/chapter10/chapter10/fabfile.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | Build_Web_With_Flask/Building web applications with Flask_Code/chapter10/chapter10/fabfile.py | abacuspix/NFV_project | f5585a6750119b1f954fea65c37a14badad1fd62 | [
"MIT"
] | null | null | null | # coding:utf-8
from fabric.api import *
from fabric.contrib.files import exists
env.linewise = True
# forward_agent allows you to git pull from your repository
# if you have your ssh key setup
env.forward_agent = True
env.hosts = ['your.host.ip.address']
def create_project():
if not exists('~/project'):
... | 20.192308 | 59 | 0.678095 |
4a1a705df8527f8cf57558cb597ced9fd49cbe27 | 7,524 | py | Python | pettingzoo/classic/connect_four/connect_four.py | raphaelavalos/PettingZoo | f34b57a9f4f20947ae56c6708f66c4510413d148 | [
"Apache-2.0"
] | null | null | null | pettingzoo/classic/connect_four/connect_four.py | raphaelavalos/PettingZoo | f34b57a9f4f20947ae56c6708f66c4510413d148 | [
"Apache-2.0"
] | null | null | null | pettingzoo/classic/connect_four/connect_four.py | raphaelavalos/PettingZoo | f34b57a9f4f20947ae56c6708f66c4510413d148 | [
"Apache-2.0"
] | null | null | null | from pettingzoo import AECEnv
from gym import spaces
import numpy as np
import os
import pygame
from pettingzoo.utils import wrappers
from pettingzoo.utils.agent_selector import agent_selector
def get_image(path):
import pygame
from os import path as os_path
cwd = os_path.dirname(__file__)
image = py... | 36.347826 | 147 | 0.569112 |
4a1a706333e97d749328f9bcaba45ede8eb9ce96 | 4,796 | py | Python | software/multifluids_icferst/tests/turbine_flux_penalty_2plus1/mesh/scripts/triangle_add_edgeowner.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | 2 | 2020-05-11T02:39:46.000Z | 2020-05-11T03:08:38.000Z | software/multifluids_icferst/tests/turbine_flux_dg_2d/mesh/scripts/triangle_add_edgeowner.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | null | null | null | software/multifluids_icferst/tests/turbine_flux_dg_2d/mesh/scripts/triangle_add_edgeowner.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | 2 | 2020-05-21T22:50:19.000Z | 2020-10-28T17:16:31.000Z | #!/usr/bin/env python
import sys
import triangle
import copy
import numpy
from sets import Set
#input surface_id, filename
# 5.5.2010: this script adds a new attribute to the .edge file which holds the "owner" element number of this edge
# Here is an examle geo file for this script:
# Point(1) = {0, 0, 0, 2};
# Poi... | 35.007299 | 177 | 0.634487 |
4a1a707cfdfd24389298bd4acb4d9bf4b007347e | 4,860 | py | Python | selfdrive/car/vw/carcontroller.py | micksmi/openpilot | 15e128d08cf6fcbb12bb9c665b711f16f75a4e5a | [
"MIT"
] | null | null | null | selfdrive/car/vw/carcontroller.py | micksmi/openpilot | 15e128d08cf6fcbb12bb9c665b711f16f75a4e5a | [
"MIT"
] | null | null | null | selfdrive/car/vw/carcontroller.py | micksmi/openpilot | 15e128d08cf6fcbb12bb9c665b711f16f75a4e5a | [
"MIT"
] | null | null | null | from cereal import car
from common.numpy_fast import clip, interp
from common.realtime import sec_since_boot
from selfdrive.config import Conversions as CV
from selfdrive.boardd.boardd import can_list_to_can_capnp
from selfdrive.car.vw.carstate import CarState, get_gateway_can_parser, get_extended_can_parser
from selfd... | 42.631579 | 162 | 0.703086 |
4a1a70a5bfd96eb835ca829ff5a1442f9bbaa2fb | 939 | py | Python | directvscraper/items.py | santteegt/directv-scraper | f5b87a8409fad6cff5148c9045b8ce4f4fb549a6 | [
"MIT"
] | null | null | null | directvscraper/items.py | santteegt/directv-scraper | f5b87a8409fad6cff5148c9045b8ce4f4fb549a6 | [
"MIT"
] | null | null | null | directvscraper/items.py | santteegt/directv-scraper | f5b87a8409fad6cff5148c9045b8ce4f4fb549a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
import logging
logger = logging.getLogger('serializerLogger')
def unicode_serialization(stream):
logger.info(stream)
new_stream = stream.encode... | 26.083333 | 64 | 0.743344 |
4a1a70bff0812194a3af47f5021bd00b1254ecc3 | 47,396 | py | Python | cogs/pug.py | rksouthee/pugbot | 9802c2f10574b350ca78adfb613048d5830ac858 | [
"MIT"
] | null | null | null | cogs/pug.py | rksouthee/pugbot | 9802c2f10574b350ca78adfb613048d5830ac858 | [
"MIT"
] | null | null | null | cogs/pug.py | rksouthee/pugbot | 9802c2f10574b350ca78adfb613048d5830ac858 | [
"MIT"
] | null | null | null | import asyncio
import collections
import collections.abc
import contextlib
import functools
import heapq
import itertools
import random
import re
import shelve
import os
from discord.ext import commands
import discord
import pendulum
PICKMODES = [
[0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1],
[0, ... | 37.645751 | 130 | 0.605473 |
4a1a729c1854a3240bbc870f7d4eb2fb9b5858cc | 14,922 | py | Python | O365/event.py | BDeliers/python-o365 | 24bf6d8aa82b00b02faf9a5d1d790481d19991b7 | [
"Apache-2.0"
] | null | null | null | O365/event.py | BDeliers/python-o365 | 24bf6d8aa82b00b02faf9a5d1d790481d19991b7 | [
"Apache-2.0"
] | null | null | null | O365/event.py | BDeliers/python-o365 | 24bf6d8aa82b00b02faf9a5d1d790481d19991b7 | [
"Apache-2.0"
] | null | null | null | from O365.contact import Contact
from O365.group import Group
from O365.connection import Connection
import logging
import json
import requests
import time
log = logging.getLogger(__name__)
class Event( object ):
'''
Class for managing the creation and manipluation of events in a calendar.
Methods:
create -- Cr... | 32.940397 | 131 | 0.704798 |
4a1a73927d9a85a5378529c7edd1c4a37f95ee68 | 695 | py | Python | backend/tests/factories.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 8 | 2019-06-03T16:29:49.000Z | 2021-05-11T20:38:36.000Z | backend/tests/factories.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 342 | 2019-01-15T19:13:58.000Z | 2020-03-24T16:38:13.000Z | backend/tests/factories.py | DSBUGAY2/zcash-grant-system | 729b9edda13bd1eeb3f445d889264230c6470d7e | [
"MIT"
] | 5 | 2019-02-15T09:06:47.000Z | 2022-01-24T21:38:41.000Z | # -*- coding: utf-8 -*-
"""Factories to help in tests."""
from factory import PostGenerationMethodCall, Sequence
from factory.alchemy import SQLAlchemyModelFactory
from grant.app import db
class BaseFactory(SQLAlchemyModelFactory):
"""Base factory."""
class Meta:
"""Factory configuration."""
... | 23.965517 | 66 | 0.67482 |
4a1a73eb6f2a2f6181f925554b845a9a4c5caff6 | 5,744 | py | Python | google/ads/googleads/v9/resources/types/campaign_simulation.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/resources/types/campaign_simulation.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/resources/types/campaign_simulation.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.888889 | 128 | 0.696205 |
4a1a747df51a0428c835594168f000e0b51798ca | 9,271 | py | Python | pypureclient/flashblade/FB_2_0/models/file_system_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flashblade/FB_2_0/models/file_system_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flashblade/FB_2_0/models/file_system_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashBlade REST API Client
A lightweight client for FlashBlade REST API 2.0, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
imp... | 41.573991 | 126 | 0.596807 |
4a1a74b966d0956a3bebe66b65a241795398078f | 273 | py | Python | probability_combinatorics/distribute_stuff.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/distribute_stuff.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/distribute_stuff.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | def distribute_something(count, people):
"""
Given count = X things
distribute it among people=N
"""
l = [0] * people
while count > 0:
for i in xrange(len(l)):
l[i] += 1
count -= 1
if count == 0: return l
| 22.75 | 40 | 0.490842 |
4a1a753458e4de149ecb045549c7dfb81ef4d62c | 3,763 | py | Python | tests/test_euklid_vector.py | airgproducts/euklid_rd | 3222cfeca8a9216d1a6bfc5c41606fb0801192d0 | [
"MIT"
] | null | null | null | tests/test_euklid_vector.py | airgproducts/euklid_rd | 3222cfeca8a9216d1a6bfc5c41606fb0801192d0 | [
"MIT"
] | 15 | 2022-01-07T16:42:39.000Z | 2022-03-01T18:13:22.000Z | tests/test_euklid_vector.py | airgproducts/euklid_rs | 3222cfeca8a9216d1a6bfc5c41606fb0801192d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
"""Unittest for euklid_rs.vector against euklid.vector"""
import math
import unittest
import euklid
import euklid_rs
class TestVectorFunctions(unittest.TestCase):
"""Test euklid_rs.vector against euklid.vector"""
def setUp(self) -> None:
# Vector2D
sel... | 35.838095 | 88 | 0.639383 |
4a1a757ec031f7126b0bba916e35fc7bcca487f4 | 12,770 | py | Python | fairseq/tasks/translation_multi_simple_epoch.py | cece95/fairseq | 92f27771b4cec979d4e7c1dc47b63d40d8220823 | [
"MIT"
] | null | null | null | fairseq/tasks/translation_multi_simple_epoch.py | cece95/fairseq | 92f27771b4cec979d4e7c1dc47b63d40d8220823 | [
"MIT"
] | null | null | null | fairseq/tasks/translation_multi_simple_epoch.py | cece95/fairseq | 92f27771b4cec979d4e7c1dc47b63d40d8220823 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import datetime
import time
import torch
from fairseq.data import (
data_utils,
FairseqDataset,
iterators,
Lan... | 42.006579 | 119 | 0.626703 |
4a1a7722274bfd7b333b96412ddc86e49d966dd0 | 208 | py | Python | spockpy/config/__init__.py | gavindsouza/spockpy | 8664550d46be088a5ef8439220353ba4c33893f8 | [
"Apache-2.0"
] | 58 | 2017-03-25T05:52:23.000Z | 2021-09-11T08:16:14.000Z | spockpy/config/__init__.py | gavindsouza/spockpy | 8664550d46be088a5ef8439220353ba4c33893f8 | [
"Apache-2.0"
] | 4 | 2017-08-16T13:51:57.000Z | 2018-06-12T08:09:17.000Z | spockpy/config/__init__.py | gavindsouza/spockpy | 8664550d46be088a5ef8439220353ba4c33893f8 | [
"Apache-2.0"
] | 18 | 2017-03-26T18:26:21.000Z | 2021-03-25T23:08:17.000Z | # module - spockpy.config
# imports - compatibility imports
from __future__ import absolute_import
# imports - module imports
from spockpy.config.base import Config
from spockpy.config.app import AppConfig | 26 | 41 | 0.8125 |
4a1a774be5fc53ca407b375c0783fe70fdf2e193 | 586 | py | Python | hackerrank/30 Days of Code/Day 0 - Hello, World/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/30 Days of Code/Day 0 - Hello, World/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/30 Days of Code/Day 0 - Hello, World/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import io
import unittest
from contextlib import redirect_stdout
from unittest.mock import patch
class TestQ(unittest.TestCase):
@patch('builtins.input', return_value='Welcome to 30 Days of Code!')
def test_case_0(self, input_mock=None):
text_trap = io.StringIO()
with redirect_stdout(text_trap... | 27.904762 | 72 | 0.595563 |
4a1a78c94f8f49f22753e98aceaf4ca83f82ceae | 1,806 | py | Python | Python/code.py | snehalovhal/greyatom-python-for-data-science | 54da11b6ab64ecc6556249554ebe3f03f3d73aad | [
"MIT"
] | null | null | null | Python/code.py | snehalovhal/greyatom-python-for-data-science | 54da11b6ab64ecc6556249554ebe3f03f3d73aad | [
"MIT"
] | null | null | null | Python/code.py | snehalovhal/greyatom-python-for-data-science | 54da11b6ab64ecc6556249554ebe3f03f3d73aad | [
"MIT"
] | null | null | null | # --------------
# Code starts here
# Create the lists
class_1 = ['Geoffrey Hinton','Andrew Ng','Sebastian Raschka','Yoshua Bengio']
class_2 = ['Hilary Mason','Carla Gentry','Corinna Cortes']
# Concatenate both the strings
new_class = class_1 + class_2
print(new_class)
# Append the list
new_class.append('P... | 24.405405 | 156 | 0.700443 |
4a1a78f6884ca6f5e27b39090583d0be9d780925 | 3,313 | py | Python | src/niweb/apps/noclook/tests/test_views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2018-12-21T09:35:27.000Z | 2019-07-31T18:51:58.000Z | src/niweb/apps/noclook/tests/test_views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2019-07-25T07:10:23.000Z | 2021-02-08T09:58:57.000Z | src/niweb/apps/noclook/tests/test_views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 5 | 2019-02-06T12:00:26.000Z | 2021-11-19T14:48:06.000Z | from .neo4j_base import NeoTestCase
from apps.noclook.helpers import set_user, set_noclook_auto_manage
from apps.noclook import forms
from django.urls import reverse
class ViewTest(NeoTestCase):
"""
Excercises the view fiels, by running at least one of the views in them.
"""
def test_router_list_view... | 42.474359 | 90 | 0.686991 |
4a1a79033fe86d457ccf1a04fe9fdfc1cbaf33db | 21,406 | py | Python | tests/packagedcode/test_maven.py | quepop/scancode-toolkit | cea1d29064812e89a5d59cc3a3a39a5adb0b3e15 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-06-25T20:11:53.000Z | 2021-06-25T20:11:53.000Z | tests/packagedcode/test_maven.py | quepop/scancode-toolkit | cea1d29064812e89a5d59cc3a3a39a5adb0b3e15 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | tests/packagedcode/test_maven.py | quepop/scancode-toolkit | cea1d29064812e89a5d59cc3a3a39a5adb0b3e15 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... | 40.388679 | 107 | 0.638045 |
4a1a7996e893afce90861c72fe40ca794de7eaff | 255 | py | Python | employee_management/employee_management/doctype/product_bin_gg/product_bin_gg.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/product_bin_gg/product_bin_gg.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/employee_management/doctype/product_bin_gg/product_bin_gg.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Gopi and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class ProductBinGG(Document):
pass
| 23.181818 | 49 | 0.772549 |
4a1a79b62106e9a5f7ece770f6285cbc29d164b3 | 4,377 | py | Python | triopg/_triopg.py | touilleMan/triopg | 1178ce8cf0bd5eb133b3f709af7157f7591a8284 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-11-08T02:44:55.000Z | 2021-11-08T09:41:05.000Z | triopg/_triopg.py | touilleMan/triopg | 1178ce8cf0bd5eb133b3f709af7157f7591a8284 | [
"Apache-2.0",
"MIT"
] | null | null | null | triopg/_triopg.py | touilleMan/triopg | 1178ce8cf0bd5eb133b3f709af7157f7591a8284 | [
"Apache-2.0",
"MIT"
] | null | null | null | from functools import wraps, partial
import trio
import asyncpg
import trio_asyncio
def _shielded(f):
@wraps(f)
async def wrapper(*args, **kwargs):
with trio.open_cancel_scope(shield=True):
return await f(*args, **kwargs)
return wrapper
def connect(*args, **kwargs):
return TrioC... | 29.574324 | 77 | 0.657756 |
4a1a7a5802cdd1b5519551a8694336f1c7730411 | 5,082 | py | Python | 007/src/object_detector/yolov3.py | AzharMithani/99-ML-Learning-Projects | 88777e6da153f3de97fe8ec09ee86c7d8ebbf27b | [
"MIT"
] | null | null | null | 007/src/object_detector/yolov3.py | AzharMithani/99-ML-Learning-Projects | 88777e6da153f3de97fe8ec09ee86c7d8ebbf27b | [
"MIT"
] | null | null | null | 007/src/object_detector/yolov3.py | AzharMithani/99-ML-Learning-Projects | 88777e6da153f3de97fe8ec09ee86c7d8ebbf27b | [
"MIT"
] | null | null | null | # Azhar Mithani
import os
import time
import itertools
import cv2
import numpy as np
# A class defining all the functions used in the detection of People aka PeopleDetector function
class PeopleDetector:
def __init__(self, yolocfg='yolo_weights/yolov3.cfg',
yoloweights='yolo_weights/yolov3.weights... | 39.395349 | 96 | 0.569264 |
4a1a7a734a30f82148461097c717170372a6a88d | 7,272 | py | Python | onnxruntime/python/tools/bert/compare_bert_results.py | lizy14/onnxruntime | 8f00147c14c64715ffd4b1512df5356ddeb75462 | [
"MIT"
] | 1 | 2020-07-12T16:33:35.000Z | 2020-07-12T16:33:35.000Z | onnxruntime/python/tools/bert/compare_bert_results.py | Montaer/onnxruntime | 6dc25a60f8b058a556964801d99d5508641dcf69 | [
"MIT"
] | null | null | null | onnxruntime/python/tools/bert/compare_bert_results.py | Montaer/onnxruntime | 6dc25a60f8b058a556964801d99d5508641dcf69 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#--------------------------------------------------------------------------
# It is a tool to compare the inference results of the original model and... | 43.029586 | 154 | 0.679318 |
4a1a7b55989de2db00140e9f2e2173d3c0269bf1 | 2,212 | py | Python | webhook_trigger_service/basic/run.py | GShepherdTC/tcex-app-templates | fae927965563f98eed0bd7716afa3bf4d4fda3bf | [
"Apache-2.0"
] | 1 | 2022-02-23T16:04:16.000Z | 2022-02-23T16:04:16.000Z | webhook_trigger_service/basic/run.py | GShepherdTC/tcex-app-templates | fae927965563f98eed0bd7716afa3bf4d4fda3bf | [
"Apache-2.0"
] | null | null | null | webhook_trigger_service/basic/run.py | GShepherdTC/tcex-app-templates | fae927965563f98eed0bd7716afa3bf4d4fda3bf | [
"Apache-2.0"
] | 3 | 2022-02-16T18:13:58.000Z | 2022-03-31T18:46:20.000Z | """Playbook App"""
# standard library
import traceback
# first-party
from app_lib import AppLib
# pylint: disable=no-member
def run(**kwargs) -> None:
"""Update path and run the App."""
# update the path to ensure the App has access to required modules
app_lib = AppLib()
app_lib.update_path()
#... | 27.65 | 79 | 0.64557 |
4a1a7bdbc5158595bec15ee75f44f44f07597f14 | 952 | py | Python | baselibs/python/example_lsres.py | openhpi2/openhpi_apr25 | 720d4043124ac44d17715db4ffb735c623c08e38 | [
"BSD-3-Clause"
] | 5 | 2018-12-18T01:32:53.000Z | 2021-11-15T10:41:48.000Z | baselibs/python/example_lsres.py | openhpi2/openhpi_apr25 | 720d4043124ac44d17715db4ffb735c623c08e38 | [
"BSD-3-Clause"
] | 34 | 2018-05-11T21:31:33.000Z | 2021-01-12T07:13:46.000Z | baselibs/python/example_lsres.py | openhpi2/openhpi_apr25 | 720d4043124ac44d17715db4ffb735c623c08e38 | [
"BSD-3-Clause"
] | 8 | 2018-08-27T22:48:44.000Z | 2022-03-15T03:49:55.000Z |
# -*- python -*-
#
# Copyright (C) 2012, Pigeon Point Systems
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This
# file and program are licensed under a BSD style license.... | 28.848485 | 70 | 0.705882 |
4a1a7d0ea611db492931467cc0f853c3adbc334e | 631 | py | Python | encoding.py | Hydrazer/vyxal-2.4.1 | fc377aeba95928cfbf7c2aa5cf98961948c09d9a | [
"MIT"
] | 1 | 2021-05-26T02:00:14.000Z | 2021-05-26T02:00:14.000Z | encoding.py | Command-Master/Vyxal | 2a1fd535c786dcbce2796360931c994438777cca | [
"MIT"
] | null | null | null | encoding.py | Command-Master/Vyxal | 2a1fd535c786dcbce2796360931c994438777cca | [
"MIT"
] | null | null | null | from commands import codepage
import string
def vyxal_to_utf8(code):
# Taken from the old 05AB1E interpreter
processed_code = ""
for char in code:
processed_code += codepage[char]
return processed_code
def utf8_to_vyxal(code):
# Taken from the old 05AB1E interpreter
processed_code = ""... | 25.24 | 52 | 0.713154 |
4a1a7e003a3969eec1c8ad2c8d85b621112b8886 | 3,001 | py | Python | plugins/yahoo_weather.1h.py | longpdo/bitbar-plugins-custom | 58cff1571ae4a939f7edac9c42fcd1156e3c8661 | [
"MIT"
] | 4 | 2020-07-08T23:47:51.000Z | 2021-04-15T12:03:08.000Z | plugins/yahoo_weather.1h.py | longpdo/bitbar-plugins-custom | 58cff1571ae4a939f7edac9c42fcd1156e3c8661 | [
"MIT"
] | null | null | null | plugins/yahoo_weather.1h.py | longpdo/bitbar-plugins-custom | 58cff1571ae4a939f7edac9c42fcd1156e3c8661 | [
"MIT"
] | 3 | 2020-07-08T23:48:29.000Z | 2021-03-17T07:37:02.000Z | #!/usr/bin/env LC_ALL=en_US.UTF-8 /usr/local/bin/python3
#
# <bitbar.title>Yahoo Weather</bitbar.title>
# <bitbar.version>v3.0</bitbar.version>
# <bitbar.author>mgjo5899</bitbar.author>
# <bitbar.author.github>mgjo5899</bitbar.author.github>
# <bitbar.desc>It tells you the current weather condition of the location wher... | 33.344444 | 261 | 0.681106 |
4a1a7e4c7a135a427fa569ff73aa4b12532b9faf | 37,568 | py | Python | chia/wallet/wallet_node.py | Kaieida/bluepool | 88feb12da64673815ff20c503e497b28fa9f9b82 | [
"Apache-2.0"
] | 15 | 2021-06-05T00:53:48.000Z | 2021-06-22T10:33:40.000Z | chia/wallet/wallet_node.py | Kaieida/bluepool | 88feb12da64673815ff20c503e497b28fa9f9b82 | [
"Apache-2.0"
] | 24 | 2021-06-06T16:50:33.000Z | 2021-08-31T19:14:09.000Z | chia/wallet/wallet_node.py | Kaieida/bluepool | 88feb12da64673815ff20c503e497b28fa9f9b82 | [
"Apache-2.0"
] | 13 | 2021-06-06T13:21:27.000Z | 2021-12-31T01:34:59.000Z | import asyncio
import json
import logging
import socket
import time
import traceback
from pathlib import Path
from typing import Callable, Dict, List, Optional, Set, Tuple, Union
from blspy import PrivateKey
from chia.consensus.block_record import BlockRecord
from chia.consensus.constants import ConsensusConstants
fr... | 42.885845 | 119 | 0.594575 |
4a1a7f1f20cc46c762d68b98e026daece631e120 | 2,613 | py | Python | duckietown_rl/gym_duckietown/envs/multimap_env.py | rizavelioglu/AIDO-CITEC | 97f4d8564dc6eb743063a7902a8932a429349c04 | [
"MIT"
] | 18 | 2020-08-31T11:30:41.000Z | 2022-02-15T07:35:12.000Z | duckietown_rl/gym_duckietown/envs/multimap_env.py | rizavelioglu/AIDO-CITEC | 97f4d8564dc6eb743063a7902a8932a429349c04 | [
"MIT"
] | 5 | 2020-09-27T02:15:56.000Z | 2022-01-23T17:56:24.000Z | duckietown_rl/gym_duckietown/envs/multimap_env.py | rizavelioglu/AIDO-CITEC | 97f4d8564dc6eb743063a7902a8932a429349c04 | [
"MIT"
] | 21 | 2020-04-28T16:38:01.000Z | 2021-11-16T14:21:08.000Z | # coding=utf-8
import os
import gym
from .duckietown_env import DuckietownEnv
from ..utils import get_subdir_path
class MultiMapEnv(gym.Env):
"""
Environment which samples from multiple environments, for
multi-taks learning
"""
def __init__(self, **kwargs):
self.env_list = []
map... | 26.13 | 73 | 0.600459 |
4a1a800e7b1ec1c3c27bddad5ff399926f8f1d70 | 4,168 | py | Python | wordnet2neo4j.py | sergey-zarealye-com/wordnet2neo4j | 2e97dda005549d60f284f851a2e6432f9a71422f | [
"Apache-2.0"
] | null | null | null | wordnet2neo4j.py | sergey-zarealye-com/wordnet2neo4j | 2e97dda005549d60f284f851a2e6432f9a71422f | [
"Apache-2.0"
] | null | null | null | wordnet2neo4j.py | sergey-zarealye-com/wordnet2neo4j | 2e97dda005549d60f284f851a2e6432f9a71422f | [
"Apache-2.0"
] | 3 | 2016-07-01T19:05:39.000Z | 2020-04-01T17:28:23.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 15:03:08 2015
@author: sergey, comcon1
Example usage:
NOUNS
-i dict/data.noun --neo4j bolt://127.0.0.1:7687 --nodelabel Enwordnet --reltype Pointer --limit 1000
VERBS
-i dict/data.verb --neo4j bolt://127.0.0.1:7687 --nodelabel Enwordnet --reltype Pointer --limit 1000... | 32.818898 | 100 | 0.5 |
4a1a802518ab8315af45466eec97e5dfda31e5d7 | 1,147 | py | Python | tests/test_provider_gavinbunney_kubectl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_gavinbunney_kubectl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_gavinbunney_kubectl.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_gavinbunney_kubectl.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:20:27 UTC)
def test_provider_import():
import terrascript.provider.gavinbunney.kubectl
def test_resource_import():
from terrascript.resource.gavinbunney.kubectl import kubectl_manifest
from terra... | 31 | 80 | 0.787271 |
4a1a8028bee7a7c47ec7a99a8e7eb8965401d944 | 11,230 | py | Python | caer/io/resize.py | brccabral/caer | 2ddb84095202aa98224b04612eff9e97c8680309 | [
"MIT"
] | null | null | null | caer/io/resize.py | brccabral/caer | 2ddb84095202aa98224b04612eff9e97c8680309 | [
"MIT"
] | null | null | null | caer/io/resize.py | brccabral/caer | 2ddb84095202aa98224b04612eff9e97c8680309 | [
"MIT"
] | null | null | null | # _____ ______ _____
# / ____/ /\ | ____ | __ \
# | | / \ | |__ | |__) | Caer - Modern Computer Vision
# | | / /\ \ | __| | _ / Languages: Python, C, C++, Cuda
# | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer
# \_____\/_/ \_ \______ |_| \_\
# Lic... | 37.811448 | 270 | 0.634907 |
4a1a81945766d3bfa7a4bdf301ebfca34eb81973 | 12,840 | py | Python | gibson/gibson/envs/minitaur_env.py | joel99/midlevel-reps | f0b4a4d8ccf09a0488cd18af24723172aff99446 | [
"MIT"
] | 120 | 2019-04-22T04:45:28.000Z | 2022-03-23T01:53:17.000Z | gibson/envs/minitaur_env.py | bradleyemi/GibsonEnv | 30c2b54c29e8561fc5b5127cb4bdb08ef6869299 | [
"MIT"
] | 14 | 2019-06-12T08:21:21.000Z | 2021-08-25T15:36:58.000Z | gibson/envs/minitaur_env.py | bradleyemi/GibsonEnv | 30c2b54c29e8561fc5b5127cb4bdb08ef6869299 | [
"MIT"
] | 19 | 2019-06-19T07:00:36.000Z | 2022-03-24T07:18:30.000Z | '''
Customized Minitaur Environment for Cambria
Author: Zhiyang He, Stanford University
Original: Pybullet
Note that in the original pybullet environment, major difference exist in simulation
accuracy.
Original:
Solver iterations: 300 (Major difference)
Time step: 1/100.0
Action repeat: 1
Original Accurat... | 37.988166 | 114 | 0.648442 |
4a1a81a27d9347befdb44374a33456f35cc5bcd1 | 2,189 | py | Python | deeprob/spn/utils/statistics.py | deeprob-org/deeprob-kit | c46050eb8047dcfa0cc2420887624184c042e32e | [
"MIT"
] | 38 | 2021-09-27T11:39:23.000Z | 2022-02-09T15:33:44.000Z | deeprob/spn/utils/statistics.py | deeprob-org/deeprob-kit | c46050eb8047dcfa0cc2420887624184c042e32e | [
"MIT"
] | 14 | 2021-09-27T15:04:46.000Z | 2021-12-08T21:08:01.000Z | deeprob/spn/utils/statistics.py | deeprob-org/deeprob-kit | c46050eb8047dcfa0cc2420887624184c042e32e | [
"MIT"
] | 3 | 2021-09-30T08:05:06.000Z | 2022-01-02T04:44:19.000Z | # MIT License: Copyright (c) 2021 Lorenzo Loconte, Gennaro Gala
from deeprob.spn.structure.leaf import Leaf
from deeprob.spn.structure.node import Node, Sum, Product, bfs
from deeprob.spn.utils.filter import collect_nodes, filter_nodes_by_type
def compute_statistics(root: Node) -> dict:
"""
Compute some stat... | 30.830986 | 83 | 0.66423 |
4a1a81ea5908d97445ea0eab3151ee37164ae532 | 2,048 | py | Python | sandbox/src1/TCSE3-3rd-examples/src/py/intro/loop4simviz2.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 5 | 2016-05-28T14:12:28.000Z | 2021-04-22T10:23:12.000Z | sandbox/src1/TCSE3-3rd-examples/src/py/intro/loop4simviz2.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | null | null | null | sandbox/src1/TCSE3-3rd-examples/src/py/intro/loop4simviz2.py | sniemi/SamPy | e048756feca67197cf5f995afd7d75d8286e017b | [
"BSD-2-Clause"
] | 2 | 2015-07-13T10:04:10.000Z | 2021-04-22T10:23:23.000Z | #!/usr/bin/env python
"""
As loop4simviz1.py, but here we call simviz2.py, make movies,
and also allow any simviz2.py option to be varied in a loop.
"""
import sys, os, commands
usage = 'Usage: %s parameter min max increment '\
'[ simviz2.py options ]' % sys.argv[0]
try:
option_name = sys.argv[1]
min = ... | 35.310345 | 62 | 0.643066 |
4a1a8531b4f4c89cf1764ca0c5bd8ed8443a1df5 | 4,171 | py | Python | modules/kmeans_vector_quantizer.py | lahiruts/Online-Speech-Recognition | 6f1b231d6cdd164505a612b008d60120547f0f87 | [
"Apache-2.0"
] | 201 | 2020-06-15T15:48:12.000Z | 2021-02-02T04:25:31.000Z | modules/kmeans_vector_quantizer.py | lahiruts/Online-Speech-Recognition | 6f1b231d6cdd164505a612b008d60120547f0f87 | [
"Apache-2.0"
] | 14 | 2021-02-03T00:33:08.000Z | 2021-11-14T13:19:25.000Z | modules/kmeans_vector_quantizer.py | lahiruts/Online-Speech-Recognition | 6f1b231d6cdd164505a612b008d60120547f0f87 | [
"Apache-2.0"
] | 25 | 2020-06-22T15:46:25.000Z | 2021-01-21T15:31:07.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
from modules.group_norm import Fp32GroupNorm
class KmeansVectorQuantizer(nn.Module):
def __init__(
... | 33.103175 | 83 | 0.572525 |
4a1a858bad6a74755ef95024f907938d5bb202b2 | 1,122 | py | Python | testTordu.py | icarito/guy | 9477b548b91ae81bfc327dac7ba1ec80804f4f8d | [
"Apache-2.0"
] | null | null | null | testTordu.py | icarito/guy | 9477b548b91ae81bfc327dac7ba1ec80804f4f8d | [
"Apache-2.0"
] | null | null | null | testTordu.py | icarito/guy | 9477b548b91ae81bfc327dac7ba1ec80804f4f8d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from guy import Guy
from datetime import datetime
class Simplest(Guy):
size=(200,200)
__doc__="""
<h1>Hello</h1>
<button style="float:right;font-size:2em" onclick="self.exit()">X</button>
"""
class Tordu(Guy):
size=(200,400)
__doc__="""
<... | 23.375 | 78 | 0.612299 |
4a1a859b30ba8ea78451d9ec57adb117cf92c1e4 | 7,352 | py | Python | flink-python/pyflink/ml/tests/test_pipeline_it_case.py | mnmhouse/flink | 8b05cbee4425c5ee33d73bed1473e075d7e17387 | [
"Apache-2.0"
] | 41 | 2018-11-14T04:05:42.000Z | 2022-02-09T10:39:23.000Z | flink-python/pyflink/ml/tests/test_pipeline_it_case.py | mnmhouse/flink | 8b05cbee4425c5ee33d73bed1473e075d7e17387 | [
"Apache-2.0"
] | 15 | 2021-06-13T18:06:12.000Z | 2022-02-09T22:40:04.000Z | flink-python/pyflink/ml/tests/test_pipeline_it_case.py | fantasticKe/flink | c42ad0fcbcd5f2666952ee3fc4763490915091f6 | [
"Apache-2.0"
] | 16 | 2019-01-04T09:19:03.000Z | 2022-01-10T14:34:31.000Z | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 39.106383 | 94 | 0.646763 |
4a1a86089297721a5a0bdd05581ba2df4e0ba508 | 7,223 | py | Python | mir_driver/nodes/laithlin_move.py | K-F-P/mir_robot | 1c2a4f2efbe20f2bc6eabf8ea7d0528ac50363c6 | [
"BSD-3-Clause"
] | null | null | null | mir_driver/nodes/laithlin_move.py | K-F-P/mir_robot | 1c2a4f2efbe20f2bc6eabf8ea7d0528ac50363c6 | [
"BSD-3-Clause"
] | null | null | null | mir_driver/nodes/laithlin_move.py | K-F-P/mir_robot | 1c2a4f2efbe20f2bc6eabf8ea7d0528ac50363c6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import rospy
import sys
import argparse
import numpy
import time
import geometry_msgs.msg as gm
from move_base_msgs.msg import MoveBaseActionFeedback, MoveBaseActionGoal, MoveBaseActionResult, MoveBaseFeedback, MoveBaseResult
from std_msgs.msg import String
from geometry_msgs.msg import Pose, P... | 23.759868 | 129 | 0.637685 |
4a1a862653498fe786d568cbe7d3bd9bdeb70bf0 | 3,536 | py | Python | pydeconz/api.py | klada/deconz | 485e915822404d292156ff2a83488954e1ed8286 | [
"MIT"
] | null | null | null | pydeconz/api.py | klada/deconz | 485e915822404d292156ff2a83488954e1ed8286 | [
"MIT"
] | null | null | null | pydeconz/api.py | klada/deconz | 485e915822404d292156ff2a83488954e1ed8286 | [
"MIT"
] | null | null | null | """API base classes."""
import logging
from asyncio import get_running_loop
from .errors import BridgeBusy
LOGGER = logging.getLogger(__name__)
class APIItems:
"""Base class for a map of API Items."""
def __init__(self, raw, request, path, item_cls) -> None:
self._request = request
self._... | 26.38806 | 95 | 0.580034 |
4a1a86ff341aa444b877c8289a2416a952f0e606 | 12,278 | py | Python | hw/dendogram/cluster.py | colonel8377/hkust_machine_learning | 80d880a8bd6a0139d5d5409000f836900855b0ba | [
"MIT"
] | 3 | 2021-09-14T11:45:08.000Z | 2022-03-24T14:15:45.000Z | hw/dendogram/cluster.py | colonel8377/hkust_machine_learning | 80d880a8bd6a0139d5d5409000f836900855b0ba | [
"MIT"
] | 1 | 2021-11-02T09:05:03.000Z | 2021-11-02T09:05:03.000Z | hw/dendogram/cluster.py | colonel8377/hkust_machine_learning | 80d880a8bd6a0139d5d5409000f836900855b0ba | [
"MIT"
] | 2 | 2021-09-04T12:04:47.000Z | 2021-09-29T02:22:27.000Z | from __future__ import division
from __future__ import absolute_import
import numpy
import copy
import argparse
from operator import itemgetter
from collections import defaultdict
from itertools import combinations, product
import numpy as np
from api import AbstractClusterer
from dendrogram import Dendrogram
from ... | 37.895062 | 94 | 0.586252 |
4a1a878c105a5271a80e688070f9672278848e49 | 3,816 | py | Python | simulation/src/simulation_evaluation/src/state_machine/states/overtaking.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 13 | 2020-06-30T17:18:28.000Z | 2021-07-20T16:55:35.000Z | simulation/src/simulation_evaluation/src/state_machine/states/overtaking.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 1 | 2020-11-10T20:15:42.000Z | 2020-12-25T18:27:56.000Z | simulation/src/simulation_evaluation/src/state_machine/states/overtaking.py | LeonardII/KitCarFork | b2802c5b08cc8250446ce3731cb622af064db4ca | [
"MIT"
] | 3 | 2020-07-20T09:09:08.000Z | 2021-07-20T17:00:37.000Z | """States used in the OvertakingStateMachine."""
from simulation_evaluation.msg import Speaker as SpeakerMsg
from simulation_evaluation.msg import State as StateMsg
from ..state_machines.state_machine import StateMachine
from .state import State
class OvertakingState(State):
def next(self, state_machine, input_... | 31.02439 | 91 | 0.650419 |
4a1a888d255abe1228513fb6d10c8eee86b438f5 | 28,225 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_04_01/aio/operations/_route_filter_rules_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.22242 | 221 | 0.673056 |
4a1a8897b1cd7eebc62ab1f33dd53b52c384ae1b | 6,591 | py | Python | link-prediction/GIC/GIC/execute_link.py | Super-Dainiu/DATA130007.01-Community-Detection-Link-Prediction-and-Node-Classification-on-Ego-Facebook-and-Cites | 1b5077342756ba6dc587a2af49abd2451319e5df | [
"MIT"
] | 3 | 2021-07-04T04:32:33.000Z | 2022-01-14T08:36:02.000Z | link-prediction/GIC/GIC/execute_link.py | super-dainiu/DATA130007.01-Community-Detection-Link-Prediction-and-Node-Classification-on-Ego-Facebook-and-Cites | 1b5077342756ba6dc587a2af49abd2451319e5df | [
"MIT"
] | null | null | null | link-prediction/GIC/GIC/execute_link.py | super-dainiu/DATA130007.01-Community-Detection-Link-Prediction-and-Node-Classification-on-Ego-Facebook-and-Cites | 1b5077342756ba6dc587a2af49abd2451319e5df | [
"MIT"
] | 1 | 2022-01-16T11:35:45.000Z | 2022-01-16T11:35:45.000Z | "Implementation based on https://github.com/PetarV-/DGI"
import numpy as np
import scipy.sparse as sp
import torch
import torch.nn as nn
from models import GIC, LogReg
from utils import process
from sklearn.metrics import roc_auc_score
from sklearn.metrics import average_precision_score
import statistics
import arg... | 29.959091 | 124 | 0.572144 |
4a1a8d0153e92b0a5c2ef7b848d1c01db85feb86 | 74 | py | Python | learn2learn/optim/update_rules/__init__.py | Brikwerk/learn2learn | 7997c13c26ec627d13ce77ba98427260df78ada8 | [
"MIT"
] | 1,774 | 2019-09-05T20:41:16.000Z | 2022-03-30T09:49:02.000Z | learn2learn/optim/update_rules/__init__.py | Kostis-S-Z/learn2learn | c0b7c088f15986880b136ec27059644ac513db60 | [
"MIT"
] | 196 | 2019-09-05T08:11:31.000Z | 2022-03-31T12:08:25.000Z | learn2learn/optim/update_rules/__init__.py | Kostis-S-Z/learn2learn | c0b7c088f15986880b136ec27059644ac513db60 | [
"MIT"
] | 266 | 2019-09-13T10:17:54.000Z | 2022-03-28T07:17:21.000Z | #!/usr/bin/env python3
from .differentiable_sgd import DifferentiableSGD
| 18.5 | 49 | 0.824324 |
4a1a8e797922624e7b5fb7b664574c388ac12d78 | 1,172 | py | Python | core/voice.py | xe1gyq/NuupXe | 94608ac72bb1cf3e648c27d8402831dfb165b8af | [
"Apache-2.0"
] | null | null | null | core/voice.py | xe1gyq/NuupXe | 94608ac72bb1cf3e648c27d8402831dfb165b8af | [
"Apache-2.0"
] | null | null | null | core/voice.py | xe1gyq/NuupXe | 94608ac72bb1cf3e648c27d8402831dfb165b8af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import commands
import subprocess
import time
from core.irlp import Irlp
class Voice(object):
def __init__(self):
self.filename = "voice.wav"
self.proc = None
self.irlp = Irlp()
def filenameset(self, name):
self.filename = name
def recordstart(self):
... | 23.44 | 84 | 0.558874 |
4a1a8ed453fb5f8b2da73333682c640adac71a20 | 3,189 | py | Python | kuryr_kubernetes/handlers/k8s_base.py | al1216/kuryr-kubernetes | e21d2f3d8bc12384fb2e352e024e2637c523b1e3 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/handlers/k8s_base.py | al1216/kuryr-kubernetes | e21d2f3d8bc12384fb2e352e024e2637c523b1e3 | [
"Apache-2.0"
] | 1 | 2021-04-16T11:12:00.000Z | 2021-04-16T11:12:00.000Z | kuryr_kubernetes/handlers/k8s_base.py | al1216/kuryr-kubernetes | e21d2f3d8bc12384fb2e352e024e2637c523b1e3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Mirantis, Inc.
# 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 requir... | 29.527778 | 78 | 0.648793 |
4a1a8f0f2090f2cc961ba72a704d399369517e0d | 878 | py | Python | Deep-Learning/Licence_Plate_Recognition/character_segmentation.py | ghassenetanabene6/Vehicle-Recognition-System-in-Tunisia | 3d34d8ca535f73a0be4107483c0cc7fcfa1806b3 | [
"CNRI-Python"
] | 3 | 2020-07-08T10:25:00.000Z | 2021-06-19T16:24:48.000Z | Deep-Learning/Licence_Plate_Recognition/character_segmentation.py | ghassenetanabene6/Vehicle-Recognition-System-in-Tunisia | 3d34d8ca535f73a0be4107483c0cc7fcfa1806b3 | [
"CNRI-Python"
] | null | null | null | Deep-Learning/Licence_Plate_Recognition/character_segmentation.py | ghassenetanabene6/Vehicle-Recognition-System-in-Tunisia | 3d34d8ca535f73a0be4107483c0cc7fcfa1806b3 | [
"CNRI-Python"
] | 2 | 2020-07-20T14:14:27.000Z | 2021-08-28T06:24:01.000Z | # Find characters in the resulting images
def segment_characters(image) :
# Preprocess cropped license plate image
img = cv2.resize(image, (333, 75))
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
_, img_binary = cv2.threshold(img_gray, 200, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)
img_erode = cv2... | 31.357143 | 88 | 0.697039 |
4a1a902f5e2c8fa225633af27feb573ba35259d6 | 2,498 | py | Python | nanoblocks/wallet/wallet.py | ipazc/nanoblocks | d7433b60029e4bcda4c2c802c3ff05c53d7b220a | [
"MIT"
] | 3 | 2021-03-16T23:59:37.000Z | 2021-12-11T13:52:46.000Z | nanoblocks/wallet/wallet.py | ipazc/nanoblocks | d7433b60029e4bcda4c2c802c3ff05c53d7b220a | [
"MIT"
] | 1 | 2021-04-02T14:11:02.000Z | 2021-06-16T00:03:33.000Z | nanoblocks/wallet/wallet.py | ipazc/nanoblocks | d7433b60029e4bcda4c2c802c3ff05c53d7b220a | [
"MIT"
] | null | null | null | from nanoblocks.base import NanoblocksClass
from nanoblocks.protocol.crypto.crypto_functions import make_seed, derive_seed, derive_bip39, fill_bip39_words
from nanoblocks.wallet.wallet_accounts import WalletAccounts
class Wallet(NanoblocksClass):
"""
Represents a Wallet in the Nano ecosystem.
This is cla... | 29.388235 | 115 | 0.644516 |
4a1a90866677bb7a30d8106651c53c91f9ab4dca | 3,026 | py | Python | meiduo3/apps/users/migrations/0001_initial.py | caoyongpeng/CYP_meiduo | 378cc05a8621b36dc15714a10258606860bb5ad2 | [
"MIT"
] | null | null | null | meiduo3/apps/users/migrations/0001_initial.py | caoyongpeng/CYP_meiduo | 378cc05a8621b36dc15714a10258606860bb5ad2 | [
"MIT"
] | null | null | null | meiduo3/apps/users/migrations/0001_initial.py | caoyongpeng/CYP_meiduo | 378cc05a8621b36dc15714a10258606860bb5ad2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-10-20 08:21
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 63.041667 | 329 | 0.66226 |
4a1a91d353a7ac7abd5afa1066c881ea1e33c751 | 1,810 | py | Python | customers/migrations/0001_initial.py | chorna/taxi24 | 09e174a0cb3b9543ca4987e60cd0d37ecda6ac3c | [
"MIT"
] | null | null | null | customers/migrations/0001_initial.py | chorna/taxi24 | 09e174a0cb3b9543ca4987e60cd0d37ecda6ac3c | [
"MIT"
] | null | null | null | customers/migrations/0001_initial.py | chorna/taxi24 | 09e174a0cb3b9543ca4987e60cd0d37ecda6ac3c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-11 04:16
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('drivers', '0002_cab_vehicle'),
]
operations = [
migrations.CreateModel(
... | 42.093023 | 182 | 0.596133 |
4a1a92a68aa930168528884f5808a4870e3e74c8 | 2,271 | py | Python | bak/nasa_ngrams.py | NorthDecoder/nasaMining | 81706cb9e48d9469b27314123a4f7b6e063f033e | [
"MIT"
] | 18 | 2015-04-16T03:12:57.000Z | 2021-08-20T08:07:23.000Z | bak/nasa_ngrams.py | jonroberts/nasaMining | 32680b58de9111dfa714e355dbc79de3faba59c3 | [
"MIT"
] | 17 | 2021-05-25T23:45:19.000Z | 2022-03-31T22:55:06.000Z | bak/nasa_ngrams.py | NorthDecoder/nasaMining | 81706cb9e48d9469b27314123a4f7b6e063f033e | [
"MIT"
] | 12 | 2015-04-14T20:21:57.000Z | 2021-05-12T22:01:53.000Z | from __future__ import unicode_literals
import json
from gensim.models.phrases import Phrases
from textblob import TextBlob
# from gensim: threshold represents a threshold for forming the phrases (higher means fewer phrases).
# A phrase of words a and b is accepted if (cnt(a, b) - min_count) * N / (cnt(a) * cnt(b)) >... | 29.881579 | 141 | 0.639806 |
4a1a9305f053139b4890f03eaf9f50e093973bce | 1,165 | py | Python | src/airing.py | punkhere/HerokuAnimeDLBot | 90c0e34577d50981f4180f218b91f9bb7ad78a72 | [
"MIT"
] | null | null | null | src/airing.py | punkhere/HerokuAnimeDLBot | 90c0e34577d50981f4180f218b91f9bb7ad78a72 | [
"MIT"
] | null | null | null | src/airing.py | punkhere/HerokuAnimeDLBot | 90c0e34577d50981f4180f218b91f9bb7ad78a72 | [
"MIT"
] | null | null | null | # Copyright © 2021 BaraniARR
# Encoding = 'utf-8'
# Licensed under MIT License
# Special Thanks for gogoanime
from pyrogram import *
from pyrogram.types import *
import requests
from requests_html import HTMLSession
from bs4 import BeautifulSoup
import sys
# Getting currently airing Anime from the API
# Returns an "I... | 32.361111 | 96 | 0.671245 |
4a1a940984c95031184ed3256dbf5cad58a1f7fe | 1,150 | py | Python | 6/6.py | dvento/projectEuler | 3debbc9453ae50166a91b990145418f3c26fced8 | [
"MIT"
] | null | null | null | 6/6.py | dvento/projectEuler | 3debbc9453ae50166a91b990145418f3c26fced8 | [
"MIT"
] | null | null | null | 6/6.py | dvento/projectEuler | 3debbc9453ae50166a91b990145418f3c26fced8 | [
"MIT"
] | null | null | null | # coding=utf-8
'''
Daniel Vento, 2020
PROBLEM #6:
The sum of the squares of the first ten natural numbers is,
1^2 + 2^2 + ... + 10^2 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ... + 10)^2 = 55^2 = 3025
Hence the difference between the sum of the squares of the first ten natural numbers... | 28.75 | 159 | 0.66 |
4a1a940ad1729b93c4de0d6cd1355d5abcc91c68 | 724 | py | Python | examples/CNCEncoderPad/layers/layer0.py | lesley-byte/pykey | ce21b5b6c0da938bf24891e5acb196d6779c433a | [
"MIT"
] | null | null | null | examples/CNCEncoderPad/layers/layer0.py | lesley-byte/pykey | ce21b5b6c0da938bf24891e5acb196d6779c433a | [
"MIT"
] | null | null | null | examples/CNCEncoderPad/layers/layer0.py | lesley-byte/pykey | ce21b5b6c0da938bf24891e5acb196d6779c433a | [
"MIT"
] | null | null | null | from pykey.keycode import PK_Keycode as KC # REQUIRED if using KC.* values
layer = { # REQUIRED dict, must be named 'layer'
'name' : 'Layer 0', # Application name
'encoder' : [ (0x202000, 'LEFT', [ KC.LEFT ]),
(0x202000, 'RIGHT',[ KC.RIGHT ])
],
'macros' : [ ... | 34.47619 | 74 | 0.453039 |
4a1a964338ba2191de4113e3263f76536df807c8 | 2,445 | py | Python | python/tvm/exec/rpc_tracker.py | janifer112x/incubator-tvm | 98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6 | [
"Apache-2.0"
] | 40 | 2021-06-14T23:14:46.000Z | 2022-03-21T14:32:23.000Z | python/tvm/exec/rpc_tracker.py | janifer112x/incubator-tvm | 98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6 | [
"Apache-2.0"
] | 14 | 2021-06-08T03:15:54.000Z | 2022-02-01T23:50:24.000Z | python/tvm/exec/rpc_tracker.py | janifer112x/incubator-tvm | 98c2096f4944bdbdbbb2b7b20ccd35c6c11dfbf6 | [
"Apache-2.0"
] | 11 | 2021-06-14T05:56:18.000Z | 2022-02-27T06:52:07.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.809524 | 100 | 0.685072 |
4a1a96d339e935eb446e26650691412d21a90fd0 | 447 | py | Python | code_week10_629_75/pascals_triangle_ii.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week10_629_75/pascals_triangle_ii.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | code_week10_629_75/pascals_triangle_ii.py | dylanlee101/leetcode | b059afdadb83d504e62afd1227107de0b59557af | [
"Apache-2.0"
] | null | null | null | '''
给定一个非负索引 k,其中 k ≤ 33,返回杨辉三角的第 k 行。
在杨辉三角中,每个数是它左上方和右上方的数的和。
示例:
输入: 3
输出: [1,3,3,1]
进阶:
你可以优化你的算法到 O(k) 空间复杂度吗?
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/pascals-triangle-ii
'''
class Solution:
def getRow(self, rowIndex: int) -> List[int]:
row = [1 for _ in range(rowIndex+1)]
fo... | 17.88 | 55 | 0.579418 |
4a1a9716a9976e844b69083435237d3f29d0a98d | 3,530 | py | Python | app/template_db/template_engine/model_handler/utils.py | Plawn/petit_publipost_gateway | e0a09207ae5bcad1623f8e7662e004ad9b59ffbe | [
"Apache-2.0"
] | null | null | null | app/template_db/template_engine/model_handler/utils.py | Plawn/petit_publipost_gateway | e0a09207ae5bcad1623f8e7662e004ad9b59ffbe | [
"Apache-2.0"
] | 7 | 2021-06-22T09:48:59.000Z | 2022-01-10T16:08:00.000Z | app/template_db/template_engine/model_handler/utils.py | Plawn/petit_publiposter | e0a09207ae5bcad1623f8e7662e004ad9b59ffbe | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from collections.abc import Mapping
from typing import Any, Dict, Iterable, List, Set, Tuple, Callable
from ..adapter_middleware import MultiAdapter
class FallbackAction(ABC):
def __init__(self, field_name: str, replacer: MultiAdapter):
self.field_name = field_name
... | 29.416667 | 92 | 0.57932 |
4a1a97a393eba06d6fa6498ac5afd499e0b8a29d | 3,778 | py | Python | automl/cloud-client/get_model_evaluation.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-09-19T04:22:52.000Z | 2020-09-23T14:04:17.000Z | automl/cloud-client/get_model_evaluation.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 1 | 2020-07-24T19:18:29.000Z | 2020-07-24T19:45:23.000Z | automl/cloud-client/get_model_evaluation.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-11-24T18:20:51.000Z | 2020-12-12T12:21:52.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 40.623656 | 79 | 0.750926 |
4a1a97e4d96a38157a2896fd70e283df8e7f63ff | 16,311 | py | Python | codebuddy.py | davidfurlong/CodeBuddy | eb76272987c187a8cd18547348b5fc1fd3009fa3 | [
"MIT"
] | 1 | 2015-12-06T23:53:24.000Z | 2015-12-06T23:53:24.000Z | codebuddy.py | davidfurlong/CodeBuddy | eb76272987c187a8cd18547348b5fc1fd3009fa3 | [
"MIT"
] | null | null | null | codebuddy.py | davidfurlong/CodeBuddy | eb76272987c187a8cd18547348b5fc1fd3009fa3 | [
"MIT"
] | null | null | null | import sublime, sublime_plugin, math, random
# GNU License Copyright David Furlong
# Used some Scrolling code from
# https://github.com/zzjin/syncViewScroll
# which is licensed under GNU
# Copyright (C) 2012 Tito Bouzout <tito.bouzout@gmail.com>
# TODOS: Auto Language detection + comment syntax {}
# Find, Search, Rep... | 50.187692 | 515 | 0.68414 |
4a1a97f286f12baacd82d676d7147ad0f559e5bf | 2,585 | py | Python | bench/benchmark/bm.py | gaaalmeida/trab_benchmark | 4e42c6c34b6859050b792cefcad9627ecc5906bd | [
"MIT"
] | null | null | null | bench/benchmark/bm.py | gaaalmeida/trab_benchmark | 4e42c6c34b6859050b792cefcad9627ecc5906bd | [
"MIT"
] | null | null | null | bench/benchmark/bm.py | gaaalmeida/trab_benchmark | 4e42c6c34b6859050b792cefcad9627ecc5906bd | [
"MIT"
] | null | null | null | from queue import Queue
from threading import Thread
import pandas as pd
import time
import codecs
import os
import numpy as np
_time = [0,0,0]
_words = []
_tf = False
_size = 0
_finished = False
def setup_words(cv):
global _words
for _ in range(cv):
_words.append([0])
def clearResults(names):
for name ... | 23.935185 | 113 | 0.57911 |
4a1a980a5355306d5714ee31ec2949c436e3f816 | 7,390 | py | Python | user_manager/tests.py | MOOCworkbench/MOOCworkbench | c478dd4f185c50e0a48319e2b30d418533c32a34 | [
"MIT"
] | null | null | null | user_manager/tests.py | MOOCworkbench/MOOCworkbench | c478dd4f185c50e0a48319e2b30d418533c32a34 | [
"MIT"
] | 1 | 2017-07-09T17:38:21.000Z | 2017-07-09T17:38:22.000Z | user_manager/tests.py | MOOCworkbench/MOOCworkbench | c478dd4f185c50e0a48319e2b30d418533c32a34 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.core.management import call_command
from django.shortcuts import reverse
from django.test import Client, TestCase
from dataschema_manager.models import DataSchema
from experiments_manager.models import Experiment
from git_manager.models import GitRepository
from ... | 43.216374 | 91 | 0.623951 |
4a1a98cf424d148f2ae09bad11a3b81f6039a3b8 | 2,952 | py | Python | ops.py | mato00/TFAN_HS_Segmentation | 21e95fdcbec8b2c06909bc8cb99cb87727a9da6f | [
"MIT"
] | 1 | 2021-07-14T01:36:38.000Z | 2021-07-14T01:36:38.000Z | ops.py | mato00/TFAN_HS_Segmentation | 21e95fdcbec8b2c06909bc8cb99cb87727a9da6f | [
"MIT"
] | null | null | null | ops.py | mato00/TFAN_HS_Segmentation | 21e95fdcbec8b2c06909bc8cb99cb87727a9da6f | [
"MIT"
] | null | null | null | import math
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tensorflow.python.framework import ops
import tensorflow.contrib.layers as tflayers
from utils import *
from ncausalconv import *
def batch_norm(input, is_training=True, name="batch_norm"):
x = tflayers.batch_norm(... | 42.171429 | 120 | 0.629065 |
4a1a99c2f5752f2cefa22247417a3ba3df8f57d8 | 563 | py | Python | deployments/migrations/0018_auto_20200319_0431.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 11 | 2018-06-11T06:05:12.000Z | 2022-03-25T09:31:44.000Z | deployments/migrations/0018_auto_20200319_0431.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 498 | 2017-11-07T21:20:13.000Z | 2022-03-31T14:37:18.000Z | deployments/migrations/0018_auto_20200319_0431.py | IFRCGo/ifrcgo-api | c1c3e0cf1076ab48d03db6aaf7a00f8485ca9e1a | [
"MIT"
] | 6 | 2018-04-11T13:29:50.000Z | 2020-07-16T16:52:11.000Z | # Generated by Django 2.0.12 on 2020-03-19 04:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('deployments', '0017_auto_20200122_1434'),
]
operations = [
migrations.AlterField(
model_name='... | 28.15 | 178 | 0.667851 |
4a1a9a16bab51ac31347cc052307597a4e91d441 | 6,888 | py | Python | tensorflow_probability/python/distributions/vector_laplace_diag_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/vector_laplace_diag_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/vector_laplace_diag_test.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | 36.444444 | 78 | 0.634146 |
4a1a9a1d21a4a56185df933b79061d6e57745d67 | 27,646 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2021-12-07T13:43:54.000Z | 2021-12-07T13:43:54.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2019-10-14T19:43:52.000Z | 2019-10-14T19:43:52.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_detect_language_async.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import platform
import functools
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.pipeline.t... | 44.2336 | 141 | 0.653657 |
4a1a9a27bb1a4b82e7e785fa4cbafe968a1c3547 | 626 | py | Python | runs/par-nobro-iter00600.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/par-nobro-iter00600.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/par-nobro-iter00600.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/par-nobro-iter00600.result.csv'
# Source computers for the requests
SOURCE = ['10.0.0.1']
# Should Bro be enabled on the source machines?
SOURCE_BRO = [False]
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# Should Bro be enabled on the target mac... | 21.586207 | 68 | 0.722045 |
4a1a9a3a8ddbff60a412ac97623216b4d3f845c0 | 20,540 | py | Python | vino_nsyss2020/utils/GPU_models.py | onurbarut/Encrypted_Malware_Detection | 2d2323c1e9ea3313b76bc2e37b68a9126587c6cd | [
"Apache-2.0"
] | 1 | 2022-02-25T00:50:35.000Z | 2022-02-25T00:50:35.000Z | vino_nsyss2020/utils/GPU_models.py | onurbarut/Encrypted_Malware_Detection | 2d2323c1e9ea3313b76bc2e37b68a9126587c6cd | [
"Apache-2.0"
] | 1 | 2022-03-12T01:15:51.000Z | 2022-03-23T07:34:58.000Z | vino_nsyss2020/utils/GPU_models.py | onurbarut/Encrypted_Malware_Detection | 2d2323c1e9ea3313b76bc2e37b68a9126587c6cd | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
from tensorflow.keras.utils import plot_model
from tensorflow.keras.models import Sequential, Model, model_from_json
from tensorflow.keras.layers import Input, Dense, Dropout, BatchNormalization, Flatten, Conv1D, MaxPooling1D, Conv2D, MaxPooling2D
def one_hot(y_, n_classes=N... | 42.702703 | 130 | 0.558179 |
4a1a9a7064fbb1b719f52728ae7cfe44c41c3b47 | 2,928 | py | Python | test_seirmodel.py | tomkooij/covid19 | a7d8a5781ed84b4a59652fc4575c15679de7898a | [
"MIT"
] | 6 | 2020-09-27T17:21:23.000Z | 2022-02-06T11:20:48.000Z | test_seirmodel.py | tomkooij/covid19 | a7d8a5781ed84b4a59652fc4575c15679de7898a | [
"MIT"
] | 3 | 2020-11-23T13:44:31.000Z | 2021-07-10T20:10:38.000Z | test_seirmodel.py | tomkooij/covid19 | a7d8a5781ed84b4a59652fc4575c15679de7898a | [
"MIT"
] | 5 | 2020-11-23T13:29:59.000Z | 2021-12-25T02:23:32.000Z | """Test cases for code validation."""
import numpy as np
import pandas as pd
from seirmodel import EpidemyModel
def test_EpidemyModel():
"""Test case"""
em = EpidemyModel(
R=2, T_lat=2.2, T_i2h=3.5, T_i2d=5.4,
ihr=0.1, ifr=0.01, dispersion=0.0)
# print(list(em.estate.labels))
expec... | 33.655172 | 73 | 0.486339 |
4a1a9abc02e8fa90f470512daf2d6d720873bc83 | 3,494 | py | Python | retired/old_version/original/example/servers/Speech.py | gecko-robotics/pygecko | a809593a894d8e591e992455a01aa73d8f7b7981 | [
"MIT"
] | 3 | 2019-06-13T07:52:12.000Z | 2020-07-05T13:28:43.000Z | retired/old_version/original/example/servers/Speech.py | walchko/pygecko | a809593a894d8e591e992455a01aa73d8f7b7981 | [
"MIT"
] | 23 | 2017-07-07T01:29:33.000Z | 2018-11-23T18:41:08.000Z | retired/old_version/original/example/servers/Speech.py | MomsFriendlyRobotCompany/pygecko | a809593a894d8e591e992455a01aa73d8f7b7981 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
import logging # logging
import multiprocessing as mp # multiprocess
import pygecko.lib.ZmqClass as zmq
from pygecko.TTS import TTS
from pygecko.Chatbot import Chatbot
import speech_recognition
class SphinxServer(mp.Pro... | 27.296875 | 106 | 0.68403 |
4a1a9ae27be80cada7cfcf91702da5726f58f2ad | 1,445 | py | Python | extensions/jisho.py | TuxedoDiscord/TuxedoBot | 77536b34c6778f3c97353c777cca5cd325bc16d3 | [
"MIT"
] | 5 | 2017-11-23T06:39:14.000Z | 2018-02-05T16:03:26.000Z | extensions/jisho.py | TuxedoDiscord/TuxedoBot | 77536b34c6778f3c97353c777cca5cd325bc16d3 | [
"MIT"
] | 11 | 2018-02-09T18:46:15.000Z | 2018-04-12T19:05:11.000Z | extensions/jisho.py | TuxedoDiscord/TuxedoBot | 77536b34c6778f3c97353c777cca5cd325bc16d3 | [
"MIT"
] | 7 | 2017-11-21T20:58:26.000Z | 2018-02-05T14:50:52.000Z | #!/usr/bin/env python3
"""jisho.org query command."""
import urllib.parse
import requests
import discord
from discord.ext import commands
BASE_URL = "http://jisho.org/api/v1/search/words"
class Jisho:
"""A Japanese translation command."""
@commands.command(aliases=["jp"])
async def jisho(self, ctx, q... | 31.413043 | 90 | 0.595156 |
4a1a9bac9d341358010e679e800f98f1451c2093 | 26,510 | py | Python | pysolar/util.py | matthistuff/Decaying-Shelters-Rhino | 38f5669f34da886bf4740f7fcaa9383872a1bf5b | [
"MIT"
] | null | null | null | pysolar/util.py | matthistuff/Decaying-Shelters-Rhino | 38f5669f34da886bf4740f7fcaa9383872a1bf5b | [
"MIT"
] | 1 | 2019-04-23T02:25:54.000Z | 2019-04-23T12:41:50.000Z | pysolar/util.py | matthistuff/Decaying-Shelters-Rhino | 38f5669f34da886bf4740f7fcaa9383872a1bf5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2009-2010 Brandon Stafford
#
# This file is part of Pysolar.
#
# Pysolar 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 versio... | 39.626308 | 266 | 0.646247 |
4a1a9c316c33e460b47bee597d85a4509e9b9544 | 3,254 | py | Python | dataset.py | atkirtland/pyffe | f6788a70ed495fb7dd3721ad2f8fc876cd09ca13 | [
"MIT"
] | null | null | null | dataset.py | atkirtland/pyffe | f6788a70ed495fb7dd3721ad2f8fc876cd09ca13 | [
"MIT"
] | null | null | null | dataset.py | atkirtland/pyffe | f6788a70ed495fb7dd3721ad2f8fc876cd09ca13 | [
"MIT"
] | null | null | null | import os
from collections import Counter
import numpy as np
import pandas as pd
import pyffe
# DataSubset is DEPRECATED
class DataSubset(object):
def __init__(self, parent, list_file_name):
self.parent = parent
self.list_file = list_file_name
self.list_name = os.path.splitext(self.list_fi... | 31.592233 | 93 | 0.588814 |
4a1a9d557c880d2fceee02a71c80cbc939374dcd | 5,902 | py | Python | pybat/cli/commands/get.py | lslap/pybat | 72fcc703c095ab9841e8b13845c1bea780f02904 | [
"MIT"
] | null | null | null | pybat/cli/commands/get.py | lslap/pybat | 72fcc703c095ab9841e8b13845c1bea780f02904 | [
"MIT"
] | null | null | null | pybat/cli/commands/get.py | lslap/pybat | 72fcc703c095ab9841e8b13845c1bea780f02904 | [
"MIT"
] | null | null | null | # Encoding: UTF-8
# Copyright (c) Marnik Bercx, University of Antwerp
# Distributed under the terms of the MIT License
import os
import pdb
from pybat.core import Cathode, DimerNEBAnalysis
from pymatgen import Structure
from pymatgen.io.vasp.outputs import Outcar
from pymatgen.analysis.transition_state import NEBAnal... | 32.251366 | 79 | 0.659268 |
4a1a9dd890766579078b4b73f34ba0e798ec9fc2 | 1,735 | py | Python | autres/gestion-des-mots-de-passe.py | ehbc221/apprenez-a-programmer-en-python | 16ed3ba8b914b77a576ef18a34702179acb25338 | [
"MIT"
] | null | null | null | autres/gestion-des-mots-de-passe.py | ehbc221/apprenez-a-programmer-en-python | 16ed3ba8b914b77a576ef18a34702179acb25338 | [
"MIT"
] | null | null | null | autres/gestion-des-mots-de-passe.py | ehbc221/apprenez-a-programmer-en-python | 16ed3ba8b914b77a576ef18a34702179acb25338 | [
"MIT"
] | null | null | null | # -*-coding:Utf-8 -*
########################################################
# Réceptionner un mot de passe saisi par l'utilisateur #
########################################################
from getpass import getpass
mot_de_passe = getpass("Tapez votre mot de passe : ")
############################
# Chiffrer un ... | 34.019608 | 221 | 0.637464 |
4a1a9f173226a6f677f68c6553ed2c29e67eb448 | 342 | py | Python | src/main.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 3 | 2020-01-14T04:47:32.000Z | 2020-09-10T17:57:20.000Z | src/main.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 5 | 2020-01-14T06:06:35.000Z | 2020-02-19T01:01:33.000Z | src/main.py | codestrange/cool-compiler-2020 | 30508965d75a1a1d1362d0b51bef8da3978fd0c2 | [
"MIT"
] | 3 | 2020-01-14T04:58:24.000Z | 2020-01-14T16:23:41.000Z | from os import system
from sys import argv
INPUT_FILE = argv[1]
OUTPUT_FILE = f"{INPUT_FILE[0: -2]}mips"
print("CodeStrange Cool Compiler v0.1")
print(
"Copyright (c) 2020: "
+ "Carlos Bermudez Porto, "
+ "Leynier Gutiérrez González, "
+ "Tony Raúl Blanco Fernández"
)
system(f"python coolc.py {INPUT_... | 21.375 | 53 | 0.687135 |
4a1aa0f55bb3dcf4ddcef486719549b7ebb8e53d | 1,025 | py | Python | Archive/appendix/Atari/baseline-QR-DQN/utils.py | uncharted-technologies/risk-and-uncertainty | d6bc518ebd3a661d3de6f298588bec5cc4c96e96 | [
"MIT"
] | 19 | 2019-05-28T14:30:23.000Z | 2022-03-31T03:14:31.000Z | Archive/appendix/Atari/baseline-QR-DQN/utils.py | uncharted-technologies/risk-and-uncertainty | d6bc518ebd3a661d3de6f298588bec5cc4c96e96 | [
"MIT"
] | 4 | 2021-06-08T20:30:58.000Z | 2022-03-12T00:02:29.000Z | Archive/appendix/Atari/baseline-QR-DQN/utils.py | uncharted-technologies/risk-and-uncertainty | d6bc518ebd3a661d3de6f298588bec5cc4c96e96 | [
"MIT"
] | 3 | 2019-07-20T14:40:03.000Z | 2021-02-26T04:09:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
import numpy as np
import torch
def set_global_seed(seed, env):
torch.manual_seed(seed)
env.seed(seed)
np.random.seed(seed)
random.seed(seed)
def quantile_huber_loss(x,y, device, kappa=1):
batch_size = x.shape[0]
num_quant = x.... | 24.404762 | 84 | 0.626341 |
4a1aa14630751a073bb1bf18454d0489502307b9 | 2,017 | py | Python | AutomatedSpearPhisher/CommonFrame.py | tejarrpaladagu/phisher | ddfcc10820d6c995a44e7d7c302b5df860140480 | [
"MIT"
] | 3 | 2021-06-28T19:37:04.000Z | 2022-03-18T23:27:53.000Z | AutomatedSpearPhisher/CommonFrame.py | tejarrpaladagu/phisher | ddfcc10820d6c995a44e7d7c302b5df860140480 | [
"MIT"
] | null | null | null | AutomatedSpearPhisher/CommonFrame.py | tejarrpaladagu/phisher | ddfcc10820d6c995a44e7d7c302b5df860140480 | [
"MIT"
] | 4 | 2021-04-22T17:50:20.000Z | 2021-08-13T01:57:38.000Z | from tkinter import Frame, PhotoImage, Label
from warnings import warn
from time import strftime
# Common Frame with header and footer
class CommonFrame(Frame):
def __init__(self, parent):
Frame.__init__(self, parent, bg='#0077e6')
self.createHeading()
self.createFooter()
self.tick ... | 35.385965 | 119 | 0.653941 |
4a1aa29b784174e35a2142b053855a39049f072e | 2,665 | py | Python | wolframclient/serializers/encoders/datetime.py | WolframResearch/WolframClientForPython | 27cffef560eea8d16c02fe4086f42363604284b6 | [
"MIT"
] | 358 | 2018-10-18T13:39:48.000Z | 2022-03-26T09:42:53.000Z | wolframclient/serializers/encoders/datetime.py | WolframResearch/WolframClientForPython | 27cffef560eea8d16c02fe4086f42363604284b6 | [
"MIT"
] | 29 | 2018-10-20T09:04:12.000Z | 2022-03-06T18:36:19.000Z | wolframclient/serializers/encoders/datetime.py | LaudateCorpus1/WolframClientForPython | 26f7fa3d81691ba2a63d3eadcd9734b261130b7c | [
"MIT"
] | 38 | 2018-10-19T21:52:14.000Z | 2021-11-21T13:07:04.000Z | from __future__ import absolute_import, print_function, unicode_literals
import datetime
from wolframclient.utils.dispatch import Dispatch
encoder = Dispatch()
@encoder.dispatch(datetime.datetime)
def encode_datetime(serializer, o):
return serializer.serialize_function(
serializer.serialize_symbol(b"Da... | 29.94382 | 91 | 0.605253 |
4a1aa2d9a44249a405091a6c5891bcf0418bb906 | 6,275 | py | Python | src/hackeme/frontend/hackeme_parser.py | ThomasBollmeier/hackeme-native | 1bd9eac3eb057661045bcc1a612f8fc704f6d809 | [
"Apache-2.0"
] | null | null | null | src/hackeme/frontend/hackeme_parser.py | ThomasBollmeier/hackeme-native | 1bd9eac3eb057661045bcc1a612f8fc704f6d809 | [
"Apache-2.0"
] | null | null | null | src/hackeme/frontend/hackeme_parser.py | ThomasBollmeier/hackeme-native | 1bd9eac3eb057661045bcc1a612f8fc704f6d809 | [
"Apache-2.0"
] | null | null | null | from .hackeme_base_parser import HackemeBaseParser
from komparse import Ast
class HackemeParser(HackemeBaseParser):
def __init__(self):
HackemeBaseParser.__init__(self)
self._init_transformations()
def parse(self, source):
ast = HackemeBaseParser.parse(self, source)
if ast:
... | 30.31401 | 76 | 0.567649 |
4a1aa32d3c14b1be6a9b5623dbfba181e538efc0 | 2,367 | py | Python | doc/scripts/docgen.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 2,045 | 2015-01-01T14:07:52.000Z | 2022-03-08T08:56:41.000Z | doc/scripts/docgen.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 305 | 2015-01-02T13:18:24.000Z | 2021-08-20T18:03:28.000Z | doc/scripts/docgen.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 976 | 2015-01-01T17:08:51.000Z | 2022-03-25T19:53:17.000Z |
from __future__ import print_function
from collections import defaultdict
import inspect
import getopt
import os
import shutil
import sys
if __name__ == '__main__':
throot = "/".join(sys.path[0].split("/")[:-2])
options = defaultdict(bool)
options.update(dict([x, y or True] for x, y in getopt.getopt(s... | 32.424658 | 133 | 0.538657 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.