hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17134739b8596a864d6e6e37035825d72ffbe045 | 3,119 | py | Python | securetea/lib/antivirus/scanner/yara_scanner.py | neerajv18/SecureTea-Project | e999cbe7c8e497c69b76b4c886de0d063169ea03 | [
"MIT"
] | 257 | 2018-03-28T12:43:20.000Z | 2022-03-29T07:07:23.000Z | securetea/lib/antivirus/scanner/yara_scanner.py | neerajv18/SecureTea-Project | e999cbe7c8e497c69b76b4c886de0d063169ea03 | [
"MIT"
] | 155 | 2018-03-31T14:57:46.000Z | 2022-03-17T18:12:41.000Z | securetea/lib/antivirus/scanner/yara_scanner.py | neerajv18/SecureTea-Project | e999cbe7c8e497c69b76b4c886de0d063169ea03 | [
"MIT"
] | 132 | 2018-03-27T06:25:20.000Z | 2022-03-28T11:32:45.000Z | # -*- coding: utf-8 -*-
u"""Yara Scanner module for SecureTea AntiVirus.
Project:
╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐
╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤
╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴
Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jul 4 2019
Version: 1.4
Module: SecureTea
"""
from securetea.lib.antiv... | 30.281553 | 96 | 0.520359 |
20144ab955135ad084cf0fef939398cc14bdd008 | 4,305 | py | Python | server/app/services/products/views/products.py | goodfree/ActorCloud | e8db470830ea6f6f208ad43c2e56a2e8976bc468 | [
"Apache-2.0"
] | 173 | 2019-06-10T07:14:49.000Z | 2022-03-31T08:42:36.000Z | server/app/services/products/views/products.py | zlyz12345/ActorCloud | 9c34b371c23464981323ef9865d9913bde1fe09c | [
"Apache-2.0"
] | 27 | 2019-06-12T08:25:29.000Z | 2022-02-26T11:37:15.000Z | server/app/services/products/views/products.py | zlyz12345/ActorCloud | 9c34b371c23464981323ef9865d9913bde1fe09c | [
"Apache-2.0"
] | 67 | 2019-06-10T08:40:05.000Z | 2022-03-09T03:43:56.000Z | from flask import jsonify
from sqlalchemy import func
from sqlalchemy.exc import IntegrityError
from actor_libs.database.orm import db
from actor_libs.errors import ReferencedError
from actor_libs.utils import get_delete_ids
from app import auth
from app.models import DataPoint, DataStream, Device, Product, User
from ... | 36.483051 | 82 | 0.698955 |
a1f17c6dbe84da7d775bb580e842005296053491 | 1,640 | py | Python | hooks/post_gen_project.py | BrianPugh/cookiecutter-pypackage | ec8b51cb59d2436d77ca1d802991103dd37c9a95 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | BrianPugh/cookiecutter-pypackage | ec8b51cb59d2436d77ca1d802991103dd37c9a95 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | BrianPugh/cookiecutter-pypackage | ec8b51cb59d2436d77ca1d802991103dd37c9a95 | [
"BSD-3-Clause"
] | null | null | null | import os
import os.path as osp
import subprocess
COOKIECUTTER_REPO_NAME = 'cookiecutter-pypackage'
par_dir_path = osp.normpath(osp.join(osp.abspath(osp.curdir), osp.pardir))
if osp.basename(par_dir_path) == COOKIECUTTER_REPO_NAME:
# This was most likely called `cookiecutter .`
cookiecutter_repo_path = par_di... | 39.047619 | 119 | 0.669512 |
272f9a294cfa1016c03db2b08daaf22b1cdf0748 | 10,110 | py | Python | sdk/python/pulumi_azure_native/devtestlab/policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/devtestlab/policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 41.950207 | 632 | 0.631256 |
419ed8ebc49f720d92ff045b931926cee71ebb7f | 22,924 | py | Python | tests/compute/test_sampling.py | LunaBlack/dgl | bd1e48a51e348b0e8e25622325adeb5ddea1c0ea | [
"Apache-2.0"
] | 2 | 2021-12-09T12:36:13.000Z | 2022-03-01T21:22:36.000Z | tests/compute/test_sampling.py | LunaBlack/dgl | bd1e48a51e348b0e8e25622325adeb5ddea1c0ea | [
"Apache-2.0"
] | null | null | null | tests/compute/test_sampling.py | LunaBlack/dgl | bd1e48a51e348b0e8e25622325adeb5ddea1c0ea | [
"Apache-2.0"
] | 2 | 2020-12-07T09:34:01.000Z | 2020-12-13T06:18:58.000Z | import dgl
import backend as F
import numpy as np
import unittest
def check_random_walk(g, metapath, traces, ntypes, prob=None):
traces = F.asnumpy(traces)
ntypes = F.asnumpy(ntypes)
for j in range(traces.shape[1] - 1):
assert ntypes[j] == g.get_ntype_id(g.to_canonical_etype(metapath[j])[0])
... | 47.659044 | 126 | 0.567658 |
6042c12cfef6c41795afaee5e6f92c8ab2598325 | 9,435 | py | Python | samples/roof_types/train_roof_model.py | mWollenhaupt/Mask_RCNN | 40366f4fb6e4853467293bfeb657e0d69585024f | [
"MIT"
] | null | null | null | samples/roof_types/train_roof_model.py | mWollenhaupt/Mask_RCNN | 40366f4fb6e4853467293bfeb657e0d69585024f | [
"MIT"
] | null | null | null | samples/roof_types/train_roof_model.py | mWollenhaupt/Mask_RCNN | 40366f4fb6e4853467293bfeb657e0d69585024f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import sys
import random
import math
import re
import time
import numpy as np
import cv2
import matplotlib
import matplotlib.pyplot as plt
import skimage.io
from imgaug import augmenters as iaa
import imgaug as ia
# Root directory of the project
ROOT_DIR = os... | 33.221831 | 157 | 0.629889 |
766190045266006ca75ef8f58ba1f3bb115e5859 | 28,906 | py | Python | zvmsdk/tests/unit/test_api.py | wngzhe/feilong | 43aeb9c002214e2b150cb1173cf4a2bae239aaa7 | [
"Apache-2.0"
] | null | null | null | zvmsdk/tests/unit/test_api.py | wngzhe/feilong | 43aeb9c002214e2b150cb1173cf4a2bae239aaa7 | [
"Apache-2.0"
] | null | null | null | zvmsdk/tests/unit/test_api.py | wngzhe/feilong | 43aeb9c002214e2b150cb1173cf4a2bae239aaa7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017,2021 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 44.064024 | 78 | 0.627551 |
08a44a4d5423bc24d10d60c34524642ea8970d9d | 1,120 | py | Python | persimmon/view/blocks/csvoutblock.py | AlvarBer/Persimmon | da08ed854dd0305d7e4684e97ee828acffd76b4d | [
"MIT"
] | 206 | 2016-11-02T20:45:48.000Z | 2022-02-07T05:43:18.000Z | persimmon/view/blocks/csvoutblock.py | mgbin088/Persimmon | da08ed854dd0305d7e4684e97ee828acffd76b4d | [
"MIT"
] | 6 | 2016-11-06T19:16:01.000Z | 2018-02-20T11:22:45.000Z | persimmon/view/blocks/csvoutblock.py | mgbin088/Persimmon | da08ed854dd0305d7e4684e97ee828acffd76b4d | [
"MIT"
] | 40 | 2017-03-08T21:01:53.000Z | 2020-12-29T16:43:56.000Z | from persimmon.view.pins import InputPin
from persimmon.view.util import FileDialog
from persimmon.view.blocks.block import Block
from kivy.properties import ObjectProperty, StringProperty
from kivy.lang import Builder
import numpy as np
import pandas as pd
Builder.load_file('persimmon/view/blocks/csvoutblock.kv')
... | 31.111111 | 76 | 0.665179 |
37100c3d52b29cc3756f66df886a7f5479039646 | 10,106 | py | Python | spacy_transformers/wrapper.py | maxtrem/spacy-transformers | 7458fc3466af0800617c3c106a4ff86fc0285f4d | [
"MIT"
] | null | null | null | spacy_transformers/wrapper.py | maxtrem/spacy-transformers | 7458fc3466af0800617c3c106a4ff86fc0285f4d | [
"MIT"
] | 1 | 2020-07-11T14:08:04.000Z | 2020-07-11T14:08:04.000Z | spacy_transformers/wrapper.py | maxtrem/spacy-transformers | 7458fc3466af0800617c3c106a4ff86fc0285f4d | [
"MIT"
] | 2 | 2020-06-04T18:38:34.000Z | 2022-02-19T19:23:19.000Z | from thinc.extra.wrappers import PyTorchWrapper, xp2torch, torch2xp
from transformers.optimization import AdamW
import transformers
import torch.autograd
import torch.nn.utils.clip_grad
import torch
from typing import Tuple, Callable, Any
from thinc.neural.optimizers import Optimizer
import numpy
import contextlib
from... | 37.992481 | 88 | 0.590243 |
eb5237ee19b1366d3f8afcf05da7a4a80734d3e4 | 1,467 | py | Python | LED_Knight_Rider01.py | LekkerPrutsen/LED-matrix-experiments | 62bd8b18be842df7648d5a09a87b203933541524 | [
"MIT"
] | 4 | 2017-01-27T15:08:05.000Z | 2019-07-27T19:35:13.000Z | LED_Knight_Rider01.py | LekkerPrutsen/LED-matrix-experiments | 62bd8b18be842df7648d5a09a87b203933541524 | [
"MIT"
] | null | null | null | LED_Knight_Rider01.py | LekkerPrutsen/LED-matrix-experiments | 62bd8b18be842df7648d5a09a87b203933541524 | [
"MIT"
] | 1 | 2018-03-31T13:09:00.000Z | 2018-03-31T13:09:00.000Z | # -*- coding: utf-8 -*-
import time
from random import randint
import max7219.led as led
device = led.matrix(cascaded=4)
device.orientation(90)
print "Press Ctrl+C to stop"
#ASCII codes
symbol01 = 219
symbol02 = 178
symbol03 = 177
symbol04 = 176
duration = 0.2
try:
while True:
#position 1
d... | 18.807692 | 34 | 0.587594 |
17abb5660d5577fd08a3c9ddab481c55cf7d159c | 24,233 | py | Python | tests/test_taskgroups.py | byronformwalt/anyio | 35858dcd08d2522fee3f84b213d55d902ebbc2ff | [
"MIT"
] | null | null | null | tests/test_taskgroups.py | byronformwalt/anyio | 35858dcd08d2522fee3f84b213d55d902ebbc2ff | [
"MIT"
] | null | null | null | tests/test_taskgroups.py | byronformwalt/anyio | 35858dcd08d2522fee3f84b213d55d902ebbc2ff | [
"MIT"
] | null | null | null | import asyncio
import re
import sys
import time
import pytest
import trio
import anyio
from anyio import (
CancelScope, ExceptionGroup, create_task_group, current_effective_deadline, current_time,
fail_after, get_cancelled_exc_class, move_on_after, sleep, wait_all_tasks_blocked)
if sys.version_info < (3, 7):... | 27.32018 | 99 | 0.653695 |
ebef1c101324744cadab3ce6c3e39ccb05c9efed | 1,934 | py | Python | Splunk_TA_paloalto/bin/Splunk_TA_paloalto_rh_cortex_xdr.py | moshekaplan/Splunk-Apps | fc95334aa2ee2209b221bd5b2a6a520ad9ecab4a | [
"0BSD"
] | 34 | 2016-03-25T08:09:05.000Z | 2020-07-23T05:04:16.000Z | Splunk_TA_paloalto/bin/Splunk_TA_paloalto_rh_cortex_xdr.py | moshekaplan/Splunk-Apps | fc95334aa2ee2209b221bd5b2a6a520ad9ecab4a | [
"0BSD"
] | 127 | 2020-08-07T21:56:58.000Z | 2022-03-30T18:24:53.000Z | Splunk_TA_paloalto/bin/Splunk_TA_paloalto_rh_cortex_xdr.py | moshekaplan/Splunk-Apps | fc95334aa2ee2209b221bd5b2a6a520ad9ecab4a | [
"0BSD"
] | 22 | 2016-03-26T09:39:19.000Z | 2020-07-27T21:17:55.000Z |
import splunk_ta_paloalto_declare
from splunktaucclib.rest_handler.endpoint import (
field,
validator,
RestModel,
DataInputModel,
)
from splunktaucclib.rest_handler import admin_external, util
from splunk_aoblib.rest_migration import ConfigMigrationHandler
util.remove_http_proxy_env_vars()
fields =... | 19.535354 | 63 | 0.544467 |
430e28f567856a1115587b43a19d9f22689d789f | 752 | py | Python | Client/scraping.py | alejodiazg/DadaPoemGenerator | 798d6e4a80b3b79201e65e394f11748a5d25ea8a | [
"MIT"
] | null | null | null | Client/scraping.py | alejodiazg/DadaPoemGenerator | 798d6e4a80b3b79201e65e394f11748a5d25ea8a | [
"MIT"
] | null | null | null | Client/scraping.py | alejodiazg/DadaPoemGenerator | 798d6e4a80b3b79201e65e394f11748a5d25ea8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from lxml import html
import requests
from random import shuffle
from re import search
print(" ")
print("***** INSTRUCCIONES PARA REALIZAR UN POEMA DADAÍSTA *****")
print("***** (Sin necesidad de periódicos o tijeras) *****")
print(" ")
url = raw_input("Introduzca el URL del artículo sel... | 24.258065 | 66 | 0.658245 |
5c1a11917529a867c7dfd9d48fa45816d5863d2a | 959 | py | Python | ML_and_DL/gpu_project.py | AshfakYeafi/AI_practice_code | 3d8a0b9382f5903e840ce59218ebb95ca962ab01 | [
"MIT"
] | null | null | null | ML_and_DL/gpu_project.py | AshfakYeafi/AI_practice_code | 3d8a0b9382f5903e840ce59218ebb95ca962ab01 | [
"MIT"
] | null | null | null | ML_and_DL/gpu_project.py | AshfakYeafi/AI_practice_code | 3d8a0b9382f5903e840ce59218ebb95ca962ab01 | [
"MIT"
] | null | null | null | import tensorflow as tf
import cv2
from tensorflow import keras
import matplotlib.pyplot as plt
import numpy as np
(x_train,y_train),(x_test,y_test)=tf.keras.datasets.cifar10.load_data()
classes=["airplane", "automobile", "bird","cat","deer","dog","frog","horse","ship","truck"]
x_train_scaled=x_train/255
x_test_scale... | 18.09434 | 91 | 0.727842 |
7e938db1a1cb23f0ac8b5d897b9240c86e4f9287 | 955 | py | Python | stable_baselines3/common/recorder.py | offdroid/stable-baselines3 | 793bf44e11fe1e6735e8984add42442e5ab59d0f | [
"MIT"
] | null | null | null | stable_baselines3/common/recorder.py | offdroid/stable-baselines3 | 793bf44e11fe1e6735e8984add42442e5ab59d0f | [
"MIT"
] | null | null | null | stable_baselines3/common/recorder.py | offdroid/stable-baselines3 | 793bf44e11fe1e6735e8984add42442e5ab59d0f | [
"MIT"
] | null | null | null | from typing import List, Tuple
from enum import Enum
class ReplayMode(Enum):
"""No recording or replay"""
IGNORE = 1
"""Record the training buffer"""
RECORDING = 2
"""Replay a given buffer"""
REPLAYING = 3
class Recording:
def __init__(self, source: List) -> None:
self.pos = 0
... | 24.487179 | 80 | 0.597906 |
642cf8d3a51d63ae2db4a42fb7e03f804a6e2c42 | 571 | py | Python | qlib/contrib/online/__init__.py | lpd6375/qlib | 3a911bc09ba5136cd7c61c2c8dcca8a63339e738 | [
"MIT"
] | 1 | 2022-02-05T06:54:28.000Z | 2022-02-05T06:54:28.000Z | qlib/contrib/online/__init__.py | lpd6375/qlib | 3a911bc09ba5136cd7c61c2c8dcca8a63339e738 | [
"MIT"
] | null | null | null | qlib/contrib/online/__init__.py | lpd6375/qlib | 3a911bc09ba5136cd7c61c2c8dcca8a63339e738 | [
"MIT"
] | 1 | 2022-03-22T06:37:38.000Z | 2022-03-22T06:37:38.000Z | # pylint: skip-file
'''
TODO:
- Online needs that the model have such method
def get_data_with_date(self, date, **kwargs):
"""
Will be called in online module
need to return the data that used to predict the label (score) of stocks at date.
:param
date: pd.Timestamp
... | 27.190476 | 98 | 0.618214 |
8cb519dd73ef2509e17d878d0ec8f2d5b5f35250 | 7,086 | py | Python | test/functional/llmq-chainlocks.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | null | null | null | test/functional/llmq-chainlocks.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | null | null | null | test/functional/llmq-chainlocks.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | 1 | 2021-01-03T02:35:54.000Z | 2021-01-03T02:35:54.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2020 The autx Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
from test_framework.mininode import *
from test_framework.test_framework import autxTestFramewo... | 45.716129 | 123 | 0.670336 |
8e5ee16141e43d4fa74f17f6c4f49a59d45501bc | 6,950 | py | Python | steps.py | undoingtech/Sticky-Steps | fdb3af0c4c7e0ccf3689204d298d0794c2f99dc6 | [
"MIT"
] | null | null | null | steps.py | undoingtech/Sticky-Steps | fdb3af0c4c7e0ccf3689204d298d0794c2f99dc6 | [
"MIT"
] | null | null | null | steps.py | undoingtech/Sticky-Steps | fdb3af0c4c7e0ccf3689204d298d0794c2f99dc6 | [
"MIT"
] | null | null | null | """ TODO: cosmetics
- get rid of the lines from html_label
"""
""" TODO: functionality
- new temporary input file (opens editor)
- save temporary input file (opens save dialog)
- text resizing / zoom
- remember text size / zoom on close
- open file from url
- copy button for codeblocks and code
- remember file and st... | 33.253589 | 142 | 0.71554 |
87ece73966885a4b54b7c9a3af968b9f263fb60d | 620 | py | Python | pyvac/tests/mocks/celery.py | sayoun/pyvac | 45ade8de2f29864d500e0358e38ebcbd2674a06d | [
"BSD-3-Clause"
] | 21 | 2015-11-19T17:36:46.000Z | 2021-07-02T15:48:21.000Z | pyvac/tests/mocks/celery.py | sayoun/pyvac | 45ade8de2f29864d500e0358e38ebcbd2674a06d | [
"BSD-3-Clause"
] | 28 | 2015-07-03T07:54:48.000Z | 2022-03-21T22:16:23.000Z | pyvac/tests/mocks/celery.py | sayoun/pyvac | 45ade8de2f29864d500e0358e38ebcbd2674a06d | [
"BSD-3-Clause"
] | 13 | 2015-07-03T07:30:04.000Z | 2020-07-03T15:22:51.000Z | # -*- coding: utf-8 -*-
""" Mock classses for Celery subtask method and Task class. """
def subtask(task):
return task
class DummyTask(object):
_ids = {
'worker_approved': 10,
'worker_accepted': 20,
'worker_denied': 30,
}
def __init__(self, task=None):
self.task = ... | 16.756757 | 63 | 0.570968 |
6acba325333dfee5254429a311e85022dc800296 | 7,075 | py | Python | ucsb/repository/asset_repository.py | jasunchen/agmonitor_backend | 2eea26732dea09080af2a7e700c24ef7f9300f2c | [
"MIT"
] | null | null | null | ucsb/repository/asset_repository.py | jasunchen/agmonitor_backend | 2eea26732dea09080af2a7e700c24ef7f9300f2c | [
"MIT"
] | null | null | null | ucsb/repository/asset_repository.py | jasunchen/agmonitor_backend | 2eea26732dea09080af2a7e700c24ef7f9300f2c | [
"MIT"
] | null | null | null | from ucsb.models import user_asset, user
from rest_framework.response import Response
from rest_framework.decorators import api_view
from ucsb.repository.asset_data_repository import delete_asset_data_helper
from django.forms.models import model_to_dict
from ucsb.repository.helpers import *
@api_view(['POST'])
def add... | 38.243243 | 192 | 0.619788 |
a574e9c80a438acde205cffa5ed7393322181f4a | 1,839 | py | Python | src/tic_tac_toe_game/__main__.py | alexistli/tic-tac-toe-game | f6689d5ea722c3ea52c06c8a3433cf052543297f | [
"MIT"
] | 1 | 2021-12-11T09:10:33.000Z | 2021-12-11T09:10:33.000Z | src/tic_tac_toe_game/__main__.py | alexistli/tic-tac-toe-game | f6689d5ea722c3ea52c06c8a3433cf052543297f | [
"MIT"
] | 39 | 2021-11-01T23:18:43.000Z | 2022-03-31T23:27:55.000Z | src/tic_tac_toe_game/__main__.py | alexistli/tic-tac-toe-game | f6689d5ea722c3ea52c06c8a3433cf052543297f | [
"MIT"
] | null | null | null | """Command-line interface."""
import click
from tic_tac_toe_game import engine
@click.command()
@click.version_option()
def main() -> None:
"""Tic Tac Toe Game."""
click.secho("hello", fg="green")
if click.confirm("Do you want to play a game?", abort=True):
click.echo("Let's play a game...")
... | 28.292308 | 72 | 0.584013 |
3359fef0e98cc83f7723cb3fe70bb7cba5b8a9ab | 1,749 | py | Python | movie.py | Roger-tn-su/javbus_crawler | ebc163a778df2210f8a01749f84057f8fdcb9229 | [
"MIT"
] | null | null | null | movie.py | Roger-tn-su/javbus_crawler | ebc163a778df2210f8a01749f84057f8fdcb9229 | [
"MIT"
] | null | null | null | movie.py | Roger-tn-su/javbus_crawler | ebc163a778df2210f8a01749f84057f8fdcb9229 | [
"MIT"
] | 1 | 2021-10-30T18:30:56.000Z | 2021-10-30T18:30:56.000Z |
class Movie:
""" class for each movie in javbus website"""
def __init__(self, avNum, title, coverImgUrl, date):
self._avNum = avNum
self._title = title
self._cover_img = coverImgUrl
self._release_date = date
@property
def avNum(self):
return self._avNum
@p... | 20.576471 | 98 | 0.608348 |
fa64d027993ad0602ee242b438a5dab7c4abc5aa | 2,767 | py | Python | setup.py | kadeve/assistant-sdk-python | d8f6143f03851a0c2f236e12c2f1051f8f77178c | [
"Apache-2.0"
] | null | null | null | setup.py | kadeve/assistant-sdk-python | d8f6143f03851a0c2f236e12c2f1051f8f77178c | [
"Apache-2.0"
] | null | null | null | setup.py | kadeve/assistant-sdk-python | d8f6143f03851a0c2f236e12c2f1051f8f77178c | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# 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,... | 31.804598 | 76 | 0.653415 |
621879993257357bd94ae2ab02c4f42840705bd9 | 6,686 | py | Python | funsor/joint.py | bogiebro/funsor | c15eaf7019e34c647630ed3da89001e620a972fa | [
"Apache-2.0"
] | null | null | null | funsor/joint.py | bogiebro/funsor | c15eaf7019e34c647630ed3da89001e620a972fa | [
"Apache-2.0"
] | null | null | null | funsor/joint.py | bogiebro/funsor | c15eaf7019e34c647630ed3da89001e620a972fa | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import math
from collections import OrderedDict
from functools import reduce
from typing import Tuple, Union
from multipledispatch import dispatch
from multipledispatch.variadic import Variadic
import funsor.ops as ops
from funsor.cn... | 42.858974 | 120 | 0.667963 |
b5cca9bc3246e5b87c5752b1652216acb8c65c7b | 216 | py | Python | yabul/__init__.py | timodonnell/yabul | d2ad2fbf934b375f9ef2b6f2d9c2ab9c157260d2 | [
"Apache-2.0"
] | 2 | 2021-03-01T20:09:20.000Z | 2021-03-02T05:52:34.000Z | yabul/__init__.py | timodonnell/yabul | d2ad2fbf934b375f9ef2b6f2d9c2ab9c157260d2 | [
"Apache-2.0"
] | null | null | null | yabul/__init__.py | timodonnell/yabul | d2ad2fbf934b375f9ef2b6f2d9c2ab9c157260d2 | [
"Apache-2.0"
] | null | null | null | """
Yet Another Bioinformatics Utility Library
"""
__version__ = "0.0.3"
from .fasta import read_fasta, write_fasta
from .align import align_pair
__all__ = [
"read_fasta",
"write_fasta",
"align_pair",
]
| 16.615385 | 42 | 0.699074 |
596289ba8a1eb9f05ef70c8af8d9347678a59cb9 | 1,871 | py | Python | src/preprocess/displace_matrix.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 2 | 2021-01-05T02:55:57.000Z | 2021-04-16T15:49:08.000Z | src/preprocess/displace_matrix.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | null | null | null | src/preprocess/displace_matrix.py | MelvinYin/Defined_Proteins | 75da20be82a47d85d27176db29580ab87d52b670 | [
"BSD-3-Clause"
] | 1 | 2021-01-05T08:12:38.000Z | 2021-01-05T08:12:38.000Z | """
Displace a matrix file to the left or right, filling remaining spots with the
composition frequencies.
"""
import matplotlib.pyplot as plt
import os
from config import paths
from utils import seq_logo
from preprocess import crop_matrix
def displace(displacement, matrix_file, output_file,
composition... | 31.183333 | 77 | 0.644041 |
db91d1a194430276df4a1258b130857333228a1e | 5,715 | py | Python | test_net.py | R2D2oid/slowfast_feature_extractor | a5f2f0bdeee964ffd3b5e5950d84c22b93ab8467 | [
"MIT"
] | 63 | 2019-11-08T14:03:26.000Z | 2022-03-06T05:28:40.000Z | test_net.py | xujinglin/slowfast_feature_extractor | be219c1dbf24511a189e458cc8d4ab5c0292a335 | [
"MIT"
] | 15 | 2019-11-11T09:16:30.000Z | 2022-03-08T14:56:21.000Z | test_net.py | xujinglin/slowfast_feature_extractor | be219c1dbf24511a189e458cc8d4ab5c0292a335 | [
"MIT"
] | 17 | 2019-11-11T07:38:59.000Z | 2021-11-19T19:29:09.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Modified to process a list of videos
"""Extract features for videos using pre-trained networks"""
import numpy as np
import torch
import os
import time
from tqdm import tqdm
import av
from moviepy.video.io.VideoFileClip ... | 32.657143 | 83 | 0.584427 |
3c3513a3ef5992c12d88cee0ae7da54721bec955 | 7,841 | py | Python | train.py | ruyueshi/crnn.pytorch-1 | 2272d4defc328c033a889b9ca3279795f268b52d | [
"MIT"
] | 2,122 | 2017-03-23T02:43:38.000Z | 2022-03-30T22:48:43.000Z | train.py | Salamit/crnn.pytorch | d3a47f91691b31b8d5336e2ed5932e6cf65142f0 | [
"MIT"
] | 242 | 2017-04-02T07:05:24.000Z | 2022-03-15T08:35:22.000Z | train.py | Salamit/crnn.pytorch | d3a47f91691b31b8d5336e2ed5932e6cf65142f0 | [
"MIT"
] | 646 | 2017-03-04T15:15:40.000Z | 2022-03-30T02:32:48.000Z | from __future__ import print_function
from __future__ import division
import argparse
import random
import torch
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variable
import numpy as np
from warpctc_pytorch import CTCLoss
import os
import utils
imp... | 36.640187 | 117 | 0.693406 |
9a1837e2f9dd3fc1a3e0d38816c4c8288db421e0 | 197 | py | Python | leonardo_package_index/apps/package_index_api.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | null | null | null | leonardo_package_index/apps/package_index_api.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | 11 | 2015-08-28T23:00:15.000Z | 2016-09-17T19:31:00.000Z | leonardo_package_index/apps/package_index_api.py | leonardo-modules/leonardo-package-index | ed4dd006055fe99d841ce09776507a2cd31c2b83 | [
"BSD-3-Clause"
] | null | null | null |
from django.conf.urls import *
urlpatterns = patterns('leonardo_package_index.apps.views',
url(r'^', include('leonardo_package_index.api.urls'),),
)
| 28.142857 | 78 | 0.57868 |
69eb164733d6ec8bd04522102a81225cce0bf977 | 2,268 | py | Python | src/utils/glove.py | LaudateCorpus1/hermes-5 | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 135 | 2015-11-17T09:04:37.000Z | 2022-01-14T07:00:34.000Z | src/utils/glove.py | cacan/hermes | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 16 | 2015-11-19T18:04:13.000Z | 2016-11-19T00:30:12.000Z | src/utils/glove.py | cacan/hermes | d9b50452379fe636da96c2bad2d286afa15cd7b9 | [
"Apache-2.0"
] | 68 | 2015-11-13T22:51:57.000Z | 2022-01-26T01:51:09.000Z | import numpy as np
class Glove(object):
"""Load a GloVe model and provide access to the vectors and vector space.
Provides access to word vectors as if it were a dictionary:
glove_instance = Glove('file')
glove['word']
Unrecognized words will return the Null vector (all 0).
Also pro... | 31.5 | 78 | 0.59612 |
35b101f2c6f3c7d3d6daf2d23908f82c5f60f15f | 2,388 | py | Python | python/cuda_linux_demo/model_test.py | windstamp/Paddle-Inference-Demo | de773a0864eb12911d2cdcbc8f1f036911541c60 | [
"Apache-2.0"
] | 115 | 2020-05-06T09:47:08.000Z | 2022-03-31T08:47:18.000Z | python/cuda_linux_demo/model_test.py | windstamp/Paddle-Inference-Demo | de773a0864eb12911d2cdcbc8f1f036911541c60 | [
"Apache-2.0"
] | 79 | 2020-05-06T09:51:45.000Z | 2022-03-27T00:23:29.000Z | python/cuda_linux_demo/model_test.py | windstamp/Paddle-Inference-Demo | de773a0864eb12911d2cdcbc8f1f036911541c60 | [
"Apache-2.0"
] | 81 | 2020-05-06T09:47:11.000Z | 2022-03-23T07:29:32.000Z | import numpy as np
import argparse
import cv2
from paddle.inference import Config
from paddle.inference import create_predictor
from paddle.inference import PrecisionType
from img_preprocess import preprocess
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--model_dir",
... | 31.421053 | 173 | 0.646566 |
2c26c233741c290e55f23f5fb8856be3cd70b909 | 2,068 | py | Python | motorodm/documents/meta_document.py | rob-blackbourn/motorodm | c77e79bd2b11c896b9a971ba6a9c4947dce96163 | [
"Apache-2.0"
] | null | null | null | motorodm/documents/meta_document.py | rob-blackbourn/motorodm | c77e79bd2b11c896b9a971ba6a9c4947dce96163 | [
"Apache-2.0"
] | null | null | null | motorodm/documents/meta_document.py | rob-blackbourn/motorodm | c77e79bd2b11c896b9a971ba6a9c4947dce96163 | [
"Apache-2.0"
] | null | null | null | from ..fields.field import Field
from ..fields import ObjectIdField
from ..query_sets.query_set import QuerySet
class MetaEmbeddedDocument(type):
def __new__(cls, name, bases, dct):
dct['_fields'] = {}
dct['_db_name_map'] = {}
dct['_indices'] = []
for base in bases:
... | 31.815385 | 102 | 0.597195 |
d27a7cd8fb1a33aefe639f54dcde93489cfbe955 | 6,982 | py | Python | JobScript/wind_to_db/wind_stock_daily_import.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | null | null | null | JobScript/wind_to_db/wind_stock_daily_import.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | 9 | 2021-02-08T20:19:53.000Z | 2022-03-11T23:16:46.000Z | JobScript/wind_to_db/wind_stock_daily_import.py | zuoziji/transaction | 7a59817a699d9df32e13d43edda630520af7860d | [
"Apache-2.0"
] | 2 | 2019-03-03T14:27:54.000Z | 2019-07-22T09:00:35.000Z | from datetime import date, datetime, timedelta
import pandas as pd
import numpy as np
from config_fh import get_db_engine, get_db_session, STR_FORMAT_DATE, UN_AVAILABLE_DATE, WIND_REST_URL
from fh_tools.windy_utils_rest import WindRest
from fh_tools.fh_utils import get_last, get_first
import logging
from sqlalch... | 44.75641 | 133 | 0.584073 |
7e99ec6791ef449bd15d88bc40e47be5465426ce | 2,149 | py | Python | bot_4u/shop.py | Gametz/Helper_Bot | c48c8258a71782ecc4621b0a0eac3f9de4d461b7 | [
"Apache-2.0"
] | null | null | null | bot_4u/shop.py | Gametz/Helper_Bot | c48c8258a71782ecc4621b0a0eac3f9de4d461b7 | [
"Apache-2.0"
] | null | null | null | bot_4u/shop.py | Gametz/Helper_Bot | c48c8258a71782ecc4621b0a0eac3f9de4d461b7 | [
"Apache-2.0"
] | null | null | null | import json
def shop():
return "Магазин:" \
"\n" \
"\n 🚗 Машины" \
"\n 📱 Телефоны" \
"\n 🏡 Дома" \
"\n 🎞 Видеокарты" \
"\n ₿ Биткоины" \
"\n" \
"\n📌 Для просмотра категории используйте ее... | 35.229508 | 73 | 0.442531 |
02f488e6ce3fe201ae71bfea566b158c06d9e203 | 5,026 | py | Python | dataset_processing/process_modelnet.py | Mingy2018/SwitchVAE | cf9c06ce3af50a559d79b9cba14851472e43a70b | [
"MIT"
] | 1 | 2021-07-22T00:46:06.000Z | 2021-07-22T00:46:06.000Z | dataset_processing/process_modelnet.py | Mingy2018/SwitchVAE | cf9c06ce3af50a559d79b9cba14851472e43a70b | [
"MIT"
] | null | null | null | dataset_processing/process_modelnet.py | Mingy2018/SwitchVAE | cf9c06ce3af50a559d79b9cba14851472e43a70b | [
"MIT"
] | 1 | 2021-12-07T17:10:19.000Z | 2021-12-07T17:10:19.000Z | import os
import numpy as np
from utils import binvox_rw
import glob
if __name__ == '__main__':
ModelNet10_ROOT = '/home/zmy/Datasets/ModelNet10/ModelNet10'
ModelNet40_ROOT = '/home/zmy/Datasets/ModelNet40'
image_ROOT = '/home/zmy/mmi_dataset/ModelNet40_images/modelnet40_images_new_12x'
ModelNet10_CLA... | 45.690909 | 120 | 0.449065 |
1c51aa15373779b06273296a27d913c070079f41 | 857 | py | Python | python/paddle/fluid/contrib/slim/quantization/__init__.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2022-03-26T11:44:07.000Z | 2022-03-26T11:44:07.000Z | python/paddle/fluid/contrib/slim/quantization/__init__.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/contrib/slim/quantization/__init__.py | ysh329/Paddle | 50ad9046c9a440564d104eaa354eb9df83a35678 | [
"Apache-2.0"
] | 1 | 2022-03-26T11:44:12.000Z | 2022-03-26T11:44:12.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 37.26087 | 74 | 0.787631 |
7be7a563b31adbb4c9c6a38a319557746106dc98 | 2,409 | py | Python | day20/part2.py | mtn/advent18 | 634ad20f02c321d6a38583077ee6b7f84a8848e5 | [
"MIT"
] | 1 | 2018-12-01T20:58:37.000Z | 2018-12-01T20:58:37.000Z | day20/part2.py | mtn/advent18 | 634ad20f02c321d6a38583077ee6b7f84a8848e5 | [
"MIT"
] | null | null | null | day20/part2.py | mtn/advent18 | 634ad20f02c321d6a38583077ee6b7f84a8848e5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from collections import defaultdict
open_parens = []
start_end = {} # open paren to close paren ind
alt_starts = {} # alternation to opening "("
alts = {} # maps "(" ind to [alternations]
with open("input.txt") as f:
inp = f.read().strip()
for i, ch in enumerate(inp):
if ch == "$":
... | 24.333333 | 74 | 0.479867 |
c045e6c776ebf0200b59b2bd61fbe2c462c08bca | 6,031 | py | Python | pydown/downloader.py | qorost/pydown | b8ab1ff12c20f0e9e3f7af30bea31f4288025d7e | [
"BSD-2-Clause"
] | null | null | null | pydown/downloader.py | qorost/pydown | b8ab1ff12c20f0e9e3f7af30bea31f4288025d7e | [
"BSD-2-Clause"
] | null | null | null | pydown/downloader.py | qorost/pydown | b8ab1ff12c20f0e9e3f7af30bea31f4288025d7e | [
"BSD-2-Clause"
] | null | null | null | import sys
import urllib
import urllib2
#import requests
import os.path
import thread
import threading
import argparse
def print_progress(iteration,total,prefix='Progress: ',suffix='Complete',decimals = 2, barlen = 100):
"""
http://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console
... | 31.910053 | 113 | 0.507213 |
d8ffa1d38fd38bef012c335812ecb17304bf1ace | 5,266 | py | Python | raymon/types.py | pbonte/raymon | 83912d7a5ff22d61289688828169a7178fa34a2d | [
"MIT"
] | 21 | 2021-06-14T08:37:22.000Z | 2022-03-08T05:41:54.000Z | raymon/types.py | pbonte/raymon | 83912d7a5ff22d61289688828169a7178fa34a2d | [
"MIT"
] | 57 | 2021-01-30T08:45:13.000Z | 2022-02-21T16:15:00.000Z | raymon/types.py | pbonte/raymon | 83912d7a5ff22d61289688828169a7178fa34a2d | [
"MIT"
] | 1 | 2021-06-18T09:53:58.000Z | 2021-06-18T09:53:58.000Z | import json
import io
from abc import ABC, abstractmethod
from pydoc import locate
import msgpack
import numpy as np
import pandas as pd
import base64
import ast
from PIL import Image as PILImage
from raymon.globals import Serializable
class RaymonDataType(Serializable, ABC):
def to_json(self):
return jso... | 29.418994 | 263 | 0.6109 |
4e04e12ca888d485002ae7196472f3182c8a4d8a | 640 | py | Python | release/cs_submitter/mainform/views.py | kvswim/kv_jhucs_coursesubmit | a00f2d1ca52204857bdf34271e13d97b424fcfca | [
"MIT"
] | null | null | null | release/cs_submitter/mainform/views.py | kvswim/kv_jhucs_coursesubmit | a00f2d1ca52204857bdf34271e13d97b424fcfca | [
"MIT"
] | null | null | null | release/cs_submitter/mainform/views.py | kvswim/kv_jhucs_coursesubmit | a00f2d1ca52204857bdf34271e13d97b424fcfca | [
"MIT"
] | null | null | null | #Kyle Verdeyen
#Independent Study, Summer 2017
#Joanne Selinski
#View for the mainform. Very basic validation checks.
from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse
from .forms import MainFormModelForm
from django.urls import reverse
# Create your views here.
def... | 30.47619 | 65 | 0.75 |
ae70b469d9ff51872b0638d41b15693be95ad731 | 7,398 | py | Python | mars/services/scheduling/supervisor/tests/test_queue_balance.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/services/scheduling/supervisor/tests/test_queue_balance.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/services/scheduling/supervisor/tests/test_queue_balance.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 40.872928 | 90 | 0.628008 |
1bd69ceec19c6af6752dbe20cdaa51daebdac417 | 183 | py | Python | mindhome_alpha/erpnext/patches/v5_0/rename_customer_issue.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | mindhome_alpha/erpnext/patches/v5_0/rename_customer_issue.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | null | null | null | mindhome_alpha/erpnext/patches/v5_0/rename_customer_issue.py | Mindhome/field_service | 3aea428815147903eb9af1d0c1b4b9fc7faed057 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.table_exists("Customer Issue"):
frappe.rename_doc("DocType", "Customer Issue", "Warranty Claim")
| 26.142857 | 66 | 0.775956 |
3385ae91238131c0f2ff872285f9cab3f21c3557 | 2,189 | py | Python | fynance/models/xgb.py | ArthurBernard/Fynance | efd9a2e6f8eddcff017d828972236312f6f24084 | [
"MIT"
] | 19 | 2018-12-13T18:52:51.000Z | 2021-09-03T00:33:47.000Z | fynance/models/xgb.py | ArthurBernard/Fynance | efd9a2e6f8eddcff017d828972236312f6f24084 | [
"MIT"
] | null | null | null | fynance/models/xgb.py | ArthurBernard/Fynance | efd9a2e6f8eddcff017d828972236312f6f24084 | [
"MIT"
] | 6 | 2019-05-31T16:51:51.000Z | 2021-07-29T21:31:25.000Z | #!/usr/bin/env python3
# coding: utf-8
# @Author: ArthurBernard
# @Email: arthur.bernard.92@gmail.com
# @Date: 2019-04-23 19:15:05
# @Last modified by: ArthurBernard
# @Last modified time: 2019-09-25 14:14:47
# Built-in packages
# Third party packages
# import xgboost as xgb
# Local packages
__all__ = ['XGB', 'XGB... | 24.595506 | 80 | 0.562814 |
79e4955fbc2717ea605a117d3b035dbae454bceb | 36,864 | py | Python | tensorflow/python/autograph/impl/api_test.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/python/autograph/impl/api_test.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/autograph/impl/api_test.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # Copyright 2017 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... | 28.400616 | 86 | 0.678792 |
dc2fc7e67bc880962a42b7655e4b7d26a8f72a0d | 5,474 | py | Python | com/xiumei/etl/process_finance_data.py | struggle3014/aqf | d0477075bd6d25d0de82acd9796a5a4e9e056b2e | [
"Apache-2.0"
] | 2 | 2020-02-07T15:08:12.000Z | 2020-04-14T09:48:07.000Z | com/xiumei/etl/process_finance_data.py | struggle3014/aqf | d0477075bd6d25d0de82acd9796a5a4e9e056b2e | [
"Apache-2.0"
] | null | null | null | com/xiumei/etl/process_finance_data.py | struggle3014/aqf | d0477075bd6d25d0de82acd9796a5a4e9e056b2e | [
"Apache-2.0"
] | null | null | null | # -*- coding=utf-8 -*-
import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
import seaborn
import tushare as ts
import scipy.stats as stats
# 1.1- 获取单个证券的股价数据
def get_single_stock_data(stock, start_date, end_date):
# 获取证券的股价。数据类型为 pandas.core.frame.DataFrame
data = ts.get_k_d... | 34 | 116 | 0.658385 |
8ada3766ccb0b1de8ad1debab6da32648e1e988f | 1,679 | py | Python | myshkin/mixins/model.py | jakesnell/myshkin | cea0a625b1913627e27d66d0ada9155402f57d33 | [
"MIT"
] | null | null | null | myshkin/mixins/model.py | jakesnell/myshkin | cea0a625b1913627e27d66d0ada9155402f57d33 | [
"MIT"
] | null | null | null | myshkin/mixins/model.py | jakesnell/myshkin | cea0a625b1913627e27d66d0ada9155402f57d33 | [
"MIT"
] | null | null | null | import os
import glob
import yaml
import numpy as np
import keras
class Model(object):
def save_conf(self, out_file):
with open(out_file, 'w') as f:
conf_dict = {'model': self.__class__.__name__,
'opts': dict(self.opts._asdict())}
f.write(yaml.dump(conf_dic... | 35.723404 | 91 | 0.596188 |
4a84eff221ec4d84cf0a858d30cc9ef4061428fe | 1,867 | py | Python | commands.py | Bocom/LSP-typescript | c2fbd5f756ff0fe36142b00a31100bf7505bdbc1 | [
"MIT"
] | null | null | null | commands.py | Bocom/LSP-typescript | c2fbd5f756ff0fe36142b00a31100bf7505bdbc1 | [
"MIT"
] | null | null | null | commands.py | Bocom/LSP-typescript | c2fbd5f756ff0fe36142b00a31100bf7505bdbc1 | [
"MIT"
] | null | null | null | from .protocol import Call, CallsDirection, CallsRequestParams, CallsResponse
from LSP.plugin import Request
from LSP.plugin import Session
from LSP.plugin.core.protocol import LocationLink
from LSP.plugin.core.registry import LspTextCommand
from LSP.plugin.core.typing import Optional
from LSP.plugin.core.views import ... | 38.102041 | 117 | 0.688806 |
020af2a1bce83b829f5f549f2229002dcd2274fc | 9,491 | py | Python | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py | hmcl/ambari-apache | 87423d64f54d896c62d1a9245eb03a97763e35a4 | [
"Apache-2.0"
] | 1 | 2021-05-06T06:24:04.000Z | 2021-05-06T06:24:04.000Z | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py | hmcl/ambari-apache | 87423d64f54d896c62d1a9245eb03a97763e35a4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/hbase.py | hmcl/ambari-apache | 87423d64f54d896c62d1a9245eb03a97763e35a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
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");... | 34.638686 | 116 | 0.660837 |
cf922ee9a428e5e2e14e71ebf5fb49ed68e89d24 | 1,271 | py | Python | setup.py | laterpay/djtranslationchecker | 6589ed3472193a795d78504a9f2337cd045b29f2 | [
"MIT"
] | 1 | 2015-03-25T09:30:55.000Z | 2015-03-25T09:30:55.000Z | setup.py | laterpay/djtranslationchecker | 6589ed3472193a795d78504a9f2337cd045b29f2 | [
"MIT"
] | null | null | null | setup.py | laterpay/djtranslationchecker | 6589ed3472193a795d78504a9f2337cd045b29f2 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from setuptools import find_packages, setup
import codecs
import os
#import time
#_version = "0.10.dev%s" % int(time.time())
_version = "0.10.0"
_packages = find_packages('.', exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
if os.path.exists('README.rst'):
_long_description = codecs... | 28.244444 | 84 | 0.638867 |
ca071c293474dd0ee380b182a0684ea4dd7fde3b | 170 | py | Python | persist.py | leosantos16/sample-market-maker | 4006b1a7fadf0db3821202cfb5681768af33d711 | [
"Apache-2.0"
] | null | null | null | persist.py | leosantos16/sample-market-maker | 4006b1a7fadf0db3821202cfb5681768af33d711 | [
"Apache-2.0"
] | null | null | null | persist.py | leosantos16/sample-market-maker | 4006b1a7fadf0db3821202cfb5681768af33d711 | [
"Apache-2.0"
] | null | null | null | from subprocess import Popen
import sys
filename = 'run.py'
while True:
print("\nStarting " + filename)
p = Popen("python " + filename, shell=True)
p.wait()
| 18.888889 | 47 | 0.658824 |
9e511e5d1d9bdf7f3fa6fac8215605f4269c1137 | 1,771 | py | Python | cafe/drivers/unittest/config.py | melissa-kam/opencafe | af90c228084d479afa60b8b06a6b5d4d1adf2b8e | [
"Apache-2.0"
] | null | null | null | cafe/drivers/unittest/config.py | melissa-kam/opencafe | af90c228084d479afa60b8b06a6b5d4d1adf2b8e | [
"Apache-2.0"
] | null | null | null | cafe/drivers/unittest/config.py | melissa-kam/opencafe | af90c228084d479afa60b8b06a6b5d4d1adf2b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Rackspace
# 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, sof... | 37.680851 | 79 | 0.726708 |
d28f307af02ce3bac54ba47c296eef107a99687c | 4,432 | py | Python | src/103_signal_processing.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/103_signal_processing.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | src/103_signal_processing.py | j20232/kaggle_earthquake | 47fac5f2e8d2ad4fab82426a0b6af18b71e4b57b | [
"MIT"
] | null | null | null | """Extract signal processing features
Reference: https://www.kaggle.com/gpreda/lanl-earthquake-eda-and-prediction
"""
import sys
import numpy as np
import pandas as pd
from pathlib import Path
from sklearn.linear_model import LinearRegression
from tqdm import tqdm
import competition as cc
from common import stop_... | 43.45098 | 147 | 0.678475 |
7d6fa3b3374606aeeb424c0e983aa60cabcb2ff0 | 1,209 | py | Python | dgi_gcn/models/dgi.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | dgi_gcn/models/dgi.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | dgi_gcn/models/dgi.py | Guo-lab/Graph | c4c5fbc8fb5d645c16da20351b9746019cf75aab | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from layers import GCN, AvgReadout, Discriminator
class DGI(nn.Module):
def __init__(self, n_in, n_h, activation):
super(DGI, self).__init__()
self.gcn = GCN(n_in, n_h, activation)
self.read = AvgReadout()
self.sigm = nn.Sigmoid()
self.d... | 29.487805 | 76 | 0.557486 |
c570097cf8e08e24570debaf9bdf54543aca13c6 | 6,331 | py | Python | lab/weather.py | AbdullahNoori/replace | 1dffd3668ca467a1e5acf20c5fe6f992e483eb49 | [
"MIT"
] | null | null | null | lab/weather.py | AbdullahNoori/replace | 1dffd3668ca467a1e5acf20c5fe6f992e483eb49 | [
"MIT"
] | null | null | null | lab/weather.py | AbdullahNoori/replace | 1dffd3668ca467a1e5acf20c5fe6f992e483eb49 | [
"MIT"
] | null | null | null |
class Subject:
# Both of the following two methods take an
# observer as an argument; that is, the observer
# to be registered ore removed.
def registerObserver(observer):
pass
def removeObserver(observer):
pass
# This method is called to notify all observers
# when the Subject's s... | 32.973958 | 79 | 0.623282 |
dfa52052899c80b0f08aa247e02dd629e0153ad3 | 180 | py | Python | start_notebook_server.py | ftschindler-work/proceedings-mbour-2017-lrbms-control | 0fa8b63b223f3ce8bdfa0f010266a7719a574091 | [
"BSD-2-Clause"
] | null | null | null | start_notebook_server.py | ftschindler-work/proceedings-mbour-2017-lrbms-control | 0fa8b63b223f3ce8bdfa0f010266a7719a574091 | [
"BSD-2-Clause"
] | null | null | null | start_notebook_server.py | ftschindler-work/proceedings-mbour-2017-lrbms-control | 0fa8b63b223f3ce8bdfa0f010266a7719a574091 | [
"BSD-2-Clause"
] | 1 | 2020-09-23T12:51:00.000Z | 2020-09-23T12:51:00.000Z | #!/bin/bash
export NOTEBOOK_PATH=$PWD
export NOTEBOOK_PORT=${EXPOSED_PORT:-18881}
jupyter-notebook --ip 0.0.0.0 --no-browser --notebook-dir=$NOTEBOOK_PATH --port=$NOTEBOOK_PORT
| 22.5 | 94 | 0.755556 |
13bd82f006456ce483eba276ce72a8df6bcd6f25 | 1,054 | py | Python | solutions/day11/p1/main.py | tosmun/AdventOfCode | 62f4f3a8cc3761ee5d5eaf682ae9c2c985cd80b5 | [
"Apache-2.0"
] | 1 | 2017-07-15T19:01:03.000Z | 2017-07-15T19:01:03.000Z | solutions/day11/p1/main.py | tosmun/Python-AdventOfCode | 62f4f3a8cc3761ee5d5eaf682ae9c2c985cd80b5 | [
"Apache-2.0"
] | null | null | null | solutions/day11/p1/main.py | tosmun/Python-AdventOfCode | 62f4f3a8cc3761ee5d5eaf682ae9c2c985cd80b5 | [
"Apache-2.0"
] | null | null | null | import copy, re
encoding="UTF-8"
input=bytearray('hepxcrrq',encoding)
max_byte=bytearray('z', encoding)[0]
min_byte=bytearray('a', encoding)[0]
invalid_chars=bytearray('iol', encoding)
double_char_pattern=re.compile(r'(.|^)(?!\1)(.)\2(?!\2)')
new=copy.copy(input)
while True:
#Work backwards
for i in range(len(new)-... | 23.422222 | 57 | 0.63852 |
a89b95f6ef51c58e817351f96c53f0273a56013a | 4,112 | py | Python | zfused_maya/zfused_maya/tool/rigging/transferuv.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | 2 | 2019-02-22T03:33:26.000Z | 2019-02-23T03:29:26.000Z | zfused_maya/zfused_maya/tool/rigging/transferuv.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/tool/rigging/transferuv.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- 张伟
# cmds.polyTransfer('zero:p_zero_luoxuanjiang_1', v = 0, vc = 0, uv = 1, ao = 'zero_172:p_zero_luoxuanjiang_1')
from PySide2 import QtWidgets, QtCore
import maya.OpenMayaUI as oi
import shiboken2 as shiboken
import zfused_maya.widgets.window as win
import maya.cmds as cmds
class PolyTr... | 39.538462 | 111 | 0.604086 |
af1f95eda2e8845d622db272b4eee154b56d8c9d | 4,932 | py | Python | test/record/parser/test_response_ccwhois_verisign_grs_com_cc_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_ccwhois_verisign_grs_com_cc_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_ccwhois_verisign_grs_com_cc_status_registered.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/ccwhois.verisign-grs.com/cc/status_registered
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parse... | 57.348837 | 1,647 | 0.727494 |
d762a376f57716369303f18337fb37d8543ff2f8 | 2,615 | py | Python | arithmetic_analysis/in_static_equilibrium.py | Study-Repos-Forks/Python | c86aa72cfa0467bd9a5711d7b5a77ed8243e49f1 | [
"MIT"
] | 1 | 2022-03-18T12:11:26.000Z | 2022-03-18T12:11:26.000Z | arithmetic_analysis/in_static_equilibrium.py | abdussalam02/Python | a80e5aadf30817251989378e8d908ca18f733a2f | [
"MIT"
] | null | null | null | arithmetic_analysis/in_static_equilibrium.py | abdussalam02/Python | a80e5aadf30817251989378e8d908ca18f733a2f | [
"MIT"
] | null | null | null | """
Checks if a system of forces is in static equilibrium.
"""
from __future__ import annotations
from numpy import array, cos, cross, float64, radians, sin
from numpy.typing import NDArray
def polar_force(
magnitude: float, angle: float, radian_mode: bool = False
) -> list[float]:
"""
Resol... | 28.423913 | 78 | 0.545315 |
03c0e45d005d4bdc28d9e1488c2e81136cd0e8d7 | 4,719 | py | Python | modules/tools/common/message_manager.py | zarmars/apollo | 2c71e68118fdfc8ea4327e6a0fdc93b428882a8b | [
"Apache-2.0"
] | 1 | 2021-12-04T08:02:09.000Z | 2021-12-04T08:02:09.000Z | modules/tools/common/message_manager.py | Mrrabbitan/apollo | ff6bb065eb343689603a0827828728ed4fa1a699 | [
"Apache-2.0"
] | null | null | null | modules/tools/common/message_manager.py | Mrrabbitan/apollo | ff6bb065eb343689603a0827828728ed4fa1a699 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | 38.365854 | 79 | 0.665395 |
73c11134fd43b5ccb5c236067011b23c61ff39d3 | 13,997 | py | Python | niftynet/application/regression_application.py | josemariamoreira/NiftyNet | d3ed1404fed9b8b69a3b60ae5b398045ae121d34 | [
"Apache-2.0"
] | 1 | 2018-05-13T14:54:47.000Z | 2018-05-13T14:54:47.000Z | niftynet/application/regression_application.py | josemariamoreira/NiftyNet | d3ed1404fed9b8b69a3b60ae5b398045ae121d34 | [
"Apache-2.0"
] | null | null | null | niftynet/application/regression_application.py | josemariamoreira/NiftyNet | d3ed1404fed9b8b69a3b60ae5b398045ae121d34 | [
"Apache-2.0"
] | 2 | 2018-05-13T14:54:48.000Z | 2018-05-26T16:08:09.000Z | import tensorflow as tf
import os
from niftynet.application.base_application import BaseApplication
from niftynet.engine.application_factory import ApplicationNetFactory
from niftynet.engine.application_factory import OptimiserFactory
from niftynet.engine.application_variables import CONSOLE
from niftynet.engine.appli... | 45.444805 | 78 | 0.650639 |
13acb83397ddc86f7d6751b0180565940b1d779a | 713 | py | Python | cplex_gurobi_projects/00_Initial/first_example.py | hpaucar/autonomous-system-repo | b86b62c23fe9a05694fcb5a106457454ff9976fb | [
"MIT"
] | null | null | null | cplex_gurobi_projects/00_Initial/first_example.py | hpaucar/autonomous-system-repo | b86b62c23fe9a05694fcb5a106457454ff9976fb | [
"MIT"
] | null | null | null | cplex_gurobi_projects/00_Initial/first_example.py | hpaucar/autonomous-system-repo | b86b62c23fe9a05694fcb5a106457454ff9976fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
First Example from CPLEX
"""
import pyomo.environ as pyo
from pyomo.environ import *
from pyomo.opt import SolverFactory
model = pyo.ConcreteModel()
model.c = pyo.Var(bounds=(0, None), domain=Integers)
model.p = pyo.Var(bounds=(0, None), domain=Integers)
c = model.c
p = model.p
model.obj ... | 23.766667 | 65 | 0.619916 |
5fb99e5517c1f752028d731a23e50fc1001ed510 | 9,634 | py | Python | lib/core/function.py | kuldeepbrd1/deep-high-resolution-net.pytorch | aece4d855edb4f43c968218a294a72e23304b4b1 | [
"MIT"
] | 1 | 2021-12-17T08:37:38.000Z | 2021-12-17T08:37:38.000Z | lib/core/function.py | kuldeepbrd1/HRNet-spacecraft-pose | 13992450423449b9abf3b02741e699d5e2ae2875 | [
"MIT"
] | null | null | null | lib/core/function.py | kuldeepbrd1/HRNet-spacecraft-pose | 13992450423449b9abf3b02741e699d5e2ae2875 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... | 34.284698 | 89 | 0.531659 |
86cd1aac404ea65ff2fa02d832bb61f296deba69 | 4,509 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/rax_cdb_database.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/rax_cdb_database.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/rax_cdb_database.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: rax_cdb_database
short_description: 'cr... | 26.063584 | 146 | 0.645154 |
a82f4fe5cd0e915c94eb16e20bf17f63bc9186f1 | 420 | py | Python | kernal_rom.py | folkertvanheusden/pyc64 | 90d7fc117427fc3f7b7a65a5a26ed0d1d2ad8941 | [
"Apache-2.0"
] | null | null | null | kernal_rom.py | folkertvanheusden/pyc64 | 90d7fc117427fc3f7b7a65a5a26ed0d1d2ad8941 | [
"Apache-2.0"
] | null | null | null | kernal_rom.py | folkertvanheusden/pyc64 | 90d7fc117427fc3f7b7a65a5a26ed0d1d2ad8941 | [
"Apache-2.0"
] | null | null | null | # (C) 2020 by Folkert van Heusden <mail@vanheusden.com>
# License: Apache License v2.0
from bus_device import bus_device
class kernal_rom(bus_device):
def __init__(self):
fh = open('kernal.901227-01.bin', 'rb')
self.rom: List[int] = [ int(b) for b in fh.read() ]
fh.close()
def write_t... | 24.705882 | 59 | 0.628571 |
0b1440e94e2481ce39569cfabc7511ea13f6f245 | 68,112 | py | Python | taxcalc/utils.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | 1 | 2021-02-23T21:03:43.000Z | 2021-02-23T21:03:43.000Z | taxcalc/utils.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | null | null | null | taxcalc/utils.py | ClarePan/Tax-Calculator | d2d6cb4b551f34017db7166d91d982b5c4670816 | [
"CC0-1.0"
] | null | null | null | """
PUBLIC low-level utility functions for Tax-Calculator.
"""
# CODING-STYLE CHECKS:
# pycodestyle utils.py
# pylint --disable=locally-disabled utils.py
#
# pylint: disable=too-many-lines
import os
import math
import json
import collections
import pkg_resources
import six
import numpy as np
import pandas as pd
import... | 39.189873 | 79 | 0.626571 |
8185a8d9f5d71cb35eecdb1605c61aa54a9f4f9f | 4,726 | py | Python | code/calcUpstreamLength.py | hishivshah/waterSourceHeatMap | 5f5e3ace8d7ede88ec543132b48c9c3f21f66593 | [
"MIT"
] | null | null | null | code/calcUpstreamLength.py | hishivshah/waterSourceHeatMap | 5f5e3ace8d7ede88ec543132b48c9c3f21f66593 | [
"MIT"
] | null | null | null | code/calcUpstreamLength.py | hishivshah/waterSourceHeatMap | 5f5e3ace8d7ede88ec543132b48c9c3f21f66593 | [
"MIT"
] | null | null | null | import sqlite3
import logging
import networkx
import shapely
import shapely.wkt
def searchUpOrDownStream(
graph, startNode, gaugedEdgeId, gaugedEdgeUpLen, searchDirection
):
if searchDirection == "upstream":
# Find upstream edges
searchNodes = graph.predecessors(startNode)
elif searchDir... | 33.28169 | 79 | 0.557766 |
dbcd6fa121b8b855845c9a235a8511266164b058 | 53,702 | py | Python | cinder/tests/unit/test_rbd.py | scottdangelo/RemoveVolumeMangerLocks | a448e6981f00ee068e29f3daac33d2d2d3820b4d | [
"Apache-2.0"
] | 1 | 2019-02-08T05:24:58.000Z | 2019-02-08T05:24:58.000Z | cinder/tests/unit/test_rbd.py | scottdangelo/RemoveVolumeMangerLocks | a448e6981f00ee068e29f3daac33d2d2d3820b4d | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/test_rbd.py | scottdangelo/RemoveVolumeMangerLocks | a448e6981f00ee068e29f3daac33d2d2d3820b4d | [
"Apache-2.0"
] | null | null | null |
# Copyright 2012 Josh Durgin
# Copyright 2013 Canonical Ltd.
# 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/LICENS... | 41.597211 | 79 | 0.586663 |
8514a26670ff04da73c9c99ba2907300ac8a2757 | 619 | py | Python | ubb/fop/lab05-07/main.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | ubb/fop/lab05-07/main.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | 6 | 2020-03-04T20:52:39.000Z | 2022-03-31T00:33:07.000Z | ubb/fop/lab05-07/main.py | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | import atexit
from tests.tester import Tester
from ui.LibraryApplication import LibraryApplication
from controllers.LibraryController import LibraryController
from repository.LibraryRepository import LibraryRepository
from model.sort import gnomeSort
from model.sort import testSort
from model.book import Book
from mo... | 25.791667 | 59 | 0.785137 |
40b15e77b786a0dd62c833f18e16386fc67b5932 | 5,905 | py | Python | mne/parallel.py | libertyh/mne-python | bf03e17f323341a877dea62963c86cf140757896 | [
"BSD-3-Clause"
] | 1 | 2020-07-28T16:09:54.000Z | 2020-07-28T16:09:54.000Z | mne/parallel.py | gkmaro634/mne-python | 5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe | [
"BSD-3-Clause"
] | 1 | 2019-08-16T13:59:53.000Z | 2019-08-19T16:37:35.000Z | mne/parallel.py | gkmaro634/mne-python | 5409a89233b764f3f3f3136cf9bf6b8d5fb0a4fe | [
"BSD-3-Clause"
] | 1 | 2019-12-10T02:59:18.000Z | 2019-12-10T02:59:18.000Z | """Parallel util function."""
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: Simplified BSD
import logging
import os
from . import get_config
from .utils import logger, verbose, warn, ProgressBar
from .fixes import _get_args
if 'MNE_FORCE_SERIAL' in os.environ:
_force_serial... | 35.359281 | 79 | 0.602371 |
7e653828f0538d63d5a0053be206b584f1b6d857 | 4,350 | py | Python | feature_engine/base_transformers.py | iahsanujunda/feature_engine | 46c6bd5a06626b0789fcc1367069d065010794a1 | [
"BSD-3-Clause"
] | 1 | 2020-11-15T13:15:28.000Z | 2020-11-15T13:15:28.000Z | feature_engine/base_transformers.py | myamullaciencia/feature_engine | 46c6bd5a06626b0789fcc1367069d065010794a1 | [
"BSD-3-Clause"
] | null | null | null | feature_engine/base_transformers.py | myamullaciencia/feature_engine | 46c6bd5a06626b0789fcc1367069d065010794a1 | [
"BSD-3-Clause"
] | null | null | null | # Transformation methods are shared by most transformer groups.
# Each transformer can inherit the transform method from these base classes.
import warnings
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_is_fitted
from feature_engine.dataframe_checks import (
... | 32.954545 | 87 | 0.662299 |
b7ec5f45c56d3759b8ab7bfc00162a5371be0bb7 | 22,703 | py | Python | tests/sentry/receivers/test_featureadoption.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/receivers/test_featureadoption.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/receivers/test_featureadoption.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.utils import timezone
from sentry.models import FeatureAdoption, GroupAssignee, GroupTombstone, Rule
from sentry.plugins.bases import IssueTrackingPlugin2, NotificationPlugin
from sentry.signals import (
alert_rule_created,
event_processed,
first_event_re... | 38.544992 | 149 | 0.609963 |
5c6ad587928af26fe0259f211e65b6b49220a490 | 1,218 | py | Python | krux/object.py | SpectrumIO/python-krux-stdlib | cb99e5dbd52711a76eb4fbb68a90fc1373616c07 | [
"MIT"
] | 3 | 2016-02-05T22:46:11.000Z | 2017-07-15T03:23:41.000Z | krux/object.py | SpectrumIO/python-krux-stdlib | cb99e5dbd52711a76eb4fbb68a90fc1373616c07 | [
"MIT"
] | 45 | 2015-01-13T00:59:05.000Z | 2019-10-16T01:14:02.000Z | krux/object.py | SpectrumIO/python-krux-stdlib | cb99e5dbd52711a76eb4fbb68a90fc1373616c07 | [
"MIT"
] | 2 | 2015-08-08T04:17:30.000Z | 2021-03-02T18:09:47.000Z | # © Copyright 2013-2020 Salesforce.com, inc.
from __future__ import generator_stop
from abc import ABCMeta
from krux.logging import get_logger
from krux.stats import get_stats
class Object(object, metaclass=ABCMeta):
"""
An abstract class to handle the common Krux coding pattern
.. seealso:: https://d... | 34.8 | 84 | 0.686371 |
be6528415bedcc22d19f89616ddae8848dbc562c | 4,507 | py | Python | tests/test_s3_merge_upsert.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | 1 | 2021-08-06T07:55:34.000Z | 2021-08-06T07:55:34.000Z | tests/test_s3_merge_upsert.py | njdanielsen/aws-data-wrangler | 5cdb316224370e952dfb3a701825e1b1ab331105 | [
"Apache-2.0"
] | 1 | 2021-03-12T20:39:41.000Z | 2021-03-15T08:21:03.000Z | tests/test_s3_merge_upsert.py | Glovo/aws-data-wrangler | ce0444ecc210d51eec1aeb2e085aabe536d51172 | [
"Apache-2.0"
] | null | null | null | import datetime
import logging
import pandas as pd
import pytest
import awswrangler as wr
from awswrangler.s3._merge_upsert_table import _is_data_quality_sufficient, merge_upsert_table
logger = logging.getLogger("awswrangler")
logger.setLevel(logging.DEBUG)
def test_is_data_quality_sufficient_check_column_names():... | 49.527473 | 116 | 0.678722 |
deb062c48dc791c67574092b3e55e7f5d40c6526 | 16,020 | py | Python | neural_network/gan.py | kostogls/Python | 81c2bcb3cbaeb4f861bc5c44df2526a89c616512 | [
"MIT"
] | 5 | 2020-03-04T18:50:13.000Z | 2020-05-05T11:46:13.000Z | neural_network/gan.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 1 | 2021-12-19T23:22:00.000Z | 2021-12-19T23:22:00.000Z | neural_network/gan.py | Mathewsmusukuma/Python | 4866b1330bc7c77c0ed0e050e6b99efdeb026448 | [
"MIT"
] | 4 | 2020-03-06T00:53:00.000Z | 2021-01-05T13:42:35.000Z | import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
from sklearn.utils import shuffle
import input_data
random_numer = 42
np.random.seed(random_numer)
def ReLu(x):
mask = (x > 0) * 1.0
return mask * x
def d_ReLu(x):
mask = (x > 0) * 1.0
return mask
def arcta... | 31.597633 | 173 | 0.527278 |
3e2bbd0b61fae259eacb5d804224ea267d56aa77 | 2,260 | py | Python | pylearn2/neuroimaging_utils/research/randomize_snps.py | rdevon/pylearn2 | f7b9a6ea0e2498176b47202f5bb83aec4976e1dd | [
"BSD-3-Clause"
] | 1 | 2017-10-29T06:18:35.000Z | 2017-10-29T06:18:35.000Z | pylearn2/neuroimaging_utils/research/randomize_snps.py | rdevon/pylearn2 | f7b9a6ea0e2498176b47202f5bb83aec4976e1dd | [
"BSD-3-Clause"
] | null | null | null | pylearn2/neuroimaging_utils/research/randomize_snps.py | rdevon/pylearn2 | f7b9a6ea0e2498176b47202f5bb83aec4976e1dd | [
"BSD-3-Clause"
] | null | null | null | """
.. todo::
WRITEME
"""
__authors__ = "Devon Hjelm"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Devon Hjelm"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import theano
from theano.sandbox.rng_mrg import MRG_RandomStreams
from ... | 23.789474 | 84 | 0.557522 |
9cb329d58ba682b36718b26aa33b7d052f527bfe | 267,910 | py | Python | src/config/api-server/vnc_cfg_api_server/tests/test_crud_basic.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/config/api-server/vnc_cfg_api_server/tests/test_crud_basic.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/test_crud_basic.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from builtins import str
from builtins import range
from builtins import object
from past.utils import old_div
import gevent
import os
import ... | 45.937929 | 132 | 0.618249 |
74b93d4be0ab8f90cc3467660ab4b39d02b01114 | 277 | py | Python | backend/api/migrations/0013_merge_20210528_1016.py | alairice/doccano | 27eff5caec1ec6ad31f1e74bd1b73b1dd43228dc | [
"MIT"
] | 2,082 | 2018-05-09T07:16:21.000Z | 2019-12-01T16:41:50.000Z | backend/api/migrations/0013_merge_20210528_1016.py | alairice/doccano | 27eff5caec1ec6ad31f1e74bd1b73b1dd43228dc | [
"MIT"
] | 365 | 2018-07-31T13:49:05.000Z | 2019-11-29T11:25:17.000Z | backend/api/migrations/0013_merge_20210528_1016.py | alairice/doccano | 27eff5caec1ec6ad31f1e74bd1b73b1dd43228dc | [
"MIT"
] | 476 | 2018-08-17T06:43:57.000Z | 2019-12-01T09:47:08.000Z | # Generated by Django 3.2.3 on 2021-05-28 10:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("api", "0009_annotations_relations_20210421_1445"),
("api", "0012_auto_20210514_0654"),
]
operations = []
| 19.785714 | 60 | 0.67148 |
d371c53546a0ab1f6473844da9f5e3582e18d4ca | 7,144 | py | Python | lib/psd_count_contigs/psd_count_contigsClient.py | nlharris/psd_count_contigs | 2b1d1e534dad3c4181258ab97942c7adbc19a406 | [
"MIT"
] | null | null | null | lib/psd_count_contigs/psd_count_contigsClient.py | nlharris/psd_count_contigs | 2b1d1e534dad3c4181258ab97942c7adbc19a406 | [
"MIT"
] | null | null | null | lib/psd_count_contigs/psd_count_contigsClient.py | nlharris/psd_count_contigs | 2b1d1e534dad3c4181258ab97942c7adbc19a406 | [
"MIT"
] | null | null | null | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
try:
import json as _json
except ImportError:
import sys
sys.path.append('simplejson-2.3.3')... | 39.688889 | 109 | 0.575168 |
4e874f83909e989a87b196065b3b273d1697620f | 5,088 | py | Python | 3DBeam/inputs/eigenvectors/compare_eigenvector.py | JoZimmer/Beam-Models | e701c0bae6e3035e7a07cc590da4a132b133dcff | [
"BSD-3-Clause"
] | null | null | null | 3DBeam/inputs/eigenvectors/compare_eigenvector.py | JoZimmer/Beam-Models | e701c0bae6e3035e7a07cc590da4a132b133dcff | [
"BSD-3-Clause"
] | null | null | null | 3DBeam/inputs/eigenvectors/compare_eigenvector.py | JoZimmer/Beam-Models | e701c0bae6e3035e7a07cc590da4a132b133dcff | [
"BSD-3-Clause"
] | 1 | 2022-01-05T17:32:32.000Z | 2022-01-05T17:32:32.000Z | import sys
from matplotlib.pylab import *
import numpy as np
# pgf_with_rc_fonts = {"pgf.texsystem": "pdflatex"}
# matplotlib.rcParams.update(pgf_with_rc_fonts)
# measurements from padova
z_measured = [0, 0.115, 0.23, 0.345, 0.460]
z_adapted = [0 * 180/.46, 0.115 * 180/.46, 0.23 * 180/.46, 0.345 * 180/.46, 0.460 * 18... | 42.4 | 167 | 0.636989 |
c3f4cf959ad953c0dc67efd176ff8c4ec187ed12 | 97 | py | Python | monitor/__init__.py | GdoongMathew/Monitor | 1affeea0ca4f61d84fd8f0b8838a847da16854c2 | [
"MIT"
] | null | null | null | monitor/__init__.py | GdoongMathew/Monitor | 1affeea0ca4f61d84fd8f0b8838a847da16854c2 | [
"MIT"
] | null | null | null | monitor/__init__.py | GdoongMathew/Monitor | 1affeea0ca4f61d84fd8f0b8838a847da16854c2 | [
"MIT"
] | null | null | null | from .reader import NVGPUReader
from .reader import CPUReader
from .monitor import BasicMonitor
| 19.4 | 33 | 0.835052 |
930a9bde08163fe4edf860e4527a4c2097c28915 | 5,029 | py | Python | floppymusic-web.py | MisterX2000/floppymusic-web | 6fc86757211203fe203c27d64760310766fa7af0 | [
"MIT"
] | null | null | null | floppymusic-web.py | MisterX2000/floppymusic-web | 6fc86757211203fe203c27d64760310766fa7af0 | [
"MIT"
] | 4 | 2017-05-24T05:15:36.000Z | 2017-05-24T21:45:59.000Z | floppymusic-web.py | MisterX2000/floppymusic-web | 6fc86757211203fe203c27d64760310766fa7af0 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, url_for, flash, g
from flask_uploads import UploadSet, configure_uploads, UploadNotAllowed
import argparse
import subprocess
import sqlite3
import os
parser = argparse.ArgumentParser(description="IMPORTANT! To ensure floppymusics functionality this script mu... | 34.682759 | 128 | 0.641479 |
1fb9c9b268ba8250c3a2c02829f29af9031513dc | 19,987 | py | Python | src/cogent3/util/unit_test.py | Lmaster20/cogent3 | 1d5ff1ba2b3d42736f8f04de8507b5cd585b4fe9 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/util/unit_test.py | Lmaster20/cogent3 | 1d5ff1ba2b3d42736f8f04de8507b5cd585b4fe9 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/util/unit_test.py | Lmaster20/cogent3 | 1d5ff1ba2b3d42736f8f04de8507b5cd585b4fe9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Extension of the built-in unittest framework for floating-point comparisons.
Specific Extensions:
assertFloatEqual, assertFloatEqualAbs, and assertFloatEqualRel give fine-
grained control over how floating point numbers (or lists thereof) are tested
for equality.
assertContains and assertNot... | 37.081633 | 87 | 0.553009 |
de3719bd3024869b259b9109ca2c04b0a330dcf9 | 180 | py | Python | config/configuration.py | JobQiu/bi-att-flow | ef5058ca5b7e08bdae930340295786a9c047a664 | [
"Apache-2.0"
] | null | null | null | config/configuration.py | JobQiu/bi-att-flow | ef5058ca5b7e08bdae930340295786a9c047a664 | [
"Apache-2.0"
] | null | null | null | config/configuration.py | JobQiu/bi-att-flow | ef5058ca5b7e08bdae930340295786a9c047a664 | [
"Apache-2.0"
] | null | null | null | class Config():
def __init__(self):
self.squadLocation = "/content/bi-att-flow/data/squad"
self.gloveLocation = "/content/bi-att-flow/data/glove"
pass
| 25.714286 | 62 | 0.633333 |
7aaf03e55aa5ee812d4b7b122436fc8ee5950860 | 1,788 | py | Python | banti/conncomp.py | aimsravi/TELUGU-OCR | 6b15e37fd0ad93e5e2ac90b8822b06e64230f05f | [
"Apache-2.0"
] | 41 | 2015-12-19T15:55:35.000Z | 2021-08-12T22:29:44.000Z | banti/conncomp.py | aimsravi/TELUGU-OCR | 6b15e37fd0ad93e5e2ac90b8822b06e64230f05f | [
"Apache-2.0"
] | 9 | 2015-12-05T04:20:55.000Z | 2022-01-19T21:46:53.000Z | banti/conncomp.py | aimsravi/TELUGU-OCR | 6b15e37fd0ad93e5e2ac90b8822b06e64230f05f | [
"Apache-2.0"
] | 16 | 2016-01-25T11:45:49.000Z | 2021-11-10T06:53:32.000Z | import scipy.ndimage.measurements as meas
from .helpers import arr_to_ascii_art
class Component():
def __init__(self, big_img, slice, index):
self.index = index
self.pix = big_img[slice] == index
self.slice = slice
self.y, self.y2 = slice[0].start, slice[0].stop
self.ht = ... | 32.509091 | 79 | 0.587808 |
921d0f26f502b0d59c0ba44e40c95ef2b273c492 | 1,960 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateFlowProjectRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateFlowProjectRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/CreateFlowProjectRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | # 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... | 35 | 74 | 0.766837 |
aa5f3e6e9ad5a9b303ad9726622917e8ac2ecbe4 | 354 | py | Python | app/__init__.py | tonyin/fluffmo | 335b0c072f536b9cd4ed4b75d521ef2403f2000c | [
"Apache-2.0"
] | null | null | null | app/__init__.py | tonyin/fluffmo | 335b0c072f536b9cd4ed4b75d521ef2403f2000c | [
"Apache-2.0"
] | null | null | null | app/__init__.py | tonyin/fluffmo | 335b0c072f536b9cd4ed4b75d521ef2403f2000c | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from werkzeug.contrib.fixers import ProxyFix
app = Flask(
__name__,
instance_relative_config=True,
static_url_path='/fluffymomo/static'
)
# Load default config and then instance config
app.config.from_object('config')
app.config.from_pyfile('config.py')
app.wsgi_app = ProxyFix(app... | 20.823529 | 46 | 0.774011 |
80251871562022e2440b4cdb3e56f83c037d5175 | 1,379 | py | Python | neofaker/util.py | spacelis/neofaker | 72e2f687280d431e864c55531f29ef3cf2edcdde | [
"MIT"
] | null | null | null | neofaker/util.py | spacelis/neofaker | 72e2f687280d431e864c55531f29ef3cf2edcdde | [
"MIT"
] | null | null | null | neofaker/util.py | spacelis/neofaker | 72e2f687280d431e864c55531f29ef3cf2edcdde | [
"MIT"
] | null | null | null | """
File: util.py
Author: Wen Li Email: spacelis@gmail.com
Github: http://github.com/spacelis
Description: A set of utility functions
"""
from functools import reduce
from csv import DictWriter
def rekey(dct, kname, vname, extra=None):
""" Generate dicts by keying the key-value pair
:dct: a dict
:kname: ... | 23.372881 | 80 | 0.632342 |
d3a61627281349b383baf30802ae2b8810e5fa4f | 11,297 | py | Python | official/benchmark/models/shakespeare/shakespeare_main.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 4 | 2020-03-13T14:01:32.000Z | 2021-05-31T17:17:32.000Z | official/benchmark/models/shakespeare/shakespeare_main.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 7 | 2020-09-26T01:03:33.000Z | 2022-02-10T01:30:14.000Z | official/benchmark/models/shakespeare/shakespeare_main.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 3 | 2020-08-23T21:15:41.000Z | 2021-11-08T10:02:17.000Z | # Copyright 2019 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... | 35.75 | 80 | 0.672922 |
db0922253dae1838663571fc9dff15a3f0189855 | 1,446 | py | Python | joyful/mappings/dualshock4.py | cauebs/joyful | b501827fe6ee7da21e79c5dd8e1e9f5fef7fc674 | [
"MIT"
] | null | null | null | joyful/mappings/dualshock4.py | cauebs/joyful | b501827fe6ee7da21e79c5dd8e1e9f5fef7fc674 | [
"MIT"
] | null | null | null | joyful/mappings/dualshock4.py | cauebs/joyful | b501827fe6ee7da21e79c5dd8e1e9f5fef7fc674 | [
"MIT"
] | null | null | null | from enum import Enum, auto
class Labels(Enum):
DPAD_X = auto()
DPAD_Y = auto()
L1_BUTTON = auto()
L2_BUTTON = auto()
L2_TRIGGER = auto()
L3_X_AXIS = auto()
L3_Y_AXIS = auto()
L3_BUTTON = auto()
SHARE = auto()
OPTIONS = auto()
START = auto()
SELECT = auto()
PLAYST... | 19.808219 | 30 | 0.607192 |
affd3c43f7b3cfa1966e92e5bca6a749e47121fa | 9,125 | py | Python | neutron/db/api.py | cleo4zheng/neutron | 6d65318308edfd984bdd0ff1ac7fef9486a040f7 | [
"Apache-2.0"
] | null | null | null | neutron/db/api.py | cleo4zheng/neutron | 6d65318308edfd984bdd0ff1ac7fef9486a040f7 | [
"Apache-2.0"
] | null | null | null | neutron/db/api.py | cleo4zheng/neutron | 6d65318308edfd984bdd0ff1ac7fef9486a040f7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 VMware, 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 required by ... | 34.048507 | 79 | 0.688219 |
4b5b81c3390197b9849bea00bd9aedb3207c0229 | 3,164 | py | Python | src/407. Trapping Rain Water II_learned.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/407. Trapping Rain Water II_learned.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | src/407. Trapping Rain Water II_learned.py | wisesky/LeetCode-Practice | 65549f72c565d9f11641c86d6cef9c7988805817 | [
"MIT"
] | null | null | null | from typing import List
import heapq
class Solution:
def trapRainWater(self, heightMap: List[List[int]]) -> int:
if len(heightMap) == 0:
return 0
h = len(heightMap)
w = len(heightMap[0])
visited = {}
pq = []
for i in ra... | 26.14876 | 76 | 0.418458 |
d5609e6275c3b63d4fa48b8dd47fb85876df1fe2 | 7,484 | py | Python | api/client/src/pcluster_client/model/ec2_ami_info.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 279 | 2015-01-02T12:03:58.000Z | 2018-11-05T07:58:55.000Z | api/client/src/pcluster_client/model/ec2_ami_info.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 383 | 2015-01-04T18:52:06.000Z | 2018-11-12T16:23:44.000Z | api/client/src/pcluster_client/model/ec2_ami_info.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 127 | 2015-01-25T23:51:28.000Z | 2018-11-04T04:50:29.000Z | """
ParallelCluster
ParallelCluster API # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from pcluster_client.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNo... | 38.979167 | 110 | 0.576563 |
e3dccdec7ecd277cf4d201c33d6480a350f7635d | 4,960 | py | Python | test/functional/p2p_time_offset.py | nyerium-core/nyerium | 0bc3b4da2c8cf1c96ab3910cff4c743ff09fcd1e | [
"MIT"
] | 2 | 2019-08-06T13:37:38.000Z | 2022-01-07T11:57:49.000Z | test/functional/p2p_time_offset.py | nyerium-core/nyerium | 0bc3b4da2c8cf1c96ab3910cff4c743ff09fcd1e | [
"MIT"
] | 5 | 2018-05-31T20:01:32.000Z | 2018-09-21T22:55:04.000Z | test/functional/p2p_time_offset.py | nyerium-core/nyerium | 0bc3b4da2c8cf1c96ab3910cff4c743ff09fcd1e | [
"MIT"
] | 4 | 2018-06-03T07:09:44.000Z | 2020-08-17T12:43:24.000Z | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Nyerium developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
from test_framework.test_framework import NyeriumTestFramework
from test_framework.util import (
... | 40.991736 | 103 | 0.604637 |
2fb331b17734ead24561bf6eee1a4920680295c7 | 2,560 | py | Python | tools/rm_subj.py | roshchupkin/hase | c7aa36459c53ccb5bd1f884bbc38df0cfebdf208 | [
"Apache-2.0"
] | 13 | 2016-03-25T12:22:03.000Z | 2021-04-14T11:14:00.000Z | tools/rm_subj.py | roshchupkin/hase | c7aa36459c53ccb5bd1f884bbc38df0cfebdf208 | [
"Apache-2.0"
] | 8 | 2016-08-02T22:06:07.000Z | 2019-12-10T08:42:22.000Z | tools/rm_subj.py | roshchupkin/hase | c7aa36459c53ccb5bd1f884bbc38df0cfebdf208 | [
"Apache-2.0"
] | 3 | 2019-12-03T12:49:46.000Z | 2021-08-13T15:11:27.000Z | import os
import h5py
import pandas as pd
import numpy as np
import argparse
import tables
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Script to remove subjects from HASE hdf5 files')
parser.add_argument("-g", required=True, type=str, help="path/paths to genotype data folder")
... | 40 | 117 | 0.591406 |
1dd113147cf4af844657ef03d56202202fd4db5e | 15,265 | py | Python | src/cmds/show.py | Flofie/chia-blockchain | d3013f1a392fc1761d975581a7b1d0770f92cb14 | [
"Apache-2.0"
] | null | null | null | src/cmds/show.py | Flofie/chia-blockchain | d3013f1a392fc1761d975581a7b1d0770f92cb14 | [
"Apache-2.0"
] | null | null | null | src/cmds/show.py | Flofie/chia-blockchain | d3013f1a392fc1761d975581a7b1d0770f92cb14 | [
"Apache-2.0"
] | null | null | null | import click
async def show_async(
rpc_port: int,
state: bool,
show_connections: bool,
exit_node: bool,
add_connection: str,
remove_connection: str,
block_header_hash_by_height: str,
block_by_header_hash: str,
) -> None:
import aiohttp
import time
import traceback
from... | 46.539634 | 119 | 0.541042 |
34cf699feaf63c14ab14f757bec38f2e6ec45490 | 970 | py | Python | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_preview_storage/v2018_03_01_preview/models/list_container_items.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2019-05-10T19:58:09.000Z | 2019-05-10T19:58:09.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_preview_storage/v2018_03_01_preview/models/list_container_items.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | src/storage-preview/azext_storage_preview/vendored_sdks/azure_mgmt_preview_storage/v2018_03_01_preview/models/list_container_items.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | 1 | 2021-07-28T14:50:54.000Z | 2021-07-28T14:50:54.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 ... | 32.333333 | 76 | 0.589691 |
db280fea135ddb681a718266a153452220814710 | 1,924 | py | Python | rest_framework_elasticsearch/es_serializer.py | xaviermathew/django-rest-elasticsearch | d8778165e2e42601b8c15c8901c5f58b3061a47c | [
"Apache-2.0"
] | 219 | 2017-04-22T11:32:06.000Z | 2021-06-04T10:33:28.000Z | rest_framework_elasticsearch/es_serializer.py | xaviermathew/django-rest-elasticsearch | d8778165e2e42601b8c15c8901c5f58b3061a47c | [
"Apache-2.0"
] | 37 | 2017-06-27T15:43:31.000Z | 2020-09-02T03:05:17.000Z | rest_framework_elasticsearch/es_serializer.py | xaviermathew/django-rest-elasticsearch | d8778165e2e42601b8c15c8901c5f58b3061a47c | [
"Apache-2.0"
] | 47 | 2017-05-02T13:18:38.000Z | 2022-02-07T08:54:43.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from rest_framework import serializers
class BaseElasticSerializer(object):
def es_instance(self):
raise NotImplementedError
def get_es_model(self):
if not hasattr(self.Meta, 'es_model'):
raise Value... | 30.539683 | 76 | 0.628898 |
2f4c3b4af8211c237d8e989fcc6ae3a4839c9031 | 792 | py | Python | content/pkg/deps/python/dassana/common/timing.py | gauravphoenix/dassana | d663e89353f439b1ff67193635f4c9c06babd104 | [
"Apache-2.0"
] | 1 | 2021-11-17T00:45:07.000Z | 2021-11-17T00:45:07.000Z | content/pkg/deps/python/dassana/common/timing.py | MartinLiu2/dassana | 23c5e6d4e380630945621e2979820a6d61335535 | [
"Apache-2.0"
] | null | null | null | content/pkg/deps/python/dassana/common/timing.py | MartinLiu2/dassana | 23c5e6d4e380630945621e2979820a6d61335535 | [
"Apache-2.0"
] | null | null | null | import logging
from functools import wraps
from time import time
from typing import Dict, List
def timing(f, measurements: Dict[frozenset, List], args_measure_func=lambda x: None, kw_measure_func=lambda y: None):
@wraps(f)
def wrap(*args, **kw):
nonlocal measurements
ts = time()
result... | 31.68 | 117 | 0.621212 |
7ba3ee75d440262bbb39ada016ada6d90a10bbf2 | 434 | py | Python | scratch/scratch3.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | scratch/scratch3.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | scratch/scratch3.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | class MyTypeError(TypeError):
def __init__(self, message: str, code: int):
super().__init__(message)
self._code = code
@property
def code(self) -> int:
return self._code
if __name__ == "__main__":
error = MyTypeError("Waht?", 12345)
print(error)
print(error.code)
"""
Raises error bec... | 21.7 | 64 | 0.665899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.