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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e28d9c2a9469eaa0a29ce489a165209352bdd02 | 6,646 | py | Python | speech_interface/models/hifi_gan.py | AppleHolic/SpeechInterface | 60e57663076fb2f793448e4e915aa7f6d4122888 | [
"MIT"
] | 2 | 2021-03-19T19:40:57.000Z | 2021-03-20T03:47:37.000Z | speech_interface/models/hifi_gan.py | AppleHolic/SpeechInterface | 60e57663076fb2f793448e4e915aa7f6d4122888 | [
"MIT"
] | 3 | 2021-03-19T13:35:12.000Z | 2021-04-12T05:35:18.000Z | speech_interface/models/hifi_gan.py | AppleHolic/SpeechInterface | 60e57663076fb2f793448e4e915aa7f6d4122888 | [
"MIT"
] | null | null | null | #
# Reference : https://github.com/jik876/hifi-gan/blob/master/models.py
# HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis
# https://arxiv.org/abs/2010.05646
#
import torch
import torch.nn.functional as F
import torch.nn as nn
from argparse import Namespace
from torch.nn impor... | 34.614583 | 107 | 0.553717 |
be5d38fc602a3eb8c22b6436cd809c6d9f09d88f | 8,026 | py | Python | python/pyarrow/tests/conftest.py | kimmolinna/arrow | 7bbd3d77fc2a585b9e2f3b3d223866ee979e679b | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/conftest.py | kimmolinna/arrow | 7bbd3d77fc2a585b9e2f3b3d223866ee979e679b | [
"Apache-2.0"
] | 3 | 2022-02-09T03:24:57.000Z | 2022-02-14T22:26:27.000Z | python/pyarrow/tests/conftest.py | kimmolinna/arrow | 7bbd3d77fc2a585b9e2f3b3d223866ee979e679b | [
"Apache-2.0"
] | 1 | 2020-08-27T22:54:09.000Z | 2020-08-27T22:54:09.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... | 26.314754 | 78 | 0.642537 |
9bcdc6fb553457b2af70e47ca4d24431ff28eee7 | 21,986 | py | Python | plugin/tooling.py | Daggy1234/LSP | 65a40d6d28fd8ed03e483ed2bb9d43d049ed29d0 | [
"MIT"
] | null | null | null | plugin/tooling.py | Daggy1234/LSP | 65a40d6d28fd8ed03e483ed2bb9d43d049ed29d0 | [
"MIT"
] | null | null | null | plugin/tooling.py | Daggy1234/LSP | 65a40d6d28fd8ed03e483ed2bb9d43d049ed29d0 | [
"MIT"
] | null | null | null | from .core.css import css
from .core.registry import windows
from .core.sessions import get_plugin
from .core.transports import create_transport
from .core.transports import Transport
from .core.transports import TransportCallbacks
from .core.types import Capabilities
from .core.types import ClientConfig
from .core.typ... | 43.796813 | 153 | 0.575594 |
8a51704732d7f3aab8a80d3034bceefe6c7e564f | 45,357 | py | Python | pandas/tests/arrays/sparse/test_array.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/arrays/sparse/test_array.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/arrays/sparse/test_array.py | ivary43/pandas | 46adc5b1c2aacb312d72729af72bc0ad600917c0 | [
"BSD-3-Clause"
] | null | null | null | import operator
import re
import warnings
import numpy as np
import pytest
from pandas._libs.sparse import IntIndex
import pandas.util._test_decorators as td
import pandas as pd
from pandas import isna
from pandas.core.sparse.api import SparseArray, SparseDtype, SparseSeries
import pandas.util.testing as tm
from pan... | 36.112261 | 79 | 0.583262 |
42669c64bd33c16e53c358304fc974c7b1fe8ccc | 7,870 | py | Python | ros/src/tl_detector/tl_detector.py | DanielStuttgart/CarND_Capstone | a3312cff4d7caede9758c404aff4ab024c333616 | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | DanielStuttgart/CarND_Capstone | a3312cff4d7caede9758c404aff4ab024c333616 | [
"MIT"
] | 9 | 2020-09-26T01:05:50.000Z | 2022-03-12T00:30:03.000Z | ros/src/tl_detector/tl_detector.py | DanielStuttgart/CarND_Capstone | a3312cff4d7caede9758c404aff4ab024c333616 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... | 38.768473 | 132 | 0.640152 |
3d8487edd0693f87c166969646bb3b2f04d8e56d | 14,145 | py | Python | google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | null | null | null | google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 43.928571 | 90 | 0.63853 |
13cc230dfc98d33207b68b14551ec1aadedcb623 | 350 | py | Python | game/__main__.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 7 | 2019-03-28T15:56:21.000Z | 2021-11-08T09:02:05.000Z | game/__main__.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 2 | 2019-05-16T02:00:22.000Z | 2021-06-08T19:49:46.000Z | game/__main__.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 4 | 2019-04-02T17:49:30.000Z | 2019-04-04T00:38:54.000Z | import game.menu as menu
import game.game as game
import game.animations as animations
import game.help as helper
import game.sound as sound
sound.play_music()
animations.show_intro()
selection = menu.ask_for_selection()
if selection == "New Game":
game.start()
elif selection == "How to play?":
helper.guide()... | 20.588235 | 36 | 0.737143 |
fb977397cdc113d413868d9ff8f82bdadde4215c | 879 | py | Python | tests/test_execution/conftest.py | johnpaulguzman/py-gql | 5a2d180537218e1c30c65b2a933fb4fe197785ae | [
"MIT"
] | 6 | 2019-04-30T10:48:09.000Z | 2021-08-19T15:57:53.000Z | tests/test_execution/conftest.py | johnpaulguzman/py-gql | 5a2d180537218e1c30c65b2a933fb4fe197785ae | [
"MIT"
] | 6 | 2019-04-08T12:39:08.000Z | 2020-08-10T15:00:18.000Z | tests/test_execution/conftest.py | johnpaulguzman/py-gql | 5a2d180537218e1c30c65b2a933fb4fe197785ae | [
"MIT"
] | 2 | 2021-04-14T07:06:15.000Z | 2021-08-19T15:58:46.000Z | # -*- coding: utf-8 -*-
import pytest
from py_gql.execution import BlockingExecutor, Executor
from py_gql.execution.runtime import (
AsyncIORuntime,
BlockingRuntime,
ThreadPoolRuntime,
)
from ._test_utils import assert_execution as assert_execution_original
@pytest.fixture(
params=(
pytest.p... | 27.46875 | 77 | 0.70876 |
371509c6e600190a0dffc75b445c68c9ef8d4085 | 180 | py | Python | tests/unit/copy/binlog_copy/test_key.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 69 | 2016-06-29T16:13:55.000Z | 2022-03-21T06:38:37.000Z | tests/unit/copy/binlog_copy/test_key.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 237 | 2016-09-28T02:12:34.000Z | 2022-03-25T13:32:23.000Z | tests/unit/copy/binlog_copy/test_key.py | denssk/backup | 292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e | [
"Apache-2.0"
] | 45 | 2017-01-04T21:20:27.000Z | 2021-12-29T10:42:22.000Z | from twindb_backup.copy.binlog_copy import BinlogCopy
def test_key():
backup_copy = BinlogCopy('foo', 'some_name', 100)
assert backup_copy.key == 'foo/binlog/some_name'
| 22.5 | 53 | 0.738889 |
3e4781395a1c999f19dafac2002a19b37c4a9c6d | 2,549 | py | Python | src/ClusterManager/ResourceInfo.py | AI-ML-Projects/DLWorkspace | b4b07187f673fa6b98341c6d38a7a83bb6baa160 | [
"MIT"
] | 1 | 2021-02-27T14:13:43.000Z | 2021-02-27T14:13:43.000Z | src/ClusterManager/ResourceInfo.py | AI-ML-Projects/DLWorkspace | b4b07187f673fa6b98341c6d38a7a83bb6baa160 | [
"MIT"
] | null | null | null | src/ClusterManager/ResourceInfo.py | AI-ML-Projects/DLWorkspace | b4b07187f673fa6b98341c6d38a7a83bb6baa160 | [
"MIT"
] | 1 | 2021-07-14T18:51:26.000Z | 2021-07-14T18:51:26.000Z | import math
class ResourceInfo:
def __init__(self, res={}):
self.CategoryToCountMap = {}
for key in res:
self.CategoryToCountMap[key] = int(res[key])
def ToSerializable(self):
return self.CategoryToCountMap
@staticmethod
def Difference(resInfo1, resInfo... | 40.460317 | 185 | 0.657513 |
28dc682ea2c0c618949d3d9d79d1406290a0213e | 1,370 | py | Python | coinbase/tests/test_contacts.py | EU-institution/coinbase_python | 1e0d5d162cb40c1094775ceb5c267a5bdedf0949 | [
"Unlicense",
"MIT"
] | 53 | 2015-01-05T08:42:17.000Z | 2022-03-01T20:52:41.000Z | coinbase/tests/test_contacts.py | EU-institution/coinbase_python | 1e0d5d162cb40c1094775ceb5c267a5bdedf0949 | [
"Unlicense",
"MIT"
] | 10 | 2015-01-08T04:09:25.000Z | 2021-10-08T21:43:17.000Z | coinbase/tests/test_contacts.py | mhluongo/coinbase_python | 2e29d4fa1c501495b41005bbcc770cb29fba6ad1 | [
"MIT",
"Unlicense"
] | 34 | 2016-09-18T23:18:44.000Z | 2022-02-19T17:31:05.000Z | from sure import this
from unittest import TestCase
from coinbase import CoinbaseContact
from . import account_setup
from .http_mocking import *
@with_http_mocking
class ContactsTest(TestCase):
def setUp(self):
mock_http('GET https://coinbase.com/api/v1/contacts',
response_body)
d... | 22.833333 | 64 | 0.575182 |
2f9275260654663315242837c4e2ecfd04dad529 | 5,934 | py | Python | OnlyUse24Stops/TripToGif.py | gzyszuuow/BusBunching | e9b01a62e422ae6525d9287bdf46c25aacdf9c6c | [
"Apache-2.0"
] | null | null | null | OnlyUse24Stops/TripToGif.py | gzyszuuow/BusBunching | e9b01a62e422ae6525d9287bdf46c25aacdf9c6c | [
"Apache-2.0"
] | null | null | null | OnlyUse24Stops/TripToGif.py | gzyszuuow/BusBunching | e9b01a62e422ae6525d9287bdf46c25aacdf9c6c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import random
import time
import math
import datetime as dt
import random
import copy
from datetime import datetime
from time import mktime
import os
import json
from functools import cmp_to_key
import numpy as np # 数组相关的库
imp... | 34.300578 | 256 | 0.653691 |
e8ab2ce626072e51afe81151c3e4ae3183630052 | 2,095 | py | Python | tests/sources/elasticsearch/test_api.py | snippergoals/cibyl | 1721450532593c86acaf3aff3c5a60d48213d38b | [
"Apache-2.0"
] | null | null | null | tests/sources/elasticsearch/test_api.py | snippergoals/cibyl | 1721450532593c86acaf3aff3c5a60d48213d38b | [
"Apache-2.0"
] | null | null | null | tests/sources/elasticsearch/test_api.py | snippergoals/cibyl | 1721450532593c86acaf3aff3c5a60d48213d38b | [
"Apache-2.0"
] | null | null | null | """
# Copyright 2022 Red Hat
#
# 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... | 32.734375 | 79 | 0.633413 |
3968336bba7a3addf1fc24ade94f4bf93638f604 | 5,282 | py | Python | examples/pentominos.py | Seemee/exactcover | 5c5759883469493437b4e45fa223fe93109f7458 | [
"MIT"
] | null | null | null | examples/pentominos.py | Seemee/exactcover | 5c5759883469493437b4e45fa223fe93109f7458 | [
"MIT"
] | null | null | null | examples/pentominos.py | Seemee/exactcover | 5c5759883469493437b4e45fa223fe93109f7458 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2011 by Kenneth Waters
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | 32.012121 | 79 | 0.610564 |
205de8862c75fd1a352c9d0fb5c6d5c49077c286 | 3,523 | py | Python | sdk/cognitivelanguage/azure-ai-language-conversations/tests/async/test_conv_issue_summarization_async.py | kushagraThapar/azure-sdk-for-python | f8d87571488b5838537fb0974e38bec1795fa07d | [
"MIT"
] | null | null | null | sdk/cognitivelanguage/azure-ai-language-conversations/tests/async/test_conv_issue_summarization_async.py | kushagraThapar/azure-sdk-for-python | f8d87571488b5838537fb0974e38bec1795fa07d | [
"MIT"
] | null | null | null | sdk/cognitivelanguage/azure-ai-language-conversations/tests/async/test_conv_issue_summarization_async.py | kushagraThapar/azure-sdk-for-python | f8d87571488b5838537fb0974e38bec1795fa07d | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.credentials import AzureKeyCredential
from... | 42.963415 | 125 | 0.415271 |
8f9cd7c63c3e2ee5426142bc5f8c9247790a9e0d | 12,402 | py | Python | training/gan_model.py | AyushExel/GANSketching | c72524ac4425de898087af7a4c554b777a4e2218 | [
"MIT"
] | 598 | 2021-08-05T19:51:24.000Z | 2022-03-29T07:07:43.000Z | training/gan_model.py | AyushExel/GANSketching | c72524ac4425de898087af7a4c554b777a4e2218 | [
"MIT"
] | 15 | 2021-08-08T13:38:54.000Z | 2022-03-30T02:45:42.000Z | training/gan_model.py | AyushExel/GANSketching | c72524ac4425de898087af7a4c554b777a4e2218 | [
"MIT"
] | 69 | 2021-08-06T09:33:29.000Z | 2022-03-24T13:07:55.000Z | import os
import random
import torch
from training import networks
class GANModel(torch.nn.Module):
def __init__(self, opt):
super().__init__()
self.opt = opt
self.device = 'cuda' if not self.opt.use_cpu else 'cpu'
self.FloatTensor = torch.cuda.FloatTensor if self.use_gpu() \
... | 42.183673 | 120 | 0.633043 |
74d0f0fb19a50b1a41aeeffbea61def120ce4e5e | 7,593 | py | Python | cambridge/compute_overlap.py | fintelia/habitationi | 7dd15ecbab0ad63a70505920766de9c27294fb6e | [
"Apache-2.0"
] | 1 | 2021-10-03T14:44:38.000Z | 2021-10-03T14:44:38.000Z | cambridge/compute_overlap.py | fintelia/habitationi | 7dd15ecbab0ad63a70505920766de9c27294fb6e | [
"Apache-2.0"
] | null | null | null | cambridge/compute_overlap.py | fintelia/habitationi | 7dd15ecbab0ad63a70505920766de9c27294fb6e | [
"Apache-2.0"
] | 1 | 2021-02-20T23:22:10.000Z | 2021-02-20T23:22:10.000Z | #!/usr/bin/python
# Copyright 2019 Christopher Schmidt
#
# 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... | 37.220588 | 162 | 0.564467 |
7e42a3e06758cd4aaed7642e1354d4dc3acfe0f2 | 3,624 | py | Python | generix/core/app.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | generix/core/app.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | generix/core/app.py | K9173A/Generix | 214ac660fd2a03ecf5d999a6cd1f4fb2b47502b4 | [
"MIT"
] | null | null | null | """
A module for an application base window.
"""
import os
import pygame
from generix.core.board.manager import BoardManager
from generix.core.data.db import Database
from generix.core.settings.registry import settings_reg
from generix.core.settings.settings import BOARD_FILE_PATH, LOAD_BOARD, FPS, REFRESH_RATE
cla... | 35.184466 | 90 | 0.626932 |
2c1bf11933f210b3f376f850501ee52744ae5873 | 2,075 | py | Python | keystone/tests/unit/identity/test_core.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/identity/test_core.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/identity/test_core.py | sanket4373/keystone | 7cf7e7497729803f0470167315af9349b88fe0ec | [
"Apache-2.0"
] | null | null | null | # 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, software
# distributed under t... | 33.467742 | 77 | 0.689639 |
0e0857c7d6cf4021c794610247176d7cb22a95fe | 3,942 | py | Python | solarnet/preprocessing/masks.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | solarnet/preprocessing/masks.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | solarnet/preprocessing/masks.py | fedesigno/solar-panel-segmentation | 75856be3361bb4904387e6abc986627d1cc98ebb | [
"MIT"
] | null | null | null | from json import load
import pandas as pd
import numpy as np
import tifffile as tif
from matplotlib.path import Path as PolygonPath
from pathlib import Path
from collections import defaultdict
from tqdm import tqdm
import multiprocessing
from joblib import Parallel, delayed
from typing import List, Tuple
IMAGE_SIZES ... | 38.647059 | 118 | 0.625317 |
637b782e917158fdf2839654e7b4a584fceba5be | 755 | py | Python | entry.py | panubo/sensu-result-proxy | e7b8ee72bfbfadaaa798020630af6f6c5ed36e37 | [
"MIT"
] | null | null | null | entry.py | panubo/sensu-result-proxy | e7b8ee72bfbfadaaa798020630af6f6c5ed36e37 | [
"MIT"
] | null | null | null | entry.py | panubo/sensu-result-proxy | e7b8ee72bfbfadaaa798020630af6f6c5ed36e37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
def main(argv):
# www-data user
spawn_uid = 33
spawn_gid = 33
def execute(arg, user, group):
print(">> Replacing current process with: %s" % arg[1])
os.setgid(group)
os.setuid(user)
print(">> Running as %s:%s" % (os.geteuid()... | 23.59375 | 95 | 0.605298 |
cf2b8f24693648bc7a633a4d37dee00749e088d9 | 8,513 | py | Python | src/unity/python/turicreate/toolkits/_private_utils.py | shreyasvj25/turicreate | 32e84ca16aef8d04aff3d49ae9984bd49326bffd | [
"BSD-3-Clause"
] | 2 | 2019-02-08T08:45:27.000Z | 2020-09-07T05:55:18.000Z | src/unity/python/turicreate/toolkits/_private_utils.py | shreyasvj25/turicreate | 32e84ca16aef8d04aff3d49ae9984bd49326bffd | [
"BSD-3-Clause"
] | 3 | 2021-09-08T02:18:00.000Z | 2022-03-12T00:39:44.000Z | src/unity/python/turicreate/toolkits/_private_utils.py | ZeroInfinite/turicreate | dd210c2563930881abd51fd69cb73007955b33fd | [
"BSD-3-Clause"
] | 1 | 2019-06-01T18:49:28.000Z | 2019-06-01T18:49:28.000Z | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... | 33.648221 | 91 | 0.660402 |
9659f45b3cd8ba3d33e2848e46a6f8dc195a3669 | 111,732 | py | Python | plugins/ibm_resilient_incident/icon_ibm_resilient_incident/actions/get_individual_incident/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/ibm_resilient_incident/icon_ibm_resilient_incident/actions/get_individual_incident/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/ibm_resilient_incident/icon_ibm_resilient_incident/actions/get_individual_incident/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Gets an individual incident"
class Input:
INCIDENT_ID = "incident_id"
ORGANIZATION_ID = "organization_id"
class Output:
INCIDENT = "incident"
class GetIndividualIncidentInput(komand.Input):
... | 25.960037 | 67 | 0.3008 |
dd216fe9a7d17972bfad70a13188aeeb40321978 | 1,073 | py | Python | test/test_addhydrogens.py | UnixJunkie/frowns | 427e4c11a8a4dbe865828d18221899478497795e | [
"BSD-3-Clause"
] | null | null | null | test/test_addhydrogens.py | UnixJunkie/frowns | 427e4c11a8a4dbe865828d18221899478497795e | [
"BSD-3-Clause"
] | null | null | null | test/test_addhydrogens.py | UnixJunkie/frowns | 427e4c11a8a4dbe865828d18221899478497795e | [
"BSD-3-Clause"
] | null | null | null | from frowns.Atom import Atom
from frowns.Bond import Bond
def addHydrogens(mol):
if not mol.explicitHydrogens:
for atom in mol.atoms:
for i in range(atom.hcount):
hatom = Atom()
hatom.symbol = 'H'
#is the coordinates of hydrogen s... | 26.170732 | 99 | 0.524697 |
880f6a667eca7f51f325595ae53a7f60e6af656c | 12,067 | py | Python | mymodel/models/model.py | picsolab/COLING2020-BiasStudy | e877cb0625d1f529334507d08db1a6e517fa77b1 | [
"MIT"
] | 1 | 2020-12-04T20:32:21.000Z | 2020-12-04T20:32:21.000Z | mymodel/models/model.py | picsolab/COLING2020-BiasStudy | e877cb0625d1f529334507d08db1a6e517fa77b1 | [
"MIT"
] | null | null | null | mymodel/models/model.py | picsolab/COLING2020-BiasStudy | e877cb0625d1f529334507d08db1a6e517fa77b1 | [
"MIT"
] | 1 | 2020-11-28T19:56:44.000Z | 2020-11-28T19:56:44.000Z | from torch.autograd import Function
import torch.nn as nn
import transformers as T
import torch
import torch.nn.init as init
from allennlp.data.tokenizers import WordTokenizer
from allennlp.modules.elmo import Elmo, batch_to_ids
from allennlp.modules import InputVariationalDropout
from allennlp.modules.token_embedders ... | 49.253061 | 146 | 0.686915 |
58f00f0c16bec16959b44dd71f42cd1cfc025377 | 420 | py | Python | test_exercise.py | ec500-software-engineering/exercise-2-ffmpeg-joshem | ac4add9506735f9f682e265aa6d2ed58296dd1f9 | [
"MIT"
] | null | null | null | test_exercise.py | ec500-software-engineering/exercise-2-ffmpeg-joshem | ac4add9506735f9f682e265aa6d2ed58296dd1f9 | [
"MIT"
] | null | null | null | test_exercise.py | ec500-software-engineering/exercise-2-ffmpeg-joshem | ac4add9506735f9f682e265aa6d2ed58296dd1f9 | [
"MIT"
] | null | null | null | from pytest import approx
import subprocess
def test_duration():
inp='2mb.avi'
out='2.avi'
outLen = subprocess.call(['ffprobe', '-v', 'error', '-show_entries', 'format=duration', '-of', 'default=noprint_wrappers=1:nokey=1',out])
inLen = subprocess.call(['ffprobe', '-v', 'error', '-show_entries', 'for... | 38.181818 | 141 | 0.666667 |
9747e0fc0640b1d642a0a8be72690a63a1425228 | 8,495 | py | Python | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/source_control/github/github_webhook.py | jkroepke/homelab | ffdd849e39b52972870f5552e734fd74cb1254a1 | [
"Apache-2.0"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/source_control/github/github_webhook.py | jkroepke/kubernetes-the-hard-way | 70fd096a04addec0777744c9731a4e3fbdc40c8f | [
"Apache-2.0"
] | null | null | null | kubernetes-the-hard-way/system/collections/ansible_collections/community/general/plugins/modules/source_control/github/github_webhook.py | jkroepke/kubernetes-the-hard-way | 70fd096a04addec0777744c9731a4e3fbdc40c8f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright: (c) 2018, 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: github_webhook
short_description: Manage GitHu... | 30.448029 | 106 | 0.618128 |
2f02f7bce85031286494c98e108b92af1b225678 | 1,517 | py | Python | solutions/nested-list-weight-sum.py | Shuailong/Leetcode | 153aa7bc1b9ad5bbc503ddd7e0694bd2a17a2b97 | [
"MIT"
] | 3 | 2017-05-21T04:28:32.000Z | 2019-03-06T03:28:51.000Z | solutions/nested-list-weight-sum.py | Shuailong/Leetcode | 153aa7bc1b9ad5bbc503ddd7e0694bd2a17a2b97 | [
"MIT"
] | null | null | null | solutions/nested-list-weight-sum.py | Shuailong/Leetcode | 153aa7bc1b9ad5bbc503ddd7e0694bd2a17a2b97 | [
"MIT"
] | 1 | 2018-10-28T22:49:40.000Z | 2018-10-28T22:49:40.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
nested-list-weight-sum.py
Created by Shuailong on 2016-03-30.
https://leetcode.com/problems/nested-list-weight-sum/.
"""
# """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
# cla... | 23.703125 | 95 | 0.593276 |
5ce26d9de21af7338ef23cb45997ac6060ad5bd9 | 10,041 | py | Python | contrib/spendfrom/spendfrom.py | LordDarkHelmet/Dynamic | 75cd043bf8a520f5630d2d7367b4a4e947388a2f | [
"MIT"
] | 76 | 2017-04-06T13:58:15.000Z | 2022-01-04T16:36:58.000Z | contrib/spendfrom/spendfrom.py | LordDarkHelmet/Dynamic | 75cd043bf8a520f5630d2d7367b4a4e947388a2f | [
"MIT"
] | 181 | 2016-11-19T21:09:35.000Z | 2021-08-21T02:57:23.000Z | contrib/spendfrom/spendfrom.py | LordDarkHelmet/Dynamic | 75cd043bf8a520f5630d2d7367b4a4e947388a2f | [
"MIT"
] | 61 | 2017-01-08T11:30:24.000Z | 2021-08-13T07:06:46.000Z | #!/usr/bin/env python
#
# Use the raw transactions API to spend Dynamic received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a dynamicd or Dyna... | 37.466418 | 111 | 0.632805 |
1854170b86c2f2ddc0b509ce78e9ff644d995cfa | 149 | py | Python | mocha/skel/create/application/lib/helpers.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | 7 | 2017-05-14T02:21:48.000Z | 2020-11-07T20:12:01.000Z | mocha/skel/create/application/lib/helpers.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | 6 | 2019-11-04T02:52:17.000Z | 2021-05-06T19:00:33.000Z | mocha/skel/create/application/lib/helpers.py | mardix/Mocha | bce481cb31a0972061dd99bc548701411dcb9de3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Helpers
This contain your application's helper functions or utilities
that will be shared accross multiple places
"""
| 16.555556 | 62 | 0.718121 |
4e8d75e49e38b43b9d3dc7e859ae834b8c885b3f | 237 | py | Python | Projeler/odev.py | ciwan6521/udemy | cb26d5c29af743fecee7d9fee90d56e26ebd7222 | [
"MIT"
] | null | null | null | Projeler/odev.py | ciwan6521/udemy | cb26d5c29af743fecee7d9fee90d56e26ebd7222 | [
"MIT"
] | null | null | null | Projeler/odev.py | ciwan6521/udemy | cb26d5c29af743fecee7d9fee90d56e26ebd7222 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
sayi1 = int(input("Lütfen ilk sayıyı giriniz: "))
sayi2 = int(input("Lütfen ilk ikinci giriniz: "))
sayi3 = int(input("Lütfen ilk üçüncü giriniz: "))
carpim = sayi1*sayi2*sayi3
print("Sonuç: {}".format(carpim)) | 26.333333 | 49 | 0.666667 |
27719501a0d86f821508fcf6ca43178651609e5b | 824 | py | Python | server/inform/debias_result.py | tiankaixie/fairrankvis | 6810895cae280ffb1caa790414f754f34d8bbb8b | [
"MIT"
] | 1 | 2022-03-01T05:32:17.000Z | 2022-03-01T05:32:17.000Z | server/inform/debias_result.py | VADERASU/fairrankvis | 52aabf2b94344072cf8e58c09424e09da4fe321e | [
"MIT"
] | null | null | null | server/inform/debias_result.py | VADERASU/fairrankvis | 52aabf2b94344072cf8e58c09424e09da4fe321e | [
"MIT"
] | 2 | 2021-10-01T01:51:20.000Z | 2021-11-13T18:58:36.000Z | import utils
from scipy.sparse import identity
from scipy.sparse.csgraph import laplacian
def matrix_conjugate_gradient(A, B, X, tol=1e-12, maxiter=100):
if maxiter is None:
maxiter = X.shape[0] * 10
R = B - A @ X
P = R.copy()
for niter in range(maxiter):
residual_prev = utils.trace(... | 23.542857 | 63 | 0.565534 |
7e224ccb3d847f2d2a4dd20ef602ab0203555ab5 | 439 | py | Python | Dataset/Leetcode/test/58/481.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/58/481.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/58/481.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, s: str) -> int:
'''逆序遍历,匹配空格'''
# i,j=len(s)-1,len(s)-1
# while i>-1:
# if s[j]==' ':
# j-=1
# i-=1
# elif s[i]==' ':
# break
# else:
# i-=1
# return j-i
... | 23.105263 | 38 | 0.29385 |
2e65f0d6d5205f532a83cec0e8b49ba32040ecb1 | 18,450 | py | Python | data/model/repo_mirror.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | data/model/repo_mirror.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | data/model/repo_mirror.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | import re
from datetime import datetime, timedelta
from peewee import IntegrityError, fn, JOIN
from jsonschema import ValidationError
from data.database import (
RepoMirrorConfig,
RepoMirrorRule,
RepoMirrorRuleType,
RepoMirrorStatus,
RepositoryState,
Repository,
uuid_generator,
db_tra... | 31.008403 | 100 | 0.69187 |
d49496c9213106a0918889d0e3a6aa3992ff1641 | 1,829 | py | Python | data_structures/disjoint_set/disjoint_set.py | egagraha/python-algorithm | 07a6a745b4ebddc93ab7c10b205c75b2427ac1fb | [
"MIT"
] | null | null | null | data_structures/disjoint_set/disjoint_set.py | egagraha/python-algorithm | 07a6a745b4ebddc93ab7c10b205c75b2427ac1fb | [
"MIT"
] | null | null | null | data_structures/disjoint_set/disjoint_set.py | egagraha/python-algorithm | 07a6a745b4ebddc93ab7c10b205c75b2427ac1fb | [
"MIT"
] | null | null | null | """
Disjoint set.
Reference: https://en.wikipedia.org/wiki/Disjoint-set_data_structure
"""
class Node:
def __init__(self, data: int) -> None:
self.data = data
self.rank: int
self.parent: Node
def make_set(x: Node) -> None:
"""
Make x as a set.
"""
# rank is the di... | 21.517647 | 73 | 0.556042 |
88729cfc6e0e491d45a4158245aac23bb7f1217e | 879 | py | Python | tardis/rest/app/main.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 4 | 2018-05-22T13:22:06.000Z | 2019-03-26T15:32:57.000Z | tardis/rest/app/main.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 50 | 2018-05-18T11:46:39.000Z | 2019-04-26T07:29:45.000Z | tardis/rest/app/main.py | maxfischer2781/tardis | a83ba0a02d2f153a8ab95b84ec78bc6ababa57a5 | [
"MIT"
] | 2 | 2018-12-12T13:15:59.000Z | 2018-12-17T08:18:15.000Z | from ...__about__ import __version__
from .routers import login, resources
from fastapi import FastAPI
app = FastAPI(
title="TARDIS REST API",
version=__version__,
description="",
contact={
"name": "Matterminers",
"url": "https://matterminers.github.io/",
"email": "matterminers... | 26.636364 | 112 | 0.600683 |
0e019887d473b0e6a8fa279a88adf5b000a2350c | 803 | py | Python | medium/python3/c0109_227_basic-calculator-ii/00_leetcode_0109.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0109_227_basic-calculator-ii/00_leetcode_0109.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0109_227_basic-calculator-ii/00_leetcode_0109.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | 3 | 2018-02-09T02:46:48.000Z | 2021-02-20T08:32:03.000Z | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#227. Basic Calculator II
#Implement a basic calculator to evaluate a simple expression string.
#The expression string contains only non-negative integers... | 33.458333 | 149 | 0.704857 |
1eedd1387d6740b7b1418de921d4ff2a1d4a0762 | 1,444 | py | Python | doc/examples/jupyter_notebook/jupyter_notebook_config.py | carlsonp/pachyderm | d0362d76234821a1f4dbb44082d98749c166b227 | [
"Apache-2.0"
] | null | null | null | doc/examples/jupyter_notebook/jupyter_notebook_config.py | carlsonp/pachyderm | d0362d76234821a1f4dbb44082d98749c166b227 | [
"Apache-2.0"
] | 1 | 2021-03-26T00:20:21.000Z | 2021-03-26T00:20:21.000Z | doc/examples/jupyter_notebook/jupyter_notebook_config.py | carlsonp/pachyderm | d0362d76234821a1f4dbb44082d98749c166b227 | [
"Apache-2.0"
] | 1 | 2020-09-02T10:05:28.000Z | 2020-09-02T10:05:28.000Z | # Copyright (c) Jupyter Development Team.
from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
import errno
import stat
PEM_FILE = os.path.join(jupyter_data_dir(), 'notebook.pem')
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
# Point the no... | 34.380952 | 69 | 0.655817 |
e9545a0ab992579b116020ca1122e63d86e3a24a | 2,138 | py | Python | _static/cookbook/gravmag_harvester_grav.py | fatiando/v0.2 | e90e42f2073c4851453e0012238c915071613734 | [
"BSD-3-Clause"
] | null | null | null | _static/cookbook/gravmag_harvester_grav.py | fatiando/v0.2 | e90e42f2073c4851453e0012238c915071613734 | [
"BSD-3-Clause"
] | null | null | null | _static/cookbook/gravmag_harvester_grav.py | fatiando/v0.2 | e90e42f2073c4851453e0012238c915071613734 | [
"BSD-3-Clause"
] | null | null | null | """
GravMag: 3D gravity inversion by planting anomalous densities using
``harvester`` (simple example)
"""
from fatiando import gridder, utils
from fatiando.gravmag import prism, harvester
from fatiando.mesher import Prism, PrismMesh, vremove
from fatiando.vis import mpl, myv
# Create a synthetic model
model = [Prism(... | 30.542857 | 79 | 0.709074 |
820a702967a7f35143f669b3f2911222a22401ce | 370 | py | Python | doc/scripts/matrix_mul.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 206 | 2018-06-28T00:28:47.000Z | 2022-03-29T05:17:03.000Z | doc/scripts/matrix_mul.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 670 | 2018-07-23T11:02:24.000Z | 2022-03-30T07:28:05.000Z | doc/scripts/matrix_mul.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 19 | 2019-09-19T06:01:00.000Z | 2022-03-29T05:17:06.000Z |
from numpy import zeros
n = 5000
m = 7000
p = 5000
a = zeros((n,m))
b = zeros((m,p))
c = zeros((n,p))
for i in range(0, n):
for j in range(0, m):
a[i,j] = i-j
for i in range(0, m):
for j in range(0, p):
b[i,j] = i+j
for i in range(0, n):
for j in range(0, p):
for k in range(0,... | 14.230769 | 43 | 0.464865 |
11a269cc01407a89e488fa57f52ea504d7d4007e | 277 | py | Python | {{cookiecutter.project_slug}}/python/{{cookiecutter.project_slug}}/__init__.py | Jawabiscuit/cookiecutter-houdini-project | 7c95420f00110f0d272317fc3155c307ff138680 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/python/{{cookiecutter.project_slug}}/__init__.py | Jawabiscuit/cookiecutter-houdini-project | 7c95420f00110f0d272317fc3155c307ff138680 | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/python/{{cookiecutter.project_slug}}/__init__.py | Jawabiscuit/cookiecutter-houdini-project | 7c95420f00110f0d272317fc3155c307ff138680 | [
"BSD-3-Clause"
] | null | null | null | """{{ cookiecutter.project_name }} module"""
__author__ = """{{ cookiecutter.full_name }}"""
__email__ = '{{ cookiecutter.email }}'
__version__ = '{{ cookiecutter.version }}'
# TODO: Remove this test before committing
print("{{ cookiecutter.project_slug }} loaded!") | 30.777778 | 48 | 0.67148 |
7b83a18e3228558a568756cbda7a8ca239bd2731 | 492 | py | Python | 0801-0850/0801-MinimumSwapsToMakeSequencesIncreasing/MinimumSwapsToMakeSequencesIncreasing.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | 3 | 2018-04-12T05:13:52.000Z | 2018-04-15T05:11:51.000Z | 0801-0850/0801-MinimumSwapsToMakeSequencesIncreasing/MinimumSwapsToMakeSequencesIncreasing.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | null | null | null | 0801-0850/0801-MinimumSwapsToMakeSequencesIncreasing/MinimumSwapsToMakeSequencesIncreasing.py | Sun-Zhen/leetcode | 57fe0de95881255393e0d6817e75bfae8f5744dc | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
@author: Alden
@email: sunzhenhy@gmail.com
@date: 2018/4/7
@version: 1.0.0.0
"""
class Solution(object):
def minSwap(self, A, B):
"""
:type A: List[int]
:type B: List[int]
:rtype: int
"""
if __name__ == "__main__":
s = Solution()
s.minSw... | 16.965517 | 31 | 0.428862 |
1fc72b4149b3bfcf7cc330e1762980408db28d3d | 11,027 | py | Python | tests/components/frontend/test_init.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 2 | 2019-07-31T16:09:15.000Z | 2019-09-05T08:07:12.000Z | tests/components/frontend/test_init.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 2 | 2022-01-13T04:00:03.000Z | 2022-03-12T01:02:40.000Z | tests/components/frontend/test_init.py | maexono/home-assistant | c174b83f5408124fc7834e8282969a1e8f9cca16 | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """The tests for Home Assistant frontend."""
import asyncio
import re
from unittest.mock import patch
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components.frontend import (
DOMAIN, CONF_JS_VERSION, CONF_THEMES, CONF_EXTRA_HTML_URL,
CONF_EXTRA_HTML_URL_ES5)
from hom... | 31.962319 | 78 | 0.664369 |
93adbbbe92a3ae8afd277a77854e3cbfa101f352 | 145 | py | Python | 03_rosalind/old_stronghold_scripts/scripts/11_py2solution.py | rcsbiotech/learnerboi | 6c7c7445aa41808b224f8a7dca1ad7f8e52fe395 | [
"BSD-3-Clause"
] | null | null | null | 03_rosalind/old_stronghold_scripts/scripts/11_py2solution.py | rcsbiotech/learnerboi | 6c7c7445aa41808b224f8a7dca1ad7f8e52fe395 | [
"BSD-3-Clause"
] | null | null | null | 03_rosalind/old_stronghold_scripts/scripts/11_py2solution.py | rcsbiotech/learnerboi | 6c7c7445aa41808b224f8a7dca1ad7f8e52fe395 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
n = 90
k = 17
f = [1]*100
for i in xrange(2,n):
f[i] = f[i-1] + f[i-2]
if i >= k:
f[i] -= f[(i-k)-1]
print(f[i])
| 9.666667 | 23 | 0.448276 |
fc1f95a4066836fefb1c0184699f84da48c1c44c | 2,552 | py | Python | ipcam/src/root.py | jack139/HF | 4810f4ee2faf9ab51c867e105addc139da2adfd1 | [
"BSD-3-Clause"
] | 10 | 2019-04-07T20:13:23.000Z | 2021-12-07T06:23:52.000Z | ipcam/src/root.py | jack139/HF | 4810f4ee2faf9ab51c867e105addc139da2adfd1 | [
"BSD-3-Clause"
] | 1 | 2020-05-29T16:11:22.000Z | 2020-05-29T16:11:22.000Z | ipcam/src/root.py | jack139/HF | 4810f4ee2faf9ab51c867e105addc139da2adfd1 | [
"BSD-3-Clause"
] | 6 | 2017-10-20T10:53:33.000Z | 2020-04-24T06:34:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# yum install smartmontools
#
from os import system
import os
import locale
import curses
import time
def get_param(prompt_string):
try:
screen.clear()
screen.border(0)
screen.addstr(2, 2, prompt_string)
screen.refresh()
input = screen.getstr(4, 2, 60)
excep... | 26.863158 | 100 | 0.611285 |
c6b52b36baddda05cc513a639b8c407fadb6a123 | 2,969 | py | Python | BUILD/doc/source/examples/export_basetype_xml_minimal_false_code.py | netsec/pytan | 29a3484d21cb90d8896275febd1c535e4f3cdc7e | [
"MIT"
] | 1 | 2019-01-29T21:22:06.000Z | 2019-01-29T21:22:06.000Z | BUILD/doc/source/examples/export_basetype_xml_minimal_false_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | BUILD/doc/source/examples/export_basetype_xml_minimal_false_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | # import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | 32.271739 | 90 | 0.737622 |
a71d5440c2da9e65e1749daa29c463f562b4b7d0 | 3,019 | py | Python | 11a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | 1 | 2021-01-05T01:29:22.000Z | 2021-01-05T01:29:22.000Z | 11a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | null | null | null | 11a/app/main/views.py | fredsonchaves07/flask-course | 4e9a3a94c3c49595c1d810794ba7533499811b58 | [
"MIT"
] | null | null | null | from datetime import datetime
from flask import render_template, session, redirect, url_for, flash
from flask_login import login_required, current_user
from ..decorators import admin_required, permission_required
from . import main
from .forms import EditProfileAdminForm, EditProfileForm, NameForm, PostForm
from .. imp... | 35.517647 | 83 | 0.70785 |
923fcdfdbcc053a7d7485b30896661d82308cb26 | 3,196 | py | Python | Proyecto2/adn_final.py | adageran2418/ProgramacionG320182 | 21573f67b7dada4fd6fa2bd3b92ed450570c8f8d | [
"MIT"
] | null | null | null | Proyecto2/adn_final.py | adageran2418/ProgramacionG320182 | 21573f67b7dada4fd6fa2bd3b92ed450570c8f8d | [
"MIT"
] | 1 | 2018-08-23T23:46:08.000Z | 2018-08-23T23:46:08.000Z | Proyecto2/adn_final.py | adageran2418/ProgramacionG320182 | 21573f67b7dada4fd6fa2bd3b92ed450570c8f8d | [
"MIT"
] | 1 | 2018-08-23T23:33:59.000Z | 2018-08-23T23:33:59.000Z | def es_base (caracter):
'''
(str) - bool
Programa para validar si el caracter es parte de la base
Programa para validar si una base es de la cadena
>>> es_base('A')
True
>>> es_base('P')
False
>>> es_base('F')
False
:param base: ingresa una letra para saber si correspon... | 19.137725 | 75 | 0.563517 |
32bd791344993bb8f751e49e09e6d8f1d3645574 | 7,384 | py | Python | v0.5.0/nvidia/submission/code/single_stage_detector/pytorch/ssd300.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-07T18:52:33.000Z | 2019-07-06T12:48:18.000Z | v0.5.0/nvidia/submission/code/single_stage_detector/pytorch/ssd300.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 12 | 2018-12-13T18:04:36.000Z | 2019-06-14T20:49:33.000Z | v0.5.0/nvidia/submission/code/single_stage_detector/pytorch/ssd300.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-09T21:04:52.000Z | 2019-06-24T07:40:28.000Z | # Copyright (c) 2018, NVIDIA 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 a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.374384 | 96 | 0.587216 |
3b019a088ab0629e60f4c91abea9b1595af0fb41 | 394 | py | Python | breathe/__init__.py | mgorny/breathe | 8143ea7990856c81d0973cce0ae388a44ace9094 | [
"BSD-3-Clause"
] | null | null | null | breathe/__init__.py | mgorny/breathe | 8143ea7990856c81d0973cce0ae388a44ace9094 | [
"BSD-3-Clause"
] | null | null | null | breathe/__init__.py | mgorny/breathe | 8143ea7990856c81d0973cce0ae388a44ace9094 | [
"BSD-3-Clause"
] | null | null | null | from . import directives
from . import file_state_cache
from .renderer import sphinxrenderer
from sphinx.application import Sphinx
__version__ = '4.29.1'
def setup(app: Sphinx):
directives.setup(app)
file_state_cache.setup(app)
sphinxrenderer.setup(app)
return {
'version': __version__,
... | 19.7 | 37 | 0.700508 |
a335a94d3b523229c01c68b6bf22b708d2b4d3aa | 3,630 | py | Python | Server/weather_ap/server.py | nathanpaulscott/IOT-Weather-Station | 3a02ed28b30bf6d35ea4856145b7f92c5d690f28 | [
"MIT"
] | null | null | null | Server/weather_ap/server.py | nathanpaulscott/IOT-Weather-Station | 3a02ed28b30bf6d35ea4856145b7f92c5d690f28 | [
"MIT"
] | null | null | null | Server/weather_ap/server.py | nathanpaulscott/IOT-Weather-Station | 3a02ed28b30bf6d35ea4856145b7f92c5d690f28 | [
"MIT"
] | null | null | null | from flask import Flask, url_for, escape, g, request, render_template, send_from_directory, jsonify
from flask_cors import CORS, cross_origin
import sqlite3
import json
from datetime import datetime as dt
def run_sql(db, sql, get_response=False, header=False):
#sends an sql command to the db
#note for creating tab... | 32.702703 | 198 | 0.69697 |
9d7f4079b89a0c0213608522de4268d3725294ca | 14,930 | py | Python | neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | 1 | 2016-01-13T14:29:07.000Z | 2016-01-13T14:29:07.000Z | neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py | yagosys/neutron | 005fec677c3bf8b2aa0df68c4aedc2b708ec7caf | [
"Apache-2.0"
] | 3 | 2015-04-03T08:47:02.000Z | 2020-02-05T10:40:45.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2013 OpenStack Foundation
# 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.ap... | 41.129477 | 79 | 0.635566 |
efb096b031e23b269989f80683c2b3a9a7b59e60 | 1,397 | py | Python | Servus/plugins/system_mac_online/cron.py | sug4rok/Servus | 9840d0e275085c08b99fc7662eb22f2ab253d8f8 | [
"MIT"
] | null | null | null | Servus/plugins/system_mac_online/cron.py | sug4rok/Servus | 9840d0e275085c08b99fc7662eb22f2ab253d8f8 | [
"MIT"
] | null | null | null | Servus/plugins/system_mac_online/cron.py | sug4rok/Servus | 9840d0e275085c08b99fc7662eb22f2ab253d8f8 | [
"MIT"
] | null | null | null | # coding=utf-8
from multiprocessing.dummy import Pool
from base.utils import CJB
from plugins.utils import get_plugins_by_package
from events.utils import event_setter
from .utils import get_mac, current_ip, pool_ips
MACAddress = get_plugins_by_package(package='plugins.system_mac_online')[0]
def set_mac_status(mac... | 27.94 | 101 | 0.658554 |
a3356689b6e4a661b8b5a7aaa10e7c9fb0845d3e | 6,353 | py | Python | nnvm/tests/python/frontend/mxnet/test_forward.py | Aimledge/tvm | f41c050fc681a9d9805e6c73e729df233e1acbac | [
"Apache-2.0"
] | null | null | null | nnvm/tests/python/frontend/mxnet/test_forward.py | Aimledge/tvm | f41c050fc681a9d9805e6c73e729df233e1acbac | [
"Apache-2.0"
] | null | null | null | nnvm/tests/python/frontend/mxnet/test_forward.py | Aimledge/tvm | f41c050fc681a9d9805e6c73e729df233e1acbac | [
"Apache-2.0"
] | null | null | null | import numpy as np
import topi
import tvm
from tvm.contrib import graph_runtime
import nnvm.symbol as sym
import nnvm.compiler
from nnvm.testing.config import ctx_list
from nnvm import frontend
import mxnet as mx
from mxnet import gluon
from mxnet.gluon.model_zoo import vision
import model_zoo
def verify_mxnet_front... | 38.271084 | 96 | 0.63954 |
070da36edd1921d65a1898516ed0ab8f066b7513 | 2,469 | py | Python | CMR/python/cmr/__init__.py | nasa/cmr-python-client | 6ec3eb057f6147f48675f7de580b6ceb8daca108 | [
"Apache-2.0"
] | 20 | 2020-10-14T20:21:00.000Z | 2022-01-10T01:21:51.000Z | CMR/python/cmr/__init__.py | nasa/cmr-python-client | 6ec3eb057f6147f48675f7de580b6ceb8daca108 | [
"Apache-2.0"
] | 28 | 2020-11-04T13:50:48.000Z | 2022-03-10T20:35:08.000Z | CMR/python/cmr/__init__.py | nasa/cmr-python-client | 6ec3eb057f6147f48675f7de580b6ceb8daca108 | [
"Apache-2.0"
] | 9 | 2020-11-04T16:22:09.000Z | 2022-02-28T17:37:07.000Z | # NASA EO-Metadata-Tools Python interface for the Common Metadata Repository (CMR)
#
# https://cmr.earthdata.nasa.gov/search/site/docs/search/api.html
#
# Copyright (c) 2020 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# ... | 36.850746 | 88 | 0.704334 |
5cdd556103f64260fef1a5f2216b39ce839cf22d | 1,351 | py | Python | project/project/apps/home/migrations/0008_auto_20210620_1428.py | SabaOrk/ForSet-Hackathon | 5cb2a8f23a7ab93f7a12d24f3626ea44692689af | [
"MIT"
] | null | null | null | project/project/apps/home/migrations/0008_auto_20210620_1428.py | SabaOrk/ForSet-Hackathon | 5cb2a8f23a7ab93f7a12d24f3626ea44692689af | [
"MIT"
] | null | null | null | project/project/apps/home/migrations/0008_auto_20210620_1428.py | SabaOrk/ForSet-Hackathon | 5cb2a8f23a7ab93f7a12d24f3626ea44692689af | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-20 10:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('home', '0007_auto_20210620_1251'),
]
operations = [
migrations.AddField(
model_name='experience... | 33.775 | 134 | 0.61362 |
89511a9db720fea8d83c1d2583ba53364702e959 | 986 | py | Python | lizard_auth_server/migrations/0011_auto_20160826_1242.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-02-21T02:12:04.000Z | 2019-02-21T02:12:04.000Z | lizard_auth_server/migrations/0011_auto_20160826_1242.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 88 | 2015-04-23T15:37:17.000Z | 2021-02-18T15:28:32.000Z | lizard_auth_server/migrations/0011_auto_20160826_1242.py | lisannewapstra/lizard-auth-server | 3824edfaedd01caff5eb84bbcb9557ccfec2371a | [
"MIT",
"BSD-3-Clause"
] | 2 | 2018-04-24T08:48:35.000Z | 2021-02-17T10:18:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-26 10:42
from django.db import migrations
from django.db import models
import lizard_auth_server.models
class Migration(migrations.Migration):
dependencies = [
("lizard_auth_server", "0010_auto_20160826_1035"),
]
operations = [
... | 28.171429 | 85 | 0.602434 |
546499f70831f8667330a06a333af22c36269bcf | 29,513 | py | Python | colorexlib/common/datastructures.py | louisronron/ColorFunk | aef341bed941b2e9d63abc64ab7b02348a271583 | [
"MIT"
] | null | null | null | colorexlib/common/datastructures.py | louisronron/ColorFunk | aef341bed941b2e9d63abc64ab7b02348a271583 | [
"MIT"
] | null | null | null | colorexlib/common/datastructures.py | louisronron/ColorFunk | aef341bed941b2e9d63abc64ab7b02348a271583 | [
"MIT"
] | 1 | 2020-05-30T08:26:46.000Z | 2020-05-30T08:26:46.000Z | '''
Copyright 2019 Louis Ronald
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distri... | 28.625606 | 104 | 0.515874 |
062e6346e5f954d99085cbd0a3a41ecb99795b9a | 6,414 | py | Python | salt/_modules/metalk8s_package_manager_yum.py | the-wright-engineer/metalk8s | ea351fe191c66f63112067ef03ab9fd1e8545bcb | [
"Apache-2.0"
] | null | null | null | salt/_modules/metalk8s_package_manager_yum.py | the-wright-engineer/metalk8s | ea351fe191c66f63112067ef03ab9fd1e8545bcb | [
"Apache-2.0"
] | 2 | 2021-02-08T20:53:50.000Z | 2021-04-30T21:28:09.000Z | salt/_modules/metalk8s_package_manager_yum.py | the-wright-engineer/metalk8s | ea351fe191c66f63112067ef03ab9fd1e8545bcb | [
"Apache-2.0"
] | null | null | null | '''
Describes our custom way to deal with yum packages
so that we can support downgrade in metalk8s
'''
import logging
from contextlib import contextmanager
from salt.exceptions import CommandExecutionError
try:
import yum
HAS_YUM_LIB = True
except ImportError:
HAS_YUM_LIB = False
log = logging.getLogger... | 28.380531 | 79 | 0.600873 |
05044120dcd1d4ebf7a4e85e7290df980267426b | 2,854 | py | Python | Hands_Train.py | Checkmate-2/IHearU | 887b31c089034cc84c32458c51c3d016cc828835 | [
"MIT"
] | 2 | 2021-07-17T08:11:03.000Z | 2022-03-18T01:08:34.000Z | Hands_Train.py | Checkmate-2/IHearU | 887b31c089034cc84c32458c51c3d016cc828835 | [
"MIT"
] | null | null | null | Hands_Train.py | Checkmate-2/IHearU | 887b31c089034cc84c32458c51c3d016cc828835 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import numpy as np
import os
from sklearn.model_selection import train_test_split
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense
from sklearn.metrics import accuracy_score
from tenso... | 38.567568 | 102 | 0.677295 |
89c3889f1bef606c58009275f47378d89ae9bdcc | 3,899 | py | Python | configs/top_down/resnet/coco/res50_coco_256x192.py | chaowentao/mmpose | b528c60ef4fab56d35d1ed7e187023794639be26 | [
"Apache-2.0"
] | 15 | 2020-12-10T07:43:34.000Z | 2022-03-21T08:38:36.000Z | configs/top_down/resnet/coco/res50_coco_256x192.py | chaowentao/mmpose | b528c60ef4fab56d35d1ed7e187023794639be26 | [
"Apache-2.0"
] | null | null | null | configs/top_down/resnet/coco/res50_coco_256x192.py | chaowentao/mmpose | b528c60ef4fab56d35d1ed7e187023794639be26 | [
"Apache-2.0"
] | 10 | 2020-12-17T07:57:10.000Z | 2022-03-08T07:17:12.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP', key_indicator='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning... | 27.457746 | 79 | 0.626571 |
07665be2fb6189b5709655e65964d2507eb89ca4 | 6,539 | py | Python | plsr/WatchTracking.py | lonelycorn/machine-learning | 812b4d4f214dc28463cb87bada4e88d0d0cf4184 | [
"MIT"
] | null | null | null | plsr/WatchTracking.py | lonelycorn/machine-learning | 812b4d4f214dc28463cb87bada4e88d0d0cf4184 | [
"MIT"
] | null | null | null | plsr/WatchTracking.py | lonelycorn/machine-learning | 812b4d4f214dc28463cb87bada4e88d0d0cf4184 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import os
import Plsr
import pickle
from pyquaternion import Quaternion
ACCEL_RANGE = 8 * 9.80665 # m/s^2
GYRO_RANGE = 2000 / 180.0 * 3.1415926 # rad/s
def loadData(folder):
inputFilename = os.path.join(folder, "result.csv")
outputFilename = os.path.join(fol... | 35.73224 | 114 | 0.650864 |
39d05d35e07d40b34ecca61814ee70dcec306438 | 3,471 | py | Python | setup.py | tokenchain/tronpytool | 42253e0afb71dcd0f773eda417de92cde9c6ca21 | [
"MIT"
] | null | null | null | setup.py | tokenchain/tronpytool | 42253e0afb71dcd0f773eda417de92cde9c6ca21 | [
"MIT"
] | null | null | null | setup.py | tokenchain/tronpytool | 42253e0afb71dcd0f773eda417de92cde9c6ca21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------
# Copyright (c) iEXBase. All rights reserved.
# Licensed under the MIT License.
# See License.txt in the project root for license information.
# --------------------------------------------------------------------
"""
setu... | 24.792857 | 93 | 0.554883 |
bc64fe8788accc4f26f9c5c5bf40b600e0874c47 | 1,104 | py | Python | setup.py | nobias-project/doubt | 270abc9b1fb8e708893d8c4782472488459a0262 | [
"MIT"
] | 27 | 2020-06-27T09:18:30.000Z | 2022-03-18T17:28:39.000Z | setup.py | nobias-project/doubt | 270abc9b1fb8e708893d8c4782472488459a0262 | [
"MIT"
] | 27 | 2020-03-30T10:13:47.000Z | 2022-01-07T14:39:37.000Z | setup.py | nobias-project/doubt | 270abc9b1fb8e708893d8c4782472488459a0262 | [
"MIT"
] | 2 | 2021-05-13T08:55:19.000Z | 2021-05-13T09:23:04.000Z | from setuptools import setup, find_packages
from pathlib import Path
from bump_version import get_current_version
setup(name='doubt',
version=get_current_version(return_tuple=False),
description='Bringing back uncertainty to machine learning',
long_description=Path('README.md').read_text(),
lo... | 39.428571 | 66 | 0.563406 |
32a604df050f55af6562e7d56fb13c746643789b | 1,574 | py | Python | lib/httpd/extension.py | aronreid/php_buildpack_4.3.7 | a3597b0fb637a4c221b08c155ed656084a058e96 | [
"Apache-2.0"
] | null | null | null | lib/httpd/extension.py | aronreid/php_buildpack_4.3.7 | a3597b0fb637a4c221b08c155ed656084a058e96 | [
"Apache-2.0"
] | null | null | null | lib/httpd/extension.py | aronreid/php_buildpack_4.3.7 | a3597b0fb637a4c221b08c155ed656084a058e96 | [
"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 use ... | 30.862745 | 74 | 0.652478 |
2a20fd1e019ca736c1aa6b32c7793ea1a187c23f | 75,383 | py | Python | urltoregion/pythonwhois/parse.py | geohci/geo-provenance | d86cf9131dd8b73cf48e489382b32200bddcda13 | [
"Apache-2.0"
] | null | null | null | urltoregion/pythonwhois/parse.py | geohci/geo-provenance | d86cf9131dd8b73cf48e489382b32200bddcda13 | [
"Apache-2.0"
] | null | null | null | urltoregion/pythonwhois/parse.py | geohci/geo-provenance | d86cf9131dd8b73cf48e489382b32200bddcda13 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os, re, sys, datetime, csv
from . import net, shared
try:
from io import StringIO
except ImportError:
from cStringIO import StringIO
def pkgdata(name):
with open(os.path.join(os.path.dirname(__file__), name), 'r') as fin:
return fin.read()
def read_dataset(filename, ... | 75.232535 | 770 | 0.582015 |
1c5722c9481a7f854981c4c6c2964eb767cfdc74 | 2,983 | py | Python | solace/tests/validation.py | burhan/solace | 40d2bc025ac3a78e67602f374c32355badafb4d2 | [
"BSD-3-Clause"
] | null | null | null | solace/tests/validation.py | burhan/solace | 40d2bc025ac3a78e67602f374c32355badafb4d2 | [
"BSD-3-Clause"
] | null | null | null | solace/tests/validation.py | burhan/solace | 40d2bc025ac3a78e67602f374c32355badafb4d2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
solace.tests.validation
~~~~~~~~~~~~~~~~~~~~~~~
A unittest that validates the pages using the validator.nu HTML5
validator.
:copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
i... | 32.423913 | 75 | 0.594033 |
75e971f6d9c5267bf39feac2efd8600328a4e588 | 6,899 | py | Python | bin/api_connector_splunk/solnlib/modular_input/event.py | CyberGRX/api-connector-splunk | 7f1db1cecb7ae367c1882c3188dc9f8bcb6bc4c6 | [
"MIT"
] | 106 | 2018-03-09T13:03:05.000Z | 2022-03-10T11:01:48.000Z | bin/api_connector_splunk/solnlib/modular_input/event.py | CyberGRX/api-connector-splunk | 7f1db1cecb7ae367c1882c3188dc9f8bcb6bc4c6 | [
"MIT"
] | 54 | 2016-08-11T14:22:30.000Z | 2020-08-07T22:14:55.000Z | bin/api_connector_splunk/solnlib/modular_input/event.py | CyberGRX/api-connector-splunk | 7f1db1cecb7ae367c1882c3188dc9f8bcb6bc4c6 | [
"MIT"
] | 33 | 2018-04-23T20:18:11.000Z | 2022-03-27T16:41:03.000Z | # Copyright 2016 Splunk, 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,... | 30.526549 | 76 | 0.550515 |
bd7232bf8cd695fa51d83333b06fb9b707ba8f7d | 43,999 | py | Python | tests/unit/gapic/compute_v1/test_machine_types.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/compute_v1/test_machine_types.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/compute_v1/test_machine_types.py | vam-google/python-compute | 799f2f55e5e205317862a17ca7ed548ce2ca66e5 | [
"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... | 38.902741 | 112 | 0.68122 |
f2130e6ed41b7828d53ea7152397f86eb9814fe3 | 213 | py | Python | cli/commands/login.py | kego1992/cli | 31adcc2d61b7a6b163d8ed0a67b067b47b5183bc | [
"MIT"
] | 1 | 2021-10-31T15:23:02.000Z | 2021-10-31T15:23:02.000Z | cli/commands/login.py | kego1992/cli | 31adcc2d61b7a6b163d8ed0a67b067b47b5183bc | [
"MIT"
] | null | null | null | cli/commands/login.py | kego1992/cli | 31adcc2d61b7a6b163d8ed0a67b067b47b5183bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import click
from .. import cli
@cli.cli.command()
def login():
cli.user()
click.echo(
'You\'re logged in as ' +
click.style(cli.data['email'], fg='cyan')
)
| 14.2 | 49 | 0.535211 |
d74980dfc6de09c0bd29a8498cadc5d2b9db8ba6 | 4,905 | py | Python | client/nar/base.py | HFragnaud/neural-activity-resource | c2829eede347d3f21eca6f0dd089fbee69e89789 | [
"Apache-2.0"
] | null | null | null | client/nar/base.py | HFragnaud/neural-activity-resource | c2829eede347d3f21eca6f0dd089fbee69e89789 | [
"Apache-2.0"
] | null | null | null | client/nar/base.py | HFragnaud/neural-activity-resource | c2829eede347d3f21eca6f0dd089fbee69e89789 | [
"Apache-2.0"
] | null | null | null | """
"""
import sys
from functools import wraps
import logging
from six import with_metaclass
from .errors import ResourceExistsError
logger = logging.getLogger("nar")
registry = {}
# todo: add namespaces to avoid name clashes, e.g. "Person" exists in several namespaces
def register_class(target_class):
regis... | 29.196429 | 122 | 0.573293 |
5ee845d29518a38410b919a9e61a7d5e16159901 | 1,479 | py | Python | src/study/function_learning/function_learning.py | sushanted/NNDL-forked | 3d8675f3e9258d17226b5a6da29854d75ee3315e | [
"Unlicense"
] | null | null | null | src/study/function_learning/function_learning.py | sushanted/NNDL-forked | 3d8675f3e9258d17226b5a6da29854d75ee3315e | [
"Unlicense"
] | null | null | null | src/study/function_learning/function_learning.py | sushanted/NNDL-forked | 3d8675f3e9258d17226b5a6da29854d75ee3315e | [
"Unlicense"
] | null | null | null | # A network learning provided function
from src import network
import numpy as np
# z = 3x+4y
# (3*x**2+4*y**3+5)/12
# (x+y)/2
funct = lambda x,y : (3*x**3+2*y**2)/4
def evaluation_function(test_tuples,feedforwarder):
current_cost = sum([ abs(feedforwarder(input)-expected) for (input,expected) in test_tuples ]... | 22.753846 | 122 | 0.659905 |
134ff383aefbfbd684a53633c35dbfa527b732c7 | 3,258 | py | Python | dotaworld/tree_helper.py | pydota2/pydota2 | 3d4011a3e73ccd8a69fbc474770bcebcbcdb8ab5 | [
"Apache-2.0"
] | 108 | 2017-11-02T00:07:18.000Z | 2021-09-16T06:12:05.000Z | dotaworld/tree_helper.py | pydota2/pydota2 | 3d4011a3e73ccd8a69fbc474770bcebcbcdb8ab5 | [
"Apache-2.0"
] | 26 | 2017-10-31T17:50:01.000Z | 2019-01-15T19:12:53.000Z | dotaworld/tree_helper.py | pydota2/pydota2 | 3d4011a3e73ccd8a69fbc474770bcebcbcdb8ab5 | [
"Apache-2.0"
] | 13 | 2018-02-24T07:13:04.000Z | 2020-06-16T09:08:14.000Z | ###
### Helper Class/Funcs for dealing with Trees
###
import json
from dotaservice.dotaservice.protos.dota_gcmessages_common_bot_script_pb2 import CMsgBotWorldState
BOUNDING_SIZE = 64.
BOUNDING_OFFSET = BOUNDING_SIZE / 2.
class Dota2_Tree:
def __init__(self, id, x, y, z):
self.id = id
self.... | 30.166667 | 98 | 0.557397 |
9fc2cc258f7319b7541a0d148430b68e9569428a | 1,910 | py | Python | src/command/args/word.py | vincent-lg/talismud | 645bdae3d2e71cde51a25fe48c8f1bde15319631 | [
"BSD-3-Clause"
] | 4 | 2020-05-16T21:58:55.000Z | 2020-08-29T11:17:31.000Z | src/command/args/word.py | vincent-lg/talismud | 645bdae3d2e71cde51a25fe48c8f1bde15319631 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T11:22:32.000Z | 2020-12-15T11:22:32.000Z | src/command/args/word.py | vincent-lg/talismud | 645bdae3d2e71cde51a25fe48c8f1bde15319631 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020-20201, LE GOFF Vincent
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions... | 38.2 | 78 | 0.764398 |
e7f3b66ea9d7d173aa6e413949f514efd4294f84 | 663 | py | Python | graphgallery/gallery/nodeclas/tensorflow/BVAT/utils.py | Jie-Re/GraphGallery | 37a2e807bb21e5ed986ade935ac9619b62bfdd90 | [
"MIT"
] | null | null | null | graphgallery/gallery/nodeclas/tensorflow/BVAT/utils.py | Jie-Re/GraphGallery | 37a2e807bb21e5ed986ade935ac9619b62bfdd90 | [
"MIT"
] | null | null | null | graphgallery/gallery/nodeclas/tensorflow/BVAT/utils.py | Jie-Re/GraphGallery | 37a2e807bb21e5ed986ade935ac9619b62bfdd90 | [
"MIT"
] | null | null | null | import tensorflow as tf
def get_normalized_vector(d):
d /= (1e-12 + tf.reduce_max(tf.abs(d), keepdims=True))
d /= tf.math.sqrt(1e-6 + tf.reduce_sum(tf.pow(d, 2.0), axis=-1, keepdims=True))
return d
def kl_divergence_with_logit(q_logit, p_logit,
mask=None):
q = tf.math.so... | 27.625 | 83 | 0.634992 |
957a75c979bf252f00a934d82771b4942cd72e2a | 9,044 | py | Python | model/tests/test_triplet_loss.py | TITAN-PyCompat/tensorflow-triplet-loss | fc698369bb6c9acdc9f0e9e1ea00de0ddf782f12 | [
"MIT"
] | 1,076 | 2018-03-22T17:10:59.000Z | 2022-03-30T17:32:49.000Z | model/tests/test_triplet_loss.py | TITAN-PyCompat/tensorflow-triplet-loss | fc698369bb6c9acdc9f0e9e1ea00de0ddf782f12 | [
"MIT"
] | 61 | 2018-04-02T20:13:02.000Z | 2021-12-07T07:07:41.000Z | model/tests/test_triplet_loss.py | TITAN-PyCompat/tensorflow-triplet-loss | fc698369bb6c9acdc9f0e9e1ea00de0ddf782f12 | [
"MIT"
] | 290 | 2018-03-25T12:16:11.000Z | 2022-03-31T06:25:48.000Z | """Test for the triplet loss computation."""
import numpy as np
import tensorflow as tf
from model.triplet_loss import batch_all_triplet_loss
from model.triplet_loss import batch_hard_triplet_loss
from model.triplet_loss import _pairwise_distances
from model.triplet_loss import _get_triplet_mask
from model.triplet_lo... | 34.918919 | 99 | 0.646948 |
fb974f4a334a6f1a3a8779baed04e0dc4991f1f4 | 449 | py | Python | sequence_classification/classifiers/svm_classifier.py | piotermiarer/Sequence-Classification | 05b5491cc8470f477a160fb4207aacd1b12aa5ed | [
"MIT"
] | 1 | 2021-03-14T17:22:41.000Z | 2021-03-14T17:22:41.000Z | sequence_classification/classifiers/svm_classifier.py | piotermiarer/Sequence-Classification | 05b5491cc8470f477a160fb4207aacd1b12aa5ed | [
"MIT"
] | 23 | 2018-11-17T21:05:31.000Z | 2019-01-15T09:58:33.000Z | sequence_classification/classifiers/svm_classifier.py | piotermiarer/Sequence-Classification | 05b5491cc8470f477a160fb4207aacd1b12aa5ed | [
"MIT"
] | 1 | 2020-07-31T06:09:31.000Z | 2020-07-31T06:09:31.000Z | from sklearn.svm import LinearSVC
from .sequence_classifier import SequenceClassifier
class SVMClassifier(SequenceClassifier):
def __init__(self, name='SVM', transformer=None):
super(SVMClassifier, self).__init__(name, transformer)
self.model = LinearSVC(random_state=0, tol=1e-5)
def _fit(se... | 28.0625 | 62 | 0.714922 |
0e30643edb008188bb1139578a91ba8373ef8981 | 16,898 | py | Python | posthog/models/event.py | c3ho/posthog | 418b2b6b55f1babee493a14e24d229690b12d8df | [
"MIT"
] | null | null | null | posthog/models/event.py | c3ho/posthog | 418b2b6b55f1babee493a14e24d229690b12d8df | [
"MIT"
] | null | null | null | posthog/models/event.py | c3ho/posthog | 418b2b6b55f1babee493a14e24d229690b12d8df | [
"MIT"
] | null | null | null | import copy
import datetime
import re
from collections import defaultdict
from typing import Any, Dict, List, Tuple, Union
import celery
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db import connection, models, transaction
from django.db.models import Exists, F, OuterR... | 42.779747 | 120 | 0.605456 |
7999e1a072395b78a169d6196ff02897dff4cf10 | 10,631 | py | Python | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/combined_audience_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/combined_audience_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/combined_audience_service/transports/grpc.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- 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... | 44.295833 | 112 | 0.630232 |
24dabb0c3572643d58449914974ded65fe760569 | 814 | py | Python | pythran/tests/openmp.legacy/omp_for_schedule_dynamic.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,647 | 2015-01-13T01:45:38.000Z | 2022-03-28T01:23:41.000Z | pythran/tests/openmp.legacy/omp_for_schedule_dynamic.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,116 | 2015-01-01T09:52:05.000Z | 2022-03-18T21:06:40.000Z | pythran/tests/openmp.legacy/omp_for_schedule_dynamic.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 180 | 2015-02-12T02:47:28.000Z | 2022-03-14T10:28:18.000Z | def omp_for_schedule_dynamic():
CFDMAX_SIZE = 100
chunk_size = 7
tids = [0]*CFDMAX_SIZE
count = 0
tmp_count = 0
result = 0
import omp
if 'omp parallel shared(tids)':
tid = omp.get_thread_num()
'omp for schedule(dynamic, chunk_size)'
for i in range(CFDMAX_SIZE):
... | 24.666667 | 55 | 0.531941 |
1fa5ff98f418a6abce632b299d29b9e82ab1ccb1 | 2,127 | py | Python | tutorial-contents/Evolution Strategy/Natural Evolution Strategy (NES).py | dingtx000/Evolutionary-Algorithm | 4820978bf3bc9df6da9525159204b63ccdfc72b8 | [
"MIT"
] | 2 | 2020-06-02T06:25:08.000Z | 2020-06-06T11:42:19.000Z | tutorial-contents/Evolution Strategy/Natural Evolution Strategy (NES).py | Alex9702/Evolutionary-Algorithm | 4820978bf3bc9df6da9525159204b63ccdfc72b8 | [
"MIT"
] | null | null | null | tutorial-contents/Evolution Strategy/Natural Evolution Strategy (NES).py | Alex9702/Evolutionary-Algorithm | 4820978bf3bc9df6da9525159204b63ccdfc72b8 | [
"MIT"
] | 1 | 2018-07-12T17:42:48.000Z | 2018-07-12T17:42:48.000Z | """
The basic idea about Nature Evolution Strategy with visualation.
Visit my tutorial website for more: https://morvanzhou.github.io/tutorials/
Dependencies:
Tensorflow >= r1.2
numpy
matplotlib
"""
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.contrib.distributions import... | 35.45 | 110 | 0.685943 |
aebdb6112201ec4e60274ced9b9f71bab1ab9a99 | 227 | py | Python | global_covid_tracker/content/__init__.py | kvanderveen/global_covid_tracker | ad4466b099aae30cbc73b62cce440c62a4fc87f9 | [
"MIT"
] | null | null | null | global_covid_tracker/content/__init__.py | kvanderveen/global_covid_tracker | ad4466b099aae30cbc73b62cce440c62a4fc87f9 | [
"MIT"
] | 3 | 2021-08-23T20:45:46.000Z | 2022-03-12T00:33:28.000Z | global_covid_tracker/content/__init__.py | kvanderveen/global_covid_tracker | ad4466b099aae30cbc73b62cce440c62a4fc87f9 | [
"MIT"
] | null | null | null | from .introduction_content import introduction_content
from .testing_content import testing_content
from .cases_content import cases_content
from .deaths_content import deaths_content
from .growth_content import growth_content
| 37.833333 | 54 | 0.889868 |
98d0d14a124be4b900dc7ff19e131589e8b860c4 | 24,784 | py | Python | synapse/app/homeserver.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | null | null | null | synapse/app/homeserver.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | null | null | null | synapse/app/homeserver.py | Erethon/synapse | d13863d6eb4b3a1ce1ca4a702ae30d4f8808e51f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 New Vector 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.or... | 35.918841 | 117 | 0.63775 |
877f92c4474d07aac48286c23e486eabd5a11f47 | 185 | py | Python | wasm/demo/snippets/fibonacci.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | wasm/demo/snippets/fibonacci.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | wasm/demo/snippets/fibonacci.py | mainsail-org/RustPython | 5d2d87c24f1ff7201fcc8d4fcffadb0ec12dc127 | [
"CC-BY-4.0",
"MIT"
] | 914 | 2018-07-27T09:36:14.000Z | 2022-03-31T19:56:34.000Z | n1 = 0
n2 = 1
count = 0
until = 10
print(f"These are the first {until} numbers in the Fibonacci sequence:")
while count < until:
print(n1)
n1, n2 = n2, n1 + n2
count += 1
| 15.416667 | 72 | 0.610811 |
7229c2e367b88e4c19486e6583319f1f71adabe4 | 2,773 | py | Python | hvad/tests/views.py | aptivate/django-hvad | 61457412eeae09b5df1c514a5b162230be125e1b | [
"BSD-3-Clause"
] | null | null | null | hvad/tests/views.py | aptivate/django-hvad | 61457412eeae09b5df1c514a5b162230be125e1b | [
"BSD-3-Clause"
] | null | null | null | hvad/tests/views.py | aptivate/django-hvad | 61457412eeae09b5df1c514a5b162230be125e1b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from hvad.test_utils.context_managers import LanguageOverride
from hvad.test_utils.testcase import NaniTestCase
from hvad.test_utils.request_factory import RequestFactory
from hvad.test_utils.project.app.models import Normal
from hvad.views import Tra... | 53.326923 | 149 | 0.602957 |
f7a514f2842fd95a1f2289434281b837539a4b5e | 181 | py | Python | src/pipedown/nodes/base/__init__.py | brendanhasz/drainpype | a183acec7cae1ef9fde260868e2b021516a8cd7f | [
"MIT"
] | 2 | 2021-03-03T12:11:24.000Z | 2021-03-18T15:09:52.000Z | src/pipedown/nodes/base/__init__.py | brendanhasz/pipedown | a183acec7cae1ef9fde260868e2b021516a8cd7f | [
"MIT"
] | null | null | null | src/pipedown/nodes/base/__init__.py | brendanhasz/pipedown | a183acec7cae1ef9fde260868e2b021516a8cd7f | [
"MIT"
] | null | null | null | from .cache import Cache
from .input import Input
from .loader import Loader
from .metric import Metric
from .model import Model
from .node import Node
from .primary import Primary
| 22.625 | 28 | 0.80663 |
9427a9d688c3cd32452c744405f2f9f069156e87 | 513 | py | Python | .venv/lib/python3.8/site-packages/cachy/serializers/serializer.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 36 | 2016-02-14T06:34:00.000Z | 2022-03-03T12:29:54.000Z | .venv/lib/python3.8/site-packages/cachy/serializers/serializer.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 19 | 2019-05-08T15:19:47.000Z | 2022-03-20T07:03:45.000Z | .venv/lib/python3.8/site-packages/cachy/serializers/serializer.py | RivtLib/replit01 | ce1ae18b446a9c844f40e88a51c71fbc45ab3ad7 | [
"MIT"
] | 18 | 2018-08-07T07:14:05.000Z | 2022-03-20T06:41:30.000Z | # -*- coding: utf-8 -*-
class Serializer(object):
"""
Abstract serializer.
"""
def serialize(self, data):
"""
Serialize data.
:param data: The data to serialize
:type data: mixed
:rtype: str
"""
raise NotImplementedError()
def unserialize... | 17.1 | 44 | 0.516569 |
e312d0f86ad81db6700f196a91af6d00bac33137 | 3,870 | py | Python | app/discal/cogs/handler.py | Shirataki2/DisCalendar | cfb5ecad6c65911fbb041cbc585d86588de125f5 | [
"MIT"
] | 6 | 2020-11-29T08:04:07.000Z | 2021-05-07T11:05:10.000Z | app/discal/cogs/handler.py | Shirataki2/DisCalendar | cfb5ecad6c65911fbb041cbc585d86588de125f5 | [
"MIT"
] | 139 | 2020-11-24T23:37:03.000Z | 2022-03-30T00:18:09.000Z | app/discal/cogs/handler.py | Shirataki2/DisCalendar | cfb5ecad6c65911fbb041cbc585d86588de125f5 | [
"MIT"
] | 1 | 2021-02-01T15:07:17.000Z | 2021-02-01T15:07:17.000Z | import asyncio
import json
import discord
from discord.ext import commands, tasks
from discal.bot import Bot
from datetime import datetime, timedelta
from discal.logger import get_module_logger
logger = get_module_logger(__name__)
class Handler(commands.Cog):
def __init__(self, bot):
self.bot: Bot = bot... | 36.168224 | 100 | 0.496382 |
94f3e1cac6d756d68790c0069e94e976ab87eb6d | 264 | py | Python | giico/giico/doctype/field_permeability_test/field_permeability_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/field_permeability_test/field_permeability_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | giico/giico/doctype/field_permeability_test/field_permeability_test.py | thispl/giico | 14c5631639ab56a586a7962be9871d722c20e205 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class FieldPermeabilityTest(Document):
pass
| 24 | 49 | 0.780303 |
d941dd646aab95b6e8651068a35abd345ab13e5f | 43,553 | py | Python | Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py | bodleytunes/content | 91ef88f45105cf51a4007b9ac7dad714d6a1f2a3 | [
"MIT"
] | null | null | null | Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py | bodleytunes/content | 91ef88f45105cf51a4007b9ac7dad714d6a1f2a3 | [
"MIT"
] | null | null | null | Packs/Base/Scripts/DBotTrainClustering/DBotTrainClustering.py | bodleytunes/content | 91ef88f45105cf51a4007b9ac7dad714d6a1f2a3 | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import pandas as pd
import numpy as np
import collections
import dill as pickle
import builtins
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer
from sklearn import cluster
from sklear... | 43.379482 | 130 | 0.633665 |
a0c5445b266ce646ba463af5379680a1783cfe83 | 296 | py | Python | New folder2/ad.py | sanjaymanikandan/ML-For-Beginners | cd44eda1905c203143161c665aac5f0441c9ed39 | [
"MIT"
] | null | null | null | New folder2/ad.py | sanjaymanikandan/ML-For-Beginners | cd44eda1905c203143161c665aac5f0441c9ed39 | [
"MIT"
] | null | null | null | New folder2/ad.py | sanjaymanikandan/ML-For-Beginners | cd44eda1905c203143161c665aac5f0441c9ed39 | [
"MIT"
] | null | null | null | import json
x = {
"name": "John",
"age": 30,
"married": True,
"divorced": False,
"children": ("Ann","Billy"),
"pets": None,
"cars": [
{"model": "BMW 230", "mpg": 27.5},
{"model": "Ford Edge", "mpg": 24.1}
]
}
print(json.dumps(x))
| 16.444444 | 42 | 0.429054 |
ccfc52a639a91e52394453bcd2843c59b5f66d4a | 3,443 | py | Python | .idea/VirtualEnvironment/Lib/site-packages/hstest/dynamic/file_searcher.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | .idea/VirtualEnvironment/Lib/site-packages/hstest/dynamic/file_searcher.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | 5 | 2021-04-08T22:02:15.000Z | 2022-02-10T14:53:45.000Z | .idea/VirtualEnvironment/Lib/site-packages/hstest/dynamic/file_searcher.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | import os
import re
from typing import Callable, Tuple
from hstest.exception.outcomes import ErrorWithFeedback
_contents_cached = {}
def runnable_searcher(abs_path_to_search: str = None,
file_filter: Callable[[str, str], bool] = lambda folder, file: True) -> Tuple[str, str]:
if abs_path_to... | 36.62766 | 110 | 0.572466 |
03360a537bb99e127ca8709dec45e9d9d7389fb8 | 7,231 | py | Python | sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/v2019_03_01/_data_box_edge_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.868966 | 129 | 0.730328 |
5555cfb004abbce899a44bdff8e39576507d9139 | 2,087 | py | Python | dailyfresh/apps/goods/views.py | litaiji/dailyfresh | 752691a22abd3b0007e16c3109d47a6536a5bf7e | [
"MIT"
] | null | null | null | dailyfresh/apps/goods/views.py | litaiji/dailyfresh | 752691a22abd3b0007e16c3109d47a6536a5bf7e | [
"MIT"
] | null | null | null | dailyfresh/apps/goods/views.py | litaiji/dailyfresh | 752691a22abd3b0007e16c3109d47a6536a5bf7e | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.views.generic import View
from django.core.cache import cache
from django_redis import get_redis_connection
from goods.models import GoodsType
from goods.models import IndexGoodsBanner
from goods.models import IndexPromotionBanner
from goods.mod... | 31.149254 | 112 | 0.606612 |
9d0664cd28daaccca671952cb3a57175ede6b154 | 8,652 | py | Python | src/relstorage/adapters/mysql/oidallocator.py | lungj/relstorage | e18394b0197f6b70708037f36defbd3fe3ee5137 | [
"ZPL-2.1"
] | null | null | null | src/relstorage/adapters/mysql/oidallocator.py | lungj/relstorage | e18394b0197f6b70708037f36defbd3fe3ee5137 | [
"ZPL-2.1"
] | null | null | null | src/relstorage/adapters/mysql/oidallocator.py | lungj/relstorage | e18394b0197f6b70708037f36defbd3fe3ee5137 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... | 42.62069 | 114 | 0.625058 |
e5d9c6c517cb16f0881d7262a9f90217052360a4 | 9,953 | py | Python | mint/rpc/full_node_rpc_client.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | 12 | 2021-08-18T20:53:31.000Z | 2022-03-15T21:45:13.000Z | mint/rpc/full_node_rpc_client.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | 34 | 2021-08-18T19:12:11.000Z | 2022-01-06T17:15:34.000Z | mint/rpc/full_node_rpc_client.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | 7 | 2021-08-18T20:53:34.000Z | 2022-03-15T08:37:40.000Z | from typing import Dict, List, Optional, Tuple, Any
from mint.consensus.block_record import BlockRecord
from mint.full_node.signage_point import SignagePoint
from mint.rpc.rpc_client import RpcClient
from mint.types.blockchain_format.sized_bytes import bytes32
from mint.types.coin_record import CoinRecord
from mint.ty... | 43.462882 | 120 | 0.644127 |
8a5f190b5bbfe3ceff85658d1fb94e608559f5b0 | 104 | py | Python | tests/Unittest.py | JoeroshanGithub/simpledate | 803f094555f954bfa18b21f7221bfc488df6fbcb | [
"MIT"
] | 1 | 2021-03-26T14:26:02.000Z | 2021-03-26T14:26:02.000Z | tests/Unittest.py | JoeroshanGithub/simpledate | 803f094555f954bfa18b21f7221bfc488df6fbcb | [
"MIT"
] | null | null | null | tests/Unittest.py | JoeroshanGithub/simpledate | 803f094555f954bfa18b21f7221bfc488df6fbcb | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import simpledate as dt
Date1=dt.today()-50
print(Date1)
| 10.4 | 40 | 0.759615 |
4fdf7ae9f6a80f650122df6a313d8c5234b4fbda | 872 | py | Python | test/functional_requirements/device_management/LIST_DEV_REPEAT.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | 1 | 2022-02-07T23:30:50.000Z | 2022-02-07T23:30:50.000Z | test/functional_requirements/device_management/LIST_DEV_REPEAT.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/functional_requirements/device_management/LIST_DEV_REPEAT.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import os
import sys
import json
sys.path.append("../")
sys.path.append("../../system/lib/")
import json_parser
import pos
import cli
import api
import SCAN_DEV_BASIC
def check_result(out1, out2):
list1 = json.loads(out1)['Response']['result']['data']['devicelist']
list... | 24.222222 | 72 | 0.666284 |
9387326860a3be3f403ee2920c6346a667e70dc0 | 3,077 | py | Python | oneparams/api/login.py | exebixel/oneparams | 146e7539a9cca51238f09d52fcc6090bc3b9d3c0 | [
"MIT"
] | 3 | 2020-08-08T16:03:48.000Z | 2022-03-17T22:45:38.000Z | oneparams/api/login.py | exebixel/oneparams | 146e7539a9cca51238f09d52fcc6090bc3b9d3c0 | [
"MIT"
] | null | null | null | oneparams/api/login.py | exebixel/oneparams | 146e7539a9cca51238f09d52fcc6090bc3b9d3c0 | [
"MIT"
] | null | null | null | import json
import sys
from urllib.parse import quote
from oneparams.api.base import BaseApi
class login(BaseApi):
def login(self, nome_empresa, email, senha, nome_filial="", empresa_id=0):
empresa = self.empresa(nome_empresa, nome_filial, empresa_id)
dados = {
"empresaId": empresa["i... | 32.389474 | 84 | 0.532012 |
44f63b0ad849bda9078024e6611868725649359a | 340 | py | Python | app7ox/cgi-bin/config.py | geooooo/7ox | bbfd28f77a49e37a6d4f4a7a869024a2de0cb673 | [
"MIT"
] | null | null | null | app7ox/cgi-bin/config.py | geooooo/7ox | bbfd28f77a49e37a6d4f4a7a869024a2de0cb673 | [
"MIT"
] | null | null | null | app7ox/cgi-bin/config.py | geooooo/7ox | bbfd28f77a49e37a6d4f4a7a869024a2de0cb673 | [
"MIT"
] | null | null | null | import os
from bottle import (
TEMPLATE_PATH,
route,
static_file,
)
TEMPLATE_PATH.insert(0, f"{os.getcwd()}/views/web/")
RUN_ARGS = {
'reloader': True,
'port': 8080,
'debug': True,
}
@route("/<filename:path>")
def server_static_file(filename):
return static_file(filename, root=f"{os.get... | 16.190476 | 66 | 0.644118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.