hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a1d0a9e739d5a5dc64a86da53c971b24b0c6fcbb | 690 | py | Python | 2020/Day-25/Combo_Breaker/solve_1.py | sreekesari-vangeepuram/aoc-2020 | 645531be0208affe042ac0328105b9ef3cfc9dbf | [
"MIT"
] | 1 | 2021-07-09T07:56:14.000Z | 2021-07-09T07:56:14.000Z | 2020/Day-25/Combo_Breaker/solve_1.py | sreekesari-vangeepuram/adventofcode | 645531be0208affe042ac0328105b9ef3cfc9dbf | [
"MIT"
] | null | null | null | 2020/Day-25/Combo_Breaker/solve_1.py | sreekesari-vangeepuram/adventofcode | 645531be0208affe042ac0328105b9ef3cfc9dbf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# card_pubkey, door_pubkey = map(int, open("input.txt").read().strip().split("\n"))
# card_pubkey, door_pubkey = 13316116, 13651422 # Obtained from `sample.txt`
# prime = 20201227
# ****************************************************** #
# Hard-coding numbers insted of assigning to variables ... | 38.333333 | 83 | 0.572464 |
79db868f495fc646639a46aa8462b89b08957630 | 1,071 | py | Python | ckanext-hdx_service_checker/ckanext/hdx_service_checker/plugin.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckanext-hdx_service_checker/ckanext/hdx_service_checker/plugin.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckanext-hdx_service_checker/ckanext/hdx_service_checker/plugin.py | OCHA-DAP/hdx-ckan | 202e0c44adc4ea8d0b90141e69365b65cce68672 | [
"Apache-2.0"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import ckanext.hdx_service_checker.actions.get as actions
import ckanext.hdx_service_checker.actions.authorize as authorize
import ckanext.hdx_service_checker.views.run_checks as run_checks
class HdxServiceCheckerPlugin(plugins.SingletonPlugin):
... | 28.945946 | 66 | 0.728291 |
433355584f4c2c8f126dd107c5f7775ae9ee3e1b | 513 | py | Python | workshops/migrations/0123_auto_20161218_0538.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2015-04-03T20:26:56.000Z | 2015-04-03T20:26:56.000Z | workshops/migrations/0123_auto_20161218_0538.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | 1 | 2019-12-13T11:22:47.000Z | 2019-12-13T11:22:47.000Z | workshops/migrations/0123_auto_20161218_0538.py | tracykteal/amy | cb19e318d36b880b1c3be2104efff42ef776118a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2016-12-18 10:38
from __future__ import unicode_literals
import datetime
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0122_auto_20161101_1441'),
]
... | 22.304348 | 64 | 0.647173 |
35ef3bff44aed1459841d876209c7f5e16a551ed | 1,694 | py | Python | doc/integrations/pytorch/setup.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2020-09-27T05:00:06.000Z | 2020-09-27T05:00:06.000Z | doc/integrations/pytorch/setup.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-08-04T11:17:39.000Z | 2021-08-04T11:17:39.000Z | doc/integrations/pytorch/setup.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-05-03T13:27:14.000Z | 2021-05-03T13:27:14.000Z | #!/usr/bin/env python3
# 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 sys
from setuptools import setup, find_packages
VERSION = '1.2.0' # if you update, update parlai/_... | 32.576923 | 87 | 0.582645 |
c8685702a89531b79bdbe5c3cbd4c7341001b001 | 2,807 | py | Python | src/pygerber/renderer/arc_util_mixin.py | Argmaster/pygerber | 4761a5aa60ff1d11512fb44aabd103246d9a3019 | [
"MIT"
] | 3 | 2021-08-30T07:07:59.000Z | 2021-09-29T22:14:43.000Z | src/pygerber/renderer/arc_util_mixin.py | Argmaster/pygerber | 4761a5aa60ff1d11512fb44aabd103246d9a3019 | [
"MIT"
] | 1 | 2021-09-26T13:28:49.000Z | 2021-09-26T13:28:49.000Z | src/pygerber/renderer/arc_util_mixin.py | Argmaster/pygerber | 4761a5aa60ff1d11512fb44aabd103246d9a3019 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import annotations
from math import cos, degrees, radians, sin, tau
from pygerber.mathclasses import Vector2D, angle_from_zero
from pygerber.renderer.spec import ArcSpec
class ArcUtilMixin:
@property
def isCCW(self):
return self.renderer.isCCW()
def get_b... | 34.231707 | 87 | 0.652298 |
23db8ac90743a7d88fedbec6801eb22b36b1a9d7 | 16,379 | py | Python | tensorflow/python/ops/gradients_impl.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/gradients_impl.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/gradients_impl.py | fraudies/tensorflow | a42423e302b71893bbd24aa896869941013c07fb | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.361111 | 84 | 0.707674 |
dddb2768657f9c78531a9ac7a7303bc1043bf7fd | 23,280 | py | Python | Tea/vendored/aiohttp/web_protocol.py | yndu13/tea-python | 6a23fbf6c1dd3b60103251b4740cbfac4de2de7e | [
"Apache-2.0"
] | null | null | null | Tea/vendored/aiohttp/web_protocol.py | yndu13/tea-python | 6a23fbf6c1dd3b60103251b4740cbfac4de2de7e | [
"Apache-2.0"
] | null | null | null | Tea/vendored/aiohttp/web_protocol.py | yndu13/tea-python | 6a23fbf6c1dd3b60103251b4740cbfac4de2de7e | [
"Apache-2.0"
] | null | null | null | import asyncio
import asyncio.streams
import traceback
import warnings
from collections import deque
from contextlib import suppress
from html import escape as html_escape
from http import HTTPStatus
from logging import Logger
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Optional, Tuple, Type, cast
impo... | 34.850299 | 88 | 0.582861 |
66b5763ae851aa07864ad8c740f3bb241f113001 | 305 | py | Python | src/sentry_wxwork/forms.py | liangxg787/sentry-for-wxwork | 192123496b1e5c4fa61de0c1c0742e786826ff5c | [
"MIT"
] | null | null | null | src/sentry_wxwork/forms.py | liangxg787/sentry-for-wxwork | 192123496b1e5c4fa61de0c1c0742e786826ff5c | [
"MIT"
] | 1 | 2022-01-28T03:46:17.000Z | 2022-01-28T03:46:17.000Z | src/sentry_wxwork/forms.py | liangxg787/sentry-for-wxwork | 192123496b1e5c4fa61de0c1c0742e786826ff5c | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
@Time : 2022/1/20 2:34 PM
@Author : xiaoguangliang
@File : forms.py
@Project : sentry-for-wxwork
"""
from django import forms
class WxWorkOptionsForm(forms.Form):
access_token = forms.CharField(
max_length=255,
help_text='WxWork robot access_token'
)
| 19.0625 | 45 | 0.662295 |
3631465d918cb98dc5eb3be2da7388a4b389cdff | 1,014 | py | Python | src/Python/Tutorial/Basic/rgbd_tum.py | cnheider/Open3D | eb0267dee7c50a824d4f94e9bd0f18dccbd3eb5d | [
"MIT"
] | 1 | 2019-01-26T05:41:10.000Z | 2019-01-26T05:41:10.000Z | src/Python/Tutorial/Basic/rgbd_tum.py | fate3439/open3D | 2698eac71993ad135acc17b5115d700735517197 | [
"MIT"
] | null | null | null | src/Python/Tutorial/Basic/rgbd_tum.py | fate3439/open3D | 2698eac71993ad135acc17b5115d700735517197 | [
"MIT"
] | 1 | 2021-01-31T07:02:30.000Z | 2021-01-31T07:02:30.000Z | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
#conda install pillow matplotlib
from open3d import *
import matplotlib.pyplot as plt
if __name__ == "__main__":
print("Read TUM dataset")
color_raw = read_image("../../TestData/RGBD/other_formats/TUM_colo... | 36.214286 | 80 | 0.698225 |
06108a962903f6503895af7355f92731c41bd052 | 400 | py | Python | plugins/addtodb.py | mrcentimetre/gpytranslator-bot | d3a77a58e3e0a8ff098f16dd74af2559c242e5f4 | [
"MIT"
] | 14 | 2021-03-05T19:35:29.000Z | 2021-11-08T09:52:18.000Z | plugins/addtodb.py | telegrambotdev/gpytranslator-bot | a762b16da45ed2e8bc27f6f36a821b796a44951a | [
"MIT"
] | 7 | 2021-03-07T02:32:28.000Z | 2021-11-14T21:04:54.000Z | plugins/addtodb.py | telegrambotdev/gpytranslator-bot | a762b16da45ed2e8bc27f6f36a821b796a44951a | [
"MIT"
] | 19 | 2021-03-06T03:27:54.000Z | 2021-12-01T15:17:43.000Z | from pyrogram import Client, filters
from pyrogram.types import Message
from db import functions as db
@Client.on_message(filters.private, group=-1)
async def check_chat(bot: Client, message: Message):
chat_id = message.chat.id
check_if_chat_exists = await db.chat_exists(chat_id)
if not check_if_chat_exis... | 30.769231 | 56 | 0.7475 |
3d30e892e3a81ef8299a341cee65a3491ab93f47 | 15,844 | py | Python | hctiws.py | zms21/hctiws | a416e42a18625d2c69477932db582c661df0c954 | [
"MIT"
] | 1 | 2018-05-07T07:57:53.000Z | 2018-05-07T07:57:53.000Z | hctiws.py | zms21/hctiws | a416e42a18625d2c69477932db582c661df0c954 | [
"MIT"
] | null | null | null | hctiws.py | zms21/hctiws | a416e42a18625d2c69477932db582c661df0c954 | [
"MIT"
] | null | null | null | import sys
import os
import csv
import toml
import xlrd
from PIL import Image, ImageFont, ImageDraw
def find_file(filename, style_dir=""):
"""Finding file in possible directories"""
tmp_filename = os.path.join(INPUT_DIR, filename)
if os.path.exists(tmp_filename):
return tmp_filename
... | 40.940568 | 99 | 0.558129 |
365176a746d2ab43a529b5ae19852239f2c1e03c | 7,568 | py | Python | src/models/gru.py | geektoni/concept-tagging-with-neural-networks | 6b2d3360cb21348b83063eac35acb8a2af95ed75 | [
"Apache-2.0"
] | 7 | 2019-04-21T05:45:05.000Z | 2021-12-14T11:42:22.000Z | src/models/gru.py | geektoni/concept-tagging-with-neural-networks | 6b2d3360cb21348b83063eac35acb8a2af95ed75 | [
"Apache-2.0"
] | null | null | null | src/models/gru.py | geektoni/concept-tagging-with-neural-networks | 6b2d3360cb21348b83063eac35acb8a2af95ed75 | [
"Apache-2.0"
] | 6 | 2019-03-04T12:53:34.000Z | 2021-04-27T09:18:24.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import data_manager
class GRU(nn.Module):
def __init__(self, device, w2v_weights, hidden_dim, tagset_size, drop_rate, bidirectional=False,
freeze=True, embedding_norm=10., c2v_weights=None, pad_word_length=16):
"""
... | 47.898734 | 127 | 0.614693 |
0cb0e57fb70a629d8ca57c63a409172ee21bbd64 | 10,743 | py | Python | lib/model/config.py | zmskye/pytorch-faster-rcnn | bb66361d8f922b456261014e2b13c29cddd5ebd4 | [
"MIT"
] | null | null | null | lib/model/config.py | zmskye/pytorch-faster-rcnn | bb66361d8f922b456261014e2b13c29cddd5ebd4 | [
"MIT"
] | null | null | null | lib/model/config.py | zmskye/pytorch-faster-rcnn | bb66361d8f922b456261014e2b13c29cddd5ebd4 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config im... | 28.049608 | 91 | 0.725403 |
05d7599f192967af4d5d9833c5eef9c41a523860 | 7,066 | py | Python | conf.py | brianjo/pygallery | d256c59b7ff7f21a5d484c80e3db159d82f94239 | [
"BSD-3-Clause"
] | 1 | 2019-07-24T18:19:42.000Z | 2019-07-24T18:19:42.000Z | conf.py | brianjo/pygallery | d256c59b7ff7f21a5d484c80e3db159d82f94239 | [
"BSD-3-Clause"
] | 4 | 2020-12-02T18:36:32.000Z | 2022-03-11T23:34:54.000Z | conf.py | brianjo/pygallery | d256c59b7ff7f21a5d484c80e3db159d82f94239 | [
"BSD-3-Clause"
] | 13 | 2019-06-22T19:27:40.000Z | 2021-11-09T07:30:46.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch Tutorials documentation build configuration file, created by
# sphinx-quickstart on Wed Mar 8 22:38:10 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | 30.721739 | 96 | 0.689499 |
d415e8992aabb799a1cd7639a7e5f3ccddde25cb | 29,705 | py | Python | meerk40t/gui/scenewidgets/guidewidget.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | meerk40t/gui/scenewidgets/guidewidget.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | meerk40t/gui/scenewidgets/guidewidget.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | import math
import wx
from meerk40t.core.units import Length
from meerk40t.gui.laserrender import DRAW_MODE_GUIDES
from meerk40t.gui.scene.sceneconst import HITCHAIN_HIT, RESPONSE_CHAIN, RESPONSE_CONSUME
from meerk40t.gui.scene.widget import Widget
class GuideWidget(Widget):
"""
Interface Widget
Guidel... | 40.196211 | 165 | 0.512237 |
317d22ed42be0326c7736e813f9180c3a9516f7b | 1,224 | py | Python | economy/commands/deposit.py | Ful5hii/SkellyMod | 97eec5af646cf868107c3cdb67b271e8be65e87a | [
"MIT"
] | 3 | 2022-02-09T18:25:22.000Z | 2022-02-22T14:49:22.000Z | economy/commands/deposit.py | Ful5hii/SkellyMod | 97eec5af646cf868107c3cdb67b271e8be65e87a | [
"MIT"
] | 1 | 2022-02-12T12:15:37.000Z | 2022-02-12T12:15:37.000Z | economy/commands/deposit.py | Skelly1301/BeeMod | 97eec5af646cf868107c3cdb67b271e8be65e87a | [
"MIT"
] | null | null | null | @bot.command(aliases=['dep'])
async def deposit(ctx,amount = None):
await open_account(ctx.author)
if amount == None:
em = discord.Embed(title="Please enter an amount", color=discord.Color.teal())
await ctx.reply(embed=em)
return
bal = await update_bank(ctx.author)
amount=int(... | 31.384615 | 97 | 0.64134 |
71f51cf9aac99993b7ee1f72c64c1e6d88bfbc20 | 4,438 | py | Python | scripts/dominated.py | snurk/meta-strains | 0e43871afeba312bd3fc3b39936b03597a2820dc | [
"MIT"
] | null | null | null | scripts/dominated.py | snurk/meta-strains | 0e43871afeba312bd3fc3b39936b03597a2820dc | [
"MIT"
] | null | null | null | scripts/dominated.py | snurk/meta-strains | 0e43871afeba312bd3fc3b39936b03597a2820dc | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import os
# import seaborn as sns
import warnings
import scipy
import scipy.cluster
warnings.filterwarnings('ignore')
import sys
def p2f(x):
# percents to float
if x == '-':
return None
else:
... | 28.632258 | 120 | 0.619198 |
92fdc1fdaf3e16888206dc2bf2725409b30d5d9c | 9,786 | py | Python | python/ccxt/foxbit.py | RusEu/ccxt | d6d2b3e2f54a59d102102ee2858eca4d6702fecc | [
"MIT"
] | 3 | 2021-06-29T16:27:19.000Z | 2021-07-18T08:36:07.000Z | python/ccxt/foxbit.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | python/ccxt/foxbit.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.precise import Precise
class foxbit(Exc... | 40.945607 | 135 | 0.504394 |
388c7ecc841cbfbd4dd6f29389c665b83e8c1839 | 1,600 | py | Python | api/tests/opentrons/protocol_engine/commands/test_load_pipette.py | Corey-ONeal/opentrons-app_ws-remote | a255b76c8a07457787d575da12b2d5bdb6220a91 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_engine/commands/test_load_pipette.py | Corey-ONeal/opentrons-app_ws-remote | a255b76c8a07457787d575da12b2d5bdb6220a91 | [
"Apache-2.0"
] | null | null | null | api/tests/opentrons/protocol_engine/commands/test_load_pipette.py | Corey-ONeal/opentrons-app_ws-remote | a255b76c8a07457787d575da12b2d5bdb6220a91 | [
"Apache-2.0"
] | null | null | null | """Test load pipette commands."""
from mock import AsyncMock # type: ignore[attr-defined]
from opentrons.types import MountType
from opentrons.protocol_engine.types import PipetteName
from opentrons.protocol_engine.execution import LoadedPipette
from opentrons.protocol_engine.commands import (
LoadPipetteRequest,... | 30.769231 | 77 | 0.729375 |
26b81653e71ca4f4e282b12aa87765f908bdf8e0 | 1,548 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_job_service_list_custom_jobs_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_job_service_list_custom_jobs_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_generated_aiplatform_v1beta1_job_service_list_custom_jobs_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"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... | 32.93617 | 85 | 0.76615 |
11c2f786fdfb21cc00e7cc1331bd09d987aeb053 | 3,713 | py | Python | flexget/utils/json.py | guillaumelamirand/Flexget | 51945105c253a64c079eb5a62680392ce9013794 | [
"MIT"
] | 2 | 2017-03-25T10:39:25.000Z | 2019-12-11T03:46:26.000Z | flexget/utils/json.py | guillaumelamirand/Flexget | 51945105c253a64c079eb5a62680392ce9013794 | [
"MIT"
] | null | null | null | flexget/utils/json.py | guillaumelamirand/Flexget | 51945105c253a64c079eb5a62680392ce9013794 | [
"MIT"
] | null | null | null | """
Helper module that can load whatever version of the json module is available.
Plugins can just import the methods from this module.
Also allows date and datetime objects to be encoded/decoded.
"""
import datetime
from flexget.plugin import DependencyError
try:
import simplejson as json
except ImportError:
... | 30.434426 | 118 | 0.623216 |
3ab46f72a22166367457872e618dda97b1177f15 | 553 | py | Python | clock/shifts/migrations/0004_shift_key.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | null | null | null | clock/shifts/migrations/0004_shift_key.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | null | null | null | clock/shifts/migrations/0004_shift_key.py | chgad/django-clock | f855cd1253574c0582ed53a0ac34206c242f04c9 | [
"MIT"
] | 1 | 2020-03-13T14:42:11.000Z | 2020-03-13T14:42:11.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-06-08 12:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shifts', '0003_shift_bool_finished'),
]
operations = [
migrations.AddField(
... | 26.333333 | 104 | 0.56962 |
b719fd643f77bed23220ba3bf652da81540bc5af | 865 | py | Python | python-threatexchange/threatexchange/signal_type/tests/test_tlsh_hash_and_match.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | 2 | 2021-04-04T19:52:32.000Z | 2021-07-12T15:53:29.000Z | python-threatexchange/threatexchange/signal_type/tests/test_tlsh_hash_and_match.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | null | null | null | python-threatexchange/threatexchange/signal_type/tests/test_tlsh_hash_and_match.py | crhird/ThreatExchange | bb1d80c414fd44fb94ade28dc332126da2db4e51 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from threatexchange.signal_type import tlsh_pdf
TEST_PDF_COMPLETE_TLSH = (
"T145B2859FE708266211A3026277C7AEE5FF76402C636AD5BA2C2CC11C23A1F2957773D5"
)
class TLSHHasherModuleUnitTest(unittest.TestCase):
def test_tlsh_from... | 37.608696 | 88 | 0.756069 |
5c4542f7405f15067732b7ae3ef929be611f6a1c | 2,890 | py | Python | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/GrantSagInstanceToVbrRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/GrantSagInstanceToVbrRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-smartag/aliyunsdksmartag/request/v20180313/GrantSagInstanceToVbrRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 39.054054 | 88 | 0.761938 |
58bb492d3afedce1826c50a50a0849ede1d732ba | 11,113 | py | Python | tools/build/test/link.py | lijgame/boost | ec2214a19cdddd1048058321a8105dd0231dac47 | [
"BSL-1.0"
] | 1 | 2018-12-15T19:57:24.000Z | 2018-12-15T19:57:24.000Z | thirdparty-cpp/boost_1_62_0/tools/build/test/link.py | nxplatform/nx-mobile | 0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5 | [
"Apache-2.0"
] | null | null | null | thirdparty-cpp/boost_1_62_0/tools/build/test/link.py | nxplatform/nx-mobile | 0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2014-2015 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Tests the link-directory rule used to create the
# common boost/ directory in the new git layout.
import Bo... | 33.173134 | 87 | 0.632233 |
aafafab425325678319f0ddba6a28351a784e5d6 | 1,174 | py | Python | Class 12/Python Programs/Stacks & Queues/stacks with class.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | Class 12/Python Programs/Stacks & Queues/stacks with class.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | Class 12/Python Programs/Stacks & Queues/stacks with class.py | edwardmasih/Python-School-Level | 545e8fcd87f540be2bbf01d3493bd84dd5504739 | [
"MIT"
] | null | null | null | class stack:
s=[]
def push(self):
a=input("Enter any number :")
stack.s.append(a)
def display(self):
if (stack.s==[]):
print("Stack Empty")
else:
l=len(stack.s)
for i in range(l-1,-1,-1):
print (stack.s[i])
d... | 26.681818 | 78 | 0.471891 |
24929a436ece3d781e5f57e2213df8c8998eb753 | 17,600 | py | Python | ERAN/tf_verify/deepg.py | ISCAS-PMC/deepg | 528beda0fb4e7381b3b64a26ff72a582e5754b58 | [
"Apache-2.0"
] | null | null | null | ERAN/tf_verify/deepg.py | ISCAS-PMC/deepg | 528beda0fb4e7381b3b64a26ff72a582e5754b58 | [
"Apache-2.0"
] | null | null | null | ERAN/tf_verify/deepg.py | ISCAS-PMC/deepg | 528beda0fb4e7381b3b64a26ff72a582e5754b58 | [
"Apache-2.0"
] | null | null | null | import argparse
import csv
import os
import copy
import numpy as np
import sys
import tensorflow as tf
from read_net_file import read_net
sys.path.insert(0, '../ELINA/python_interface/')
from eran import ERAN
from elina_coeff import *
from elina_linexpr0 import *
import time
EPS = 10**(-9)
n_rows, n_cols, n_channels =... | 44.783715 | 196 | 0.535625 |
56c153ddf68516fcf301d238de44b5c1aa00d098 | 15,611 | py | Python | .history/src/Simulador_20200711171152.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200711171152.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200711171152.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | 40.443005 | 170 | 0.652681 |
467cc39770037319aa8935bbd96bb39e69359504 | 3,323 | py | Python | src/pytorch_adapt/hooks/optimizer.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | 1 | 2021-12-15T19:36:01.000Z | 2021-12-15T19:36:01.000Z | src/pytorch_adapt/hooks/optimizer.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | null | null | null | src/pytorch_adapt/hooks/optimizer.py | MarkusSagen/pytorch-adapt | 947b9f1b748d2078cecbf4a00c34f73108d9ecde | [
"MIT"
] | null | null | null | from typing import Dict, List
import torch
from ..utils import common_functions as c_f
from ..weighters import BaseWeighter, MeanWeighter
from .base import BaseHook
from .reducers import BaseReducer, MeanReducer
class OptimizerHook(BaseHook):
"""
1. Executes the wrapped hook
2. Zeros all gradients
3... | 31.951923 | 89 | 0.605477 |
8989cb6c4d3fd8878724bcad4cc76856053623ba | 1,471 | py | Python | flashcards/admin.py | ubuntustan/nyumba-kumi | bb8c8b3159e16d6c246ff758764e858cfba3a864 | [
"MIT"
] | null | null | null | flashcards/admin.py | ubuntustan/nyumba-kumi | bb8c8b3159e16d6c246ff758764e858cfba3a864 | [
"MIT"
] | null | null | null | flashcards/admin.py | ubuntustan/nyumba-kumi | bb8c8b3159e16d6c246ff758764e858cfba3a864 | [
"MIT"
] | null | null | null | from django.contrib import admin
# Register your models here.
from django.contrib import admin
from .models import Card_Set, Card
def push_live(modeladmin, request, query_set):
'''
In the Action: dropdown on the Admin Panel -
Let's admin select multiple card sets at once to push to active
'''
rows... | 33.431818 | 133 | 0.719918 |
8c3d56027dec65b6f7f8fbb8e52003434c809cb5 | 210 | py | Python | ykdl/extractors/baidu/__init__.py | Miloxing/ykdl | 2d485cbb326327ad1d28c5cea4dffcace777032d | [
"MIT"
] | 3 | 2018-09-04T09:33:51.000Z | 2021-11-01T09:03:27.000Z | ykdl/extractors/baidu/__init__.py | MichioY/bilibiliupload | 623e0d06e6acb4b5f2c3d6291450f27bbf83667e | [
"MIT"
] | null | null | null | ykdl/extractors/baidu/__init__.py | MichioY/bilibiliupload | 623e0d06e6acb4b5f2c3d6291450f27bbf83667e | [
"MIT"
] | 1 | 2019-12-26T18:00:47.000Z | 2019-12-26T18:00:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
def get_extractor(url):
if re.search("music.baidu", url):
from . import music as s
return s.site
raise NotImplementedError(url)
| 19.090909 | 37 | 0.62381 |
e89f9ef0949b31f327818a84e967f8686269ad87 | 466 | py | Python | src/colusa/plugins/etr_cs_rutgers_edu.py | huuhoa/symphony | f8a364649634b4d864771b2c8a3103b714b6b9e2 | [
"MIT"
] | 6 | 2020-08-29T04:14:15.000Z | 2020-09-18T10:53:59.000Z | src/colusa/plugins/etr_cs_rutgers_edu.py | huuhoa/colusa | 07a0a60680c8085c5dca522e0237f7b5a5181dcb | [
"MIT"
] | 34 | 2021-09-07T15:17:38.000Z | 2022-03-25T15:16:40.000Z | src/colusa/plugins/etr_cs_rutgers_edu.py | huuhoa/colusa | 07a0a60680c8085c5dca522e0237f7b5a5181dcb | [
"MIT"
] | 2 | 2020-08-29T04:21:35.000Z | 2020-09-13T17:36:06.000Z | from colusa.etr import Extractor, register_extractor
@register_extractor('www.cs.rutgers.edu/~pxk/')
class CSRutgersEduExtractor(Extractor):
def _find_main_content(self):
return self.bs.find('div', attrs={'id': 'main'})
def cleanup(self):
self.remove_tag(self.main_content, 'div', attrs={'id':... | 35.846154 | 78 | 0.690987 |
f4ddf7606c78b2f28ef9729567af079d8545d686 | 15,955 | py | Python | aries_cloudagent/core/conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | 1 | 2021-01-15T01:04:43.000Z | 2021-01-15T01:04:43.000Z | aries_cloudagent/core/conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/core/conductor.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | 1 | 2021-01-15T01:04:31.000Z | 2021-01-15T01:04:31.000Z | """
The Conductor.
The conductor is responsible for coordinating messages that are received
over the network, communicating with the ledger, passing messages to handlers,
instantiating concrete implementations of required modules and storing data in the
wallet.
"""
import hashlib
import logging
from ..admin.base_se... | 39.00978 | 88 | 0.621561 |
5f7a60bba8beb66729f954e9ca2bdbe61a01003b | 22,107 | py | Python | tools/scons/scons-local-2.2.0/SCons/Executor.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | tools/scons/scons-local-2.2.0/SCons/Executor.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | tools/scons/scons-local-2.2.0/SCons/Executor.py | tristanpenman/gameutils | d4695922c6a8ba201a67fc8e5319da53e0d25323 | [
"BSD-2-Clause"
] | null | null | null | """SCons.Executor
A module for executing actions with specific lists of target and source
Nodes.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this soft... | 34.869085 | 108 | 0.59013 |
87b28dd04578ced725b110bb1e359f6a39bde056 | 7,246 | py | Python | apps/ticket/migrations/0001_initial.py | x315904752/loonflow | c65151916c6f5914e8edf50ae8350df53860c640 | [
"MIT"
] | null | null | null | apps/ticket/migrations/0001_initial.py | x315904752/loonflow | c65151916c6f5914e8edf50ae8350df53860c640 | [
"MIT"
] | null | null | null | apps/ticket/migrations/0001_initial.py | x315904752/loonflow | c65151916c6f5914e8edf50ae8350df53860c640 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2020-02-22 09:37
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='TicketCustomField',
fields=[
... | 73.191919 | 192 | 0.628209 |
4956d1589cc4535a73bcf5fbdc1448a03757d661 | 3,388 | py | Python | src/pynn/bin/decode_ctc.py | enesyugan/yapay-nn | b6e0740e7c1ae829abd7cd1bd447a172291538b1 | [
"Apache-2.0"
] | null | null | null | src/pynn/bin/decode_ctc.py | enesyugan/yapay-nn | b6e0740e7c1ae829abd7cd1bd447a172291538b1 | [
"Apache-2.0"
] | null | null | null | src/pynn/bin/decode_ctc.py | enesyugan/yapay-nn | b6e0740e7c1ae829abd7cd1bd447a172291538b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2019 Thai-Son Nguyen
# Licensed under the Apache License, Version 2.0 (the "License")
import time
import argparse
import torch
from pynn.util import load_object
from pynn.decoder.ctc import beam_search
from pynn.util.text import load_dict, write_hypo
from pynn.io... | 42.886076 | 91 | 0.674439 |
97f69381dc5f71b32069099a5c9932fdf36f9897 | 264 | py | Python | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 18/pizzeria/pizzerias/urls.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null |
"""定义pizzerias的url模式"""
from . import views
from django.conf.urls import url
urlpatterns = [
#主页
url(r'^$',views.index,name = 'index'),
#显示所有主题
url(r'^pizzas/$',views.pizzas,name = 'pizzas'),
url(r'^pizzas/(?P<pizza_id>\d+)/$',views.pizza,name = 'pizza'),
] | 22 | 64 | 0.647727 |
4954c1c5fbd9ec1404a785e2e866c6452534ef62 | 41,399 | py | Python | monai/apps/deepgrow/transforms.py | tatuanb/monai_V1 | 41e492b61c78bb3c303f38b03fe9fdc74a3c2e96 | [
"Apache-2.0"
] | 1 | 2020-11-13T23:13:23.000Z | 2020-11-13T23:13:23.000Z | monai/apps/deepgrow/transforms.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 2 | 2020-11-13T23:15:00.000Z | 2020-11-16T14:54:08.000Z | monai/apps/deepgrow/transforms.py | catherine1996cn/MONAI | ff9bbfa82763de46cbac75553e340633e3d84ecb | [
"Apache-2.0"
] | 1 | 2021-11-18T22:37:40.000Z | 2021-11-18T22:37:40.000Z | # Copyright 2020 - 2021 MONAI Consortium
# 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... | 44.041489 | 120 | 0.641392 |
1af3e3bbff860c59256992d72f2375654f57069a | 738 | py | Python | gu/delay.py | gf0842wf/gu | dff87afe1e51d636f69cd2d689a71a20360bb08a | [
"MIT"
] | 3 | 2015-03-15T12:15:33.000Z | 2015-03-15T12:20:00.000Z | gu/delay.py | gf0842wf/gu | dff87afe1e51d636f69cd2d689a71a20360bb08a | [
"MIT"
] | null | null | null | gu/delay.py | gf0842wf/gu | dff87afe1e51d636f69cd2d689a71a20360bb08a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""延时,循环,超时等gevent工具"""
import gevent
import time
import logging
logger = logging.getLogger(__name__)
class Timeout(gevent.Timeout):
def __init__(self, seconds=None, exception=None):
gevent.Timeout.__init__(self, seconds, exception)
self.start_time = None
def start(s... | 22.363636 | 57 | 0.612466 |
27e8499a052a60a0e43e570f24d4bd6eb82d7461 | 528 | py | Python | bad_mason/covid19getter.py | Mason-Lin/bad_mason | 1500e5b99c249ee14e55916bac280daf838e6413 | [
"MIT"
] | null | null | null | bad_mason/covid19getter.py | Mason-Lin/bad_mason | 1500e5b99c249ee14e55916bac280daf838e6413 | [
"MIT"
] | 1 | 2020-07-09T15:54:32.000Z | 2020-07-09T16:12:34.000Z | bad_mason/covid19getter.py | Mason-Lin/bad_mason | 1500e5b99c249ee14e55916bac280daf838e6413 | [
"MIT"
] | null | null | null | import subprocess
from pathlib import Path
from pprint import pprint
__all__ = ["get_covid19_data"]
def get_covid19_data():
# init_helper
helper_path = Path(__file__).absolute().parent.joinpath("datahelper.zip").resolve()
try:
subprocess.call(["py", f"{helper_path}"])
except FileNotFoundErro... | 21.12 | 87 | 0.653409 |
7bce53f879e4b13debc226ec8d2ead282d32a0da | 244 | py | Python | blog/sitemap.py | florent6001/django-simple-blog | a8a9a38ac16d2ac91698f5ca1247bcaa5db83ffd | [
"MIT"
] | 2 | 2020-03-17T12:42:56.000Z | 2020-04-19T12:10:02.000Z | blog/sitemap.py | florent6001/django-simple-blog | a8a9a38ac16d2ac91698f5ca1247bcaa5db83ffd | [
"MIT"
] | 9 | 2021-03-30T12:51:05.000Z | 2022-03-12T00:19:03.000Z | blog/sitemap.py | florent6001/django-simple-blog | a8a9a38ac16d2ac91698f5ca1247bcaa5db83ffd | [
"MIT"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from blog.models import Post, Category
class PostSitemap(Sitemap):
def items(self):
return Post.objects.all()
class CategorySitemap(Sitemap):
def items(self):
return Category.objects.all() | 20.333333 | 43 | 0.770492 |
d0a53f5f4a599a4201f63359ac6b78a34629ff7e | 3,589 | py | Python | monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | monitoring/google/cloud/monitoring_v3/proto/span_context_pb2.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/monitoring_v3/proto/span_context.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 34.84466 | 370 | 0.696851 |
f0c6b03a4d1927845ea56c58a2fcc3478357b29f | 709 | py | Python | 2019-11-19_0.py | yanorei32/trash | 0b489e1eef48c51a13d2644f79377c9d05354e7a | [
"Unlicense"
] | null | null | null | 2019-11-19_0.py | yanorei32/trash | 0b489e1eef48c51a13d2644f79377c9d05354e7a | [
"Unlicense"
] | 1 | 2020-01-21T06:40:38.000Z | 2020-01-21T06:40:38.000Z | 2019-11-19_0.py | yanorei32/trash | 0b489e1eef48c51a13d2644f79377c9d05354e7a | [
"Unlicense"
] | 1 | 2020-01-21T07:15:58.000Z | 2020-01-21T07:15:58.000Z | import random
import sys
import time
def main():
targetStr = list("ポプテピピック")
targetStrLen = len(targetStr)
matchCounter = 0
tryCounter = 0
begin = time.time()
while True:
tryCounter += 1
c = random.choice(targetStr)
sys.stdout.write(c)
if c != targetStr[matc... | 19.162162 | 109 | 0.586742 |
2124250c12034cd3ea09daca98f17c564c3c2604 | 6,804 | py | Python | train/ssl_rot_trainer.py | mmaaz60/ssl_for_fgvc | 9a4bf0a112b818caca8794868a903dc736839a43 | [
"MIT"
] | 10 | 2021-05-24T13:23:52.000Z | 2022-03-24T06:54:02.000Z | train/ssl_rot_trainer.py | mmaaz60/ssl_for_fgvc | 9a4bf0a112b818caca8794868a903dc736839a43 | [
"MIT"
] | null | null | null | train/ssl_rot_trainer.py | mmaaz60/ssl_for_fgvc | 9a4bf0a112b818caca8794868a903dc736839a43 | [
"MIT"
] | 3 | 2021-06-10T13:59:57.000Z | 2022-02-05T08:54:40.000Z | import torch
from test.base_tester import BaseTester
import logging
from utils.util import preprocess_input_data_rotation
from utils.util import save_model_checkpoints
logger = logging.getLogger(f"train/ssl_rot_trainer.py")
class SSLROTTrainer:
def __init__(self, model, dataloader, class_loss_function, rot_loss_... | 51.938931 | 120 | 0.648589 |
037cd8a335220f5d372b13603e151aa37b014912 | 8,942 | py | Python | reconcile/terraform_resources.py | apahim/qontract-reconcile | b540660da1ee5b2f843d42cf8754381c0487b6a9 | [
"Apache-2.0"
] | null | null | null | reconcile/terraform_resources.py | apahim/qontract-reconcile | b540660da1ee5b2f843d42cf8754381c0487b6a9 | [
"Apache-2.0"
] | null | null | null | reconcile/terraform_resources.py | apahim/qontract-reconcile | b540660da1ee5b2f843d42cf8754381c0487b6a9 | [
"Apache-2.0"
] | null | null | null | import sys
import shutil
import semver
import logging
import utils.gql as gql
import utils.threaded as threaded
import utils.vault_client as vault_client
import reconcile.openshift_base as ob
import reconcile.queries as queries
from utils.terrascript_client import TerrascriptClient as Terrascript
from utils.terraform... | 24.977654 | 79 | 0.646164 |
a0465c9f8827cef8f5e3ba3720f2a24e4221ea5c | 7,606 | py | Python | backbone/effnet.py | YLFF/2004P_Pytorch-Networks | 2d84fe1d904b17d0c55aa2a7a7dba82dea3dae05 | [
"MIT"
] | 454 | 2019-12-26T15:04:02.000Z | 2020-10-24T13:57:35.000Z | backbone/effnet.py | YLFF/2004P_Pytorch-Networks | 2d84fe1d904b17d0c55aa2a7a7dba82dea3dae05 | [
"MIT"
] | 1 | 2020-05-14T06:01:18.000Z | 2020-05-14T06:01:18.000Z | backbone/effnet.py | YLFF/2004P_Pytorch-Networks | 2d84fe1d904b17d0c55aa2a7a7dba82dea3dae05 | [
"MIT"
] | 17 | 2019-12-27T12:19:47.000Z | 2020-02-03T07:42:05.000Z |
import torch
import torch.nn as nn
class EffHead(nn.Module):
"""EfficientNet head: 1x1, BN, Swish, AvgPool, Dropout, FC."""
def __init__(self, w_in, w_out, nc):
super(EffHead, self).__init__()
self.conv = nn.Conv2d(w_in, w_out, 1, stride=1, padding=0, bias=False)
self.conv_bn = nn.B... | 35.050691 | 87 | 0.56508 |
b2057b6fb9429780a75729d8ff20887b544cb93e | 2,474 | py | Python | vendor/github.com/open-policy-agent/opa/build/changelog.py | chronidev/opa-docker-authz | d2a0ea0be813d4327604da05fe69bf89d35bd13d | [
"Apache-2.0"
] | 5 | 2019-03-16T13:06:05.000Z | 2020-04-25T00:19:16.000Z | vendor/github.com/open-policy-agent/opa/build/changelog.py | chronidev/opa-docker-authz | d2a0ea0be813d4327604da05fe69bf89d35bd13d | [
"Apache-2.0"
] | 1 | 2019-08-15T15:57:05.000Z | 2019-08-15T15:57:05.000Z | vendor/github.com/open-policy-agent/opa/build/changelog.py | chronidev/opa-docker-authz | d2a0ea0be813d4327604da05fe69bf89d35bd13d | [
"Apache-2.0"
] | 2 | 2021-03-17T03:01:26.000Z | 2021-12-17T20:41:17.000Z | #!/usr/bin/env python
"""
changelog.py helps generate the CHANGELOG.md message for a particular release.
"""
import argparse
import subprocess
import shlex
import re
def run(cmd, *args, **kwargs):
return subprocess.check_output(shlex.split(cmd), *args, **kwargs)
def get_commit_ids(from_commit, to_commit):
... | 27.797753 | 143 | 0.649151 |
ff69457de5259e3e04575822a38114f0462330a3 | 1,949 | py | Python | backend/app/db/crud.py | qew21/react-diary | 8d7ac6455f2a639724ffeea8a50fc2299d7ca7ea | [
"MIT"
] | null | null | null | backend/app/db/crud.py | qew21/react-diary | 8d7ac6455f2a639724ffeea8a50fc2299d7ca7ea | [
"MIT"
] | null | null | null | backend/app/db/crud.py | qew21/react-diary | 8d7ac6455f2a639724ffeea8a50fc2299d7ca7ea | [
"MIT"
] | null | null | null | from fastapi import HTTPException, status
from sqlalchemy.orm import Session
import typing as t
from . import models, schemas
from app.core.security import get_password_hash
def get_user(db: Session, user_id: int):
user = db.query(models.User).filter(models.User.id == user_id).first()
if not user:
ra... | 27.069444 | 79 | 0.691124 |
44559a0ff689765ad1d80ebeba1cc0ffa51622d2 | 1,123 | py | Python | var/spack/repos/builtin/packages/r-genelendatabase/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-genelendatabase/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-genelendatabase/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RGenelendatabase(RPackage):
"""Lengths of mRNA transcripts for a number of genomes.
... | 41.592593 | 78 | 0.730187 |
08e8b80fd22d1a8572c6c61a9735c4acdf6cf27e | 25,553 | py | Python | orphicx_graph.py | WanyuGroup/CVPR2022-OrphicX | 98d8d8259439c45661573e575cf956331df16abc | [
"MIT"
] | null | null | null | orphicx_graph.py | WanyuGroup/CVPR2022-OrphicX | 98d8d8259439c45661573e575cf956331df16abc | [
"MIT"
] | null | null | null | orphicx_graph.py | WanyuGroup/CVPR2022-OrphicX | 98d8d8259439c45661573e575cf956331df16abc | [
"MIT"
] | null | null | null | """ explainer_main.py
Main user interface for the explainer module.
"""
import argparse
import os
from networkx.algorithms.components.connected import connected_components
import sklearn.metrics as metrics
from functools import partial
from tensorboardX import SummaryWriter
import sys
import time
import math
im... | 49.617476 | 174 | 0.60083 |
c639fb5e6a696e82c5f9543ad52f343753589979 | 13,614 | py | Python | aerostructures/number_formatting/field_writer_8.py | joanmasco/aerostructures | 4dcf598a126d7e419e08d518d552861744b48bcd | [
"Apache-2.0"
] | 5 | 2019-06-22T15:56:04.000Z | 2021-09-12T15:31:55.000Z | aerostructures/number_formatting/field_writer_8.py | joanmasco/aerostructures | 4dcf598a126d7e419e08d518d552861744b48bcd | [
"Apache-2.0"
] | null | null | null | aerostructures/number_formatting/field_writer_8.py | joanmasco/aerostructures | 4dcf598a126d7e419e08d518d552861744b48bcd | [
"Apache-2.0"
] | 1 | 2018-11-16T08:14:18.000Z | 2018-11-16T08:14:18.000Z | # -*- coding: utf-8 -*-
"""
Modified by Joan Mas Colomer,
from the code written by the pyNastran Developers.
Copyright (c) 2017 pyNastran Developers. All rights reserved.
Copyright (c) 2018, ONERA
All rights reserved.
Copyright (c) 2018, ISAE
All rights reserved.
Copyright (c) 2018, Joan Mas Colomer
All rights reserv... | 32.491647 | 756 | 0.555237 |
750edb96d36eaed2336e31f32eb77380a76d4970 | 505 | py | Python | room_assistance/indico_room_assistance/__init__.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | room_assistance/indico_room_assistance/__init__.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | room_assistance/indico_room_assistance/__init__.py | bpedersen2/indico-plugins-cern | c4f06d11d981c316fc8de2892758484deb58e2f5 | [
"MIT"
] | null | null | null | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2022 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from indico.core import signals
from indico.util.i18n import make_b... | 28.055556 | 65 | 0.774257 |
10fa3bfd9d23465dc410be3fa2525c900d5475a9 | 2,005 | py | Python | nsc/spikes.py | GuilhermeToso/masters-project | 01d5acfddaedb3cbf7fa9247a88108530547e155 | [
"MIT"
] | 1 | 2021-08-01T20:13:15.000Z | 2021-08-01T20:13:15.000Z | nsc/spikes.py | GuilhermeToso/masters-project | 01d5acfddaedb3cbf7fa9247a88108530547e155 | [
"MIT"
] | null | null | null | nsc/spikes.py | GuilhermeToso/masters-project | 01d5acfddaedb3cbf7fa9247a88108530547e155 | [
"MIT"
] | null | null | null | """
Author: Guilherme M. Toso
Title: spikes.py
Project: Semi-Supervised Learning Using Competition for Neurons' Synchronization
Description:
This module contain several methods that can perform some trajectories analyses
"""
""" Dependencies """
import numpy as np
__all__ = ['discrete_potential', 'get_peak_... | 21.329787 | 87 | 0.638903 |
95a8975a3a4f3abff47702d545ce50f29a48a3be | 33,208 | py | Python | pyleecan/Classes/OutGeo.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 4 | 2017-11-27T10:14:34.000Z | 2018-09-20T11:30:32.000Z | pyleecan/Classes/OutGeo.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/OutGeo.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Output/OutGeo.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Output/OutGeo
"""
from os import linesep
from sys import getsizeof
from ... | 35.365282 | 126 | 0.524211 |
0c220948ef7c290e701b848447420eef3ec408f8 | 686 | py | Python | backend/app/app/schemas.py | kaldan007/dakje | 4a6024f7256cedec02be86eeefe6b58589ecd6a9 | [
"MIT"
] | null | null | null | backend/app/app/schemas.py | kaldan007/dakje | 4a6024f7256cedec02be86eeefe6b58589ecd6a9 | [
"MIT"
] | null | null | null | backend/app/app/schemas.py | kaldan007/dakje | 4a6024f7256cedec02be86eeefe6b58589ecd6a9 | [
"MIT"
] | null | null | null | from pydantic import BaseModel, validator
class Span(BaseModel):
start: int
end: int
@validator("*")
def span_must_not_be_neg(cls, v):
if v < 0:
raise ValueError("span shouldn't be negative")
return v
@validator("end")
def end_must_not_be_less_than_start(cls, v, v... | 19.6 | 68 | 0.631195 |
46ceb6257aa59e43dd18595d8b084969cd0c87c0 | 679 | py | Python | tests/datatypes/__init__.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 214 | 2019-01-19T03:56:10.000Z | 2022-03-31T01:37:33.000Z | tests/datatypes/__init__.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 120 | 2019-03-19T23:01:52.000Z | 2022-03-14T08:41:27.000Z | tests/datatypes/__init__.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 24 | 2019-04-29T22:41:10.000Z | 2021-11-15T00:28:01.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 37.722222 | 74 | 0.759941 |
abee574306de0d1fb06f9bd61e412f21e5eabdb9 | 4,018 | py | Python | RI/flask_server/tapi_server/models/tapi_oam_mip.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 57 | 2018-04-09T08:56:18.000Z | 2022-03-23T08:31:06.000Z | RI/flask_server/tapi_server/models/tapi_oam_mip.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 143 | 2016-06-08T04:09:54.000Z | 2018-02-23T10:45:59.000Z | RI/flask_server/tapi_server/models/tapi_oam_mip.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 64 | 2018-03-07T07:55:17.000Z | 2022-03-28T07:14:28.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501
from tapi... | 32.403226 | 223 | 0.665007 |
82c446c22c8ef3921afee3ff0a8b5642c5141e8f | 27,700 | py | Python | tests/support/mixins.py | major0/salt | 2019cc89602d296d060e24111df8f9702a8c6bc9 | [
"Apache-2.0"
] | null | null | null | tests/support/mixins.py | major0/salt | 2019cc89602d296d060e24111df8f9702a8c6bc9 | [
"Apache-2.0"
] | null | null | null | tests/support/mixins.py | major0/salt | 2019cc89602d296d060e24111df8f9702a8c6bc9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
=============
Class Mix-Ins
=============
Some reusable class Mixins
'''
# pylint: disable=repr-flag-used-in-string
# Import python libs
from __future__ import absolute_import, print_function
import os
import sys... | 39.458689 | 136 | 0.572924 |
68060a509a2d59d55dba88034dda13cb1b0bca04 | 6,938 | py | Python | reddit-focal-bat.py | jphoulihan/reddit-focal-bat | 06d4148972bd5c178dc26be819b22be1510e935f | [
"MIT"
] | null | null | null | reddit-focal-bat.py | jphoulihan/reddit-focal-bat | 06d4148972bd5c178dc26be819b22be1510e935f | [
"MIT"
] | null | null | null | reddit-focal-bat.py | jphoulihan/reddit-focal-bat | 06d4148972bd5c178dc26be819b22be1510e935f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import praw
import spacy
import random
import requests
from bs4 import BeautifulSoup
from dotenv import load_dotenv
load_dotenv()
ID = os.getenv('CLIENT_ID')
SECRET = os.getenv('CLIENT_SECRET')
PASSWORD = os.getenv('CLIENT_PASSWORD')
nlp = spacy.load('en_core_web_sm')
def... | 46.563758 | 219 | 0.66979 |
2e87bc1ebb7fa31a2b286543486cfc7bbc9cee8f | 42,322 | py | Python | round01/30_11_dDQN_light_tweak53.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | round01/30_11_dDQN_light_tweak53.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | 1 | 2022-02-10T02:27:10.000Z | 2022-02-10T02:27:10.000Z | round01/30_11_dDQN_light_tweak53.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | ########################################
# Changes compared to 30_05_CNN_revived_dDQN_light.py
# 01.
# n_epsilon_decay = int(n_episodes // 50)
# as opposed to
# n_epsilon_decay = int(n_episodes*.805)
# Takes around 9_900 to get from epsilon=1 to epsilon=0.01
# 02.
# slower lr: 1e-4
#########################... | 37.157155 | 271 | 0.579297 |
c987e2b17fcae547a07d7501a1414cbbf4afa891 | 1,421 | py | Python | PiCN/Layers/NFNLayer/R2C/test/test_TimeoutR2CClient.py | NikolaiRutz/PiCN | 7775c61caae506a88af2e4ec34349e8bd9098459 | [
"BSD-3-Clause"
] | null | null | null | PiCN/Layers/NFNLayer/R2C/test/test_TimeoutR2CClient.py | NikolaiRutz/PiCN | 7775c61caae506a88af2e4ec34349e8bd9098459 | [
"BSD-3-Clause"
] | 5 | 2020-07-15T09:01:42.000Z | 2020-09-28T08:45:21.000Z | PiCN/Layers/NFNLayer/R2C/test/test_TimeoutR2CClient.py | NikolaiRutz/PiCN | 7775c61caae506a88af2e4ec34349e8bd9098459 | [
"BSD-3-Clause"
] | null | null | null | """Test the TimeoutR2CClient"""
import unittest
from PiCN.Packets import Name, Content, Interest
from PiCN.Layers.NFNLayer.R2C import TimeoutR2CHandler
from PiCN.Layers.NFNLayer.Parser import DefaultNFNParser
from PiCN.Layers.NFNLayer.NFNComputationTable import NFNComputationList
class test_TimeoutR2CClient(unittest... | 38.405405 | 74 | 0.711471 |
0fe923b5a5a38799973cf50ee3dfc0f076ec349a | 2,070 | py | Python | profiles_api/models.py | iboumiza/profiles-rest-api | dd1c161ee4e1a2dcd941f766c0755041040e23ed | [
"MIT"
] | null | null | null | profiles_api/models.py | iboumiza/profiles-rest-api | dd1c161ee4e1a2dcd941f766c0755041040e23ed | [
"MIT"
] | 5 | 2021-03-19T00:37:39.000Z | 2021-09-22T18:42:36.000Z | profiles_api/models.py | BlueSkyTrading/profiles-rest-api | dd1c161ee4e1a2dcd941f766c0755041040e23ed | [
"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
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def c... | 28.75 | 64 | 0.680193 |
a29aa9eec9067c882e58068f0640613f655750e5 | 4,566 | py | Python | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/send_veri_code_for_change_pwd_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/send_veri_code_for_change_pwd_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/send_veri_code_for_change_pwd_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class SendVeriCodeForChangePwdRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
... | 28.01227 | 92 | 0.595926 |
6a72e7890eabef6ccafe3e01a7183871ddf78d47 | 24,840 | py | Python | pytypes/__init__.py | admdev8/pytypes | 95d58a30a8ddb665500d8e88b13a94e0e0f76373 | [
"Apache-2.0"
] | 189 | 2016-09-17T13:45:58.000Z | 2022-03-12T10:53:42.000Z | pytypes/__init__.py | admdev8/pytypes | 95d58a30a8ddb665500d8e88b13a94e0e0f76373 | [
"Apache-2.0"
] | 104 | 2017-02-23T16:43:18.000Z | 2022-03-17T17:36:18.000Z | pytypes/__init__.py | admdev8/pytypes | 95d58a30a8ddb665500d8e88b13a94e0e0f76373 | [
"Apache-2.0"
] | 21 | 2017-02-17T08:05:12.000Z | 2021-12-08T11:22:15.000Z | # Copyright 2017 Stefan Richthofer
#
# 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 ... | 40.456026 | 101 | 0.765781 |
98bcb3c655f64f0cb1417ea6a35e58c36c8a7ae3 | 89 | py | Python | src/example1.py | rummens1337/neural-network-tensorflow | 95ec089d9c0671b7cc171f07a50c92e377a37a3c | [
"MIT"
] | null | null | null | src/example1.py | rummens1337/neural-network-tensorflow | 95ec089d9c0671b7cc171f07a50c92e377a37a3c | [
"MIT"
] | null | null | null | src/example1.py | rummens1337/neural-network-tensorflow | 95ec089d9c0671b7cc171f07a50c92e377a37a3c | [
"MIT"
] | 1 | 2019-12-29T11:30:38.000Z | 2019-12-29T11:30:38.000Z | from generic_neural_network import GenericNeuralNetwork
network = GenericNeuralNetwork() | 29.666667 | 55 | 0.88764 |
555fd24d98fea83f9f96be08313bd76af9502687 | 1,289 | py | Python | setup.py | sCrypt-Inc/py-scryptlib | 58aa2d8dca36b42ea032825f1bfc01e2d9a65424 | [
"MIT"
] | 7 | 2021-11-14T20:10:29.000Z | 2022-02-26T10:05:07.000Z | setup.py | sCrypt-Inc/py-scryptlib | 58aa2d8dca36b42ea032825f1bfc01e2d9a65424 | [
"MIT"
] | 1 | 2021-08-12T16:50:42.000Z | 2021-09-08T20:13:26.000Z | setup.py | sCrypt-Inc/scryptlib-python | 4df358e89231bf9c9698240d17e06f04b61218d3 | [
"MIT"
] | 1 | 2021-10-16T23:46:23.000Z | 2021-10-16T23:46:23.000Z | #!/usr/bin/env python
import codecs
from setuptools import setup
from os import path
def read(rel_path):
here = path.abspath(path.dirname(__file__))
with codecs.open(path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
... | 29.295455 | 85 | 0.650892 |
a7ae2c5f7b33358803d4687636faada2fe4c0add | 5,663 | py | Python | model/nmt_commands.py | davidcliebman68/awesome-chatbot | 64d3e201d519946c7c66a64b5143527d18506c3d | [
"MIT"
] | 1 | 2020-02-10T19:20:15.000Z | 2020-02-10T19:20:15.000Z | model/nmt_commands.py | davidcliebman68/awesome-chatbot | 64d3e201d519946c7c66a64b5143527d18506c3d | [
"MIT"
] | null | null | null | model/nmt_commands.py | davidcliebman68/awesome-chatbot | 64d3e201d519946c7c66a64b5143527d18506c3d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
from subprocess import Popen
import re
class Commands:
def __init__(self):
self.erase_history = False
self.use_async = False
self.print_to_screen = False
self.url_search = 'https://www.google.com/search?q='
self.url_youtube = 'https://www.youtu... | 30.945355 | 106 | 0.511037 |
91cfedd83b2774b347adf27052b2e7bae93d6031 | 8,652 | py | Python | source/util_data.py | kibernetika-ai/ciagan | 6a4c1f09eb209b507f9ed6eee9366a63093d70b9 | [
"MIT"
] | null | null | null | source/util_data.py | kibernetika-ai/ciagan | 6a4c1f09eb209b507f9ed6eee9366a63093d70b9 | [
"MIT"
] | null | null | null | source/util_data.py | kibernetika-ai/ciagan | 6a4c1f09eb209b507f9ed6eee9366a63093d70b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 29 14:54:12 2018
@author: maximov
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
from torchvision import transforms, utils
from torch.utils.data.sampler import Sampler
import os
from os import listdi... | 36.661017 | 217 | 0.606449 |
c426a5009047b5fc07c2bf74565247185923f1b3 | 1,595 | py | Python | md2d.py | jfaubertin/KerasCuriosity | 72b6b0763c3a83ecba8c054620bf5062b225fe40 | [
"Apache-2.0"
] | 2 | 2019-05-15T05:33:34.000Z | 2020-10-12T19:36:41.000Z | md2d.py | jfaubertin/KerasCuriosity | 72b6b0763c3a83ecba8c054620bf5062b225fe40 | [
"Apache-2.0"
] | 1 | 2020-11-30T21:17:21.000Z | 2020-12-03T17:59:29.000Z | md2d.py | jfaubertin/KerasCuriosity | 72b6b0763c3a83ecba8c054620bf5062b225fe40 | [
"Apache-2.0"
] | 1 | 2020-11-25T13:28:52.000Z | 2020-11-25T13:28:52.000Z | import gym
from gym import spaces
# Convert MultiDiscrete to Discrete so Keras-RL Agents will work
class MD2D_ActionWrapper(gym.ActionWrapper):
def __init__(self, env, buttons):
super(MD2D_ActionWrapper, self).__init__(env)
self.action_space = spaces.Discrete(len(buttons))
self.buttons = buttons
def a... | 30.673077 | 64 | 0.467712 |
839820f1f2b89f18b9cfb80770542aae7d5a4694 | 7,626 | py | Python | parser.py | mbyra/awww | b8107f72e3b2ca49e30c81caeb962538d2867b8a | [
"MIT"
] | null | null | null | parser.py | mbyra/awww | b8107f72e3b2ca49e30c81caeb962538d2867b8a | [
"MIT"
] | null | null | null | parser.py | mbyra/awww | b8107f72e3b2ca49e30c81caeb962538d2867b8a | [
"MIT"
] | null | null | null | import sqlite3
import jinja2
conn = sqlite3.connect('dane/db.sqlite3')
c = conn.cursor()
# funckcja generujaca pliki powiatów dla danego okręgu
def generuj_powiaty(wojewodztwo, okreg):
templateLoader = jinja2.FileSystemLoader(searchpath="/")
templateEnv = jinja2.Environment(loader=templateLoader)
TEMPLATE... | 46.218182 | 199 | 0.556255 |
1c9c8f989aa852dc22f8a0d7f2df8814e88cfadd | 14,947 | py | Python | tests/test_web_middleware.py | sivakov512/aiohttp | 9bce9c2d462666ad83111c0966358c2e274bc89b | [
"Apache-2.0"
] | 1 | 2021-03-26T11:06:21.000Z | 2021-03-26T11:06:21.000Z | tests/test_web_middleware.py | sivakov512/aiohttp | 9bce9c2d462666ad83111c0966358c2e274bc89b | [
"Apache-2.0"
] | 224 | 2020-10-25T12:21:48.000Z | 2022-03-31T08:05:18.000Z | tests/test_web_middleware.py | sivakov512/aiohttp | 9bce9c2d462666ad83111c0966358c2e274bc89b | [
"Apache-2.0"
] | null | null | null | import pytest
from yarl import URL
from aiohttp import web
async def test_middleware_modifies_response(loop, aiohttp_client) -> None:
async def handler(request):
return web.Response(body=b"OK")
async def middleware(request, handler):
resp = await handler(request)
assert 200 == resp.s... | 33.970455 | 88 | 0.558373 |
825441c47397ce115a5d86f0ec31b816d6e2bfbb | 3,781 | py | Python | tests/run_tests.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 5 | 2015-04-17T11:27:00.000Z | 2017-11-29T11:31:51.000Z | tests/run_tests.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 2 | 2020-06-25T19:02:43.000Z | 2020-06-30T19:33:27.000Z | tests/run_tests.py | Erotemic/vtool_ibeis | b5dfd5bec43dacc8ea9fc3d6a7f17cd661b678c5 | [
"Apache-2.0"
] | 3 | 2016-07-04T18:22:56.000Z | 2017-03-03T22:50:19.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import sys
import utool as ut
def run_tests():
# Build module list and run tests
import sys
exclude_doctests_fnames = set([
])
exclude_dirs = [
'_broken',
'old',
'... | 30.248 | 93 | 0.576567 |
bb3e6f0aedd0dbda4ba0f6295a7abfb2248b3b7c | 2,309 | py | Python | blades_helper/mission.py | eriksalt/blades_helper_proj | 96e9d856b0e7f7a9cfc26c9f1bdc89c574eebdbc | [
"MIT"
] | null | null | null | blades_helper/mission.py | eriksalt/blades_helper_proj | 96e9d856b0e7f7a9cfc26c9f1bdc89c574eebdbc | [
"MIT"
] | null | null | null | blades_helper/mission.py | eriksalt/blades_helper_proj | 96e9d856b0e7f7a9cfc26c9f1bdc89c574eebdbc | [
"MIT"
] | null | null | null | from .mission_generator_constants import MissionGeneratorConstants as con
class Mission:
def __init__(self):
self_mission_type=con.NOTHING
self.target=con.NOTHING
self.title=con.NOTHING
self.rewards=[]
self.penalties=[]
self.notes=[]
self.requirements=[]
... | 33.463768 | 129 | 0.639671 |
b18c1fa7767e15531dce79ef591f8dde649d2ee4 | 2,714 | py | Python | sshagentmux/util.py | ulyssesbbg/sshagentmux | 3eb6f9eeecf743750d7b1432eb274af20930ba5d | [
"Apache-2.0"
] | 13 | 2016-02-25T18:30:16.000Z | 2019-09-04T21:51:14.000Z | sshagentmux/util.py | ulyssesbbg/sshagentmux | 3eb6f9eeecf743750d7b1432eb274af20930ba5d | [
"Apache-2.0"
] | 3 | 2016-09-13T16:51:58.000Z | 2017-03-03T22:32:32.000Z | sshagentmux/util.py | ulyssesbbg/sshagentmux | 3eb6f9eeecf743750d7b1432eb274af20930ba5d | [
"Apache-2.0"
] | 9 | 2016-01-27T00:40:33.000Z | 2018-03-25T04:36:52.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2015, IBM
# 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/... | 29.182796 | 79 | 0.648121 |
a45fb82197f878d3cb112fa443522bc37c868df3 | 393,282 | py | Python | ironic/tests/unit/conductor/test_manager.py | ljmcgann/ironic | 09f79416e2820cf0fcef001c4c956b7732b7e7ca | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/conductor/test_manager.py | ljmcgann/ironic | 09f79416e2820cf0fcef001c4c956b7732b7e7ca | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/conductor/test_manager.py | ljmcgann/ironic | 09f79416e2820cf0fcef001c4c956b7732b7e7ca | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 International Business Machines Corporation
# 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
# ... | 49.631752 | 79 | 0.624198 |
6fcd069611509b5db5f192819ff45008a88547c8 | 5,039 | py | Python | application/__init__.py | By-Lucas/Sistema-de-tickets-flask | 20f8062f16bc264d6784cfd0498c717861a02f37 | [
"MIT"
] | 95 | 2017-10-31T21:25:11.000Z | 2022-03-07T05:46:12.000Z | application/__init__.py | By-Lucas/Sistema-de-tickets-flask | 20f8062f16bc264d6784cfd0498c717861a02f37 | [
"MIT"
] | 47 | 2017-05-15T10:52:23.000Z | 2021-12-13T09:30:52.000Z | application/__init__.py | By-Lucas/Sistema-de-tickets-flask | 20f8062f16bc264d6784cfd0498c717861a02f37 | [
"MIT"
] | 54 | 2017-07-13T03:38:47.000Z | 2022-02-12T20:10:02.000Z | #! usr/bin/python3
# -*- coding: utf8 -*-
#
# Flicket - copyright Paul Bourne: evereux@gmail.com
"""
Flicket
=======
A simple ticket system using Python and the Flask microframework.
This probably wouldn't have been created without the excellent tutorials written by Miguel Grinberg:
https://blog... | 27.839779 | 104 | 0.794602 |
1bd21a19fe2ab7c730bf485f2028489ad76c87a9 | 3,667 | py | Python | pymeasure/instruments/thorlabs/thorlabspro8000.py | matthias6/pymeasure | f226ab4aaec8265ff442c5baadc27cfdee513ca4 | [
"MIT"
] | 4 | 2020-11-13T08:57:16.000Z | 2021-09-16T12:45:33.000Z | pymeasure/instruments/thorlabs/thorlabspro8000.py | matthias6/pymeasure | f226ab4aaec8265ff442c5baadc27cfdee513ca4 | [
"MIT"
] | 2 | 2021-12-16T16:15:47.000Z | 2022-03-27T10:47:13.000Z | pymeasure/instruments/thorlabs/thorlabspro8000.py | matthias6/pymeasure | f226ab4aaec8265ff442c5baadc27cfdee513ca4 | [
"MIT"
] | null | null | null | #
# This file is part of the PyMeasure package.
#
# Copyright (c) 2013-2021 PyMeasure Developers
#
# 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 limit... | 45.8375 | 116 | 0.605945 |
6d3946ff4a5b477dd6c3a5bb2c4964cde52f2a18 | 560 | py | Python | tests/test_mapper.py | frictionlessdata/datapackage-pipelines-bigquery-driver | 7ed9d002620619a819f73d97e03257dcc715c7a4 | [
"MIT"
] | 10 | 2017-10-19T00:45:29.000Z | 2021-11-04T20:19:49.000Z | tests/test_mapper.py | frictionlessdata/datapackage-pipelines-bigquery-driver | 7ed9d002620619a819f73d97e03257dcc715c7a4 | [
"MIT"
] | 22 | 2016-03-26T08:03:09.000Z | 2017-03-21T17:45:11.000Z | tests/test_mapper.py | frictionlessdata/tableschema-bigquery-py | 7ed9d002620619a819f73d97e03257dcc715c7a4 | [
"MIT"
] | 2 | 2016-09-19T07:45:07.000Z | 2017-04-08T00:24:31.000Z | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import pytest
from tableschema_bigquery.mapper import Mapper
# Tests
def test_mapper_convert_bucket():
mapper = Mapper('prefix_')
asser... | 25.454545 | 61 | 0.769643 |
fe6e83ffc8ab415c085fdc73aa4f00c9a87a7097 | 35 | py | Python | btd6_memory_info/generated/SteamNative/HTML_BrowserRestarted_t/html_browser_restarted_t.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/SteamNative/HTML_BrowserRestarted_t/html_browser_restarted_t.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/SteamNative/HTML_BrowserRestarted_t/html_browser_restarted_t.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class HTML_BrowserRestarted_t: pass | 35 | 35 | 0.914286 |
cf8c07a6ce1fb80959d34328e5848a2b3a8b0fee | 1,834 | py | Python | ml_service/util/attach_compute.py | anilkumar-kanasani-diconium/MLOpsAzure | a3dfb0571b48c2d2d8742d6bf321a2ff2a6ae971 | [
"MIT"
] | 1 | 2022-02-23T12:08:22.000Z | 2022-02-23T12:08:22.000Z | ml_service/util/attach_compute.py | anilkumar-kanasani-diconium/MLOpsAzure | a3dfb0571b48c2d2d8742d6bf321a2ff2a6ae971 | [
"MIT"
] | null | null | null | ml_service/util/attach_compute.py | anilkumar-kanasani-diconium/MLOpsAzure | a3dfb0571b48c2d2d8742d6bf321a2ff2a6ae971 | [
"MIT"
] | null | null | null |
import traceback
from azureml.core import Workspace
from azureml.core.compute import AmlCompute
from azureml.core.compute import ComputeTarget
from azureml.exceptions import ComputeTargetException
from ml_service.util.env_variables import Env
def get_compute(workspace: Workspace, compute_name: str, vm_size: str, for... | 45.85 | 117 | 0.663032 |
f12a3f82af20d1a20966fcf6e7e558b033d66e1c | 566 | py | Python | hackerearth/Algorithms/Cyclic Permutations/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerearth/Algorithms/Cyclic Permutations/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerearth/Algorithms/Cyclic Permutations/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('sys.stdin.readline', side_effect=[
'2',
'101',
'101',
'111',
'111',
])
def test_case_0(self, input_mock=None):
text_trap ... | 21.769231 | 46 | 0.55477 |
c649c7f7584165df7226f854fd4148048e5703fc | 26,342 | py | Python | gender_novels/analysis/gender_pronoun_freq_analysis.py | elenaboal/gender_novels | e14411e5ccc1fcead98169af02e6eb77a4a199e9 | [
"BSD-3-Clause"
] | 19 | 2018-09-07T19:26:48.000Z | 2022-02-10T14:10:19.000Z | gender_novels/analysis/gender_pronoun_freq_analysis.py | elenaboal/gender_novels | e14411e5ccc1fcead98169af02e6eb77a4a199e9 | [
"BSD-3-Clause"
] | 111 | 2018-09-09T13:09:06.000Z | 2020-12-04T00:26:50.000Z | gender_novels/analysis/gender_pronoun_freq_analysis.py | elenaboal/gender_novels | e14411e5ccc1fcead98169af02e6eb77a4a199e9 | [
"BSD-3-Clause"
] | 37 | 2018-09-05T21:44:41.000Z | 2020-12-01T17:19:02.000Z | from gender_novels.corpus import Corpus
from gender_novels.analysis.analysis import get_comparative_word_freq
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import pprint
palette = "colorblind"
style_name = "white"
style_list = {'axes.edgecolor': '.6', 'grid.color': '.9',... | 37.956772 | 983 | 0.666844 |
f0cea6a86e078a5f98a3179859b0151a34cb4e6f | 17,544 | py | Python | tests/integration/test_server.py | skytotwo/asynction | e060d0e488b4adb67b8d0bc89b65d905dea9c841 | [
"MIT"
] | 1 | 2022-03-29T12:37:43.000Z | 2022-03-29T12:37:43.000Z | tests/integration/test_server.py | skytotwo/asynction | e060d0e488b4adb67b8d0bc89b65d905dea9c841 | [
"MIT"
] | null | null | null | tests/integration/test_server.py | skytotwo/asynction | e060d0e488b4adb67b8d0bc89b65d905dea9c841 | [
"MIT"
] | null | null | null | import base64
from enum import Enum
import pytest
import yaml
from faker import Faker
from flask import Flask
import asynction
from asynction.exceptions import BindingsValidationException
from asynction.exceptions import MessageAckValidationException
from asynction.exceptions import PayloadValidationException
from as... | 31.272727 | 86 | 0.740196 |
a9a3e07dbda92fedbdab62b5ceff8fd46771360a | 261 | py | Python | bookmanager02/book02/views.py | lichenguang1205/django_base | 29a3144369fe38dcc842fab85839e767cc75015a | [
"MIT"
] | null | null | null | bookmanager02/book02/views.py | lichenguang1205/django_base | 29a3144369fe38dcc842fab85839e767cc75015a | [
"MIT"
] | null | null | null | bookmanager02/book02/views.py | lichenguang1205/django_base | 29a3144369fe38dcc842fab85839e767cc75015a | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.http import HttpRequest
from django.http import HttpResponse
def index(request):
context = {
'name': '大聪明'
}
return render(request, 'book02/index.html', context)
| 17.4 | 56 | 0.701149 |
5ccf93a09331a26c6827b55c3b0f144c2bc652b5 | 3,075 | py | Python | tests/test_traverse_invoke.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | tests/test_traverse_invoke.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | tests/test_traverse_invoke.py | danlkv/traverse-invoke | a65236c19852229ad422c707759466750e7c6139 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `traverse_invoke` package."""
import pytest
from click.testing import CliRunner
import traverse_invoke
from traverse_invoke import cli
import pprint as pp
pprint = pp.pprint
entry = traverse_invoke.entry_traverse
traverse_invoke.core.enable_logging()
invocations = []
def _gen... | 25.204918 | 70 | 0.533008 |
a6e31d59ac1081460d081b71f97bee5e7355f2c2 | 527 | py | Python | Chapter04_code/ch04_r12_abstract/models/library_book.py | PacktPublishing/Odoo-Development-Cookbook | 5553110c0bc352c4541f11904e236cad3c443b8b | [
"MIT"
] | 55 | 2016-05-23T16:05:50.000Z | 2021-07-19T00:16:46.000Z | Chapter04_code/ch04_r12_abstract/models/library_book.py | kogkog098/Odoo-Development-Cookbook | 166c9b98efbc9108b30d719213689afb1f1c294d | [
"MIT"
] | 1 | 2016-12-09T02:14:21.000Z | 2018-07-02T09:02:20.000Z | Chapter04_code/ch04_r12_abstract/models/library_book.py | kogkog098/Odoo-Development-Cookbook | 166c9b98efbc9108b30d719213689afb1f1c294d | [
"MIT"
] | 52 | 2016-06-01T20:03:59.000Z | 2020-10-31T23:58:25.000Z | # -*- coding: utf-8 -*-
from openerp import models, fields
class BaseArchive(models.AbstractModel):
_name = 'base.archive'
active = fields.Boolean(default=True)
def do_archive(self):
for record in self:
record.active = not record.active
class LibraryBook(models.Model):
_name = '... | 26.35 | 66 | 0.669829 |
43e44f104a5fcb22a807800cc9c481f33bff43f4 | 3,044 | py | Python | data/cirq_new/cirq_program/startCirq_pragma727.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma727.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma727.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=21
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... | 34.988506 | 92 | 0.653088 |
b500d9b5caf47f652935a14109b5b1f35aef01ed | 21,604 | py | Python | deepchem/data/data_loader.py | zealseeker/deepchem | a44decc033c727e2da681b1461c3d57fdd53aca0 | [
"MIT"
] | 1 | 2020-05-17T10:26:52.000Z | 2020-05-17T10:26:52.000Z | deepchem/data/data_loader.py | xli15/deepchem | 51f426b3b6acb876703e49d24ef4f16cb0b44b43 | [
"MIT"
] | null | null | null | deepchem/data/data_loader.py | xli15/deepchem | 51f426b3b6acb876703e49d24ef4f16cb0b44b43 | [
"MIT"
] | null | null | null | """
Process an input dataset into a format suitable for machine learning.
"""
import os
import gzip
import pandas as pd
import numpy as np
import csv
import numbers
import tempfile
import time
import sys
import logging
import warnings
from deepchem.utils.save import load_csv_files
from deepchem.utils.save import load_s... | 33.65109 | 122 | 0.68853 |
9db11e80ef1f9f5d10abc289680335fb825638ce | 8,367 | py | Python | test/functional/feature_proxy.py | Flight-myPPL/Flight | 9537d128ffcbc886a8c502131b17047067d70386 | [
"MIT"
] | null | null | null | test/functional/feature_proxy.py | Flight-myPPL/Flight | 9537d128ffcbc886a8c502131b17047067d70386 | [
"MIT"
] | null | null | null | test/functional/feature_proxy.py | Flight-myPPL/Flight | 9537d128ffcbc886a8c502131b17047067d70386 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Flightd with different proxy configuration.
Test plan:
- Start Flightd's with different proxy con... | 41.420792 | 121 | 0.625672 |
6026b2c67c418ab803401e83bb12390c10e9bda5 | 442 | py | Python | sources/stats/wavs_duration.py | ciro97sa/LessonAble_Speech_Dataset_Generator | bf85a4bcb13f854b2ed22082c61c3cbf62becf03 | [
"MIT"
] | null | null | null | sources/stats/wavs_duration.py | ciro97sa/LessonAble_Speech_Dataset_Generator | bf85a4bcb13f854b2ed22082c61c3cbf62becf03 | [
"MIT"
] | null | null | null | sources/stats/wavs_duration.py | ciro97sa/LessonAble_Speech_Dataset_Generator | bf85a4bcb13f854b2ed22082c61c3cbf62becf03 | [
"MIT"
] | null | null | null | import os
from pydub import AudioSegment
def wavsDuration(folderPath) -> int:
total_duration = 0
for file in os.listdir(folderPath):
if file.endswith('.wav'):
current_duration = len(AudioSegment.from_wav(folderPath + '/' + file))
total_duration += current_duration
total_dura... | 34 | 82 | 0.692308 |
0fb21940f9c4b53e03157de12bbd0b17e356b8bd | 395 | py | Python | Python-3.5/printing_out.py | GenericError/Personal-Interest-Project | 9307c7c815fc5c59f30bacccd3d03a839757c904 | [
"MIT"
] | null | null | null | Python-3.5/printing_out.py | GenericError/Personal-Interest-Project | 9307c7c815fc5c59f30bacccd3d03a839757c904 | [
"MIT"
] | null | null | null | Python-3.5/printing_out.py | GenericError/Personal-Interest-Project | 9307c7c815fc5c59f30bacccd3d03a839757c904 | [
"MIT"
] | null | null | null | # Python 3.5 Printing to the command line
print("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
print("Donec purus ligula, gravida nec dui sit amet, pretium iaculis erat.")
print("Sed porta turpis sit amet velit ornare sollicitudin.")
print("Curabitur mollis elit orci, eu eleifend libero sodales vestibulum... | 49.375 | 76 | 0.777215 |
c9f6841022e5331a832b055cbdfc8a22076bf01e | 3,414 | py | Python | growlee/src/GrowleeConnection.py | builder07/enigma2-plugins_3 | 2fc0d26891fba28ebea1550a39f5e8d7973db10c | [
"OLDAP-2.3"
] | 2 | 2020-09-02T18:25:39.000Z | 2020-09-02T18:39:07.000Z | growlee/src/GrowleeConnection.py | builder07/enigma2-plugins_3 | 2fc0d26891fba28ebea1550a39f5e8d7973db10c | [
"OLDAP-2.3"
] | null | null | null | growlee/src/GrowleeConnection.py | builder07/enigma2-plugins_3 | 2fc0d26891fba28ebea1550a39f5e8d7973db10c | [
"OLDAP-2.3"
] | 4 | 2015-02-15T16:58:18.000Z | 2016-07-09T11:09:05.000Z | # -*- coding: utf-8 -*-
from Components.config import config
from Tools import Notifications
from Screens.MessageBox import MessageBox
from twisted.internet.defer import Deferred
from twisted.internet import reactor
from . import NOTIFICATIONID
def emergencyDisable(*args, **kwargs):
if args:
try: args[0].printTrac... | 28.932203 | 123 | 0.730814 |
fec2436434386751bc549dcf8a56c1375c0868cf | 24,736 | py | Python | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/FireEyeEX/Integrations/FireEyeEX/FireEyeEX.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | from typing import Tuple
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' CONSTANTS '''
INTEGRATION_NAME = 'FireEye Email Security'
INTEGRATION_COMMAND_NAME = 'fireeye-ex'
INTEGRATION_CONTEXT_NAME = 'FireEyeEX'
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ' # ISO8601 ... | 40.818482 | 120 | 0.660293 |
829704e0b6a4fb4f19db28b92ac761a4a402df83 | 3,264 | py | Python | test/utils/multi_objective/test_scalarization.py | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f | [
"MIT"
] | 2 | 2021-01-11T18:16:27.000Z | 2021-11-30T09:34:44.000Z | test/utils/multi_objective/test_scalarization.py | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f | [
"MIT"
] | 17 | 2020-12-11T20:07:22.000Z | 2022-03-27T16:46:42.000Z | test/utils/multi_objective/test_scalarization.py | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# 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.
from __future__ import annotations
import torch
from botorch.exceptions.errors import BotorchTensorDimensionError
fro... | 45.971831 | 88 | 0.590686 |
636b2f32f98f6c1badb0ec0d3c4fa9d9d0f72fe2 | 1,608 | py | Python | Moving-to-Melbourne/code.py | sukamal1928/Greyatom-Projects-Repository | 1dca71032551b5f65abeb37ba76ca9c7184787f4 | [
"MIT"
] | null | null | null | Moving-to-Melbourne/code.py | sukamal1928/Greyatom-Projects-Repository | 1dca71032551b5f65abeb37ba76ca9c7184787f4 | [
"MIT"
] | null | null | null | Moving-to-Melbourne/code.py | sukamal1928/Greyatom-Projects-Repository | 1dca71032551b5f65abeb37ba76ca9c7184787f4 | [
"MIT"
] | null | null | null | # --------------
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# path- variable storing file path
#Code starts here
df = pd.read_csv(path)
y = df['Price']
X = df.drop('Price',axis=1)
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.3,r... | 16.57732 | 86 | 0.694652 |
495049210f0c324e2bf3f150ab11bee023b1f38b | 374 | py | Python | scratch_10.py | ddsanchezc/PythonSourceCode | cc9c6d64bdf5ce5280fb7e0721e60642bb4d50b6 | [
"Apache-2.0"
] | null | null | null | scratch_10.py | ddsanchezc/PythonSourceCode | cc9c6d64bdf5ce5280fb7e0721e60642bb4d50b6 | [
"Apache-2.0"
] | null | null | null | scratch_10.py | ddsanchezc/PythonSourceCode | cc9c6d64bdf5ce5280fb7e0721e60642bb4d50b6 | [
"Apache-2.0"
] | null | null | null | numero_leido = int(input("inserta un numero >> "))
numero = int(numero_leido)
contador = 0
verificar= False
for i in range(1,numero+1):
if (numero% i)==0:
contador = contador + 1
if contador >= 3:
verificar=True
break
if contador==2 or verificar==False:
print ("el numero ... | 24.933333 | 51 | 0.606952 |
9ef1cee4ab22e915ed46fcaf3554566304deb053 | 1,754 | py | Python | display4D/image_resizer_grtensor.py | seVenVo1d/General-Relativity-Tensorial-Calculations | 6c07823f74840352253c235af2e4dbe60044941a | [
"MIT"
] | 1 | 2021-06-16T07:29:30.000Z | 2021-06-16T07:29:30.000Z | display4D/image_resizer_grtensor.py | seVenVo1d/General-Relativity-Tensorial-Calculations | 6c07823f74840352253c235af2e4dbe60044941a | [
"MIT"
] | null | null | null | display4D/image_resizer_grtensor.py | seVenVo1d/General-Relativity-Tensorial-Calculations | 6c07823f74840352253c235af2e4dbe60044941a | [
"MIT"
] | 1 | 2021-12-02T15:11:06.000Z | 2021-12-02T15:11:06.000Z | from PIL import Image
def resize_tensor_image(tensor_object, tensor_type=''):
"""
Re-sizing the image of a tensor
Args:
tensor_object [str]: The name of the grtensor object (metric tensor, riemann tensor, etc.)
tensor_type [str]: The type of the tensor. Given in terms of 'u': contravarian... | 27.40625 | 98 | 0.623717 |
f93f045e79a26c2b24bdec5a6308f57b3dc69ec4 | 1,033 | py | Python | myproject/myproject/CBIRtool/encoder/Faiss.py | Andyb1ance/iMED_search_engine_module | ef65e3ff1361e69896a0d0d3e23acab8d1066e46 | [
"MIT"
] | null | null | null | myproject/myproject/CBIRtool/encoder/Faiss.py | Andyb1ance/iMED_search_engine_module | ef65e3ff1361e69896a0d0d3e23acab8d1066e46 | [
"MIT"
] | null | null | null | myproject/myproject/CBIRtool/encoder/Faiss.py | Andyb1ance/iMED_search_engine_module | ef65e3ff1361e69896a0d0d3e23acab8d1066e46 | [
"MIT"
] | null | null | null | import faiss
import numpy as np
'''
the input of faiss should be numpy
'''
def transform(vectors):
#transform list of vectors to numpy
return np.array(vectors,dtype=float).astype('float32')
class Encoder:
def __init__(self,device):
self.device = device
def construct(self,vectors,index... | 25.195122 | 62 | 0.613746 |
aa68dddb80b6149e18fb2c116f4caf8c1884fd96 | 117 | py | Python | salesforce_streaming/rest_api.py | aliaksandr-d/salesforce-streaming | 5f5bfe731d1323d457b6324dd0ee94c87b809461 | [
"MIT"
] | null | null | null | salesforce_streaming/rest_api.py | aliaksandr-d/salesforce-streaming | 5f5bfe731d1323d457b6324dd0ee94c87b809461 | [
"MIT"
] | null | null | null | salesforce_streaming/rest_api.py | aliaksandr-d/salesforce-streaming | 5f5bfe731d1323d457b6324dd0ee94c87b809461 | [
"MIT"
] | 1 | 2018-04-11T13:39:12.000Z | 2018-04-11T13:39:12.000Z | __author__ = 'David C. Dean'
import requests
class RestAPI:
def __init__(self):
print('Hello World')
| 11.7 | 28 | 0.649573 |
e37468d8dd287c61ebd4499c68506c861a46c162 | 95,972 | py | Python | test/surface_test.py | hljjj/pygame_documentation | 735a0823f71b28f3379d2d01c45cadd05d245e05 | [
"Python-2.0",
"OLDAP-2.3"
] | 1 | 2022-01-09T16:07:48.000Z | 2022-01-09T16:07:48.000Z | test/surface_test.py | hljjj/pygame_documentation | 735a0823f71b28f3379d2d01c45cadd05d245e05 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | test/surface_test.py | hljjj/pygame_documentation | 735a0823f71b28f3379d2d01c45cadd05d245e05 | [
"Python-2.0",
"OLDAP-2.3"
] | null | null | null | import os
import unittest
from pygame.tests import test_utils
from pygame.tests.test_utils import example_path
try:
from pygame.tests.test_utils.arrinter import *
except (ImportError, NameError):
pass
import pygame
from pygame.locals import *
from pygame.compat import xrange_, as_bytes, as_unicode
from pygame... | 39.397373 | 94 | 0.56033 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.