hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
77e058999925966ffefcc07466323369b962c6d6 | 460 | py | Python | tools/mo/openvino/tools/mo/front/kaldi/extractors/concat_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | tools/mo/openvino/tools/mo/front/kaldi/extractors/concat_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/openvino/tools/mo/front/kaldi/extractors/concat_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.ops.concat import Concat
class ConcatFrontExtractor(FrontExtractorOp):
op = 'concat'
enabled = True
@classmethod
def extract(cls, no... | 24.210526 | 62 | 0.68913 |
4cb9e56f083d523d9da23dc9914cf4d5a63f28b0 | 6,028 | py | Python | metrics/general.py | rotmanmi/Unsupervised-Disentanglement-Torus | fe6623e94da24fad888b810580618560847bd8cb | [
"Apache-2.0"
] | null | null | null | metrics/general.py | rotmanmi/Unsupervised-Disentanglement-Torus | fe6623e94da24fad888b810580618560847bd8cb | [
"Apache-2.0"
] | null | null | null | metrics/general.py | rotmanmi/Unsupervised-Disentanglement-Torus | fe6623e94da24fad888b810580618560847bd8cb | [
"Apache-2.0"
] | null | null | null | """
from https://github.com/clarken92/DisentanglementMetrics
"""
import math
import numpy as np
def sample_mask_with_rate(shape, one_rate):
assert len(shape) == 2, "'shape' must be a list/tuple of format (batch, dim)!"
assert 0.0 < one_rate < 1.0, "'one_rate' must be in (0, 1)"
num_ones = int(round(o... | 34.056497 | 109 | 0.60866 |
d4ae6949a3a6805f4317b75047932bce92bdc130 | 3,707 | py | Python | default_pfx.py | mfbsouza/proton-ge-custom | e51c7bf9058f0edef1c490f6c63e908324d6294a | [
"MIT",
"BSD-3-Clause"
] | 3 | 2018-11-24T22:50:35.000Z | 2019-03-09T16:46:44.000Z | default_pfx.py | mfbsouza/proton-ge-custom | e51c7bf9058f0edef1c490f6c63e908324d6294a | [
"MIT",
"BSD-3-Clause"
] | 1 | 2018-12-15T04:15:56.000Z | 2018-12-15T04:15:56.000Z | default_pfx.py | mfbsouza/proton-ge-custom | e51c7bf9058f0edef1c490f6c63e908324d6294a | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-12-04T19:56:47.000Z | 2021-12-04T19:56:47.000Z | #!/usr/bin/env python3
# usage: default_pfx.py path/to/default_pfx_dir path/to/dist
"Helper module for building the default prefix"
import os
import subprocess
def file_is_wine_builtin_dll(path):
if not os.path.exists(path):
return False
try:
sfile = open(path, "rb")
sfile.seek(0x40)... | 32.80531 | 86 | 0.598867 |
b8c4027cc7665320ef146df118fbe338223219d1 | 14,900 | py | Python | tensorflow/python/ops/linalg/linear_operator_tridiag.py | EricLi404/tensorflow | 23759800d89f7b5362c338d9a3fd72a6810c3e22 | [
"Apache-2.0"
] | 74 | 2020-07-06T17:11:39.000Z | 2022-01-28T06:31:28.000Z | tensorflow/python/ops/linalg/linear_operator_tridiag.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/ops/linalg/linear_operator_tridiag.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 12 | 2020-07-08T07:27:17.000Z | 2021-12-27T08:54:27.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... | 38.601036 | 99 | 0.664899 |
421f7e044d4cd2a9ca223470bd9a0f033ff181b1 | 6,520 | py | Python | src/char/basic.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | 1 | 2022-02-09T03:19:59.000Z | 2022-02-09T03:19:59.000Z | src/char/basic.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | null | null | null | src/char/basic.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | 2 | 2022-01-10T12:46:31.000Z | 2022-02-12T20:26:16.000Z | import keyboard
from utils.custom_mouse import mouse
from char import IChar,CharacterCapabilities
from template_finder import TemplateFinder
from ui import UiManager
from pather import Pather
from logger import Logger
from screen import Screen
from utils.misc import wait, cut_roi
import time
from pather import Pather, ... | 42.064516 | 154 | 0.655368 |
37deb8b12517ad7f7ed2b23d84c94d2166389722 | 1,367 | py | Python | samples/snippets/create_table_external_hive_partitioned_test.py | KoffieLabs/python-bigquery | 33b317abdc6d69f33722cb0504bb0b78c1c80e30 | [
"Apache-2.0"
] | 1 | 2022-03-25T21:07:44.000Z | 2022-03-25T21:07:44.000Z | samples/snippets/create_table_external_hive_partitioned_test.py | abecerrilsalas/python-bigquery | 8da4fa9e77bcfd2b68818b5d65b38ccc59899a01 | [
"Apache-2.0"
] | null | null | null | samples/snippets/create_table_external_hive_partitioned_test.py | abecerrilsalas/python-bigquery | 8da4fa9e77bcfd2b68818b5d65b38ccc59899a01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.341463 | 86 | 0.750549 |
8e0a794a30e9e391fe3c422efbfb50ffd669610f | 9,470 | py | Python | tests/tests_assemble_workflow/test_bundle_opensearch.py | korpx-z/opensearch-build | 370ff2ab884cd5d4751f1199c72849a39c06a768 | [
"Apache-2.0"
] | null | null | null | tests/tests_assemble_workflow/test_bundle_opensearch.py | korpx-z/opensearch-build | 370ff2ab884cd5d4751f1199c72849a39c06a768 | [
"Apache-2.0"
] | null | null | null | tests/tests_assemble_workflow/test_bundle_opensearch.py | korpx-z/opensearch-build | 370ff2ab884cd5d4751f1199c72849a39c06a768 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
import os
import unittest
import zipfile
from unittest.mock import MagicMock, Mock, call, patch
from assemble_workflow.bundle_... | 46.650246 | 149 | 0.566843 |
8d2cb78586ab442cd6e76945a25dd1f8a5d14402 | 10,861 | py | Python | src/training_script.py | vineeths96/ComBERT | 28b7fb9b39f4eed576483d22b810f7c52ed39ce4 | [
"MIT"
] | 4 | 2021-09-17T07:14:46.000Z | 2022-02-03T02:20:38.000Z | src/training_script.py | vineeths96/ComBERT | 28b7fb9b39f4eed576483d22b810f7c52ed39ce4 | [
"MIT"
] | null | null | null | src/training_script.py | vineeths96/ComBERT | 28b7fb9b39f4eed576483d22b810f7c52ed39ce4 | [
"MIT"
] | 1 | 2021-04-30T12:35:55.000Z | 2021-04-30T12:35:55.000Z | """
Notes:
* I won't add model checkpoint averaging as mentioned in the paper - it just feels like an arbitrary heuristic
and it won't add anything to the learning experience this repo aims to provide.
"""
import argparse
import time
import torch
from torch import nn
from torch.optim import Ad... | 41.773077 | 120 | 0.688703 |
f5d9f2b9d5f107b374619939454a7ff9f49823c5 | 95 | py | Python | Server/__init__.py | cbabs/netDiag | 59a74acd9edcb6c7fb90d222e96c63077b53c99c | [
"MIT"
] | 1 | 2020-07-26T02:02:57.000Z | 2020-07-26T02:02:57.000Z | Server/__init__.py | cbabs/netDiag | 59a74acd9edcb6c7fb90d222e96c63077b53c99c | [
"MIT"
] | null | null | null | Server/__init__.py | cbabs/netDiag | 59a74acd9edcb6c7fb90d222e96c63077b53c99c | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
app.config.from_object('settings')
import views | 15.833333 | 34 | 0.789474 |
dfca6b2a4c0dedb897e10f0c8990d1e832b2b5a0 | 1,847 | py | Python | src/models/tune_logistic_regression.py | titus-chin/telco-customer-churn-prediction | d7c8d4089cad6aa22f6aa8bb1b87a203a493a00d | [
"MIT"
] | null | null | null | src/models/tune_logistic_regression.py | titus-chin/telco-customer-churn-prediction | d7c8d4089cad6aa22f6aa8bb1b87a203a493a00d | [
"MIT"
] | null | null | null | src/models/tune_logistic_regression.py | titus-chin/telco-customer-churn-prediction | d7c8d4089cad6aa22f6aa8bb1b87a203a493a00d | [
"MIT"
] | null | null | null | import wandb
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
from src.data.utils import get_project_root, load_config
import os
def main():
"""Pipeline to tune logistic regression classifier,
and record the result to Weights & Biases ... | 34.849057 | 88 | 0.710883 |
f026d1d82b328248b69c1c342b38946986ba442f | 11,993 | py | Python | GANCF/CIFAR10/cifar10_dchinge.py | gargrohin/AMAT-for-GAN-Training | 9a396fb8170befb8b55d8f01e7918d12c117bacb | [
"MIT"
] | 7 | 2021-10-21T00:54:31.000Z | 2022-03-28T04:22:35.000Z | GANCF/CIFAR10/cifar10_dchinge.py | gargrohin/AMAT-for-GAN-Training | 9a396fb8170befb8b55d8f01e7918d12c117bacb | [
"MIT"
] | null | null | null | GANCF/CIFAR10/cifar10_dchinge.py | gargrohin/AMAT-for-GAN-Training | 9a396fb8170befb8b55d8f01e7918d12c117bacb | [
"MIT"
] | 1 | 2021-11-22T11:42:59.000Z | 2021-11-22T11:42:59.000Z | import comet_ml
import logging
comet_ml.config.save(api_key="CX4nLhknze90b8yiN2WMZs9Vw")
logging.basicConfig(level=logging.INFO)
LOGGER = logging.getLogger("comet_ml")
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152
os.environ["CUDA_VISIBLE_DEVICES"]="1"
# prerequisites
import torch
import t... | 31.069948 | 159 | 0.58309 |
0e9caf56a53fb3cccdc7429b6e6e6646ad097625 | 9,435 | py | Python | Sources/Emmeteur/vw.py | Gramatiik/AppelClient | f089ac254ea755e0a57aab1f8e2fc12df8c294fa | [
"MIT"
] | null | null | null | Sources/Emmeteur/vw.py | Gramatiik/AppelClient | f089ac254ea755e0a57aab1f8e2fc12df8c294fa | [
"MIT"
] | null | null | null | Sources/Emmeteur/vw.py | Gramatiik/AppelClient | f089ac254ea755e0a57aab1f8e2fc12df8c294fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# vw.py
# 2015-10-31
# Public Domain
"""
This module provides a 313MHz/434MHz radio interface compatible
with the Virtual Wire library used on Arduinos.
It has been tested between a Pi, TI Launchpad, and Arduino Pro Mini.
"""
import time
import pigpio
MAX_MESSAGE_BYTES=77
MIN_BPS=50
MAX_BPS=... | 23.238916 | 78 | 0.537467 |
6ed9b4da9f6cc536e2a27834d584d276ff8b2b33 | 867 | py | Python | Part-08 PayPal Integration/orders/migrations/0002_auto_20210322_1634.py | azizkra/django-ecommerce-project | 5cfae7705a970f898c511368b7601187102cd0ed | [
"MIT"
] | 175 | 2021-04-17T14:14:12.000Z | 2022-03-29T06:37:23.000Z | Part-08 PayPal Integration/orders/migrations/0002_auto_20210322_1634.py | azizkra/django-ecommerce-project | 5cfae7705a970f898c511368b7601187102cd0ed | [
"MIT"
] | 8 | 2021-05-22T11:10:49.000Z | 2022-03-06T02:55:00.000Z | Part-08 PayPal Integration/orders/migrations/0002_auto_20210322_1634.py | azizkra/django-ecommerce-project | 5cfae7705a970f898c511368b7601187102cd0ed | [
"MIT"
] | 182 | 2021-04-17T15:49:51.000Z | 2022-03-31T16:27:46.000Z | # Generated by Django 3.1.7 on 2021-03-22 16:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='order',
old_name='post_code',
... | 25.5 | 64 | 0.553633 |
ba5ab7736c042e4cc690359a3d2ede943aa22a25 | 429 | py | Python | mmseg/apis/__init__.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 21 | 2022-01-11T14:06:25.000Z | 2022-03-29T06:42:13.000Z | mmseg/apis/__init__.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 13 | 2022-02-15T20:05:18.000Z | 2022-02-15T20:05:21.000Z | mmseg/apis/__init__.py | weiyx16/mmsegmentation | 6d35d76195f173fbc6b119a7d7815e67d78024c6 | [
"Apache-2.0"
] | 11 | 2022-01-11T16:05:24.000Z | 2022-03-17T01:58:52.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from .inference import inference_segmentor, init_segmentor, show_result_pyplot
from .test import multi_gpu_test, single_gpu_test
from .train import get_root_logger, set_random_seed, train_segmentor
__all__ = [
'get_root_logger', 'set_random_seed', 'train_segmentor', ... | 39 | 78 | 0.794872 |
593c0c902648901295eda62f18338e9b582d6c03 | 90 | py | Python | npimage/__init__.py | Image-Py/npimage | 78783af65edf012201d6501c11939c787984d188 | [
"BSD-3-Clause"
] | 3 | 2022-03-02T14:41:10.000Z | 2022-03-03T17:39:43.000Z | npimage/__init__.py | Image-Py/npimage | 78783af65edf012201d6501c11939c787984d188 | [
"BSD-3-Clause"
] | null | null | null | npimage/__init__.py | Image-Py/npimage | 78783af65edf012201d6501c11939c787984d188 | [
"BSD-3-Clause"
] | null | null | null | from .label import *
from .measures import *
from .filters import *
from .binary import *
| 18 | 23 | 0.733333 |
565bd8622e0e69c4cfb9d2bdccc0ccda24c0c003 | 36,476 | py | Python | index.py | Hown3d/cfn-stack-rename | 80e3b01f25c683be465115bfd94817369d7daace | [
"MIT"
] | 17 | 2021-01-29T11:20:19.000Z | 2022-03-21T20:17:49.000Z | index.py | Hown3d/cfn-stack-rename | 80e3b01f25c683be465115bfd94817369d7daace | [
"MIT"
] | 3 | 2021-06-22T16:17:29.000Z | 2022-01-14T21:32:41.000Z | index.py | Hown3d/cfn-stack-rename | 80e3b01f25c683be465115bfd94817369d7daace | [
"MIT"
] | 4 | 2021-07-31T03:17:51.000Z | 2022-03-11T05:56:11.000Z | import boto3
import sys
import json
import time
import pprint
from collections import OrderedDict
from cfn_flip import flip, to_yaml, to_json
resolve_matches = {}
def resolvePropertyValue(prop, match_resources, replace_values):
if isinstance(prop, dict):
if 'Ref' in prop:
if prop['Ref'] in mat... | 23.382051 | 140 | 0.498081 |
b45972f72e92743d71bdaf8be98f6140ff6187c5 | 2,231 | gyp | Python | src/prediction/prediction_base.gyp | sousuke0422/crIME | abc711e0c2cad19950703d59ed4d1ffe4bd76953 | [
"BSD-3-Clause"
] | 1 | 2021-02-24T07:03:26.000Z | 2021-02-24T07:03:26.000Z | src/prediction/prediction_base.gyp | sousuke0422/crIME | abc711e0c2cad19950703d59ed4d1ffe4bd76953 | [
"BSD-3-Clause"
] | 108 | 2018-05-29T17:33:53.000Z | 2019-07-22T00:01:54.000Z | src/prediction/prediction_base.gyp | sousuke0422/crIME | abc711e0c2cad19950703d59ed4d1ffe4bd76953 | [
"BSD-3-Clause"
] | 1 | 2021-12-29T08:15:14.000Z | 2021-12-29T08:15:14.000Z | # Copyright 2010-2018, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | 36.57377 | 72 | 0.697445 |
e5440107f1c2d8fb3b8c3d98ab6714c011d69e54 | 4,542 | py | Python | src/models/capacity_toy_model.py | rganti/Channel_Capacity_T_Cell | 62b9cba7a4248287598d06c010dcfcc4601a7006 | [
"MIT"
] | 1 | 2020-10-07T01:18:30.000Z | 2020-10-07T01:18:30.000Z | src/models/capacity_toy_model.py | rganti/Channel_Capacity_T_Cell | 62b9cba7a4248287598d06c010dcfcc4601a7006 | [
"MIT"
] | null | null | null | src/models/capacity_toy_model.py | rganti/Channel_Capacity_T_Cell | 62b9cba7a4248287598d06c010dcfcc4601a7006 | [
"MIT"
] | 1 | 2020-08-03T04:25:42.000Z | 2020-08-03T04:25:42.000Z | import numpy as np
'''Defines a class that numerically calculates the capacity as a function of LsT/LfT and ks/kf.'''
parameters = {'kp': 0.1, 'koff': 0.05, 'koffs': 0.05, 'kon': 0.0022, 'kons': 0.1, 'kf': 0.2,
'R': 30000.0, 'lfT': 10.0, 'M': 15, 'St': 10000.0}
class ComputeCapacity(object):
def ... | 36.926829 | 117 | 0.477983 |
ecf75204e64a4d8a33647b2748992123b062fe19 | 1,607 | py | Python | Ticket Python/cons.py | janzyxcode/LazyTicket | a8a3b9451a662bebab0e0a44dff5d02e44b73f97 | [
"MIT"
] | null | null | null | Ticket Python/cons.py | janzyxcode/LazyTicket | a8a3b9451a662bebab0e0a44dff5d02e44b73f97 | [
"MIT"
] | null | null | null | Ticket Python/cons.py | janzyxcode/LazyTicket | a8a3b9451a662bebab0e0a44dff5d02e44b73f97 | [
"MIT"
] | null | null | null | # _*_ coding: utf-8 _*_
import re
import ngRequest
import json
import os
currentWorkPath = os.getcwd()
cityNameDict = {}
cityCodeDict = {}
configPath = currentWorkPath + '/cons/config.json'
captchaPath = currentWorkPath + '/captchaImage/catchpaImage.png'
trainDicListPath = currentWorkPath + '/tickets/ticketLeft.jso... | 24.723077 | 152 | 0.660859 |
5784e8e11fb1d55b042602f147a468aaa7511d4f | 14,084 | py | Python | acme/acme/messages.py | aaroncohen/certbot | c3434bac26592585d12feb781a87f3e2be846e42 | [
"Apache-2.0"
] | 1 | 2018-09-12T03:07:11.000Z | 2018-09-12T03:07:11.000Z | acme/acme/messages.py | MAFABA/lets-encrypt- | 07273e5d7ed0fb49af0101d220a91fd4f1a56184 | [
"Apache-2.0"
] | null | null | null | acme/acme/messages.py | MAFABA/lets-encrypt- | 07273e5d7ed0fb49af0101d220a91fd4f1a56184 | [
"Apache-2.0"
] | null | null | null | """ACME protocol messages."""
import collections
from acme import challenges
from acme import errors
from acme import fields
from acme import jose
from acme import util
OLD_ERROR_PREFIX = "urn:acme:error:"
ERROR_PREFIX = "urn:ietf:params:acme:error:"
ERROR_CODES = {
'badCSR': 'The CSR is unacceptable (e.g., due ... | 31.159292 | 80 | 0.667495 |
5909dfaf3aaaf814b8002c323f84256f305d7d16 | 27,032 | py | Python | tests/helpers/test_entity_platform.py | mfaraco/home-assistant | a91b0058229974aed578fb20e833df4454d007f9 | [
"Apache-2.0"
] | 23 | 2017-11-15T21:03:53.000Z | 2021-03-29T21:33:48.000Z | tests/helpers/test_entity_platform.py | mfaraco/home-assistant | a91b0058229974aed578fb20e833df4454d007f9 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:59:36.000Z | 2022-03-12T00:52:11.000Z | tests/helpers/test_entity_platform.py | ajk12345-code/home-assistant | 85624e80312e0487f51653ce24b398320972cbec | [
"Apache-2.0"
] | 10 | 2018-01-01T00:12:51.000Z | 2021-12-21T23:08:05.000Z | """Tests for the EntityPlatform helper."""
import asyncio
from datetime import timedelta
import logging
from unittest.mock import MagicMock, Mock, patch
import asynctest
import pytest
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers import entity_platform, entity_registry
from homeassi... | 33.959799 | 88 | 0.693548 |
bbbc97c3ee3797657e5565fe9edbde2a8f99fa9f | 17,197 | py | Python | src/c3nav/editor/forms.py | johnjohndoe/c3nav | a17f863a3512e305595c16b0300796b6bae81241 | [
"Apache-2.0"
] | null | null | null | src/c3nav/editor/forms.py | johnjohndoe/c3nav | a17f863a3512e305595c16b0300796b6bae81241 | [
"Apache-2.0"
] | null | null | null | src/c3nav/editor/forms.py | johnjohndoe/c3nav | a17f863a3512e305595c16b0300796b6bae81241 | [
"Apache-2.0"
] | null | null | null | import json
import operator
import os
from functools import reduce
from itertools import chain
from operator import attrgetter
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import FieldDoesNotExist
from django.core.serializers.json import DjangoJSONEncoder
from django... | 48.036313 | 118 | 0.615049 |
bd5119423b3efdb99890a8bfe5527e861e27acdf | 809 | py | Python | AnimeRecommender/urls.py | Gnitch/Anime-Recommender | 1573d32e213200e0876e81efdf52ab5511681701 | [
"Apache-2.0"
] | 1 | 2022-03-06T11:37:40.000Z | 2022-03-06T11:37:40.000Z | AnimeRecommender/urls.py | Gnitch/Anime-Recommender | 1573d32e213200e0876e81efdf52ab5511681701 | [
"Apache-2.0"
] | null | null | null | AnimeRecommender/urls.py | Gnitch/Anime-Recommender | 1573d32e213200e0876e81efdf52ab5511681701 | [
"Apache-2.0"
] | 1 | 2021-10-04T12:20:50.000Z | 2021-10-04T12:20:50.000Z | """AnimeRecommender URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... | 35.173913 | 77 | 0.708282 |
ef80e50c46f11d174e00bf5c40793c2aeb0a4e81 | 1,620 | py | Python | setup.py | getsentry/sentry-pagerduty | 39153634cbacd114d9c0f39e3be1d9d9c1721a85 | [
"Apache-2.0"
] | 4 | 2015-01-08T12:27:31.000Z | 2017-10-31T11:32:56.000Z | setup.py | getsentry/sentry-pagerduty | 39153634cbacd114d9c0f39e3be1d9d9c1721a85 | [
"Apache-2.0"
] | 5 | 2015-04-13T16:19:52.000Z | 2016-06-24T05:16:39.000Z | setup.py | getsentry/sentry-pagerduty | 39153634cbacd114d9c0f39e3be1d9d9c1721a85 | [
"Apache-2.0"
] | 7 | 2015-03-26T20:07:55.000Z | 2021-03-03T11:16:11.000Z | #!/usr/bin/env python
# Copyright 2015 Depop 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 agree... | 29.454545 | 89 | 0.690123 |
71b3dbf75591909561b5810457041e3b76e7ba2b | 3,301 | py | Python | users/factories.py | igordavydsson/tunnistamo | 93c7660bc4d8384aed8f240cbbfdf43202b8d785 | [
"MIT"
] | null | null | null | users/factories.py | igordavydsson/tunnistamo | 93c7660bc4d8384aed8f240cbbfdf43202b8d785 | [
"MIT"
] | 4 | 2019-06-12T12:13:49.000Z | 2019-07-17T09:46:39.000Z | users/factories.py | andersinno/tunnistamo | 93c7660bc4d8384aed8f240cbbfdf43202b8d785 | [
"MIT"
] | null | null | null | from datetime import timedelta
import factory
from django.contrib.auth import get_user_model
from django.utils.timezone import now
from faker import Faker
from oauth2_provider.models import AccessToken
from oidc_provider.models import Client, ResponseType, UserConsent
from oidc_provider.tests.app.utils import create_f... | 31.141509 | 86 | 0.720085 |
27e7e3bd69881d904cd1528119b9472dbe45d794 | 374 | py | Python | timedata/instruments/laser/abs_lfo_fader.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | null | null | null | timedata/instruments/laser/abs_lfo_fader.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | 1 | 2018-08-02T12:07:17.000Z | 2018-08-02T12:07:17.000Z | timedata/instruments/laser/abs_lfo_fader.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | null | null | null | from timedata.ui import switch_button, int_slider, box_layout
class AbsLfoFader(box_layout.BoxLayout):
def __init__(self, label, **kwds):
super().__init__(orientation='vertical', **kwds)
self.slider = int_slider.IntSlider(label, 0, 127)
self.button = switch_button.SwitchButton('abs', 'LFO'... | 37.4 | 62 | 0.695187 |
33e1a30a17cae1bfaf90be7081e948a160c11659 | 32,621 | py | Python | experiments_ovary_detect/run_ovary_egg-segmentation.py | ddavid/pyImSegm | 3604f8a215a782d101c0ecd538b9efaaf1931135 | [
"BSD-3-Clause"
] | 1 | 2021-07-22T23:51:43.000Z | 2021-07-22T23:51:43.000Z | experiments_ovary_detect/run_ovary_egg-segmentation.py | ddavid/pyImSegm | 3604f8a215a782d101c0ecd538b9efaaf1931135 | [
"BSD-3-Clause"
] | null | null | null | experiments_ovary_detect/run_ovary_egg-segmentation.py | ddavid/pyImSegm | 3604f8a215a782d101c0ecd538b9efaaf1931135 | [
"BSD-3-Clause"
] | null | null | null | """
Run experiments with several segmentation techniques for instance segmentation
Require installation of Morph. Snakes - https://github.com/Borda/morph-snakes ::
pip install --user git+https://github.com/Borda/morph-snakes.git
Sample usage::
python run_ovary_egg-segmentation.py \
-list data-images... | 38.377647 | 119 | 0.671531 |
0cd57744768041c61f6418dd4eba64ba89915fe1 | 350 | py | Python | Korolev_Dmitry_DZ_9/Task_1.py | Akkormsk/GB_Python_1824 | c5d4e6eb0fa761bd0d61934b7344746abb0bb0d7 | [
"MIT"
] | null | null | null | Korolev_Dmitry_DZ_9/Task_1.py | Akkormsk/GB_Python_1824 | c5d4e6eb0fa761bd0d61934b7344746abb0bb0d7 | [
"MIT"
] | null | null | null | Korolev_Dmitry_DZ_9/Task_1.py | Akkormsk/GB_Python_1824 | c5d4e6eb0fa761bd0d61934b7344746abb0bb0d7 | [
"MIT"
] | null | null | null | from itertools import cycle
import time
class TrafficLight:
__color = ['red', 'yellow', 'green']
def running(self):
print('Start')
cyc_col = cycle(self.__color)
cyc_time = cycle([7, 2, 3])
while True:
print(next(cyc_col))
time.sleep(next(cyc_time))
a ... | 17.5 | 40 | 0.577143 |
73c86e7a9e186a305fd933ba146d2e05dab26749 | 38 | py | Python | fastapi_serviceutils/utils/tests/__init__.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 34 | 2019-10-27T22:33:13.000Z | 2022-03-20T17:06:08.000Z | fastapi_serviceutils/utils/tests/__init__.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 4 | 2019-11-12T21:02:40.000Z | 2021-07-29T07:38:54.000Z | fastapi_serviceutils/utils/tests/__init__.py | egmkang/fastapi_serviceutils | 7095349421eb5e5f0435908938f79ddc93561dab | [
"MIT"
] | 5 | 2019-11-12T21:40:41.000Z | 2022-01-19T10:06:41.000Z | """Utils for testing using pytest."""
| 19 | 37 | 0.684211 |
81a36710b8a9623178d45ee465cb7dbc6d0964bc | 2,029 | py | Python | workflows/train/tensorflow-mnist-distributed-horovod.py | yunjie-hub/azureml-examples | 39b05e793d83e454552eb04633b4f6af1dedbc99 | [
"MIT"
] | 1 | 2020-11-05T03:51:25.000Z | 2020-11-05T03:51:25.000Z | workflows/train/tensorflow-mnist-distributed-horovod.py | yunjie-hub/azureml-examples | 39b05e793d83e454552eb04633b4f6af1dedbc99 | [
"MIT"
] | 6 | 2021-06-28T20:38:09.000Z | 2022-02-27T11:14:01.000Z | workflows/train/tensorflow-mnist-distributed-horovod.py | yunjie-hub/azureml-examples | 39b05e793d83e454552eb04633b4f6af1dedbc99 | [
"MIT"
] | null | null | null | # description: train tensorflow CNN model on mnist data distributed via horovod
# For more information on using Horovod with TensorFlow, refer to Horovod documentation:
#
# * [Horovod with TensorFlow](https://github.com/horovod/horovod/blob/master/docs/tensorflow.rst)
# * [Horovod with Keras](https://github.com/horovo... | 31.215385 | 108 | 0.779202 |
2c243e16efc6ab74d1bf044432241318aeced061 | 25,555 | pyw | Python | main.pyw | yuj09161/mock_grade | 6daa1103068a2febe5230f36abde8c97e5daae5b | [
"MIT"
] | null | null | null | main.pyw | yuj09161/mock_grade | 6daa1103068a2febe5230f36abde8c97e5daae5b | [
"MIT"
] | null | null | null | main.pyw | yuj09161/mock_grade | 6daa1103068a2febe5230f36abde8c97e5daae5b | [
"MIT"
] | null | null | null | from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from UI import UI_Main,UI_Subject,UI_Input_Score,Ui_Errors
import os,sys,re,json,traceback,ctypes
#define subject code
KOREAN = 0
MATH = 1
ENGLISH = 2
HISTORY = 3
SEARCH_1 = 4
SEARCH_2 = 5
#define search subjects name
... | 34.580514 | 119 | 0.55449 |
3c0d5678da9ba3826b496ddbda26df9841f519c1 | 15,332 | py | Python | tests/transforms/test_qfunc_transform.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | 1 | 2022-01-21T15:20:20.000Z | 2022-01-21T15:20:20.000Z | tests/transforms/test_qfunc_transform.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | null | null | null | tests/transforms/test_qfunc_transform.py | therooler/pennylane | 88a8a5960a2ffd218a12f85ace632021eef2abf5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | 34.071111 | 95 | 0.543047 |
e45f3242320418cb5068b87656e756ee07b6117c | 2,960 | py | Python | wandb/sdk/interface/interface_sock.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/sdk/interface/interface_sock.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/sdk/interface/interface_sock.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | """InterfaceSock - Derived from InterfaceShared using a socket to send to internal thread
See interface.py for how interface classes relate to each other.
"""
import logging
from typing import Any, Optional
from typing import TYPE_CHECKING
from .interface_shared import InterfaceShared
from .message_future import M... | 34.418605 | 91 | 0.691554 |
d8b2018f64a93b88f15835c02b352c1977f4afe6 | 112 | py | Python | vibra/firefly/__init__.py | PerceptronV/vibra | ce8587987fb7a642f885af89ee20899b52a9d517 | [
"MIT"
] | null | null | null | vibra/firefly/__init__.py | PerceptronV/vibra | ce8587987fb7a642f885af89ee20899b52a9d517 | [
"MIT"
] | null | null | null | vibra/firefly/__init__.py | PerceptronV/vibra | ce8587987fb7a642f885af89ee20899b52a9d517 | [
"MIT"
] | null | null | null | from vibra.firefly.built_in import built_in
from vibra.firefly.file import file
from vibra.firefly import data | 37.333333 | 44 | 0.839286 |
6281873073d7f8f274c50884895c4438a8e370ee | 52 | py | Python | deployml/__init__.py | Carlo-Carandang/deploy-ml | cc9ffccff3ecea89037ce4dda7ad926fe7469429 | [
"MIT"
] | null | null | null | deployml/__init__.py | Carlo-Carandang/deploy-ml | cc9ffccff3ecea89037ce4dda7ad926fe7469429 | [
"MIT"
] | null | null | null | deployml/__init__.py | Carlo-Carandang/deploy-ml | cc9ffccff3ecea89037ce4dda7ad926fe7469429 | [
"MIT"
] | null | null | null | import sklearn
# import keras
# import tensorflow
| 8.666667 | 19 | 0.769231 |
5f88847ebbebc9938a08aa208b3a28b827e573d9 | 6,367 | py | Python | pymtensor/rot_tensor.py | danielsjensen1/pymtensor | e25bdafcf38ed9e1841798435606ce9eb3166807 | [
"BSD-3-Clause"
] | null | null | null | pymtensor/rot_tensor.py | danielsjensen1/pymtensor | e25bdafcf38ed9e1841798435606ce9eb3166807 | [
"BSD-3-Clause"
] | null | null | null | pymtensor/rot_tensor.py | danielsjensen1/pymtensor | e25bdafcf38ed9e1841798435606ce9eb3166807 | [
"BSD-3-Clause"
] | 1 | 2021-04-17T02:58:22.000Z | 2021-04-17T02:58:22.000Z | from numpy import array, cos, dot, empty, nditer, sin, tensordot
from numpy.linalg import norm
from itertools import chain, permutations, product
# TODO: add more error checking for input arrays
def to_tensor(voigt, order='Voigt'):
"""
Convert from compressed to standard tensor notation.
1 -> 11, 2 ... | 33.161458 | 95 | 0.472436 |
3eb17ec3ab8b01cd12764a6a1634e899d0e96f57 | 4,869 | py | Python | cloudcafe/identity/v2_0/extensions/osksadm/behaviors.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/identity/v2_0/extensions/osksadm/behaviors.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/identity/v2_0/extensions/osksadm/behaviors.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | 1 | 2020-04-13T17:44:28.000Z | 2020-04-13T17:44:28.000Z | """
Copyright 2013 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, software
dist... | 38.952 | 77 | 0.643459 |
11723f82020fdef17a433c8372bcdd2e1f72ab5e | 707 | py | Python | correiospy/format_order_codes.py | guicarvalho/pycorreios | a332f8dfebaa98d749705c0d846b3d58c7a3e32a | [
"MIT"
] | 8 | 2015-02-17T04:33:01.000Z | 2022-03-04T10:19:13.000Z | correiospy/format_order_codes.py | guicarvalho/pycorreios | a332f8dfebaa98d749705c0d846b3d58c7a3e32a | [
"MIT"
] | 1 | 2016-03-04T10:51:28.000Z | 2016-09-25T19:04:32.000Z | correiospy/format_order_codes.py | guicarvalho/pycorreios | a332f8dfebaa98d749705c0d846b3d58c7a3e32a | [
"MIT"
] | 1 | 2016-03-05T12:37:30.000Z | 2016-03-05T12:37:30.000Z | # coding: utf-8
from .errors import InvalidOrderFormatError
class OrderFormats(object):
BOX_PACKAGE_FORMAT = 1
ROLL_PRISM_FORMAT = 2
ENVELOPE_FORMAT = 3
def __init__(self, number):
self.formats = {
self.BOX_PACKAGE_FORMAT: 'Box/Package format',
self.ROLL_PRISM_FORMAT... | 25.25 | 88 | 0.661952 |
13da45e6cb01719e361907c419ec74e1cfa000a1 | 19,243 | py | Python | scripts/west_commands/sign.py | ldalek/zephyr | fa2054f93e4e80b079a4a6a9e84d642e51912042 | [
"Apache-2.0"
] | 1 | 2022-02-23T09:03:56.000Z | 2022-02-23T09:03:56.000Z | scripts/west_commands/sign.py | ldalek/zephyr | fa2054f93e4e80b079a4a6a9e84d642e51912042 | [
"Apache-2.0"
] | 3 | 2021-10-14T04:32:03.000Z | 2021-11-12T09:02:16.000Z | scripts/west_commands/sign.py | ldalek/zephyr | fa2054f93e4e80b079a4a6a9e84d642e51912042 | [
"Apache-2.0"
] | 1 | 2018-07-07T11:14:38.000Z | 2018-07-07T11:14:38.000Z | # Copyright (c) 2018 Foundries.io
#
# SPDX-License-Identifier: Apache-2.0
import abc
import argparse
import os
import pathlib
import pickle
import platform
import shutil
import subprocess
import sys
from west import log
from west.util import quote_sh_list
from build_helpers import find_build_dir, is_zephyr_build, \
... | 38.796371 | 91 | 0.580211 |
93c16b3c038640b4b8e9dde0b30075cf7fcc1149 | 2,336 | py | Python | appengine/components/components/stats_framework/stats_logs.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 74 | 2015-04-01T02:35:15.000Z | 2021-12-17T22:10:56.000Z | appengine/components/components/stats_framework/stats_logs.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 123 | 2015-04-01T04:02:57.000Z | 2022-03-02T12:49:55.000Z | appengine/components/components/stats_framework/stats_logs.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 32 | 2015-04-03T01:40:47.000Z | 2021-11-13T15:20:13.000Z | # Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import collections
import logging
from google.appengine.api import logservice
from components import utils
# Logs prefix.
#
# The idea is that... | 29.948718 | 80 | 0.736729 |
11bf48c93d5b0644ac117ed20947e1629414a496 | 957 | py | Python | book/ch02/python/ch02.py | verazuo/Code-For-Data-driven-Security | c85c045ebd4dc9727811bab4356ce074ef916d9e | [
"MIT"
] | null | null | null | book/ch02/python/ch02.py | verazuo/Code-For-Data-driven-Security | c85c045ebd4dc9727811bab4356ce074ef916d9e | [
"MIT"
] | null | null | null | book/ch02/python/ch02.py | verazuo/Code-For-Data-driven-Security | c85c045ebd4dc9727811bab4356ce074ef916d9e | [
"MIT"
] | null | null | null | #
# name ch02.py
# 数据帧(类似excel)
# create a new data frame
import numpy as np
import pandas as pd
# create a new data frame of hosts & high vuln counts
assets_df = pd.DataFrame({
"name": ["danube", "gander", "ganges", "mekong", "orinoco"],
"os": ["W2K8", "RHEL5", "W2K8", "RHEL5", "RHEL5"],
"highvulns": [1... | 25.184211 | 69 | 0.640543 |
b791fbc8f14df83b3648266f1cfe378f26b2d314 | 282 | py | Python | prison-labor-dodgers.py | sarvenderdahiya/FoobarGoogle | 2c5715659615be03845a09d75a8b96ee03cb0ad9 | [
"MIT"
] | null | null | null | prison-labor-dodgers.py | sarvenderdahiya/FoobarGoogle | 2c5715659615be03845a09d75a8b96ee03cb0ad9 | [
"MIT"
] | null | null | null | prison-labor-dodgers.py | sarvenderdahiya/FoobarGoogle | 2c5715659615be03845a09d75a8b96ee03cb0ad9 | [
"MIT"
] | null | null | null | def solution(x, y):
x.sort()
y.sort()
xlen = len(x)
ylen = len(y)
if xlen > ylen:
sol = list(set(x) - set(y))
else:
sol = list(set(y) - set(x))
for i in sol:
x = i
return x
print(solution([13, 5, 6, 2, 5], [5, 2, 5, 13])) | 15.666667 | 48 | 0.443262 |
7ea163a10ff10b2fe1007f5beb985546c1db0ba1 | 4,363 | py | Python | src/Onigmo/tool/CaseFolding.py | kangwenhang/WindTerm | 24c96a6aa611675aeb5decf7f673318c0b626399 | [
"Apache-2.0"
] | 4,267 | 2019-10-12T03:52:44.000Z | 2022-03-31T14:55:28.000Z | src/Onigmo/tool/CaseFolding.py | kangwenhang/WindTerm | 24c96a6aa611675aeb5decf7f673318c0b626399 | [
"Apache-2.0"
] | 537 | 2020-01-24T09:34:07.000Z | 2022-03-31T23:59:11.000Z | src/Onigmo/tool/CaseFolding.py | kangwenhang/WindTerm | 24c96a6aa611675aeb5decf7f673318c0b626399 | [
"Apache-2.0"
] | 337 | 2019-10-17T00:11:40.000Z | 2022-03-31T11:16:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage:
# $ wget http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
# $ python CaseFolding.py CaseFolding.txt > ../enc/unicode/casefold.h
from __future__ import print_function
import sys
import re
def print_case_folding_data(filename):
pattern = re.compile("(... | 32.804511 | 75 | 0.536328 |
679555309c3a683a23522323a289a19cac83d77a | 1,401 | py | Python | cognite/client/data_classes/__init__.py | haakonvt/cognite-sdk-python | 353284a8dfdf7c00d34d12ebe0c2361cab8d3aa5 | [
"Apache-2.0"
] | null | null | null | cognite/client/data_classes/__init__.py | haakonvt/cognite-sdk-python | 353284a8dfdf7c00d34d12ebe0c2361cab8d3aa5 | [
"Apache-2.0"
] | null | null | null | cognite/client/data_classes/__init__.py | haakonvt/cognite-sdk-python | 353284a8dfdf7c00d34d12ebe0c2361cab8d3aa5 | [
"Apache-2.0"
] | null | null | null | from typing import *
from cognite.client.data_classes.assets import Asset, AssetFilter, AssetList, AssetUpdate
from cognite.client.data_classes.datapoints import Datapoint, Datapoints, DatapointsList, DatapointsQuery
from cognite.client.data_classes.events import Event, EventFilter, EventList, EventUpdate
from cognite... | 41.205882 | 118 | 0.82227 |
728842a3408ee620f51233b187ae5737827d21c3 | 8,109 | py | Python | runtime/launch.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/launch.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/launch.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
r"""
`torch.distributed.launch` is a module that spawns up multiple distributed
training processes on each of the training nodes.
The utility can be used for single-node distributed training, in which one or
more processes per node will be... | 46.603448 | 84 | 0.658528 |
f7f7577be18813be11da8db7ee9a682a9c76edaa | 1,874 | py | Python | test/dvc/test_stages.py | giganticode/bohr-framework | fd364a1f036123985ac96e9076e5dce3bbc2ca2c | [
"MIT"
] | null | null | null | test/dvc/test_stages.py | giganticode/bohr-framework | fd364a1f036123985ac96e9076e5dce3bbc2ca2c | [
"MIT"
] | 54 | 2021-02-17T13:36:51.000Z | 2021-08-25T05:06:57.000Z | test/dvc/test_stages.py | giganticode/bohr-framework | fd364a1f036123985ac96e9076e5dce3bbc2ca2c | [
"MIT"
] | null | null | null | from pathlib import Path
from test.testutils import stub_commit_mapper, stub_task
from bohr.config.pathconfig import PathConfig
from bohr.dvc.stages import ApplyHeuristicsCommand, ParseLabelsCommand
def test_parse_labels_command():
command = ParseLabelsCommand(
PathConfig(Path("/project_root"), Path("/so... | 26.027778 | 88 | 0.5619 |
b4c995e8eae781235b4aac718559cca76f4c70a2 | 3,323 | py | Python | caffe/examples/finetune_flickr_style/assemble_data.py | blitzingeagle/DeepEmbeddedClustering | cbc648fc9271f74c3bb257f57f0f78e1a1a66459 | [
"MIT"
] | 408 | 2015-11-19T21:50:16.000Z | 2022-03-22T08:17:26.000Z | caffe/examples/finetune_flickr_style/assemble_data.py | blitzingeagle/DeepEmbeddedClustering | cbc648fc9271f74c3bb257f57f0f78e1a1a66459 | [
"MIT"
] | 29 | 2016-05-18T10:24:00.000Z | 2021-09-26T21:43:46.000Z | caffe/examples/finetune_flickr_style/assemble_data.py | blitzingeagle/DeepEmbeddedClustering | cbc648fc9271f74c3bb257f57f0f78e1a1a66459 | [
"MIT"
] | 256 | 2015-07-31T18:58:15.000Z | 2021-02-07T07:09:51.000Z | #!/usr/bin/env python
"""
Form a subset of the Flickr Style data, download images to dirname, and write
Caffe ImagesDataLayer training file.
"""
import os
import urllib
import hashlib
import argparse
import numpy as np
import pandas as pd
import multiprocessing
# Flickr returns a special image if the request is unavai... | 36.516484 | 89 | 0.670178 |
f5d9996691ec4c52a529ad2828d47d3794ea2bf4 | 143 | py | Python | backend/volontulo_org/settings/production.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | null | null | null | backend/volontulo_org/settings/production.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | null | null | null | backend/volontulo_org/settings/production.py | ponycalypsenow/volontulo | 8f7886aa3c8ea5ec0ca84711a089bea60fb69598 | [
"MIT"
] | null | null | null | """
Production Settings File
"""
# pylint: skip=file
from .base import *
# Extra settings go here:
ANGULAR_ROOT = 'http://volontuloapp.org'
| 13 | 40 | 0.699301 |
03b8c1c4d3d2a30d0ad10c75e9abb32bf644417f | 2,026 | py | Python | brax/envs/to_torch.py | o-Oscar/brax | 38195a458467ab5e7b39b64d150c76cd0952d175 | [
"Apache-2.0"
] | null | null | null | brax/envs/to_torch.py | o-Oscar/brax | 38195a458467ab5e7b39b64d150c76cd0952d175 | [
"Apache-2.0"
] | null | null | null | brax/envs/to_torch.py | o-Oscar/brax | 38195a458467ab5e7b39b64d150c76cd0952d175 | [
"Apache-2.0"
] | null | null | null | """ Wrapper around a Brax GymWrapper, that converts its outputs to PyTorch tensors.
This conversion happens directly on-device, witout the need to move values to the CPU.
"""
from typing import Optional, Union
import gym
from brax.envs.wrappers import GymWrapper, VectorGymWrapper
# NOTE: The following line will rais... | 32.677419 | 87 | 0.662883 |
82a51334304692211c6a0df1f359f1e20856a3fc | 2,171 | py | Python | server/bin/wmgr_local2.py | AustralianDisabilityLimited/MultiversePlatform | 7e1aad33d48b9e47f3db2ca638cb57592336ddb7 | [
"MIT"
] | 33 | 2015-02-16T02:52:08.000Z | 2022-02-18T08:46:32.000Z | server/bin/wmgr_local2.py | bensku/MultiversePlatform | 7e1aad33d48b9e47f3db2ca638cb57592336ddb7 | [
"MIT"
] | 1 | 2017-09-09T18:50:23.000Z | 2020-12-29T18:13:56.000Z | server/bin/wmgr_local2.py | bensku/MultiversePlatform | 7e1aad33d48b9e47f3db2ca638cb57592336ddb7 | [
"MIT"
] | 31 | 2015-02-07T16:20:24.000Z | 2022-02-23T15:02:43.000Z | #
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... | 36.79661 | 72 | 0.777522 |
ea991474aab599dbfb6121cb1c454758db68c1e4 | 638 | py | Python | pythonDesafios/desafio020.py | mateusdev7/desafios-python | 6160ddc84548c7af7f5775f9acabe58238f83008 | [
"MIT"
] | null | null | null | pythonDesafios/desafio020.py | mateusdev7/desafios-python | 6160ddc84548c7af7f5775f9acabe58238f83008 | [
"MIT"
] | null | null | null | pythonDesafios/desafio020.py | mateusdev7/desafios-python | 6160ddc84548c7af7f5775f9acabe58238f83008 | [
"MIT"
] | null | null | null | from random import shuffle
print('====Desafio 020====')
print('Sorteando a sequência de apresentação')
n1 = str(input('Aluno 01: '))
n2 = str(input('Aluno 02: '))
n3 = str(input('Aluno 03: '))
n4 = str(input('Aluno 04: '))
n5 = str(input('Aluno 05: '))
lista = [n1, n2, n3, n4]
shuffle(lista)
print(f'A sequência de a... | 30.380952 | 118 | 0.69906 |
2d0732f2bb5e9f5e03ef89309213751bc0805d1b | 58 | py | Python | src/graphnet/models/gnn/__init__.py | mhaminh/graphnet | ef74573c259cd25868d0b26f17a7f86502ec2ffc | [
"Apache-2.0"
] | 4 | 2021-04-12T08:53:23.000Z | 2021-09-21T12:08:03.000Z | src/graphnet/models/gnn/__init__.py | mhaminh/graphnet | ef74573c259cd25868d0b26f17a7f86502ec2ffc | [
"Apache-2.0"
] | 64 | 2021-09-22T07:13:07.000Z | 2021-12-07T13:10:23.000Z | src/graphnet/models/gnn/__init__.py | mhaminh/graphnet | ef74573c259cd25868d0b26f17a7f86502ec2ffc | [
"Apache-2.0"
] | 6 | 2021-09-21T09:00:44.000Z | 2021-11-23T12:28:32.000Z | from .dynedge import DynEdge
from .convnet import ConvNet
| 19.333333 | 28 | 0.827586 |
cb8879925ae563416cba0496c0e6b594379b5bfe | 255 | py | Python | tests/testapp/views.py | cpmbailey/drf-flex-fields | 10881f3beb198d12e00fdf61ea63153141e4ff90 | [
"MIT"
] | 1 | 2018-10-31T13:54:24.000Z | 2018-10-31T13:54:24.000Z | tests/testapp/views.py | cpmbailey/drf-flex-fields | 10881f3beb198d12e00fdf61ea63153141e4ff90 | [
"MIT"
] | null | null | null | tests/testapp/views.py | cpmbailey/drf-flex-fields | 10881f3beb198d12e00fdf61ea63153141e4ff90 | [
"MIT"
] | null | null | null | from rest_flex_fields import FlexFieldsModelViewSet
from tests.testapp.serializers import PetSerializer
from tests.testapp.models import Pet
class PetViewSet(FlexFieldsModelViewSet):
serializer_class = PetSerializer
queryset = Pet.objects.all()
| 28.333333 | 51 | 0.831373 |
0be20b24a281d2e51f8b286f59391592bd63bd1c | 6,949 | py | Python | meta_optimizer.py | Ujjwal-9/pytorch-meta-optimizer | 0154d4d4fc856163885a62bac06174311aa58caf | [
"MIT"
] | 298 | 2017-01-30T05:30:29.000Z | 2022-03-18T09:05:23.000Z | meta_optimizer.py | Ujjwal-9/pytorch-meta-optimizer | 0154d4d4fc856163885a62bac06174311aa58caf | [
"MIT"
] | 9 | 2017-03-28T01:56:12.000Z | 2021-02-18T15:07:00.000Z | meta_optimizer.py | Ujjwal-9/pytorch-meta-optimizer | 0154d4d4fc856163885a62bac06174311aa58caf | [
"MIT"
] | 66 | 2017-01-30T05:45:25.000Z | 2021-11-09T08:50:05.000Z | from functools import reduce
from operator import mul
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import math
from utils import preprocess_gradients
from layer_norm_lstm import LayerNormLSTMCell
from layer_norm import LayerNorm1D
c... | 34.919598 | 103 | 0.62124 |
16bd8d3e0635c348b9661ece5e3811a5d78872b8 | 17,627 | py | Python | cwltool/load_tool.py | nyue/cwltool | b2f4cdf66e142b9ec4dd53144070f8b9926f085e | [
"Apache-2.0"
] | null | null | null | cwltool/load_tool.py | nyue/cwltool | b2f4cdf66e142b9ec4dd53144070f8b9926f085e | [
"Apache-2.0"
] | null | null | null | cwltool/load_tool.py | nyue/cwltool | b2f4cdf66e142b9ec4dd53144070f8b9926f085e | [
"Apache-2.0"
] | null | null | null | """Loads a CWL document."""
import hashlib
import logging
import os
import re
import urllib
import uuid
from typing import (
Any,
Callable,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
cast,
)
from ruamel.yaml.comments import CommentedMap, CommentedSeq
f... | 35.324649 | 99 | 0.585806 |
160ff84a845b2851c287f30f02a66bb7edbbd394 | 5,922 | py | Python | db.py | Santhiya247-CSE/Banking-Application-Software | fffff03c4e533486e65e0655f99089d1d91b2007 | [
"Apache-2.0"
] | 1 | 2018-12-15T05:56:35.000Z | 2018-12-15T05:56:35.000Z | db.py | Santhiya247-CSE/Banking-Application-Software | fffff03c4e533486e65e0655f99089d1d91b2007 | [
"Apache-2.0"
] | null | null | null | db.py | Santhiya247-CSE/Banking-Application-Software | fffff03c4e533486e65e0655f99089d1d91b2007 | [
"Apache-2.0"
] | null | null | null | import mysql.connector
from myfunc import *
accno=7600775
custid=1000
choice=-1
while (choice!=0):
choice =int(input("1.Sign-up\n2.Sign-in\n3.Admin Sign-in\n4.Quit\n"))
if( choice==1 ):
fname = input("Enter the first name:")
lname = input("Enter the Last name:")
... | 51.947368 | 515 | 0.404255 |
1d2fb7fddc9dd6228859230beaebcf495231d4c0 | 3,985 | py | Python | pandas/tests/io/parser/test_converters.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 603 | 2020-12-23T13:49:32.000Z | 2022-03-31T23:38:03.000Z | pandas/tests/io/parser/test_converters.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | pandas/tests/io/parser/test_converters.py | CJL89/pandas | 6210077d32a9e9675526ea896e6d1f9189629d4a | [
"BSD-3-Clause"
] | 35 | 2021-03-26T03:12:04.000Z | 2022-03-23T10:15:10.000Z | """
Tests column conversion functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import StringIO
from dateutil.parser import parse
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Index
import pandas._testing as tm
def test_converters_type_must_be_d... | 24.751553 | 80 | 0.597742 |
59838766834a066d2e38c9e5e1d1ad3817a6079b | 6,564 | py | Python | WavSteg.py | HeMancute/Steganography | d947c6ea67f4b936fb1ca9b4e1bdb94b3a61e0bb | [
"MIT"
] | 1 | 2018-12-04T08:42:58.000Z | 2018-12-04T08:42:58.000Z | WavSteg.py | HeMancute/Steganography | d947c6ea67f4b936fb1ca9b4e1bdb94b3a61e0bb | [
"MIT"
] | null | null | null | WavSteg.py | HeMancute/Steganography | d947c6ea67f4b936fb1ca9b4e1bdb94b3a61e0bb | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2015 Ryan Gibson
#
# 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... | 37.508571 | 79 | 0.620963 |
f92d3bdb63469bc3c9c0065bd50a19570678103d | 20,640 | py | Python | lektor/utils.py | arabidopsis/lektor | e33f799da41f64b8ed645690623638d82894a352 | [
"BSD-3-Clause"
] | null | null | null | lektor/utils.py | arabidopsis/lektor | e33f799da41f64b8ed645690623638d82894a352 | [
"BSD-3-Clause"
] | null | null | null | lektor/utils.py | arabidopsis/lektor | e33f799da41f64b8ed645690623638d82894a352 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import hashlib
import json
import multiprocessing
import os
import posixpath
import re
import subprocess
import sys
import tempfile
import traceback
import unicodedata
import uuid
from contextlib import contextmanager
from datetime import datetime
from threading import Thread
try:... | 27.086614 | 86 | 0.58968 |
6360ccf137e0a7979c0c5ad91ac6a82d253ac049 | 22,092 | py | Python | tests/unit/cmor/test_cmor_check.py | yifatdzigan/ESMValTool | 83320b0e0b24ddde965599961bb80428e180a731 | [
"Apache-2.0"
] | null | null | null | tests/unit/cmor/test_cmor_check.py | yifatdzigan/ESMValTool | 83320b0e0b24ddde965599961bb80428e180a731 | [
"Apache-2.0"
] | null | null | null | tests/unit/cmor/test_cmor_check.py | yifatdzigan/ESMValTool | 83320b0e0b24ddde965599961bb80428e180a731 | [
"Apache-2.0"
] | null | null | null | """Unit tests for the CMORCheck class."""
import sys
import unittest
import iris
import iris.coord_categorisation
import iris.coords
import iris.util
import numpy
from cf_units import Unit
from esmvaltool.cmor.check import CMORCheck, CMORCheckError
class VariableInfoMock:
"""Mock for the variables defintion"""... | 36.395387 | 79 | 0.623619 |
727a4cfe7ea9d4b6775ed1443e620875d62d9a36 | 122 | py | Python | src/utoolbox/io/encdec/__init__.py | thhsieh00/utoolbox-core | e46704348d60985c205a16f41788d2c185e11fb6 | [
"Apache-2.0"
] | 3 | 2020-08-21T02:34:32.000Z | 2021-04-06T06:56:46.000Z | src/utoolbox/io/encdec/__init__.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | src/utoolbox/io/encdec/__init__.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | """
This module contains encoder/decoder that are not distributed as installable packages.
"""
__all__ = ["amira"]
| 20.333333 | 88 | 0.704918 |
4aa4647b5e119491009ce1937e37c15d873786f0 | 2,779 | py | Python | biketour/iterators.py | esovetkin/biketour | d3de0ec104b8fe09a95b329cd194db21ebaea989 | [
"MIT"
] | null | null | null | biketour/iterators.py | esovetkin/biketour | d3de0ec104b8fe09a95b329cd194db21ebaea989 | [
"MIT"
] | null | null | null | biketour/iterators.py | esovetkin/biketour | d3de0ec104b8fe09a95b329cd194db21ebaea989 | [
"MIT"
] | null | null | null | #!/bin/env python
import pandas as pd
import datetime
class Iter_Historical_Weather(object):
"""Iterator class that allows iterate over a sample of historical weather
"""
def __init__(self, hist_weather):
"""Initialise iterator for historical weather object
:hist_weather: Historical_Weat... | 25.971963 | 93 | 0.577186 |
ac767b78553a29385937cafea31784ac2978eaed | 1,456 | py | Python | hw_asr/text_encoder/ctc_char_text_encoder.py | MatyashDare/DLA | a1783a1298d9e5c7edc82bb2e7f17ba59743152e | [
"MIT"
] | null | null | null | hw_asr/text_encoder/ctc_char_text_encoder.py | MatyashDare/DLA | a1783a1298d9e5c7edc82bb2e7f17ba59743152e | [
"MIT"
] | null | null | null | hw_asr/text_encoder/ctc_char_text_encoder.py | MatyashDare/DLA | a1783a1298d9e5c7edc82bb2e7f17ba59743152e | [
"MIT"
] | null | null | null | from typing import List, Tuple
import torch
from hw_asr.text_encoder.char_text_encoder import CharTextEncoder
class CTCCharTextEncoder(CharTextEncoder):
EMPTY_TOK = "^"
def __init__(self, alphabet: List[str]):
super().__init__(alphabet)
self.ind2char = {
0: self.EMPTY_TOK
... | 30.978723 | 94 | 0.567995 |
cfc955fbfefe9e0cbfba81b53ce0cb4351020531 | 1,933 | py | Python | lib/googlecloudsdk/third_party/apis/servicemanagement/v1/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/servicemanagement/v1/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/third_party/apis/servicemanagement/v1/resources.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2015 Google 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 applicable law or ag... | 28.426471 | 74 | 0.676151 |
d12231bdbf7e7383526b04c883ca0fd812e3849c | 4,901 | py | Python | temboo/core/Library/Twitter/FriendsAndFollowers/CreateFriendship.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Twitter/FriendsAndFollowers/CreateFriendship.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Twitter/FriendsAndFollowers/CreateFriendship.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# CreateFriendship
# Allows you to follow another Twitter user by specifying a Twitter user id or screen name.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache Licens... | 43.371681 | 191 | 0.69292 |
b71084b10f0f8ac1701ca9f8edcf257aae6d4cca | 2,595 | py | Python | doc/source/conf.py | niuzhenguo/os-cpu | 53b7d0c06fc09b7e9ce8e5d6f509bf7ff947b81b | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | niuzhenguo/os-cpu | 53b7d0c06fc09b7e9ce8e5d6f509bf7ff947b81b | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | niuzhenguo/os-cpu | 53b7d0c06fc09b7e9ce8e5d6f509bf7ff947b81b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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... | 31.646341 | 79 | 0.699807 |
a55e0d0fa2730c4824e728fbe63916210894cd96 | 3,562 | py | Python | client.py | 7wikd/CreateAPlaylist | dedcd70ce2a074e072d53ad9da8fe93e91df9cf6 | [
"MIT"
] | 1 | 2021-07-19T15:38:34.000Z | 2021-07-19T15:38:34.000Z | client.py | 7wikd/CreateAPlaylist | dedcd70ce2a074e072d53ad9da8fe93e91df9cf6 | [
"MIT"
] | null | null | null | client.py | 7wikd/CreateAPlaylist | dedcd70ce2a074e072d53ad9da8fe93e91df9cf6 | [
"MIT"
] | null | null | null | import json
import requests
from requests.models import Response
from track import Track
from playlist import Playlist
class Client:
"""
Working with the Spotify API
"""
def __init__(self,auth_token,user_id):
"""
auth_token: Spotify API Token
user_id: Spotify User ID
""... | 30.973913 | 152 | 0.580853 |
d5959808766074362a75ec51728adfbc8698a70e | 2,176 | py | Python | benchmark/bench_pycode/pycode_15_extend-tostr.py | frederic-loui/tenjin | 13fccc464f882133d11219f7660d8eac3c524ae6 | [
"MIT"
] | null | null | null | benchmark/bench_pycode/pycode_15_extend-tostr.py | frederic-loui/tenjin | 13fccc464f882133d11219f7660d8eac3c524ae6 | [
"MIT"
] | null | null | null | benchmark/bench_pycode/pycode_15_extend-tostr.py | frederic-loui/tenjin | 13fccc464f882133d11219f7660d8eac3c524ae6 | [
"MIT"
] | null | null | null | ## name:
## desc: extend + to_str
_buf = []; _extend = _buf.extend; _extend(('''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
... | 24.449438 | 87 | 0.535846 |
45faf32cb49ede5a1be0e801036088e0bec46d1e | 1,796 | py | Python | app/user/serializers.py | shjeong92/recipe-app | ff77f25bae810cd60fd5ceb4c3dd3bb5c0e74872 | [
"MIT"
] | null | null | null | app/user/serializers.py | shjeong92/recipe-app | ff77f25bae810cd60fd5ceb4c3dd3bb5c0e74872 | [
"MIT"
] | null | null | null | app/user/serializers.py | shjeong92/recipe-app | ff77f25bae810cd60fd5ceb4c3dd3bb5c0e74872 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""Serializer for the user object"""
class Meta: #
model = get_user_model()
fields =... | 30.965517 | 73 | 0.638641 |
5d3ac214b6c2921ef15b4b6855538060d89fcb27 | 5,242 | py | Python | tests/functional/test_gathering.py | slemrmartin/insights-analytics-collector | dea641896540c556d309f17e5030e9fdfd652eab | [
"Apache-2.0"
] | null | null | null | tests/functional/test_gathering.py | slemrmartin/insights-analytics-collector | dea641896540c556d309f17e5030e9fdfd652eab | [
"Apache-2.0"
] | null | null | null | tests/functional/test_gathering.py | slemrmartin/insights-analytics-collector | dea641896540c556d309f17e5030e9fdfd652eab | [
"Apache-2.0"
] | null | null | null | from tests.classes.analytics_collector import AnalyticsCollector
import tests.functional.collector_module
import tests.functional.collector_module2
import json
import logging
import pytest
import tarfile
@pytest.fixture
def collector(mocker):
collector = AnalyticsCollector(collector_module=tests.functional.collec... | 35.418919 | 111 | 0.628958 |
4bbbc1f178dd8419b14ed16af661fc86b31a1f2f | 5,419 | py | Python | pygfunction/examples/load_aggregation.py | mitchute/pygfunction | a32ac5dc7ca91ebcc7b61f604c7464e8172475b3 | [
"BSD-3-Clause"
] | null | null | null | pygfunction/examples/load_aggregation.py | mitchute/pygfunction | a32ac5dc7ca91ebcc7b61f604c7464e8172475b3 | [
"BSD-3-Clause"
] | null | null | null | pygfunction/examples/load_aggregation.py | mitchute/pygfunction | a32ac5dc7ca91ebcc7b61f604c7464e8172475b3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
""" Example of simulation of a geothermal system.
The g-function of a single borehole is calculated for boundary condition of
uniform borehole wall temperature along the borehole. Then, the borehole
wall temperature variations resulting from a time-varying load profile
are simul... | 31.876471 | 79 | 0.523713 |
a82bbbf811c150296b104004276d371a266821a4 | 1,697 | py | Python | web-client/core/main/email_template.py | libremente/service-app | 3cc710d2d91ca61c9f628dd023326c16cf934c51 | [
"MIT"
] | 2 | 2021-09-03T22:09:51.000Z | 2022-03-31T06:59:44.000Z | web-client/core/main/email_template.py | libremente/service-app | 3cc710d2d91ca61c9f628dd023326c16cf934c51 | [
"MIT"
] | 1 | 2022-03-01T09:24:11.000Z | 2022-03-01T09:24:11.000Z | web-client/core/main/email_template.py | libremente/service-app | 3cc710d2d91ca61c9f628dd023326c16cf934c51 | [
"MIT"
] | 2 | 2021-12-03T13:39:55.000Z | 2022-03-01T08:30:00.000Z | # Copyright INRIM (https://www.inrim.eu)
# See LICENSE file for full licensing details.
import json
class EmailTemplate:
def __init__(self):
super()
self.rows = []
self.curr_row = 0
self.curr_col = 0
self.tmp_base = {
"name": "email_template_notification",
... | 27.819672 | 80 | 0.493813 |
ce4c90e163a76ffbc205db565d450742f046d1ec | 6,346 | py | Python | helper/common.py | rahulroxx/duinoBot | 82a5af1236e3800d25f4e7767ff6983e2f1ea325 | [
"MIT"
] | null | null | null | helper/common.py | rahulroxx/duinoBot | 82a5af1236e3800d25f4e7767ff6983e2f1ea325 | [
"MIT"
] | null | null | null | helper/common.py | rahulroxx/duinoBot | 82a5af1236e3800d25f4e7767ff6983e2f1ea325 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This module contais some common routines used by other samples.
'''
import numpy as np
import cv2
import os
from contextlib import contextmanager
import itertools as it
image_extensions = ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.tiff', '.pbm', '.pgm', '.ppm']
cl... | 25.902041 | 112 | 0.523322 |
4c6d222ba3ba18baf3c1179c9235903dab92b169 | 2,728 | py | Python | thesite/base_app/views.py | deeppunster/pettwitter | 5d753af77d3b9f3fe66dce35dc1626018dd2f303 | [
"Apache-2.0"
] | 14 | 2018-10-14T18:10:21.000Z | 2020-01-29T17:53:05.000Z | thesite/base_app/views.py | deeppunster/pettwitter | 5d753af77d3b9f3fe66dce35dc1626018dd2f303 | [
"Apache-2.0"
] | 5 | 2018-10-14T17:34:29.000Z | 2022-02-10T08:03:00.000Z | thesite/base_app/views.py | deeppunster/pettwitter | 5d753af77d3b9f3fe66dce35dc1626018dd2f303 | [
"Apache-2.0"
] | 10 | 2018-10-13T09:43:30.000Z | 2020-05-03T20:26:19.000Z | from django.contrib.auth import authenticate
from django.contrib.auth import login as django_auth_login
from django.contrib.auth import logout as django_auth_logout
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
from django.sh... | 31 | 87 | 0.700513 |
527e8274926a2cfa0dfc6bca9a2a7adeff4db6db | 186 | py | Python | experiments/base.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | experiments/base.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | experiments/base.py | StevenKangWei/learning-algorithm | fa2a32c3a650f1a95c75f82750b07de444c4bbfa | [
"MIT"
] | null | null | null | # coding=utf-8
import os
import sys
dirname = os.path.dirname(os.path.abspath(__file__))
project = os.path.dirname(dirname)
if project not in sys.path:
sys.path.insert(0, project)
| 18.6 | 52 | 0.736559 |
81287f1b08ee3ac1aca9733c504610f8bde6a9bd | 40,617 | py | Python | sparsechem/utils.py | jaak-s/SparseChem-1 | 121c8c71bbe7ccd2d461d0311d8d627e8c68484b | [
"MIT"
] | null | null | null | sparsechem/utils.py | jaak-s/SparseChem-1 | 121c8c71bbe7ccd2d461d0311d8d627e8c68484b | [
"MIT"
] | null | null | null | sparsechem/utils.py | jaak-s/SparseChem-1 | 121c8c71bbe7ccd2d461d0311d8d627e8c68484b | [
"MIT"
] | null | null | null | # Copyright (c) 2020 KU Leuven
import sklearn.metrics
from tqdm import tqdm
import pandas as pd
import numpy as np
import torch
import scipy.sparse
import scipy.io
import scipy.special
import types
import json
import warnings
import math
import torch.nn.functional as F
import csv
from pynvml import *
from contextlib im... | 40.944556 | 289 | 0.614718 |
7c65c6ae9ab1950d86a72d056ac775126a1e122a | 8,673 | py | Python | src/lightMolNet/Module/interaction.py | fossabot/lightMolNet | 895c963faffe908fd14d2bff59f8a04826fd5752 | [
"MIT"
] | 1 | 2022-01-23T13:06:05.000Z | 2022-01-23T13:06:05.000Z | src/lightMolNet/Module/interaction.py | fossabot/lightMolNet | 895c963faffe908fd14d2bff59f8a04826fd5752 | [
"MIT"
] | null | null | null | src/lightMolNet/Module/interaction.py | fossabot/lightMolNet | 895c963faffe908fd14d2bff59f8a04826fd5752 | [
"MIT"
] | 2 | 2022-01-23T12:44:42.000Z | 2022-01-23T13:06:14.000Z | # -*- coding: utf-8 -*-
# ====================================== #
# @Author : Yanbo Han
# @Email : yanbohan98@gmail.com
# @File : interaction.py
# ALL RIGHTS ARE RESERVED UNLESS STATED.
# ====================================== #
from functools import partial
import torch
# ones_initializer = partial(constant_,... | 37.223176 | 116 | 0.559091 |
372487d80a031c2c01eb8b3d566cb11a414274af | 18,552 | py | Python | fastapi_code_generator/parser.py | ron96G/fastapi-code-generator | 0fd1d171fedb5db6c117d9f13e99cb49ee615dfa | [
"MIT"
] | null | null | null | fastapi_code_generator/parser.py | ron96G/fastapi-code-generator | 0fd1d171fedb5db6c117d9f13e99cb49ee615dfa | [
"MIT"
] | null | null | null | fastapi_code_generator/parser.py | ron96G/fastapi-code-generator | 0fd1d171fedb5db6c117d9f13e99cb49ee615dfa | [
"MIT"
] | null | null | null | from __future__ import annotations
import pathlib
import re
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Iterable,
List,
Mapping,
Optional,
Pattern,
Sequence,
Set,
Type,
Union,
)
from urllib.parse import ParseResult
import stringcase
from datamodel_code_ge... | 36.305284 | 107 | 0.60856 |
e501d85a6b5c22469bec8133b846a9ff445e4f0d | 681 | py | Python | loading/early-hints/resources/redirect-with-early-hints.h2.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | 1 | 2021-12-12T18:13:24.000Z | 2021-12-12T18:13:24.000Z | loading/early-hints/resources/redirect-with-early-hints.h2.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | 112 | 2021-09-27T14:39:02.000Z | 2022-03-30T14:26:35.000Z | loading/early-hints/resources/redirect-with-early-hints.h2.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | null | null | null | def handle_headers(frame, request, response):
preload_url = request.GET.first(b"preload-url").decode()
link_header_value = "<{}>; rel=preload; as=script".format(preload_url)
early_hints = [
(b":status", b"103"),
(b"link", link_header_value),
]
response.writer.write_raw_header_frame(... | 32.428571 | 74 | 0.64464 |
06d8b1e29929ec0b6c5949d4c9957fd5408addab | 659 | py | Python | Desafios/Desafio081.py | vaniaferreira/Python | 5b3158836d47c0bb7bc446e6636e7b3dcea8a0ab | [
"MIT"
] | null | null | null | Desafios/Desafio081.py | vaniaferreira/Python | 5b3158836d47c0bb7bc446e6636e7b3dcea8a0ab | [
"MIT"
] | null | null | null | Desafios/Desafio081.py | vaniaferreira/Python | 5b3158836d47c0bb7bc446e6636e7b3dcea8a0ab | [
"MIT"
] | null | null | null | #Crie um programa que vai ler vários números e colocar em uma lista.
#Depois disto, mostre:
#Quantos números foram digitados;
#A lista de valores ordenada de forma decrescente;
#Se o valor 5 foi digitado e se esta ou não na lista.
valores = []
while True:
valores.append(int(input('Digite um número: ')))
conti... | 26.36 | 68 | 0.694992 |
077aac8d2f9b0c07306344f000af0d515827864d | 5,822 | py | Python | torch/AnoGAN-torch/example.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | 2 | 2021-04-23T03:49:30.000Z | 2021-04-23T03:49:33.000Z | torch/AnoGAN-torch/example.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | null | null | null | torch/AnoGAN-torch/example.py | bolero2/DeepLearning-dc | 680266128d5a7aff590e2d6b9b71cb340b95c2ab | [
"Apache-2.0"
] | null | null | null |
import argparse
import os
import numpy as np
import math
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torc... | 31.989011 | 112 | 0.630539 |
803f3c5cd78d87ab3c97e23ccd0aab8fcc148c64 | 10,172 | py | Python | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 SAP SE
#
# 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 appl... | 36.855072 | 122 | 0.608238 |
e782be15d440df551c3946d1f0919d598db029cb | 4,830 | py | Python | testing.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 5 | 2019-01-04T06:50:18.000Z | 2019-02-13T12:02:24.000Z | testing.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | null | null | null | testing.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 1 | 2019-08-24T20:56:53.000Z | 2019-08-24T20:56:53.000Z | import argparse
import torch, os, sys
from torch.autograd import Variable
import numpy as np
import time, math, scipy
import scipy.io as sio
#import matplotlib.pyplot as plt
#from srdense.proj_utils.local_utils import *
from srdense.test_utils import *
def imread(imgfile):
assert os.path.exists(imgfile)... | 34.014085 | 108 | 0.67971 |
4964dd6de6c0d134f831443288d8745489c4196a | 1,648 | py | Python | Archieved FP/pkg_ta/scripts/log_low_level/log_brake.py | fadamsyah/final-project | 636aa6c5fbb84a1325b662c48b52b5065f4c16c5 | [
"MIT"
] | 3 | 2020-07-24T16:06:12.000Z | 2021-04-10T11:41:19.000Z | Archieved FP/pkg_ta/scripts/log_low_level/log_brake.py | fadamsyah/final-project | 636aa6c5fbb84a1325b662c48b52b5065f4c16c5 | [
"MIT"
] | null | null | null | Archieved FP/pkg_ta/scripts/log_low_level/log_brake.py | fadamsyah/final-project | 636aa6c5fbb84a1325b662c48b52b5065f4c16c5 | [
"MIT"
] | 3 | 2021-04-10T11:41:21.000Z | 2021-09-09T07:38:45.000Z | import rospy
import numpy as np
import pygame
from pkg_ta.msg import Control, LogBrakeCommand
pwm = 0
setpoint_brake = 0.
def main():
# Define the saturation value
pwm_max = 255
pos_max = 3.
# Initiate the joystick
pygame.init()
pygame.joystick.init()
js = pygame.joystick.Joystick(0)
... | 25.75 | 75 | 0.599515 |
7ce6fcea664ccd8540617dbbcb2cc48bdeb3591a | 6,522 | py | Python | python/tf/car_test.py | Panagiotis-Zachos/carfac | 9153d5277252d8d4abea0d588de5642492cc3eb7 | [
"Apache-2.0"
] | 76 | 2015-04-29T16:35:29.000Z | 2022-03-25T17:21:09.000Z | python/tf/car_test.py | Panagiotis-Zachos/carfac | 9153d5277252d8d4abea0d588de5642492cc3eb7 | [
"Apache-2.0"
] | 7 | 2021-02-11T09:05:14.000Z | 2021-06-17T13:42:39.000Z | python/tf/car_test.py | Panagiotis-Zachos/carfac | 9153d5277252d8d4abea0d588de5642492cc3eb7 | [
"Apache-2.0"
] | 32 | 2015-09-16T20:03:47.000Z | 2022-03-30T20:12:27.000Z | # Lint as: python3
#!/usr/bin/env python
# Copyright 2021 The CARFAC Authors. All Rights Reserved.
#
# This file is part of an implementation of Lyon's cochlear model:
# "Cascade of Asymmetric Resonators with Fast-Acting Compression"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... | 42.627451 | 80 | 0.596749 |
9a43c0f67b70311e5c1feae899b178a4a51cd2b4 | 193 | py | Python | blaze/compute/pmap.py | jdmcbr/blaze | 79515a8f0d25a0ff7f87a4cfbed615858241c832 | [
"BSD-3-Clause"
] | null | null | null | blaze/compute/pmap.py | jdmcbr/blaze | 79515a8f0d25a0ff7f87a4cfbed615858241c832 | [
"BSD-3-Clause"
] | null | null | null | blaze/compute/pmap.py | jdmcbr/blaze | 79515a8f0d25a0ff7f87a4cfbed615858241c832 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
default_map = [map]
def set_default_pmap(func):
default_map[0] = func
def get_default_pmap():
return default_map[0]
| 17.545455 | 64 | 0.761658 |
713adcf43b21d3564f30c331c965ad839cc65acc | 1,598 | py | Python | code/chap08/datasource_mongodb_reader.py | AnanthaVamshi/PySpark_Tutorials | fd94f9af0517f0bffca26d4c7b751333d42b8f3d | [
"Apache-2.0"
] | 60 | 2019-07-09T10:34:48.000Z | 2022-03-17T00:04:43.000Z | code/chap08/datasource_mongodb_reader.py | AnanthaVamshi/PySpark_Tutorials | fd94f9af0517f0bffca26d4c7b751333d42b8f3d | [
"Apache-2.0"
] | 2 | 2022-02-14T00:11:51.000Z | 2022-02-14T00:25:13.000Z | code/chap08/datasource_mongodb_reader.py | AnanthaVamshi/PySpark_Tutorials | fd94f9af0517f0bffca26d4c7b751333d42b8f3d | [
"Apache-2.0"
] | 34 | 2019-07-03T13:24:45.000Z | 2022-02-14T00:11:45.000Z | #!/usr/bin/python
#-----------------------------------------------------
# Read MongoDB Collection and create a DataFrame
# Input: MongoDB Collection URI
#------------------------------------------------------
# Input Parameters:
# MongoDB Collection URI
#-------------------------------------------------------
# @au... | 29.592593 | 83 | 0.567584 |
1f38228a1f9c944454fb0f6eb3496d4a32ed877e | 1,925 | py | Python | addsvc/py-grpc/addsvc_pb2_grpc.py | moul/grpcbin-proto | bca18df4138cc423a9f8513f9c7d5f71f1ea4b35 | [
"MIT"
] | null | null | null | addsvc/py-grpc/addsvc_pb2_grpc.py | moul/grpcbin-proto | bca18df4138cc423a9f8513f9c7d5f71f1ea4b35 | [
"MIT"
] | null | null | null | addsvc/py-grpc/addsvc_pb2_grpc.py | moul/grpcbin-proto | bca18df4138cc423a9f8513f9c7d5f71f1ea4b35 | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import addsvc_pb2 as addsvc__pb2
class AddStub(object):
"""The Add service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Sum = channel.unary_unary(
... | 30.078125 | 72 | 0.713766 |
385902ef4bc5e7f82183041eefd7b038ed93e6ed | 20,095 | py | Python | Tools/parser/unparse.py | mbeacom/cpython | 65d98d0f53f558d7c799098da0abf376068c15fd | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-05-22T08:19:52.000Z | 2019-05-22T08:19:52.000Z | Tools/parser/unparse.py | mbeacom/cpython | 65d98d0f53f558d7c799098da0abf376068c15fd | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2022-03-30T01:50:22.000Z | 2022-03-30T01:50:28.000Z | Tools/parser/unparse.py | mbeacom/cpython | 65d98d0f53f558d7c799098da0abf376068c15fd | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | "Usage: unparse.py <path to source file>"
import sys
import ast
import tokenize
import io
import os
# Large float and imaginary literals get turned into infinities in the AST.
# We unparse those infinities to INFSTR.
INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
def interleave(inter, f, seq):
"""Call f on e... | 28.584637 | 90 | 0.50525 |
8a71fabe7489df629bcd850ba517b0f38c08a6ba | 2,526 | py | Python | setup.py | dufcrule/kolibri-exercise-perseus-plugin | d6c6682782603c60c21ba7626b3836d3f20cfaf0 | [
"MIT"
] | null | null | null | setup.py | dufcrule/kolibri-exercise-perseus-plugin | d6c6682782603c60c21ba7626b3836d3f20cfaf0 | [
"MIT"
] | 90 | 2016-09-16T20:50:13.000Z | 2021-08-30T20:57:30.000Z | setup.py | dufcrule/kolibri-exercise-perseus-plugin | d6c6682782603c60c21ba7626b3836d3f20cfaf0 | [
"MIT"
] | 16 | 2016-09-06T20:22:09.000Z | 2021-06-01T11:04:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import logging
import sys
from setuptools import setup
import kolibri_exercise_perseus_plugin
def read_file(fname):
"""
Read file and decode in py2k
"""
if sys.version_info < (3,):... | 29.717647 | 95 | 0.648852 |
189d0d535cf2225a7afd18231b537c62d2f71439 | 2,046 | py | Python | s3recovery/s3recovery/s3recoverydryrun.py | RakeshVaghasiya/cortx-s3server | 356c00f7523883300f3271b365545f4ff8b4c2be | [
"Apache-2.0"
] | null | null | null | s3recovery/s3recovery/s3recoverydryrun.py | RakeshVaghasiya/cortx-s3server | 356c00f7523883300f3271b365545f4ff8b4c2be | [
"Apache-2.0"
] | null | null | null | s3recovery/s3recovery/s3recoverydryrun.py | RakeshVaghasiya/cortx-s3server | 356c00f7523883300f3271b365545f4ff8b4c2be | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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 ap... | 36.535714 | 105 | 0.726784 |
7a530512fc5a3fc6dafd95498bc0d24558707fd5 | 2,038 | py | Python | trainModel.py | linhhnbkdn/CRABI | 4aec98222dd41395e3e40a4a5fc91a82f8d06901 | [
"Unlicense"
] | 6 | 2021-01-19T02:56:16.000Z | 2021-01-19T13:23:56.000Z | trainModel.py | linhhnbkdn/CRABI | 4aec98222dd41395e3e40a4a5fc91a82f8d06901 | [
"Unlicense"
] | null | null | null | trainModel.py | linhhnbkdn/CRABI | 4aec98222dd41395e3e40a4a5fc91a82f8d06901 | [
"Unlicense"
] | 1 | 2021-01-19T03:52:22.000Z | 2021-01-19T03:52:22.000Z | import os
import logging
import random
import captcha
import numpy as np
import cv2
from captcha.image import ImageCaptcha
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.losses import categorical_crossentropy
from tensorflow.keras.callbacks import ModelCheckpoint
from tensorflow.keras.preprocessi... | 35.754386 | 85 | 0.636408 |
c7531ed59b663e7f9f6a5ddab0a5f299fe9c979c | 3,789 | py | Python | examples/pop3-tls.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | examples/pop3-tls.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | examples/pop3-tls.py | karpierz/libcurl | 531bd28ab32fb07c152e5b5ca4bd4dbde059b9a8 | [
"Zlib"
] | null | null | null | #***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... | 42.1 | 82 | 0.637107 |
166e20d26510fcbc10f313f11bbbe7004534eaf6 | 980 | py | Python | mcoding_bot/cogs/react.py | Lunarmagpie/mCodingBot | a21674374447247e531711d74a40ea6fd3e54cb7 | [
"MIT"
] | null | null | null | mcoding_bot/cogs/react.py | Lunarmagpie/mCodingBot | a21674374447247e531711d74a40ea6fd3e54cb7 | [
"MIT"
] | null | null | null | mcoding_bot/cogs/react.py | Lunarmagpie/mCodingBot | a21674374447247e531711d74a40ea6fd3e54cb7 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
from re import compile, I
from pincer import Client
from pincer.objects.message import MessageType
if TYPE_CHECKING:
from pincer.objects import UserMessage
class React:
def __init__(self, client: Client) -> None:
self.client = cli... | 26.486486 | 80 | 0.667347 |
70800fa17746fa9eab6096e4ecf8407c88790ad9 | 677 | py | Python | explore-socket/socket-abc/TCPClient.py | Watch-Later/Eureka | 3065e76d5bf8b37d5de4f9ee75b2714a42dd4c35 | [
"MIT"
] | 20 | 2016-05-16T11:09:04.000Z | 2021-12-08T09:30:33.000Z | explore-socket/socket-abc/TCPClient.py | Watch-Later/Eureka | 3065e76d5bf8b37d5de4f9ee75b2714a42dd4c35 | [
"MIT"
] | 1 | 2018-12-30T09:55:31.000Z | 2018-12-30T14:08:30.000Z | explore-socket/socket-abc/TCPClient.py | Watch-Later/Eureka | 3065e76d5bf8b37d5de4f9ee75b2714a42dd4c35 | [
"MIT"
] | 11 | 2016-05-02T09:17:12.000Z | 2021-12-08T09:30:35.000Z | # -*- coding: utf-8 -*-
__author__ = '0xCCCCCCCC'
from socket import *
SERVER_NAME = '127.0.0.1'
SERVER_PORT = 8088
def main():
#buffer_size = 2048
client_socket = socket(AF_INET, SOCK_STREAM)
client_socket.connect((SERVER_NAME, SERVER_PORT))
while True:
message = input('Please input a mes... | 23.344828 | 59 | 0.62777 |
3c6be18a301de0f0eeb5676b6188669673835597 | 12,993 | py | Python | test/test_sync_connection.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | test/test_sync_connection.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | test/test_sync_connection.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | """
Low-level synchronous connection tests.
These tests involve mocking out the network layer to cause specific unusual
behaviours to occur. The goal is to ensure that the synchronous connection
layer can handle unexpected network weather without falling over, and without
expending undue effort to arrange that these e... | 33.573643 | 88 | 0.649042 |
373df2ebe3a19a398f44e863a16508f0b1285de6 | 5,136 | py | Python | lococrack.py | byt3bl33d3r/lococrack | 07f849bd35f65e04a664a871611be3736d91fbf4 | [
"BSD-2-Clause"
] | 8 | 2015-09-09T10:28:31.000Z | 2022-01-27T22:08:19.000Z | lococrack.py | byt3bl33d3r/lococrack | 07f849bd35f65e04a664a871611be3736d91fbf4 | [
"BSD-2-Clause"
] | null | null | null | lococrack.py | byt3bl33d3r/lococrack | 07f849bd35f65e04a664a871611be3736d91fbf4 | [
"BSD-2-Clause"
] | 6 | 2017-09-27T09:49:51.000Z | 2022-02-08T19:36:25.000Z | from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
from gevent import joinall
import lxml.html
import re
import hashlib
import argparse
import requests
import sys
import random
import csv
import os
user_agents = [
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Crazy Browser 1.0.5)... | 39.813953 | 153 | 0.594042 |
b01dd1f6051ebfd011bd86fc6fb5f0106b6fb5aa | 84 | py | Python | Actuators/TestAdjMotor.py | AustinOrphan/MazeBot | 682319714847529373585249cd26d7a95270f843 | [
"MIT"
] | null | null | null | Actuators/TestAdjMotor.py | AustinOrphan/MazeBot | 682319714847529373585249cd26d7a95270f843 | [
"MIT"
] | null | null | null | Actuators/TestAdjMotor.py | AustinOrphan/MazeBot | 682319714847529373585249cd26d7a95270f843 | [
"MIT"
] | null | null | null | from actuators import AdjMotor
LAdjMotor = AdjMotor(22,27)
LAdjMotor.Forward(1,20)
| 16.8 | 30 | 0.797619 |
3589053ce7049adb125ea8270b0ddb1407ee7a22 | 609 | py | Python | rolling/model/serializer.py | coolkat64/rolling | 4c3ee2401128e993a52ac9b52cdbd32e17728129 | [
"MIT"
] | null | null | null | rolling/model/serializer.py | coolkat64/rolling | 4c3ee2401128e993a52ac9b52cdbd32e17728129 | [
"MIT"
] | null | null | null | rolling/model/serializer.py | coolkat64/rolling | 4c3ee2401128e993a52ac9b52cdbd32e17728129 | [
"MIT"
] | null | null | null | # coding: utf-8
import typing
import serpyco
from rolling.model.event import ZoneEvent
from rolling.model.event import ZoneEventType
from rolling.model.event import zone_event_data_types
class ZoneEventSerializerFactory:
serializers: typing.Dict[ZoneEventType, serpyco.Serializer] = {}
for zone_event_type, z... | 33.833333 | 90 | 0.80624 |
5fb158f6d4ea6eec2669e77eae5ab8a4290c80d8 | 15,199 | py | Python | cvpysdk/subclients/postgressubclient.py | kevinjojeejoseph/cvpysdk | 29d82fe6e8f552940534c508cfdbf2c14d16cde3 | [
"Apache-2.0"
] | 35 | 2016-11-30T03:51:02.000Z | 2020-05-14T09:48:34.000Z | cvpysdk/subclients/postgressubclient.py | kevinjojeejoseph/cvpysdk | 29d82fe6e8f552940534c508cfdbf2c14d16cde3 | [
"Apache-2.0"
] | 88 | 2016-11-30T03:56:00.000Z | 2020-05-14T06:58:36.000Z | cvpysdk/subclients/postgressubclient.py | kevinjojeejoseph/cvpysdk | 29d82fe6e8f552940534c508cfdbf2c14d16cde3 | [
"Apache-2.0"
] | 40 | 2016-11-29T04:11:07.000Z | 2020-06-06T15:02:59.000Z | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, 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
#
# ... | 36.102138 | 100 | 0.562932 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.