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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e6674eabad01f063a87f09e0f523066e3a45b14 | 2,298 | py | Python | mapping.py | sshleifer/transformers_config_mirror | 5644483b24212e822eeda898b5693862f914cb23 | [
"Apache-2.0"
] | null | null | null | mapping.py | sshleifer/transformers_config_mirror | 5644483b24212e822eeda898b5693862f914cb23 | [
"Apache-2.0"
] | null | null | null | mapping.py | sshleifer/transformers_config_mirror | 5644483b24212e822eeda898b5693862f914cb23 | [
"Apache-2.0"
] | 1 | 2022-02-28T18:10:49.000Z | 2022-02-28T18:10:49.000Z | from transformers.hf_api import HfApi
import os
import json
import sys
from pathlib import Path
MIRROR_DIR = Path('/Users/shleifer/transformers-config-mirror/')
from transformers import MarianConfig
from durbango import tqdm_nice
DEFAULT_UPDATE_DICT = {'max_length': 512}
def bulk_update_local_configs(models, update_... | 30.236842 | 73 | 0.659704 |
a6b7b7e53274e0900faefa73b666844708ee36ab | 20,920 | py | Python | tensorflow/python/ops/gradients_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/gradients_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/gradients_test.py | My-Technical-Architect/tensorflow | 35cf4653e6fe15953e2e565afc5a0fd2ab4d5290 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.526703 | 81 | 0.658222 |
5a364a5724bebfc7ea1a36b3d2114c42eda00c54 | 1,240 | py | Python | scripts/redact_cli_py/tests/factories/image_factory.py | ScriptBox21/OCR-Form-Tools | 2b130424f76cab5d1391a7c90674a9accf2890c3 | [
"MIT"
] | 1 | 2022-01-21T07:02:02.000Z | 2022-01-21T07:02:02.000Z | scripts/redact_cli_py/tests/factories/image_factory.py | ScriptBox21/OCR-Form-Tools | 2b130424f76cab5d1391a7c90674a9accf2890c3 | [
"MIT"
] | 1 | 2022-02-16T16:24:36.000Z | 2022-02-16T16:24:36.000Z | scripts/redact_cli_py/tests/factories/image_factory.py | ScriptBox21/OCR-Form-Tools | 2b130424f76cab5d1391a7c90674a9accf2890c3 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project
# root for license information.
from PIL import Image
class ImageFactory:
@staticmethod
def build() -> Image:
image_path = "testdata/testdata.jpg"
return Image.open(im... | 28.181818 | 64 | 0.679032 |
2618a31e6fcf488de2d11ecb31578a8ee9c4b99f | 12,792 | py | Python | tests/test_fetcher.py | v0ila/Lauwersscan | 651be7ca94f5365e160a09ccd1cc1a985ac37840 | [
"Apache-2.0"
] | 1 | 2015-11-08T07:33:31.000Z | 2015-11-08T07:33:31.000Z | tests/test_fetcher.py | willworks/pyspider | 9fc2ffa57324d1a42ef767289faa3a04f4d20f2e | [
"Apache-2.0"
] | null | null | null | tests/test_fetcher.py | willworks/pyspider | 9fc2ffa57324d1a42ef767289faa3a04f4d20f2e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-15 22:10:35
import os
import json
import copy
import time
import umsgpack
import subprocess
import unittest2 as unittest
from multiprocessing impor... | 39.36 | 96 | 0.629925 |
42554d8c327a386075e2a0bf4c15bf1f4bca88d2 | 3,615 | py | Python | gcp_variant_transforms/libs/vcf_header_definitions_merger.py | tsa87/gcp-variant-transforms | 1742dcafdc2bc6b7eb3959c4963dc5ed1ac2be55 | [
"Apache-2.0"
] | 113 | 2017-11-09T20:48:36.000Z | 2022-03-24T19:52:31.000Z | gcp_variant_transforms/libs/vcf_header_definitions_merger.py | tsa87/gcp-variant-transforms | 1742dcafdc2bc6b7eb3959c4963dc5ed1ac2be55 | [
"Apache-2.0"
] | 535 | 2017-11-09T15:47:08.000Z | 2022-03-31T17:39:10.000Z | gcp_variant_transforms/libs/vcf_header_definitions_merger.py | tsa87/gcp-variant-transforms | 1742dcafdc2bc6b7eb3959c4963dc5ed1ac2be55 | [
"Apache-2.0"
] | 62 | 2017-11-08T21:16:07.000Z | 2022-01-14T19:12:42.000Z | # Copyright 2019 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... | 38.052632 | 80 | 0.715906 |
2e27c87ccd467095efe26edf7488b28f8ddc3bed | 26,898 | py | Python | sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2022_02_01_preview/operations/_datastores_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # 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 ... | 42.425868 | 222 | 0.663618 |
a960b554d7903dcec667324b77548a4988a629b0 | 26,633 | py | Python | demo/predictor.py | wesleylp/maskrcnn-benchmark | 16c1787414a88cabdc1835fadd53e9d394cb43a5 | [
"MIT"
] | null | null | null | demo/predictor.py | wesleylp/maskrcnn-benchmark | 16c1787414a88cabdc1835fadd53e9d394cb43a5 | [
"MIT"
] | null | null | null | demo/predictor.py | wesleylp/maskrcnn-benchmark | 16c1787414a88cabdc1835fadd53e9d394cb43a5 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import matplotlib.pyplot as plt
import numpy as np
import torch
from maskrcnn_benchmark import layers as L
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.modeling.roi_heads.mask_head.infer... | 36.938974 | 98 | 0.597379 |
c9091edfab6f16e50aa346d793f32ddbee2c6350 | 921 | py | Python | tests/kyu_8_tests/test_removing_elements.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/kyu_8_tests/test_removing_elements.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/kyu_8_tests/test_removing_elements.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.kyu_8.removing_elements import remove_every_other
class RemoveEveryOtherTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(remove_every_other([1]), [1])
def test_equal_2(self):
self.assertEqual(remove_every_other([[1, 2, 3, 4, 5]]),
... | 30.7 | 77 | 0.563518 |
adab5eb0dfcb31313de659f61b965486447dd16e | 21,054 | py | Python | aiida/orm/implementation/django/nodes.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | aiida/orm/implementation/django/nodes.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | aiida/orm/implementation/django/nodes.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39.279851 | 126 | 0.636221 |
40da3bbe594a1c569fb8770c41650e84bf159f6b | 46,601 | py | Python | allennlp/tests/semparse/domain_languages/wikitables_language_test.py | schmmd/allennlp | fbc28cefe03b1ea3ff65300d475d34f5f9629a5c | [
"Apache-2.0"
] | 17 | 2019-11-19T19:02:35.000Z | 2021-11-16T16:19:07.000Z | allennlp/tests/semparse/domain_languages/wikitables_language_test.py | TalSchuster/allennlp-MultiLang | dbb28b939652491d2f633326edccca2cd0e528c8 | [
"Apache-2.0"
] | 1 | 2021-05-31T11:12:02.000Z | 2021-06-01T05:34:27.000Z | allennlp/tests/semparse/domain_languages/wikitables_language_test.py | TalSchuster/allennlp-MultiLang | dbb28b939652491d2f633326edccca2cd0e528c8 | [
"Apache-2.0"
] | 10 | 2019-12-06T11:32:37.000Z | 2022-01-06T15:39:09.000Z | # pylint: disable=no-self-use,invalid-name,too-many-public-methods
from typing import List
import pytest
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.tokenizers import Token
from allennlp.data.tokenizers import WordTokenizer
from allennlp.semparse.contexts import TableQuestionContext
from a... | 60.836815 | 151 | 0.57634 |
5a8916e02c01e6939ab63b5423f2689225fe93a9 | 12,569 | py | Python | src/adata/gui/text.py | txemavs/adata | 89a6d27fa59dc26ae3036685bb9d8bfb8e983fd9 | [
"MIT"
] | 1 | 2018-03-24T12:18:08.000Z | 2018-03-24T12:18:08.000Z | src/adata/gui/text.py | txemavs/adata | 89a6d27fa59dc26ae3036685bb9d8bfb8e983fd9 | [
"MIT"
] | null | null | null | src/adata/gui/text.py | txemavs/adata | 89a6d27fa59dc26ae3036685bb9d8bfb8e983fd9 | [
"MIT"
] | null | null | null | # adata.gui.text
'''
Console emulation using scintilla.
- StyledText is a output text control
- Console includes a prompt
TODO: Hidden time and proccess name margins
'''
from .basic import *
from wx import stc
import json
import keyword
RGB = wx.Colour
SYS_COLOUR = wx.SystemSettings.GetColour
#self.GetEOL... | 27.383442 | 96 | 0.555494 |
f476fc311e33cbf5f3b42266b9aa1dd36765ae2b | 684 | py | Python | api/order/models.py | csagar131/ecommerce-backend-api-s | 7b580ad93677683a238a2ef699f55d85acc83dd0 | [
"Apache-2.0"
] | null | null | null | api/order/models.py | csagar131/ecommerce-backend-api-s | 7b580ad93677683a238a2ef699f55d85acc83dd0 | [
"Apache-2.0"
] | null | null | null | api/order/models.py | csagar131/ecommerce-backend-api-s | 7b580ad93677683a238a2ef699f55d85acc83dd0 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from api.user.models import CustomUser
from api.product.models import Product
# Create your models here.
class Order(models.Model):
user = models.ForeignKey(CustomUser, on_delete=models.CASCADE, null=True, blank=True)
product_names = models.CharField(max_length=500)
total_produ... | 34.2 | 89 | 0.747076 |
68f040bcc28fc4c5e8523846e8a4b83da4da58ae | 2,561 | py | Python | bbg-firmware/GPS_test.py | pattern-of-life/Hardware | 7b0eb1f2b39b9e152d5b52984553fcaac98d36e8 | [
"MIT"
] | null | null | null | bbg-firmware/GPS_test.py | pattern-of-life/Hardware | 7b0eb1f2b39b9e152d5b52984553fcaac98d36e8 | [
"MIT"
] | null | null | null | bbg-firmware/GPS_test.py | pattern-of-life/Hardware | 7b0eb1f2b39b9e152d5b52984553fcaac98d36e8 | [
"MIT"
] | null | null | null | from GSM import setup_serial, send_command, parse_response, close_serial
from time import sleep
def handle_commands(ser, commands):
for com in commands:
response = send_command(ser, com)
# print(response)
count = 1
while count:
if com == b'AT+HTTPREAD':
... | 30.129412 | 151 | 0.560718 |
79e7ad87f07386acac3d88ac3c285842d14e1d97 | 3,290 | py | Python | test/test_redis_db_on_docker.py | LightStage-Aber/LightStage-Repo | 92f21b1b8a9f701cac3976a8db7034ecfefc58c7 | [
"Apache-2.0"
] | 10 | 2015-10-06T00:14:17.000Z | 2022-02-04T14:03:30.000Z | test/test_redis_db_on_docker.py | LightStage-Aber/LightStage-Repo | 92f21b1b8a9f701cac3976a8db7034ecfefc58c7 | [
"Apache-2.0"
] | 10 | 2017-05-05T11:10:19.000Z | 2019-06-04T15:30:24.000Z | test/test_redis_db_on_docker.py | LightStage-Aber/LightStage-Repo | 92f21b1b8a9f701cac3976a8db7034ecfefc58c7 | [
"Apache-2.0"
] | 2 | 2016-04-16T13:47:54.000Z | 2019-10-09T20:16:41.000Z | default_path = "../src/"
service_path = "../src/service/"
import sys
sys.path.insert(0, default_path)
sys.path.insert(0, service_path)
import unittest
from db_access import RedisDBOnDocker
class Test_RedisDBOnDocker(unittest.TestCase):
def __init__(self, *args, **kwords):
unittest.TestCase.__init__(... | 29.909091 | 78 | 0.606687 |
76da04ab18927fa8ea6375f6c123415123b6a9e8 | 2,825 | py | Python | read_and_train.py | iitmcvg/handwritten_ocr | b4b1e598aa39293eb3b929e3fa50ac3cab452bce | [
"Apache-2.0"
] | 20 | 2017-04-22T18:13:19.000Z | 2021-11-08T11:20:53.000Z | read_and_train.py | Jagannathrk2020/OCR-Handwritten-Text | b4b1e598aa39293eb3b929e3fa50ac3cab452bce | [
"Apache-2.0"
] | 3 | 2016-10-15T05:31:24.000Z | 2016-11-04T18:51:15.000Z | read_and_train.py | Jagannathrk2020/OCR-Handwritten-Text | b4b1e598aa39293eb3b929e3fa50ac3cab452bce | [
"Apache-2.0"
] | 18 | 2016-10-26T06:00:12.000Z | 2020-09-21T19:10:51.000Z | import time
import os
import glob
import tensorflow as tf
import numpy as np
import cv2
import random
# path = 'by_class'
path = 'test'
batch_size=100
t1 = time.time()
file_names=glob.glob(os.path.join(path,'*','train_*','*.[pP][nN][gG]'))
no_of_files=len(file_names)
t2 = time.time()
#print(file_names[0])
print('Tim... | 27.696078 | 96 | 0.703363 |
fd10eb578909ed2008a4c4c95bed49574bdb2509 | 26,873 | py | Python | python/ks_api_client/api_client.py | ashwinkp/ksapi | c348765cefb4d51fd90febcbfa9ff890b67bdc7d | [
"Apache-2.0"
] | 7 | 2022-02-05T16:20:37.000Z | 2022-02-27T16:48:28.000Z | python/ks_api_client/api_client.py | ashwinkp/ksapi | c348765cefb4d51fd90febcbfa9ff890b67bdc7d | [
"Apache-2.0"
] | 19 | 2022-02-03T12:40:08.000Z | 2022-03-30T09:12:46.000Z | python/ks_api_client/api_client.py | ashwinkp/ksapi | c348765cefb4d51fd90febcbfa9ff890b67bdc7d | [
"Apache-2.0"
] | 12 | 2021-12-23T06:14:21.000Z | 2022-03-28T07:47:19.000Z | # coding: utf-8
from __future__ import absolute_import
import atexit
import datetime
from dateutil.parser import parse
import json
import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
# python 2 and python 3 compatibility library
import six
from six.moves.urllib.parse impo... | 39.87092 | 114 | 0.552116 |
407b832323caec320984e562c445aead70cd6ba4 | 537 | py | Python | output/models/ms_data/schema/sch_t10_a_xsd/sch_t10_b.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/schema/sch_t10_a_xsd/sch_t10_b.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/schema/sch_t10_a_xsd/sch_t10_b.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
__NAMESPACE__ = "ns-a"
@dataclass
class BCt:
class Meta:
name = "b-ct"
att1: Optional[str] = field(
default=None,
metadata={
"type": "Attribute",
}
)
att2: str = field(
init=False... | 16.272727 | 40 | 0.506518 |
4ef98bc73e299015c0ac1283ba4c5121d0b5787b | 16,189 | py | Python | src/oci/waf/models/network_address_list.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/waf/models/network_address_list.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/waf/models/network_address_list.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.740343 | 245 | 0.651801 |
8c8f870d69958fbb5872e8dd3267d494e0a934bf | 9,757 | py | Python | tests/make_test.py | dengmingcong/httprunner | 379c758f0ab5d828156ba706c7dacdbf4d7aaba0 | [
"Apache-2.0"
] | null | null | null | tests/make_test.py | dengmingcong/httprunner | 379c758f0ab5d828156ba706c7dacdbf4d7aaba0 | [
"Apache-2.0"
] | 1 | 2022-03-09T03:05:23.000Z | 2022-03-09T03:05:23.000Z | tests/make_test.py | dengmingcong/httprunner | 379c758f0ab5d828156ba706c7dacdbf4d7aaba0 | [
"Apache-2.0"
] | 1 | 2022-03-02T03:13:27.000Z | 2022-03-02T03:13:27.000Z | import os
import unittest
import pytest
from httprunner import loader
from httprunner.make import (
main_make,
convert_testcase_path,
pytest_files_made_cache_mapping,
make_config_chain_style,
make_teststep_chain_style,
pytest_files_run_set,
ensure_file_abs_path_valid,
)
class TestMake(un... | 34.477032 | 98 | 0.489495 |
4c3f98a026c580ff50fbfdbd5b284d8ac5269b29 | 2,481 | py | Python | rotkehlchen/tests/unit/test_graph.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 137 | 2018-03-05T11:53:29.000Z | 2019-11-03T16:38:42.000Z | rotkehlchen/tests/unit/test_graph.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 385 | 2018-03-08T12:43:41.000Z | 2019-11-10T09:15:36.000Z | rotkehlchen/tests/unit/test_graph.py | rotkehlchenio/rotkehlchen | 98f49cd3ed26c641fec03b78eff9fe1872385fbf | [
"BSD-3-Clause"
] | 59 | 2018-03-08T10:08:27.000Z | 2019-10-26T11:30:44.000Z | from contextlib import ExitStack
from unittest.mock import MagicMock, patch
import pytest
from rotkehlchen.chain.ethereum.graph import Graph, format_query_indentation
from rotkehlchen.constants.timing import QUERY_RETRY_TIMES
from rotkehlchen.errors.misc import RemoteError
TEST_URL_1 = 'https://api.thegraph.com/subg... | 27.876404 | 77 | 0.657396 |
d26aebab8dc1102e1573a57f48900fb81e0ba444 | 22,723 | py | Python | AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/force_region/C5959809_ForceRegion_RotationalOffset.py | fromasmtodisasm/o3de | 0d728a76778cb0ca88caa5c07f17162fac668b2a | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : C5959809
# Test Case Title : Verify Force Region Rotational Offset
# fmt:off
class Tests:
... | 56.106173 | 182 | 0.639088 |
e04d3eaf89e31bd89c738900e099ce1858371baa | 567 | py | Python | lifelib/tests/data/generate_testdata.py | fumitoh/lifelib | 01b6fec4453b309808c1c7ca6867c7dce50668dc | [
"MIT"
] | 77 | 2018-03-02T05:21:43.000Z | 2022-03-26T20:29:59.000Z | lifelib/tests/data/generate_testdata.py | dayeoni-1376/lifelib | e65ba42843e8ae5f00ea795a8bb29ccd6e99ba54 | [
"MIT"
] | 10 | 2018-02-17T03:07:20.000Z | 2021-11-15T13:40:15.000Z | lifelib/tests/data/generate_testdata.py | dayeoni-1376/lifelib | e65ba42843e8ae5f00ea795a8bb29ccd6e99ba54 | [
"MIT"
] | 24 | 2018-03-12T20:01:06.000Z | 2022-03-07T06:06:18.000Z | import sys, os, pickle
from lifelib.projects.simplelife.scripts import simplelife
from lifelib.tests.data import round_signif
filepath = os.path.join(os.path.dirname(__file__), 'data_simplelife')
if '' not in sys.path:
sys.path.insert(0, '')
def generate_data(model):
data = []
proj = model.Projection
... | 24.652174 | 69 | 0.691358 |
f124f35980941071775aa588d64a86cb89301ccd | 125,039 | py | Python | kiali_qe/tests/__init__.py | prachiyadav/kiali-qe-python | 86b5b491b5560f8afd7d07d6ced093c3531d47c0 | [
"Apache-2.0"
] | 5 | 2019-02-28T16:53:23.000Z | 2022-03-03T19:14:45.000Z | kiali_qe/tests/__init__.py | prachiyadav/kiali-qe-python | 86b5b491b5560f8afd7d07d6ced093c3531d47c0 | [
"Apache-2.0"
] | 321 | 2018-04-20T13:51:06.000Z | 2022-01-27T08:56:46.000Z | kiali_qe/tests/__init__.py | prachiyadav/kiali-qe-python | 86b5b491b5560f8afd7d07d6ced093c3531d47c0 | [
"Apache-2.0"
] | 37 | 2018-04-17T06:29:42.000Z | 2022-03-01T17:11:17.000Z | import random
import re
import time
import math
from kiali_qe.components import (
BreadCrumb,
wait_to_spinner_disappear,
ListViewAbstract
)
from kiali_qe.components.enums import (
ServicesPageFilter,
IstioConfigPageFilter,
WorkloadsPageFilter,
ApplicationsPageFilter,
OverviewPageFilter... | 48.370986 | 100 | 0.605571 |
6422bf4e55dad0fdee06ac0a5e229a777d58065b | 1,047 | py | Python | FsStationB/BCKG/REST/tools/PyClient/generator.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 6 | 2021-09-29T15:46:55.000Z | 2021-12-14T18:39:51.000Z | FsStationB/BCKG/REST/tools/PyClient/generator.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | null | null | null | FsStationB/BCKG/REST/tools/PyClient/generator.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 3 | 2021-09-27T10:35:20.000Z | 2021-10-02T17:53:07.000Z | # -------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ----------------------------------------------------------------------... | 29.914286 | 93 | 0.583572 |
7b908ad447d57da704bafc463482392d5b91679e | 526 | py | Python | osrsguru/osrsgame/migrations/0002_auto_20210322_1518.py | OSRSGuru/OSRS.guru-BackEnd | 472096804bdbe4cf5d2abe45ab69e326043aa2be | [
"BSD-2-Clause"
] | null | null | null | osrsguru/osrsgame/migrations/0002_auto_20210322_1518.py | OSRSGuru/OSRS.guru-BackEnd | 472096804bdbe4cf5d2abe45ab69e326043aa2be | [
"BSD-2-Clause"
] | null | null | null | osrsguru/osrsgame/migrations/0002_auto_20210322_1518.py | OSRSGuru/OSRS.guru-BackEnd | 472096804bdbe4cf5d2abe45ab69e326043aa2be | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-22 15:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('osrsgame', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='server',
... | 26.3 | 165 | 0.655894 |
846ede6d543cb6759b38dece0f16c593fa59f278 | 601 | py | Python | python3/koans/about_triangle_project2.py | zhangyanan0525/python_koans | ee6500feef9848976378ff6744623ca5cbaf02d1 | [
"MIT"
] | null | null | null | python3/koans/about_triangle_project2.py | zhangyanan0525/python_koans | ee6500feef9848976378ff6744623ca5cbaf02d1 | [
"MIT"
] | null | null | null | python3/koans/about_triangle_project2.py | zhangyanan0525/python_koans | ee6500feef9848976378ff6744623ca5cbaf02d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
# You need to finish implementing triangle() in the file 'triangle.py'
from .triangle import *
class AboutTriangleProject2(Koan):
# The first assignment did not talk about how to handle errors.
# Let's handle that part now.
def test_... | 27.318182 | 71 | 0.640599 |
59c241a87af6e0aa176230c60d7bc76ff9f916c6 | 743 | py | Python | bot/models/Results/ResultsLoader.py | estebanthi/BinanceTradingBotV4 | 93ccac86db9bc8612248bf5cd1bc9e359749e383 | [
"MIT"
] | 4 | 2021-11-22T13:59:11.000Z | 2022-02-10T08:27:25.000Z | bot/models/Results/ResultsLoader.py | estebanthi/BinanceTradingBotV4 | 93ccac86db9bc8612248bf5cd1bc9e359749e383 | [
"MIT"
] | null | null | null | bot/models/Results/ResultsLoader.py | estebanthi/BinanceTradingBotV4 | 93ccac86db9bc8612248bf5cd1bc9e359749e383 | [
"MIT"
] | 3 | 2021-11-15T18:49:20.000Z | 2022-02-06T19:46:29.000Z | import pickle
import yaml
from models.MongoDriver import MongoDriver
class ResultsLoader:
"""
Useful for loading results
If it generates errors, add strategies in imports
"""
def __init__(self):
self.default_path = f"data/backtesting_results/"
def load(self, filename="results.dat",... | 28.576923 | 76 | 0.647376 |
5f86d4e41d794d29f5bb6046f69e15bb224b7a42 | 4,696 | py | Python | core/domain/visualization_registry_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 5 | 2022-01-22T17:22:23.000Z | 2022-02-04T09:21:24.000Z | core/domain/visualization_registry_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | null | null | null | core/domain/visualization_registry_test.py | yash10019coder/oppia | 8c349c61ac723a2fd507046b20957934cba70e3a | [
"Apache-2.0"
] | 2 | 2022-03-22T16:57:32.000Z | 2022-03-24T17:38:42.000Z | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 38.809917 | 80 | 0.669719 |
4644807a5ab01b0f61a49b057563ff68290e00dd | 10,773 | py | Python | fileson_backup.py | flyworker/fileson | 80d9f0b9c060dff3aca68e4cac4df3daa4d454d5 | [
"MIT"
] | null | null | null | fileson_backup.py | flyworker/fileson | 80d9f0b9c060dff3aca68e4cac4df3daa4d454d5 | [
"MIT"
] | null | null | null | fileson_backup.py | flyworker/fileson | 80d9f0b9c060dff3aca68e4cac4df3daa4d454d5 | [
"MIT"
] | 1 | 2021-04-29T01:28:23.000Z | 2021-04-29T01:28:23.000Z | #!/usr/bin/env python3
from collections import defaultdict, namedtuple
from fileson import Fileson, gmt_str, gmt_epoch
from logdict import LogDict
from crypt import keygen as kg, AESFile, sha1, calc_etag
import argparse, os, sys, json, signal, time, hashlib, inspect, shutil, re
import boto3, threading
class BotoProgre... | 42.581028 | 101 | 0.640954 |
41114e650e03fde2ce23ce7e45dd55848131257a | 199 | py | Python | services/payment-service/payments/handlers.py | ptanlam/eShop | 28391c32e0d6a888bd34840b9223fc8f82fb2495 | [
"MIT"
] | 1 | 2022-01-11T05:49:01.000Z | 2022-01-11T05:49:01.000Z | services/payment-service/payments/handlers.py | NguyenVinhPhuoc/eshop | da9ec6f8bea4b1bce66dd09ce0134272203c3e0f | [
"MIT"
] | 1 | 2022-01-02T08:18:47.000Z | 2022-01-02T08:18:47.000Z | services/payment-service/payments/handlers.py | NguyenVinhPhuoc/eshop | da9ec6f8bea4b1bce66dd09ce0134272203c3e0f | [
"MIT"
] | 2 | 2022-01-11T05:48:57.000Z | 2022-01-20T02:46:36.000Z | from .services import PaymentsService
import payments_pb2_grpc
def grpc_handler(server):
payments_pb2_grpc.add_PaymentsServiceServicer_to_server(
PaymentsService.as_servicer(), server)
| 24.875 | 60 | 0.819095 |
dd8f3987fa32f9d9734c87e5a60de60e84f93569 | 67 | py | Python | run.py | andrefaranha/flask-blog | a491386bddc5b6d3cd4706347b497945d711a3ea | [
"MIT"
] | null | null | null | run.py | andrefaranha/flask-blog | a491386bddc5b6d3cd4706347b497945d711a3ea | [
"MIT"
] | 2 | 2021-04-06T18:09:10.000Z | 2021-06-02T02:41:15.000Z | wsgi.py | sh4rpy/wllpprs | 678a004bcdfdc6c512f1fc9894172a49befb7e53 | [
"BSD-3-Clause"
] | null | null | null | from app.app import app
if __name__ == '__main__':
app.run()
| 11.166667 | 26 | 0.641791 |
ee2f8066cf7a484895d4e875195dbf03c0fb3c5c | 1,152 | py | Python | app/models/forms.py | rodrigolins92/Flask | 253f2f3162184c2a3421903e87a71f3997e5e3dd | [
"Apache-2.0"
] | null | null | null | app/models/forms.py | rodrigolins92/Flask | 253f2f3162184c2a3421903e87a71f3997e5e3dd | [
"Apache-2.0"
] | 1 | 2019-09-29T16:09:39.000Z | 2019-09-29T16:09:39.000Z | app/models/forms.py | rodrigolins92/Flask | 253f2f3162184c2a3421903e87a71f3997e5e3dd | [
"Apache-2.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import *
from wtforms.validators import DataRequired
from datetime import date, datetime
class LoginForm(FlaskForm):
username = StringField("username", validators=[DataRequired()])
password = PasswordField("password", validators=[DataRequired()])
remember_me = BooleanF... | 34.909091 | 82 | 0.701389 |
a46cbdce0065757d81e94584eef6531401ece5d5 | 1,467 | py | Python | From Another World/ship.py | Grantlee11/From_Another_World_Pygame | 1aa98162a458a1a4aacfbc9170eaa233db055e9e | [
"CC-BY-3.0"
] | null | null | null | From Another World/ship.py | Grantlee11/From_Another_World_Pygame | 1aa98162a458a1a4aacfbc9170eaa233db055e9e | [
"CC-BY-3.0"
] | null | null | null | From Another World/ship.py | Grantlee11/From_Another_World_Pygame | 1aa98162a458a1a4aacfbc9170eaa233db055e9e | [
"CC-BY-3.0"
] | null | null | null | import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, ai_settings, screen):
"""INITIALIZE THE SHIP AND SET ITS STARTING POSITION"""
super(Ship, self).__init__()
self.screen = screen
self.ai_settings = ai_settings
# LOAD THE SHIP IMAGE AND GE... | 34.116279 | 74 | 0.64758 |
326ee8361f04ac1c435305aa39fbcd72a5c336b9 | 2,215 | py | Python | script_example.py | EtalumaSupport/LumaViewPro | ab9678c04fc561e6fce8b774c5d87cc91d6f3e07 | [
"MIT"
] | null | null | null | script_example.py | EtalumaSupport/LumaViewPro | ab9678c04fc561e6fce8b774c5d87cc91d6f3e07 | [
"MIT"
] | 59 | 2021-03-26T19:22:59.000Z | 2021-12-04T00:42:12.000Z | script_example.py | EtalumaSupport/LumaViewPro | ab9678c04fc561e6fce8b774c5d87cc91d6f3e07 | [
"MIT"
] | null | null | null |
'''
To run, you will need to install the following packages:
numpy
pyserial
pypylon
time
You will also need to install the camera driver from Basler
'''
# Additional LumaViewPro files
from trinamic import *
from ledboard import *
from pyloncamera import *
import time
from PIL import I... | 28.037975 | 65 | 0.49842 |
c38d1a46ba8a61295db467cd650167044d1e3b23 | 27,706 | py | Python | pyop4/opbase/opConfigParser.py | cindy0123/duty-util01 | c582a7c5dfc6585e421b1b72b2876741b0839c95 | [
"MIT"
] | null | null | null | pyop4/opbase/opConfigParser.py | cindy0123/duty-util01 | c582a7c5dfc6585e421b1b72b2876741b0839c95 | [
"MIT"
] | null | null | null | pyop4/opbase/opConfigParser.py | cindy0123/duty-util01 | c582a7c5dfc6585e421b1b72b2876741b0839c95 | [
"MIT"
] | null | null | null | """Configuration file parser.
A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.
The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAULT] sect... | 36.745358 | 80 | 0.556053 |
812cfbf8cb08759f0cad16b08a973d2f0a749115 | 1,230 | py | Python | linear_model_src/train.py | nzpznk/futures_master | c09d27032a24bd7fa145b4dde8b3119ab2e8a4bc | [
"MIT"
] | null | null | null | linear_model_src/train.py | nzpznk/futures_master | c09d27032a24bd7fa145b4dde8b3119ab2e8a4bc | [
"MIT"
] | null | null | null | linear_model_src/train.py | nzpznk/futures_master | c09d27032a24bd7fa145b4dde8b3119ab2e8a4bc | [
"MIT"
] | null | null | null | from sklearn import linear_model
from label_data import get_labeled_data
from config import __models_dir__
from config import contract_list
from config import train_sample
from numpy import random
import pickle
def train(class_name, sample, label):
model_path = __models_dir__ + class_name
classifier = linear_m... | 36.176471 | 97 | 0.673171 |
90949d2c0a1002786edb2d7afe22e69208732fc3 | 2,943 | py | Python | setup.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | setup.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | setup.py | eldorplus/importlib | 48047b7de74c0e75fecbc0b846864e523e57ecc6 | [
"PSF-2.0",
"BSD-2-Clause"
] | null | null | null | from distutils.core import setup
import os.path
import _util
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
RELEASING = os.path.exists(os.path.join(PROJECT_ROOT, "MANIFEST.in"))
if RELEASING:
_util.verify_release_branch()
vers = _util.load_version()
################################################... | 30.340206 | 70 | 0.583418 |
d0e8797401ab6475c35ffa6834e0876d04330068 | 33,582 | py | Python | superset/security/manager.py | tiagosousac/incubator-superset | 93e75584e68fcaf158471115a1741c6451c3f962 | [
"Apache-2.0"
] | 1 | 2021-08-18T19:26:04.000Z | 2021-08-18T19:26:04.000Z | superset/security/manager.py | tiagosousac/incubator-superset | 93e75584e68fcaf158471115a1741c6451c3f962 | [
"Apache-2.0"
] | null | null | null | superset/security/manager.py | tiagosousac/incubator-superset | 93e75584e68fcaf158471115a1741c6451c3f962 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.386723 | 107 | 0.636799 |
74971917bbd68cf6b1cb0ed4fc3fcab8c65acc85 | 5,160 | py | Python | gym_electric_motor/envs/gym_pmsm/perm_mag_syn_motor_env.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | 1 | 2021-03-29T07:47:32.000Z | 2021-03-29T07:47:32.000Z | gym_electric_motor/envs/gym_pmsm/perm_mag_syn_motor_env.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | null | null | null | gym_electric_motor/envs/gym_pmsm/perm_mag_syn_motor_env.py | 54hanxiucao/gym-electric-motor | 911432388b00675e8a93f4a7937fdc575f106f22 | [
"MIT"
] | null | null | null | from ...core import ElectricMotorEnvironment
from ...physical_systems.physical_systems import SynchronousMotorSystem
from ...reference_generators import WienerProcessReferenceGenerator
from ...reward_functions import WeightedSumOfErrors
from ...constraints import SquaredConstraint
class PermanentMagnetSynchron... | 35.342466 | 114 | 0.61686 |
0e78220d477c40c05d4f78fa3eb8f934e30051d5 | 4,591 | py | Python | stripe/api_resources/__init__.py | nomadmtb/stripe-python | bc872674ba5c8ffd7d830f83ccb8e2adab53fd86 | [
"MIT"
] | null | null | null | stripe/api_resources/__init__.py | nomadmtb/stripe-python | bc872674ba5c8ffd7d830f83ccb8e2adab53fd86 | [
"MIT"
] | null | null | null | stripe/api_resources/__init__.py | nomadmtb/stripe-python | bc872674ba5c8ffd7d830f83ccb8e2adab53fd86 | [
"MIT"
] | null | null | null | # File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function
# flake8: noqa
from stripe.api_resources.error_object import ErrorObject, OAuthErrorObject
from stripe.api_resources.list_object import ListObject
from stripe.api_resources import billing_portal
from stripe.api_re... | 50.450549 | 76 | 0.88826 |
6983152e248f6e373b0154333d75ea7f30841b3c | 14,808 | py | Python | superset/charts/data/api.py | m-ajay/superset | 2cd80543581155225f2b538ad8cd5ebc7de5a9ff | [
"Apache-2.0"
] | 18,621 | 2017-06-19T09:57:44.000Z | 2021-01-05T06:28:21.000Z | superset/charts/data/api.py | m-ajay/superset | 2cd80543581155225f2b538ad8cd5ebc7de5a9ff | [
"Apache-2.0"
] | 9,043 | 2017-07-05T16:10:48.000Z | 2021-01-05T17:58:01.000Z | superset/charts/data/api.py | vecatom/incubator-superset | 0a21057bf837acf876ca25394a974bb345a646ca | [
"Apache-2.0"
] | 5,527 | 2017-07-06T01:39:43.000Z | 2021-01-05T06:01:11.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... | 37.112782 | 88 | 0.621353 |
b59e7571f85c6ffc83068ab75d1f61019c13e8e6 | 1,992 | py | Python | playground/detection/coco/poto.res50.fpn.coco.800size.3x_ms.3dmf_wo_gn.aux/config.py | attilab97/DeFCN | 811335665f62624d63fa28c6f13edd53ce5cc395 | [
"Apache-2.0"
] | null | null | null | playground/detection/coco/poto.res50.fpn.coco.800size.3x_ms.3dmf_wo_gn.aux/config.py | attilab97/DeFCN | 811335665f62624d63fa28c6f13edd53ce5cc395 | [
"Apache-2.0"
] | null | null | null | playground/detection/coco/poto.res50.fpn.coco.800size.3x_ms.3dmf_wo_gn.aux/config.py | attilab97/DeFCN | 811335665f62624d63fa28c6f13edd53ce5cc395 | [
"Apache-2.0"
] | null | null | null | import os.path as osp
from cvpods.configs.fcos_config import FCOSConfig
_config_dict = dict(
MODEL=dict(
WEIGHTS="detectron2://ImageNetPretrained/MSRA/R-50.pkl",
RESNETS=dict(DEPTH=50),
SHIFT_GENERATOR=dict(
NUM_SHIFTS=1,
OFFSET=0.5,
),
FCOS=dict(
... | 26.918919 | 111 | 0.538655 |
6b21c5f820cc8806caceae8a4e532b902b0d0013 | 2,676 | py | Python | old/modules/libraries/telepot/routing.py | deklungel/iRulez | eca073d0af55f8bf7006bf37c2cd69116e926211 | [
"MIT"
] | 1 | 2018-03-21T15:08:22.000Z | 2018-03-21T15:08:22.000Z | old/modules/libraries/telepot/routing.py | deklungel/iRulez | eca073d0af55f8bf7006bf37c2cd69116e926211 | [
"MIT"
] | 1 | 2017-08-25T06:12:08.000Z | 2017-08-25T06:13:58.000Z | old/modules/libraries/telepot/routing.py | deklungel/iRulez | eca073d0af55f8bf7006bf37c2cd69116e926211 | [
"MIT"
] | 1 | 2020-07-23T11:57:06.000Z | 2020-07-23T11:57:06.000Z | import re
from . import glance, _isstring, all_content_types
def by_content_type():
def f(msg):
content_type = glance(msg, flavor='chat')[0]
return content_type, (msg[content_type],)
return f
def by_command(extractor, prefix=('/',), separator=' ', pass_args=False):
if not isinstance(prefix... | 29.733333 | 83 | 0.56278 |
9d070439684b906fd9cd3078ff6a78292e606dbe | 4,047 | py | Python | app/recipe/tests/test_tags_api.py | Seiya7/django-api-recipe-app | bac4e4d5808990ddd7aca0b399bcebc52a12625d | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Seiya7/django-api-recipe-app | bac4e4d5808990ddd7aca0b399bcebc52a12625d | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Seiya7/django-api-recipe-app | bac4e4d5808990ddd7aca0b399bcebc52a12625d | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model # noqa
from django.urls import reverse # noqa
from django.test import TestCase # noqa
from rest_framework import status # noqa
from rest_framework.test import APIClient # noqa
from core.models import Tag, Recipe # noqa
from recipe.serializers import TagSerializer ... | 31.866142 | 71 | 0.629849 |
531f14688dd1d406dd28f661a889a5b037720001 | 1,154 | py | Python | problems/CR/auto/problem82_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | problems/CR/auto/problem82_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | problems/CR/auto/problem82_CR.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | __author__ = 'patras'
from domain_chargeableRobot import *
from timer import DURATION
from state import state
DURATION.TIME = {
'put': 2,
'take': 2,
'perceive': 3,
'charge': 5,
'move': 10,
'moveToEmergency': 5,
'moveCharger': 15,
'addressEmergency': 10,
'wait': 5,
}
DURATION.COUNTE... | 22.627451 | 117 | 0.496534 |
0a27cfc3d3eab85186210fc345bcb1d7aaa76a08 | 25,721 | py | Python | source/images.py | peppy0510/PyMusicPlayer | 6ac4779a137191700506629202eb596beacce021 | [
"MIT"
] | 18 | 2019-04-22T10:42:14.000Z | 2022-02-13T14:21:18.000Z | source/images.py | peppy0510/PyMusicPlayer | 6ac4779a137191700506629202eb596beacce021 | [
"MIT"
] | null | null | null | source/images.py | peppy0510/PyMusicPlayer | 6ac4779a137191700506629202eb596beacce021 | [
"MIT"
] | 5 | 2020-01-11T19:15:40.000Z | 2021-09-27T20:11:23.000Z | # encoding: utf-8
# author: Taehong Kim
# email: peppy0510@hotmail.com
from wx.lib.embeddedimage import PyEmbeddedImage
SmallUpArrow = PyEmbeddedImage(
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAADxJ"
"REFUOI1jZGRiZqAEMFGke2gY8P/f3/9kGwDTjM8QnAaga8JlCG3CAJdt2MQxDCAUaOjyjKMp"
... | 64.95202 | 79 | 0.878737 |
f1701d278c42a1ff9f8eaab17e6a105de6f37a16 | 18,950 | py | Python | intersight/models/iaas_ucsd_info_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | intersight/models/iaas_ucsd_info_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | intersight/models/iaas_ucsd_info_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 34.392015 | 1,052 | 0.637309 |
c178b219def8f7fbfe6d00f7822a8e61293d003a | 1,775 | py | Python | lib/python3.4/site-packages/pip/_vendor/html5lib/trie/py.py | LChristakis/chalice-hunter | 6bffea4620e23ce9ff12ac30526ebafcb9c10058 | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | env/lib/python3.6/site-packages/pip/_vendor/html5lib/_trie/py.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 8,417 | 2015-01-01T13:03:16.000Z | 2022-03-31T17:40:27.000Z | pip/_vendor/html5lib/trie/py.py | alex/pip | d51a4b345b31ec4c8defbefe7f12b996c00c67fa | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | 26.102941 | 66 | 0.588732 |
25d97682ff7a25ed7df27b1dfcb02829b32b6fa7 | 12,420 | py | Python | klab/rosetta/map_pdb_residues.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | 2 | 2016-06-14T00:32:19.000Z | 2021-07-04T01:56:17.000Z | klab/rosetta/map_pdb_residues.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | 2 | 2019-01-17T18:52:17.000Z | 2019-01-17T18:52:56.000Z | klab/rosetta/map_pdb_residues.py | Kortemme-Lab/klab | 68f028a4d7f97b9009bff45799b5602824052dd1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# encoding: utf-8
# The MIT License (MIT)
#
# Copyright (c) 2015 Shane O'Connor
#
# 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 withou... | 49.285714 | 244 | 0.696296 |
330c5dc2edef6bdc065594ad2bf5f7a85be9fc8a | 3,334 | py | Python | tests/test_late_swap.py | coltonfischer/pydfs-lineup-optimizer | ea28946bb7d8c28394468b49d08ff0216148cefd | [
"MIT"
] | 326 | 2015-12-23T16:30:18.000Z | 2022-03-19T17:48:07.000Z | tests/test_late_swap.py | coltonfischer/pydfs-lineup-optimizer | ea28946bb7d8c28394468b49d08ff0216148cefd | [
"MIT"
] | 335 | 2016-02-06T05:36:58.000Z | 2022-03-26T02:19:02.000Z | tests/test_late_swap.py | coltonfischer/pydfs-lineup-optimizer | ea28946bb7d8c28394468b49d08ff0216148cefd | [
"MIT"
] | 178 | 2016-02-06T05:30:20.000Z | 2022-03-27T19:05:42.000Z | from __future__ import absolute_import, division
import unittest
from datetime import datetime, timedelta
from pytz import timezone
from unittest.mock import patch, PropertyMock
from pydfs_lineup_optimizer import get_optimizer
from pydfs_lineup_optimizer.constants import Site, Sport
from pydfs_lineup_optimizer.lineup i... | 54.655738 | 114 | 0.691962 |
eaafeb77145a372f0c99aa7701cba3ed1e466cdd | 4,141 | py | Python | pandora/cost_volume_confidence/std_intensity.py | njimenezd/Pandora | 9e3c2054415301edac6da7510056af0136790277 | [
"Apache-2.0"
] | 14 | 2020-09-18T14:11:59.000Z | 2020-11-18T14:10:07.000Z | pandora/cost_volume_confidence/std_intensity.py | njimenezd/Pandora | 9e3c2054415301edac6da7510056af0136790277 | [
"Apache-2.0"
] | 1 | 2020-09-29T10:35:45.000Z | 2020-09-29T10:35:45.000Z | pandora/cost_volume_confidence/std_intensity.py | njimenezd/Pandora | 9e3c2054415301edac6da7510056af0136790277 | [
"Apache-2.0"
] | 1 | 2020-09-29T09:29:41.000Z | 2020-09-29T09:29:41.000Z | #!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora_pandora
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | 33.942623 | 116 | 0.666989 |
6fc8a2012f78d840220fd298815645cda18ce37b | 1,551 | py | Python | tests/helpers/misc/test_get_repository_name.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | null | null | null | tests/helpers/misc/test_get_repository_name.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | null | null | null | tests/helpers/misc/test_get_repository_name.py | bdraco/integration | b30e799bb27fdd978bd68f21909c82005d0dd3ea | [
"MIT"
] | null | null | null | """Helpers: Misc: get_repository_name."""
from custom_components.hacs.const import ELEMENT_TYPES
# pylint: disable=missing-docstring
from custom_components.hacs.helpers.functions.misc import get_repository_name
from custom_components.hacs.helpers.classes.manifest import HacsManifest
from tests.dummy_repository import ... | 35.25 | 77 | 0.756286 |
9f4641a5ad058d1a16a7bd81054c1ed5ba8b3260 | 1,205 | py | Python | emotion-classification/src/text/__init__.py | nur-ag/emotion-core | 35df8e2d39b72425c88ff986e8a9be901e77688a | [
"MIT"
] | 4 | 2021-12-15T21:50:40.000Z | 2022-03-22T10:20:24.000Z | emotion-classification/src/text/__init__.py | nur-ag/emotion-core | 35df8e2d39b72425c88ff986e8a9be901e77688a | [
"MIT"
] | null | null | null | emotion-classification/src/text/__init__.py | nur-ag/emotion-core | 35df8e2d39b72425c88ff986e8a9be901e77688a | [
"MIT"
] | 1 | 2021-11-14T17:36:15.000Z | 2021-11-14T17:36:15.000Z | from .bow import BOWExtractor
from .tfidf import TfidfExtractor
from .fasttext import FastTextTokenEmbeddingExtractor
from .bert import BertEmbeddingExtractor
from .xlmroberta import XLMRobertaEmbeddingExtractor
def extractor_factory(extractor_type, dataset=None, **kwargs):
if extractor_type == 'fasttext':
... | 46.346154 | 83 | 0.628216 |
653e5553ca75d7146967374c7b35373902047f75 | 30,094 | py | Python | salt/modules/win_useradd.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/modules/win_useradd.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/modules/win_useradd.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Module for managing Windows Users
.. important::
If you feel that Salt should be using this module to manage users on a
minion, and it is using a different module (or gives an error similar to
*'user.info' is not available*), see :ref:`here
<module-provider-override>`.
:dep... | 27.994419 | 100 | 0.604738 |
3cc43272e14ccddfed16efd5cd04dc81aa60ca0e | 2,415 | py | Python | ooobuild/lo/i18n/k_parse_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/i18n/k_parse_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/i18n/k_parse_type.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 29.45122 | 139 | 0.669151 |
7615141f390a8e1c2e6e23ae23ac114ab853ea33 | 2,920 | py | Python | dispike/server.py | cgeopapa/dispike | 5b098ff19f1a0ff966704d16a3587c9970023eb2 | [
"MIT"
] | null | null | null | dispike/server.py | cgeopapa/dispike | 5b098ff19f1a0ff966704d16a3587c9970023eb2 | [
"MIT"
] | null | null | null | dispike/server.py | cgeopapa/dispike | 5b098ff19f1a0ff966704d16a3587c9970023eb2 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, Request, Response
from fastapi.responses import PlainTextResponse
from loguru import logger
from .middlewares.verification import DiscordVerificationMiddleware
from .models.incoming import (
IncomingDiscordInteraction,
IncomingDiscordOptionList,
SubcommandIncomingDiscordOption... | 34.761905 | 102 | 0.734247 |
4c476ea0cfd1342f660647fe8806e315c3663896 | 63,925 | bzl | Python | rust/private/rustc.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | rust/private/rustc.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | rust/private/rustc.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Bazel 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 applicable la... | 42.334437 | 187 | 0.666734 |
834ecd6b40ddf2678c02d72588e7faf0160bf72e | 132 | py | Python | dashboard/urls.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | 2 | 2015-01-05T21:09:24.000Z | 2015-07-31T16:52:38.000Z | dashboard/urls.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | null | null | null | dashboard/urls.py | makaimc/pfisdi | 45e897b374d50e2f5385f15cbf318da0e17900f7 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
urlpatterns = patterns('dashboard.views',
url(r'^$', 'dashboard', name='dashboard'),
)
| 22 | 46 | 0.689394 |
6fea02550bb37131b6c74e7cc03b8a0d9abcc99c | 117 | py | Python | basic/update_upgrade_autoremove.py | CiganOliviu/automatisations | a4aa01cbb1b70bd837ab747935fb78d63130afc9 | [
"MIT"
] | null | null | null | basic/update_upgrade_autoremove.py | CiganOliviu/automatisations | a4aa01cbb1b70bd837ab747935fb78d63130afc9 | [
"MIT"
] | null | null | null | basic/update_upgrade_autoremove.py | CiganOliviu/automatisations | a4aa01cbb1b70bd837ab747935fb78d63130afc9 | [
"MIT"
] | null | null | null | import os
os.system('sudo apt-get update')
os.system('sudo apt-get upgrade')
os.system('sudo apt-get autoremove')
| 14.625 | 36 | 0.726496 |
e79b4c8de00b4f7d169843170e81574fe159af88 | 490 | py | Python | src/apps/unit/migrations/0007_topic_description.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | src/apps/unit/migrations/0007_topic_description.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | src/apps/unit/migrations/0007_topic_description.py | brainfukk/fiuread | 7414ec9f580b8bdc78e3ce63bb6ebf1ac7cdc4f8 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.7 on 2021-10-11 13:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("unit", "0006_alter_unitexerciseelementanswer_data"),
]
operations = [
migrations.AddField(
model_name="topic",
name=... | 23.333333 | 86 | 0.593878 |
a1b9676e7d90511b0335b524244d825a68eb09d7 | 23,460 | py | Python | unittest/scripts/py_devapi/scripts/mysqlx_column_metadata.py | mysql/mysql-shell | 7a299599a79ef2b2f578ffa41cbc901a88fc6b62 | [
"Apache-2.0"
] | 119 | 2016-04-14T14:16:22.000Z | 2022-03-08T20:24:38.000Z | unittest/scripts/py_devapi/scripts/mysqlx_column_metadata.py | mysql/mysql-shell | 7a299599a79ef2b2f578ffa41cbc901a88fc6b62 | [
"Apache-2.0"
] | 9 | 2017-04-26T20:48:42.000Z | 2021-09-07T01:52:44.000Z | unittest/scripts/py_devapi/scripts/mysqlx_column_metadata.py | mysql/mysql-shell | 7a299599a79ef2b2f578ffa41cbc901a88fc6b62 | [
"Apache-2.0"
] | 51 | 2016-07-20T05:06:48.000Z | 2022-03-09T01:20:53.000Z | # Assumptions: validate_crud_functions available
# Assumes __uripwd is defined as <user>:<pwd>@<host>:<plugin_port>
from __future__ import print_function
from mysqlsh import mysqlx
mySession = mysqlx.get_session(__uripwd)
ensure_schema_does_not_exist(mySession, 'py_shell_test')
schema = mySession.create_schema('py_s... | 40.8 | 395 | 0.749915 |
efc6c9928f805812fb8bc6e7ce87cd18bacc4fcc | 10,392 | py | Python | datasketch/hyperloglog.py | kinmanz/lshtry | 9361b0660239dc9563cfa747f30e1789f3bcf3f4 | [
"MIT"
] | null | null | null | datasketch/hyperloglog.py | kinmanz/lshtry | 9361b0660239dc9563cfa747f30e1789f3bcf3f4 | [
"MIT"
] | null | null | null | datasketch/hyperloglog.py | kinmanz/lshtry | 9361b0660239dc9563cfa747f30e1789f3bcf3f4 | [
"MIT"
] | 1 | 2018-04-05T13:51:38.000Z | 2018-04-05T13:51:38.000Z | '''
This module implements the HyperLogLog data sketch for estimating
cardinality of very large dataset in a single pass.
The original HyperLogLog is described here:
http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf
This HyperLogLog implementation is based on:
https://github.com/svpcom/hyperloglog
with enhanc... | 33.522581 | 82 | 0.577463 |
f18924b9a537a34c6294d8e3e7826087a3e6e505 | 966 | py | Python | azure-mgmt-web/azure/mgmt/web/models/site_config_resource_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-web/azure/mgmt/web/models/site_config_resource_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-web/azure/mgmt/web/models/site_config_resource_paged.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 34.5 | 129 | 0.587992 |
5c64afc8596ba927f2b9873857943cf1b10d4d82 | 1,145 | py | Python | setup.py | richard-lane/fourbody | 9c029ad4d179e7ad7448522166e09c29c7096071 | [
"MIT"
] | null | null | null | setup.py | richard-lane/fourbody | 9c029ad4d179e7ad7448522166e09c29c7096071 | [
"MIT"
] | null | null | null | setup.py | richard-lane/fourbody | 9c029ad4d179e7ad7448522166e09c29c7096071 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name="fourbody",
packages=["fourbody"],
version="0.2",
license="MIT",
description="Phase space parameterisation for four-body decays X -> h1+ h2- h3- h4+",
long_description="See the projet homepage for details",
author="Richard Lane",
author_email... | 31.805556 | 89 | 0.593013 |
2b1902673621d0909ad9cc48a79a4cf27adf8af4 | 23,269 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/net_tools/basics/uri.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/net_tools/basics/uri.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | null | null | null | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/net_tools/basics/uri.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# 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
ANSIBLE_METADATA = {'metadata_ver... | 35.471037 | 115 | 0.644377 |
1fd252de442c85c8d27b538ca82515856fd3276c | 102 | py | Python | main.py | IanLuan/pyHangman | 476756825825e064baad4b353f0451d82a3afb4b | [
"MIT"
] | 1 | 2019-03-08T21:08:52.000Z | 2019-03-08T21:08:52.000Z | main.py | IanLuan/pyHangman | 476756825825e064baad4b353f0451d82a3afb4b | [
"MIT"
] | null | null | null | main.py | IanLuan/pyHangman | 476756825825e064baad4b353f0451d82a3afb4b | [
"MIT"
] | 1 | 2021-04-27T02:54:35.000Z | 2021-04-27T02:54:35.000Z | from game.hangman import Hangman
from game.word import Word
from game.game import Game
game = Game()
| 17 | 32 | 0.784314 |
2ead70d7ca23b43666fc4d1b0050ea664e6fd7a9 | 39,303 | py | Python | cdap-docs/tools/licenses/licenses.py | pa-mahe/cdap | 17e80b38a17215bced088d7c1c7ee58386d0ae59 | [
"Apache-2.0"
] | 3 | 2019-06-30T08:14:21.000Z | 2019-10-14T10:03:40.000Z | cdap-docs/tools/licenses/licenses.py | pa-mahe/cdap | 17e80b38a17215bced088d7c1c7ee58386d0ae59 | [
"Apache-2.0"
] | 21 | 2018-10-31T10:19:47.000Z | 2020-02-06T12:06:05.000Z | cdap-docs/tools/licenses/licenses.py | pa-mahe/cdap | 17e80b38a17215bced088d7c1c7ee58386d0ae59 | [
"Apache-2.0"
] | 5 | 2019-09-04T19:09:50.000Z | 2020-04-22T16:06:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2014-2017 Cask Data, 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
#... | 37.148393 | 192 | 0.598733 |
285e7f8bf664656954d0414edd649e251d16c12d | 1,044 | py | Python | xlsxwriter/test/comparison/test_chart_points01.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2019-07-25T06:08:09.000Z | 2019-11-01T02:33:56.000Z | xlsxwriter/test/comparison/test_chart_points01.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2019-07-14T00:29:05.000Z | 2019-11-26T06:16:46.000Z | xlsxwriter/test/comparison/test_chart_points01.py | adgear/XlsxWriter | 79bcaad28d57ac29038b1c74bccc6d611b7a385e | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 23.727273 | 79 | 0.570881 |
4dcec586a69fabaecc24d30137cedf15871e3838 | 115,439 | py | Python | src/cluecode/copyrights.py | sthagen/nexB-scancode-toolkit | 12cc1286df78af898fae76fa339da2bb50ad51b9 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | src/cluecode/copyrights.py | sthagen/nexB-scancode-toolkit | 12cc1286df78af898fae76fa339da2bb50ad51b9 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | src/cluecode/copyrights.py | sthagen/nexB-scancode-toolkit | 12cc1286df78af898fae76fa339da2bb50ad51b9 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://a... | 31.566585 | 254 | 0.528556 |
7c3f24b4dfa408a7a7b684c86531834c764d342f | 20,720 | py | Python | Packs/AzureActiveDirectory/Integrations/AzureADIdentityProtection/AzureADIdentityProtection.py | mazmat-panw/content | 024a65c1dea2548e2637a9cbbe54966e9e34a722 | [
"MIT"
] | null | null | null | Packs/AzureActiveDirectory/Integrations/AzureADIdentityProtection/AzureADIdentityProtection.py | mazmat-panw/content | 024a65c1dea2548e2637a9cbbe54966e9e34a722 | [
"MIT"
] | null | null | null | Packs/AzureActiveDirectory/Integrations/AzureADIdentityProtection/AzureADIdentityProtection.py | mazmat-panw/content | 024a65c1dea2548e2637a9cbbe54966e9e34a722 | [
"MIT"
] | null | null | null | import demistomock as demisto
import dateparser
import urllib3
from MicrosoftApiModule import *
urllib3.disable_warnings()
''' GLOBAL VARS '''
INTEGRATION_NAME = 'Azure Active Directory Identity and Access'
OUTPUTS_PREFIX = "AADIdentityProtection"
BASE_URL = 'https://graph.microsoft.com/beta'
REQUIRED_PERMISSIONS ... | 46.666667 | 128 | 0.603813 |
ba034f2f6909d14d021a668992c9fe253fec8534 | 382 | py | Python | ckanext/archiver/tests/fixtures.py | vrk-kpa/ckanext-archiver | 13472493d4ec55a6f9299bee6ba7c98b4ddbcfb1 | [
"MIT"
] | 16 | 2016-01-11T14:42:41.000Z | 2022-03-18T03:20:15.000Z | ckanext/archiver/tests/fixtures.py | vrk-kpa/ckanext-archiver | 13472493d4ec55a6f9299bee6ba7c98b4ddbcfb1 | [
"MIT"
] | 49 | 2015-03-23T14:47:37.000Z | 2021-05-27T06:27:55.000Z | ckanext/archiver/tests/fixtures.py | vrk-kpa/ckanext-archiver | 13472493d4ec55a6f9299bee6ba7c98b4ddbcfb1 | [
"MIT"
] | 30 | 2015-01-08T09:04:31.000Z | 2021-06-22T13:53:21.000Z | import pytest
from ckanext.archiver.tests.mock_flask_server import create_app
import threading
@pytest.fixture(scope='session', autouse=True)
def client():
app = create_app()
port = 9091
thread = threading.Thread(target=lambda: app.run(debug=True, port=port, use_reloader=False))
thread.daemon = True
... | 23.875 | 96 | 0.712042 |
f7b33711f5b1f38f4ebff74da49afc737c4efd18 | 4,930 | py | Python | settings/automation_settings.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | settings/automation_settings.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | settings/automation_settings.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | #!/usr/local/bin/env python3
import collections
from settings import personal_settings
AUTOMATION_PROJECT_PATH = '/home/pi/Programming/Automation/' # end with '/'
TEMPCONTROLLER_MEASUREMENTS_PATH = AUTOMATION_PROJECT_PATH + \
'measurements/temperature_controller/'
AUTOMATION_EXECUTABLES_PATH = AUTOMATION_PROJECT... | 25.025381 | 80 | 0.489047 |
91ca0de4990c541793da14b4ab88c2a5900c07e6 | 12,069 | py | Python | src/prefect/schedules/schedules.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 1 | 2021-05-12T12:47:12.000Z | 2021-05-12T12:47:12.000Z | src/prefect/schedules/schedules.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 7 | 2021-06-26T08:05:20.000Z | 2022-03-26T08:05:32.000Z | src/prefect/schedules/schedules.py | vnsn/prefect | 972345597975155dba9e3232bcc430d0a6258a37 | [
"Apache-2.0"
] | 1 | 2021-10-16T08:33:56.000Z | 2021-10-16T08:33:56.000Z | import heapq
import itertools
import operator
import warnings
from datetime import datetime, timedelta
from typing import Callable, Iterable, List, Optional, cast
import prefect.schedules.adjustments
import prefect.schedules.clocks
import prefect.schedules.filters
class Schedule:
"""
Schedules are used to ge... | 39.312704 | 97 | 0.65341 |
629ae2f112884d7214cce175f93c2b1bb50919c0 | 942 | py | Python | django_AUS/urls.py | yashpatel7025/django-email-service-AUS | 1a584c6e3c4df4264b18c05060553f9a80ea9b96 | [
"MIT"
] | null | null | null | django_AUS/urls.py | yashpatel7025/django-email-service-AUS | 1a584c6e3c4df4264b18c05060553f9a80ea9b96 | [
"MIT"
] | null | null | null | django_AUS/urls.py | yashpatel7025/django-email-service-AUS | 1a584c6e3c4df4264b18c05060553f9a80ea9b96 | [
"MIT"
] | null | null | null | """django_AUS 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')
Class-ba... | 36.230769 | 77 | 0.723992 |
c1b06eabed7ee0015a1a7a363666b120fb931d4c | 1,066 | py | Python | tcli/cli.py | beddari/tcli | eda6b2f74201696c2b08da9eb922c0c65a5b4e71 | [
"MIT"
] | 1 | 2017-10-14T13:41:50.000Z | 2017-10-14T13:41:50.000Z | tcli/cli.py | beddari/tcli | eda6b2f74201696c2b08da9eb922c0c65a5b4e71 | [
"MIT"
] | null | null | null | tcli/cli.py | beddari/tcli | eda6b2f74201696c2b08da9eb922c0c65a5b4e71 | [
"MIT"
] | 4 | 2016-12-27T02:37:55.000Z | 2022-03-15T20:28:44.000Z | from pkg_resources import iter_entry_points
import click
from click_plugins import with_plugins
@with_plugins(iter_entry_points('tcli.plugins'))
@click.group()
def cli():
"""tcli is a modular command line tool wrapping and simplifying common
team related tasks."""
@cli.group()
def christmas():
"""This is... | 23.688889 | 74 | 0.697936 |
8b14143bdccde5f674ce162a30bbfe1697e2de42 | 1,814 | py | Python | scheduled_tasks/economy/get_retail_sales.py | Bonedeadskull/Stocksera | b36164b958dba5ae3242660088acff2af204a9af | [
"MIT"
] | 1 | 2022-03-06T00:27:26.000Z | 2022-03-06T00:27:26.000Z | scheduled_tasks/economy/get_retail_sales.py | satyami3/stock | d3d3f65a25feb764e6f735f422251fd0ede520fc | [
"MIT"
] | null | null | null | scheduled_tasks/economy/get_retail_sales.py | satyami3/stock | d3d3f65a25feb764e6f735f422251fd0ede520fc | [
"MIT"
] | null | null | null | import sqlite3
import pandas as pd
conn = sqlite3.connect(r"database/database.db", check_same_thread=False)
db = conn.cursor()
def retail_sales():
"""
Get retail sales and compare it with avg monthly covid cases
"""
df = pd.read_html("https://ycharts.com/indicators/us_retail_and_food_services_sales")... | 40.311111 | 128 | 0.675303 |
0f407716c8abd997627b4c09f6622c7f93caa49b | 2,234 | py | Python | cache.py | janastu/cache-server | a0311eb0d90a836680e7d83a5275a1b3a0508378 | [
"MIT"
] | null | null | null | cache.py | janastu/cache-server | a0311eb0d90a836680e7d83a5275a1b3a0508378 | [
"MIT"
] | null | null | null | cache.py | janastu/cache-server | a0311eb0d90a836680e7d83a5275a1b3a0508378 | [
"MIT"
] | null | null | null | import flask
from flask import Module, make_response
from urlparse import urlparse
from jpegtran import JPEGImage
import os
import requests
cache = Module(__name__, name="cache")
"""Currently works for jpg image only,
client request can provide args in url,
ex: http://test-cache.com/cache?url='image url'&width='int'&h... | 31.027778 | 78 | 0.621755 |
ddb2dfe17ff483a64e5a0d8ce0915849dcbee4d1 | 67 | py | Python | zerovl/models/backbones/builder.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 14 | 2022-01-19T08:08:29.000Z | 2022-03-10T05:55:36.000Z | zerovl/models/backbones/builder.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 2 | 2022-02-25T14:35:47.000Z | 2022-03-01T03:11:13.000Z | zerovl/models/backbones/builder.py | zerovl/ZeroVL | b48794e74fed0f80adf5fa3010481064411c4182 | [
"MIT"
] | 3 | 2022-02-09T01:23:11.000Z | 2022-02-15T11:45:30.000Z | from zerovl.utils import Registry
BACKBONE = Registry('backbone')
| 16.75 | 33 | 0.791045 |
d2e9608b20a6cc5d90b428a0db0784c9265f89a1 | 16,363 | py | Python | slingen/src/isas/sse3.py | danielesgit/slingen | e7cfee7f6f2347b57eb61a077746c9309a85411c | [
"BSD-3-Clause"
] | 23 | 2018-03-13T07:52:26.000Z | 2022-03-24T02:32:00.000Z | slingen/src/isas/sse3.py | danielesgit/slingen | e7cfee7f6f2347b57eb61a077746c9309a85411c | [
"BSD-3-Clause"
] | 2 | 2018-09-28T18:29:25.000Z | 2019-02-20T13:22:19.000Z | slingen/src/isas/sse3.py | danielesgit/slingen | e7cfee7f6f2347b57eb61a077746c9309a85411c | [
"BSD-3-Clause"
] | 3 | 2018-06-13T13:51:57.000Z | 2020-01-11T14:47:02.000Z | '''
Created on Apr 18, 2012
@author: danieles
'''
from sympy import sympify
from src.irbase import RValue, VecAccess, Pointer, AddressOf, Comment, sa
from src.isas.isabase import ISA, Loader, Storer, LoadReplacer
from src.isas.sse import mmLoaduPs, mmCvtssf32, mmShufflePs
from src.isas.sse2 import SSE2, mmLoadu... | 41.95641 | 140 | 0.522276 |
2f2511f1181a8e10ce32c78a2a41f2314ad67450 | 25,826 | py | Python | model-code/refactored-version/mlp-tabular/helper_files/helper_data.py | CHNxindong/corn-ordinal-neuralnet | 7f8a45614cb6488e9c019c5e9d3a5aee0d714e94 | [
"MIT"
] | 1 | 2021-12-15T08:16:23.000Z | 2021-12-15T08:16:23.000Z | model-code/refactored-version/mlp-tabular/helper_files/helper_data.py | CHNxindong/corn-ordinal-neuralnet | 7f8a45614cb6488e9c019c5e9d3a5aee0d714e94 | [
"MIT"
] | null | null | null | model-code/refactored-version/mlp-tabular/helper_files/helper_data.py | CHNxindong/corn-ordinal-neuralnet | 7f8a45614cb6488e9c019c5e9d3a5aee0d714e94 | [
"MIT"
] | null | null | null | import random
import pandas as pd
import torch
from torch.utils.data import sampler
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torch.utils.data import SubsetRandomSampler
from torchvision import transforms
from torchvision import datasets
def label_to_levels(label, num_classes,... | 35.969359 | 122 | 0.54511 |
3ff2b811b6ad6ad8eea82f3e6a1ce556dfa8a7c1 | 5,014 | py | Python | test/benchmark/basic_15q.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | 313 | 2018-12-19T09:19:12.000Z | 2022-03-21T18:15:41.000Z | test/benchmark/basic_15q.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | 933 | 2018-12-21T02:56:49.000Z | 2022-03-30T01:19:54.000Z | test/benchmark/basic_15q.py | chriseclectic/qiskit-aer | 61b028b7ccd1d6e96c8de48a10648c0bc3c07ff9 | [
"Apache-2.0"
] | 313 | 2018-12-19T14:52:55.000Z | 2022-02-28T20:20:14.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or d... | 39.480315 | 111 | 0.581572 |
68add56d8a0d61c0a2415b6142bf88e0d559ee57 | 5,557 | py | Python | tests/test_all_sum_reduce.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 25 | 2020-06-25T21:11:55.000Z | 2022-03-24T04:56:23.000Z | tests/test_all_sum_reduce.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 97 | 2020-06-08T17:09:59.000Z | 2022-03-26T00:47:11.000Z | tests/test_all_sum_reduce.py | BuildJet/distdl | 28b0dcf2c0a762de924cc310398a2eab9c35297f | [
"BSD-2-Clause"
] | 8 | 2020-06-08T17:00:54.000Z | 2022-03-20T20:20:24.000Z | import os
import numpy as np
import pytest
from adjoint_test import check_adjoint_test_tight
use_cuda = 'USE_CUDA' in os.environ
adjoint_parametrizations = []
# Main functionality
adjoint_parametrizations.append(
pytest.param(
np.arange(0, 12), [2, 2, 3], # P_x_ranks, P_x_topo
[3, 4], # x_glob... | 30.037838 | 80 | 0.605363 |
98b372f14863a8d3b85948de96dbca0de95569a1 | 137 | py | Python | message_passing_nn/fixtures/filenames.py | kovanostra/message-passing-nn | 6617a4753173c8fffc60140b9d8d0f497b33aed4 | [
"MIT"
] | 12 | 2020-06-14T03:00:16.000Z | 2022-01-05T09:51:07.000Z | message_passing_nn/fixtures/filenames.py | kovanostra/message-passing-nn | 6617a4753173c8fffc60140b9d8d0f497b33aed4 | [
"MIT"
] | 1 | 2020-12-13T10:37:03.000Z | 2020-12-13T10:37:03.000Z | message_passing_nn/fixtures/filenames.py | kovanostra/message-passing-nn | 6617a4753173c8fffc60140b9d8d0f497b33aed4 | [
"MIT"
] | 1 | 2020-11-21T13:04:56.000Z | 2020-11-21T13:04:56.000Z | RESULTS_CSV = 'results.csv'
DISTANCE_MAPS = 'distance_maps.pickle'
MODEL_STATE_DICTIONARY = 'model_state_dictionary.pth'
EPOCH = "Epoch"
| 27.4 | 53 | 0.80292 |
59acace20d0543df7ab156a30f0da2255f5cae51 | 819 | py | Python | app/core/tests/test_commands.py | sushan531/recipe-rest-api | 49a290efd0613af63ef1cdc1be924f902f0a743f | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | sushan531/recipe-rest-api | 49a290efd0613af63ef1cdc1be924f902f0a743f | [
"MIT"
] | 12 | 2020-02-12T01:23:36.000Z | 2022-03-11T23:56:28.000Z | app/core/tests/test_commands.py | sushan531/recipe-rest-api | 49a290efd0613af63ef1cdc1be924f902f0a743f | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTest(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for db when db ins available"""
with patch("django.db.utils.... | 35.608696 | 74 | 0.678877 |
94ac85a017530b7961f22a99bca50682b4ec9b6b | 63 | py | Python | filters.py | agnethesoraa/placepuppy | 2047a9cf364f21038234bf802ce367d791679f9c | [
"MIT"
] | 2 | 2015-03-22T20:33:44.000Z | 2015-03-22T20:33:53.000Z | filters.py | agnethesoraa/placepuppy | 2047a9cf364f21038234bf802ce367d791679f9c | [
"MIT"
] | null | null | null | filters.py | agnethesoraa/placepuppy | 2047a9cf364f21038234bf802ce367d791679f9c | [
"MIT"
] | null | null | null |
def greyscale(im):
return im.convert('L').convert('RGB')
| 12.6 | 41 | 0.634921 |
e67e56f3f3c76705661f441c85ce10c28d447d49 | 253 | py | Python | 05_debugging/solutions/bug_04.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_04.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | 05_debugging/solutions/bug_04.py | ASU-CompMethodsPhysics-PHY494/PHY494-resources-2020 | 20e08c20995eab567063b1845487e84c0e690e96 | [
"CC-BY-4.0"
] | null | null | null | # bug 4
# https://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2019/02/05/05_Debugging/#activity-fix-as-many-bugs-as-possible
# Define the sinc-function sinc(x) = \sin(x)/x:
import math
def sinc(x):
return math.sin(x)/x
print(sinc(3.145))
| 19.461538 | 123 | 0.715415 |
7e1deb20fbdb7babdd6ad6d6bcd83c10e3bffa1e | 27,909 | py | Python | models/stylegan_networks.py | rjean/contrastive-unpaired-translation | 40bff6988345c27651c7087b622c4d135ca62dcc | [
"BSD-3-Clause"
] | null | null | null | models/stylegan_networks.py | rjean/contrastive-unpaired-translation | 40bff6988345c27651c7087b622c4d135ca62dcc | [
"BSD-3-Clause"
] | null | null | null | models/stylegan_networks.py | rjean/contrastive-unpaired-translation | 40bff6988345c27651c7087b622c4d135ca62dcc | [
"BSD-3-Clause"
] | null | null | null | """
The network architectures is based on PyTorch implemenation of StyleGAN2Encoder.
Original PyTorch repo: https://github.com/rosinality/style-based-gan-pytorch
Origianl StyelGAN2 paper: https://github.com/NVlabs/stylegan2
We use the network architeture for our single-image traning setting.
"""
import math
import num... | 30.501639 | 137 | 0.558959 |
79c7500650275d9f68793fed9847b9736ee9500f | 159 | py | Python | src/day04.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | src/day04.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | src/day04.py | zhangxinyong12/my-python-demo | 3ac121073749ad9caf42531603e921b04e1e7c6c | [
"MIT"
] | null | null | null | #
def add(a):
try:
print(10 + a)
except Exception as err:
print('错误信息', err)
finally:
print('最终都会执行的')
add(23)
add('23')
| 12.230769 | 28 | 0.496855 |
9193817cff4b9e98e09a8d4103a308ac16f43959 | 584 | py | Python | campaign/migrations/0001_initial.py | tomas1207/BackendArmaGTI | 16274eb761e7f55900b1e6585dfb4b21abf25377 | [
"MIT"
] | null | null | null | campaign/migrations/0001_initial.py | tomas1207/BackendArmaGTI | 16274eb761e7f55900b1e6585dfb4b21abf25377 | [
"MIT"
] | null | null | null | campaign/migrations/0001_initial.py | tomas1207/BackendArmaGTI | 16274eb761e7f55900b1e6585dfb4b21abf25377 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-02-25 16:11
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='campaign',
fields=[
('id', models.AutoField... | 24.333333 | 114 | 0.554795 |
0438e3735efc6894ea23c4362dafa8d516676f65 | 2,727 | py | Python | egs/voxceleb/adv.v2/steps_backend/eval-be-cos.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 14 | 2021-12-19T04:24:15.000Z | 2022-03-18T03:24:04.000Z | egs/voxceleb/v1/steps_be/eval-be-v2.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | null | null | null | egs/voxceleb/v1/steps_be/eval-be-v2.py | hyperion-ml/hyperion | c4c9eee0acab1ba572843373245da12d00dfffaa | [
"Apache-2.0"
] | 5 | 2021-12-14T20:41:27.000Z | 2022-02-24T14:18:11.000Z | #!/usr/bin/env python
"""
Copyright 2019 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import sys
import os
from jsonargparse import (
ArgumentParser,
ActionConfigFile,
ActionParser,
namespace_to_dict,
)
import time
import logging
... | 26.475728 | 84 | 0.675101 |
0033e80175778cca9bda8d46dc74612ac12ee6f9 | 278 | py | Python | examples/simple/utils/changeFileName.py | M-Chase/Iris_EfficientNet | 4bbca8d4b466656f7ed1b1b7e8f924427b739124 | [
"Apache-2.0"
] | null | null | null | examples/simple/utils/changeFileName.py | M-Chase/Iris_EfficientNet | 4bbca8d4b466656f7ed1b1b7e8f924427b739124 | [
"Apache-2.0"
] | null | null | null | examples/simple/utils/changeFileName.py | M-Chase/Iris_EfficientNet | 4bbca8d4b466656f7ed1b1b7e8f924427b739124 | [
"Apache-2.0"
] | null | null | null | import os
path = r'E:\A_py_project\EfficientNet-PyTorch\examples\simple\data\newData\test\2\R'
j=0
files = os.listdir(path)
print(files)
for i in files:
print(i)
os.rename(os.path.join(path+"\\"+i),os.path.join(path+"\\"+"R_"+i))
# print(os.path)
# os.rename(os) | 27.8 | 84 | 0.661871 |
7705206475106b50409fecb08f5a7929640a2838 | 2,535 | py | Python | sbi_compare_ops_db.py | haroldham/steembasicincome | ce5b78ce35dba9cedad6a44eda4cb332bad53e49 | [
"MIT"
] | null | null | null | sbi_compare_ops_db.py | haroldham/steembasicincome | ce5b78ce35dba9cedad6a44eda4cb332bad53e49 | [
"MIT"
] | null | null | null | sbi_compare_ops_db.py | haroldham/steembasicincome | ce5b78ce35dba9cedad6a44eda4cb332bad53e49 | [
"MIT"
] | null | null | null | from beem import Steem
from beem.nodelist import NodeList
from beem.blockchain import Blockchain
import os
import json
import time
from steembi.transfer_ops_storage import AccountTrx
from steembi.storage import AccountsDB
import dataset
if __name__ == "__main__":
config_file = 'config.json'
if not os.path.isfi... | 35.704225 | 99 | 0.654832 |
2cf10f3a86193ddc1dc65843884e93f1243f6b1c | 241 | py | Python | examples/Arctic_HYCOM_GLBy/remap_test.py | bilgetutak/pyroms | 3b0550f26f4ac181b7812e14a7167cd1ca0797f0 | [
"BSD-3-Clause"
] | 75 | 2016-04-05T07:15:57.000Z | 2022-03-04T22:49:54.000Z | examples/Arctic_HYCOM_GLBy/remap_test.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 27 | 2017-02-26T04:27:49.000Z | 2021-12-01T17:26:56.000Z | examples/Arctic_HYCOM_GLBy/remap_test.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 56 | 2016-05-11T06:19:14.000Z | 2022-03-22T19:04:17.000Z | import xarray as xr
from regrid_GLBy import regrid_GLBy
gsource = xr.open_dataset('/import/AKWATERS/kshedstrom/HYCOM/Svalbard/data/HYCOM_GLBy0.08_2018_345.nc')
myssh = regrid_GLBy(gsource.ssh, method='bilinear')
myssh.to_netcdf('myssh.nc')
| 34.428571 | 103 | 0.809129 |
5995139dfd8cedea5fe3e2e2073afd74157ca3d4 | 1,183 | py | Python | neural_structured_learning/lib/abstract_gen_neighbor.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 939 | 2019-08-28T06:50:30.000Z | 2022-03-30T02:37:07.000Z | neural_structured_learning/lib/abstract_gen_neighbor.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 80 | 2019-09-01T19:47:30.000Z | 2022-02-02T20:38:38.000Z | neural_structured_learning/lib/abstract_gen_neighbor.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 196 | 2019-09-01T19:38:53.000Z | 2022-02-08T01:25:57.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.131579 | 80 | 0.775993 |
a82981089bdf52844b371d8a7eb33ca2c17ae400 | 405 | py | Python | barsystem/src/barsystem/migrations/0031_person_member.py | TkkrLab/barsystem | 17d138f19c8f6a61b14477f034d8519bb83e00fb | [
"MIT"
] | 1 | 2016-03-28T16:19:53.000Z | 2016-03-28T16:19:53.000Z | barsystem/src/barsystem/migrations/0031_person_member.py | TkkrLab/barsystem | 17d138f19c8f6a61b14477f034d8519bb83e00fb | [
"MIT"
] | 11 | 2015-09-22T20:34:34.000Z | 2017-04-12T13:55:27.000Z | barsystem/src/barsystem/migrations/0031_person_member.py | TkkrLab/barsystem | 17d138f19c8f6a61b14477f034d8519bb83e00fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('barsystem', '0030_auto_20150717_1557'),
]
operations = [
migrations.AddField(
model_name='person',
n... | 20.25 | 53 | 0.607407 |
0c3a3035d477dae678d2b0d15f9c4ec508384b15 | 325 | py | Python | assets/programovani-je-hra/3.2.1.py | JiriKalvoda/slama.dev | 4856d246858dd98a1852365b028873b61f5a6775 | [
"MIT"
] | 7 | 2019-09-15T19:55:11.000Z | 2021-12-27T11:40:20.000Z | assets/programovani-je-hra/3.2.1.py | JiriKalvoda/slama.dev | 4856d246858dd98a1852365b028873b61f5a6775 | [
"MIT"
] | 38 | 2020-05-18T12:49:13.000Z | 2022-03-23T12:51:28.000Z | assets/programovani-je-hra/3.2.1.py | JiriKalvoda/slama.dev | 4856d246858dd98a1852365b028873b61f5a6775 | [
"MIT"
] | 17 | 2020-02-16T19:49:25.000Z | 2022-02-06T14:28:35.000Z | x = 100
y = 120
dx = 3
dy = 5
r = 30
def setup():
size(400, 400)
def draw():
global x, y, dx, dy, r
background(255)
ellipse(x, y, r * 2, r * 2)
if x >= width - r:
dx = -dx
if x <= r:
dx = -dx
if y >= height - r:
dy = -dy
if y <= r:
dy = -dy
x = x + dx
y = y ... | 10.833333 | 29 | 0.406154 |
11b9510d58eebf146febccb11245c3fe0e9ab25d | 311 | py | Python | FirstExamPrepare/wormhole.py | nikolayvutov/Python | 55163496dac452a7110b7f76edc6894ee195f1fe | [
"MIT"
] | null | null | null | FirstExamPrepare/wormhole.py | nikolayvutov/Python | 55163496dac452a7110b7f76edc6894ee195f1fe | [
"MIT"
] | null | null | null | FirstExamPrepare/wormhole.py | nikolayvutov/Python | 55163496dac452a7110b7f76edc6894ee195f1fe | [
"MIT"
] | null | null | null | tel = list(map(int, input().split(' ')))
current_index, answer = 0, 0
while current_index != len(tel):
if tel[current_index] == 0:
answer += 1
current_index += 1
else:
old_index = current_index
current_index = tel[current_index]
tel[old_index] = 0
print(answer) | 23.923077 | 42 | 0.601286 |
c847d6463847794fb818daac30d4770560cd91c0 | 21,472 | py | Python | algorithms/mathematics/find_all_possible_arithmetic_expressions_and_solve.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/mathematics/find_all_possible_arithmetic_expressions_and_solve.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | algorithms/mathematics/find_all_possible_arithmetic_expressions_and_solve.py | josephedradan/algorithms | 6caa107b0df245653eab81143ebf0d9c7e5515fb | [
"MIT"
] | null | null | null | """
Created by Joseph Edradan
Github: https://github.com/josephedradan
Date created: 1/13/2021
Purpose:
Given a list of numbers and a list of operators, Make all possible permutations of the combinations of numbers and
operators. Then use all possible permutations of the combinations of numbers and operators ... | 35.786667 | 120 | 0.65313 |
dc5c46a86984a910ac4af026c440fcd58256bf08 | 12,765 | py | Python | yardstick/network_services/nfvi/resource.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | null | null | null | yardstick/network_services/nfvi/resource.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | null | null | null | yardstick/network_services/nfvi/resource.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 37.991071 | 98 | 0.621387 |
38ea0489b9451dcb91dfde227c8abcb98573d2b9 | 28,094 | py | Python | molo/core/tests/test_models.py | praekeltfoundation/molo-basic | 0c8a5fdbaf0eb62efc7164a26326801a27116dfe | [
"BSD-2-Clause"
] | null | null | null | molo/core/tests/test_models.py | praekeltfoundation/molo-basic | 0c8a5fdbaf0eb62efc7164a26326801a27116dfe | [
"BSD-2-Clause"
] | 3 | 2021-01-28T21:04:23.000Z | 2022-03-25T19:05:41.000Z | molo/core/tests/test_models.py | praekeltfoundation/molo-basic | 0c8a5fdbaf0eb62efc7164a26326801a27116dfe | [
"BSD-2-Clause"
] | 1 | 2020-09-09T08:01:02.000Z | 2020-09-09T08:01:02.000Z | # coding=utf-8
import pytest
from mock import patch
from django.test import TestCase, RequestFactory
from django.utils import timezone
from django.urls import reverse
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.contrib.contenttypes.models import ContentTyp... | 39.793201 | 79 | 0.642237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.