hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0e1d04cc8573fb6a3b19976f4a6cee94e5b841 | 2,455 | py | Python | services/migrations/0002_serviceapikey.py | City-of-Helsinki/atv | dca73dab09ab0f3a051a9f691aec5674c6369bde | [
"MIT"
] | null | null | null | services/migrations/0002_serviceapikey.py | City-of-Helsinki/atv | dca73dab09ab0f3a051a9f691aec5674c6369bde | [
"MIT"
] | 34 | 2021-05-28T06:23:38.000Z | 2022-03-08T12:42:01.000Z | services/migrations/0002_serviceapikey.py | City-of-Helsinki/atv | dca73dab09ab0f3a051a9f691aec5674c6369bde | [
"MIT"
] | 1 | 2021-05-27T10:37:42.000Z | 2021-05-27T10:37:42.000Z | # Generated by Django 3.2.3 on 2021-06-15 10:55
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("services", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="ServiceAPIKey",
... | 34.097222 | 119 | 0.402851 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("services", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="ServiceAPIKey",
fields=[
(
... | true | true |
1c0e1f929d634b54effb9de330449efc64730f6c | 1,790 | py | Python | git_squash.py | zmanji/git-squash | fafd69cb1944e1daffe9c04825942350056e653e | [
"MIT"
] | 1 | 2017-04-05T13:05:15.000Z | 2017-04-05T13:05:15.000Z | git_squash.py | zmanji/git-squash | fafd69cb1944e1daffe9c04825942350056e653e | [
"MIT"
] | null | null | null | git_squash.py | zmanji/git-squash | fafd69cb1944e1daffe9c04825942350056e653e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import functools
import sys
import git
error = functools.partial(print, file=sys.stderr)
def squash(args) -> int:
parser = argparse.ArgumentParser()
parser.add_argument(
"branch",
help="The upstream branch to squash commits of the current branch on to.... | 26.323529 | 82 | 0.643575 |
import argparse
import functools
import sys
import git
error = functools.partial(print, file=sys.stderr)
def squash(args) -> int:
parser = argparse.ArgumentParser()
parser.add_argument(
"branch",
help="The upstream branch to squash commits of the current branch on to.",
)
args = par... | true | true |
1c0e20c631359739c6169863b947fdebcba37491 | 2,922 | py | Python | frappe/templates/pages/integrations/stripe_checkout.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/templates/pages/integrations/stripe_checkout.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/templates/pages/integrations/stripe_checkout.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import json
import frappe
from frappe import _
from frappe.integrations.doctype.stripe_settings.stripe_settings import get_gateway_controller
from frappe.utils import cint, fmt_money
no_cache = 1
expected_keys = (
"amou... | 31.76087 | 99 | 0.788159 | import json
import frappe
from frappe import _
from frappe.integrations.doctype.stripe_settings.stripe_settings import get_gateway_controller
from frappe.utils import cint, fmt_money
no_cache = 1
expected_keys = (
"amount",
"title",
"description",
"reference_doctype",
"reference_docname",
"payer_name",
"payer... | true | true |
1c0e20cf216a5be97a6741ab0de30db0d0d29d50 | 458 | py | Python | Data Structures/Arrays/word.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 4 | 2020-12-01T08:52:57.000Z | 2021-11-08T11:44:42.000Z | Data Structures/Arrays/word.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 4 | 2020-09-30T19:54:10.000Z | 2020-10-17T05:04:04.000Z | Data Structures/Arrays/word.py | ayushkr459/Data-Structures-And-Algorithms | 050689a5e89a5afb0c907f16601d11706c04b614 | [
"MIT"
] | 12 | 2020-09-30T18:30:59.000Z | 2020-10-31T15:38:54.000Z |
from collections import Counter
def word_frequecy(words : str) :
counter = dict()
for word in words :
if word in counter.keys() :
counter[word] += 1
else :
counter[word] = 1
for key, value in counter.items() :
if value > 1 :
print("{} ... | 20.818182 | 45 | 0.50655 |
from collections import Counter
def word_frequecy(words : str) :
counter = dict()
for word in words :
if word in counter.keys() :
counter[word] += 1
else :
counter[word] = 1
for key, value in counter.items() :
if value > 1 :
print("{} ... | true | true |
1c0e2506735b4c40d9d782cda1e368ecebf4a888 | 4,247 | py | Python | bcbio/variation/samtools.py | markdunning/bcbio-nextgen | 37b69efcc5b2b3713b8d5cd207cece4cb343380d | [
"MIT"
] | null | null | null | bcbio/variation/samtools.py | markdunning/bcbio-nextgen | 37b69efcc5b2b3713b8d5cd207cece4cb343380d | [
"MIT"
] | null | null | null | bcbio/variation/samtools.py | markdunning/bcbio-nextgen | 37b69efcc5b2b3713b8d5cd207cece4cb343380d | [
"MIT"
] | null | null | null | """Variant calling using samtools 1.0 mpileup and bcftools.
http://www.htslib.org/workflow/#mapping_to_variant
"""
import os
from distutils.version import LooseVersion
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_transaction
from bcbio.log import logger
from bcbio.pipeline import... | 46.163043 | 103 | 0.660702 | import os
from distutils.version import LooseVersion
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_transaction
from bcbio.log import logger
from bcbio.pipeline import config_utils
from bcbio.pipeline.shared import subset_variant_regions
from bcbio.provenance import do, programs
fro... | true | true |
1c0e252ec9d4f7b6bf6bed38929a9581588b2188 | 4,823 | py | Python | tests/layer1/test_layer_speed_Novus_100G_multi_speeds.py | open-traffic-generator/snappi-tests | 820fac62ca7263a441f7199159b20b42050a44bb | [
"MIT"
] | 2 | 2021-08-05T05:23:58.000Z | 2022-01-26T16:52:15.000Z | tests/layer1/test_layer_speed_Novus_100G_multi_speeds.py | open-traffic-generator/snappi-tests | 820fac62ca7263a441f7199159b20b42050a44bb | [
"MIT"
] | 9 | 2021-04-06T14:53:02.000Z | 2022-03-07T05:35:28.000Z | tests/layer1/test_layer_speed_Novus_100G_multi_speeds.py | open-traffic-generator/snappi-tests | 820fac62ca7263a441f7199159b20b42050a44bb | [
"MIT"
] | 1 | 2022-03-10T07:35:41.000Z | 2022-03-10T07:35:41.000Z | import pytest
@pytest.mark.l1_manual
@pytest.mark.parametrize(
"speed",
["speed_10_gbps", "speed_25_gbps", "speed_40_gbps", "speed_100_gbps"],
)
def test_layer1(api, utils, speed):
"""Test that layer1 configuration settings are being applied correctly
A user should be able to configure ports with/with... | 32.809524 | 79 | 0.66017 | import pytest
@pytest.mark.l1_manual
@pytest.mark.parametrize(
"speed",
["speed_10_gbps", "speed_25_gbps", "speed_40_gbps", "speed_100_gbps"],
)
def test_layer1(api, utils, speed):
speed_type = {
"speed_10_gbps": "10000",
"speed_25_gbps": "25000",
"speed_40_gbps": "40000",
... | true | true |
1c0e25360277c01c74e00d7524989f38d4bc51e1 | 2,111 | py | Python | wp3/DefiningTF.py | loosolab/Datenanalyse-2021 | 2a94f6153a504bd6f1ee205eeeab279b20fb847d | [
"MIT"
] | 2 | 2022-02-25T16:48:56.000Z | 2022-03-29T16:43:38.000Z | wp3/DefiningTF.py | loosolab/Datenanalyse-2021 | 2a94f6153a504bd6f1ee205eeeab279b20fb847d | [
"MIT"
] | 5 | 2022-02-22T14:57:20.000Z | 2022-03-29T12:33:30.000Z | wp3/DefiningTF.py | loosolab/Datenanalyse-2021 | 2a94f6153a504bd6f1ee205eeeab279b20fb847d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 20 19:51:13 2022
@author: Moritz Hobein
"""
import pandas as pd
import argparse
#parser for using the tool via command-line interface
def cliParser():
parser = argparse.ArgumentParser(description='Script to extract the transcription factors that define a cluster (by ... | 31.507463 | 180 | 0.639034 | import pandas as pd
import argparse
def cliParser():
parser = argparse.ArgumentParser(description='Script to extract the transcription factors that define a cluster (by z score of TOBIAS footprinting score')
parser.add_argument('File', nargs=1, help='input file, tsv of binding scores')
parser.add_argument(... | true | true |
1c0e26501885099011d5a33cc2b0ab69617d34c1 | 1,444 | py | Python | module_api/bk_esb/cc.py | TencentBlueKing/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 11 | 2021-05-27T11:45:02.000Z | 2022-03-29T15:03:28.000Z | module_api/bk_esb/cc.py | hchicken/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 2 | 2021-08-16T03:59:19.000Z | 2021-09-29T09:31:39.000Z | module_api/bk_esb/cc.py | hchicken/bk-chatbot | da37fb2197142eae32158cdb5c2b658100133fff | [
"MIT"
] | 12 | 2021-05-27T11:59:18.000Z | 2022-03-17T07:21:53.000Z | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making
蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available.
Copyright (C) 2017-2018 THL A29 Limited,
a Tencent company. All rights reserved.
Licensed under the MIT License (the "License");
you may not use this file exce... | 31.391304 | 74 | 0.66759 |
from adapter.api import CCApi
from blueapps.utils.logger import logger
class CC:
def search_business(self, bk_username, condition, fields=None):
data = []
kwargs = {
"bk_username": bk_username,
"condition": condition,
"fields": fields,
}
try:
... | true | true |
1c0e2654e620fc8e16179aeefed8f39769852373 | 126 | py | Python | website/server/codenames/game/card.py | mderijk/codenames | 7133a8e85243550dddf4a64e90c9550f3b9e2cb4 | [
"MIT"
] | 2 | 2021-06-10T20:53:06.000Z | 2021-06-11T10:45:16.000Z | website/server/codenames/game/card.py | mderijk/codenames | 7133a8e85243550dddf4a64e90c9550f3b9e2cb4 | [
"MIT"
] | null | null | null | website/server/codenames/game/card.py | mderijk/codenames | 7133a8e85243550dddf4a64e90c9550f3b9e2cb4 | [
"MIT"
] | 1 | 2021-07-26T07:05:38.000Z | 2021-07-26T07:05:38.000Z |
class Card:
def __init__(self, id, type, word):
self.id = id
self.type = type
self.word = word
self.flipped = False
| 15.75 | 36 | 0.650794 |
class Card:
def __init__(self, id, type, word):
self.id = id
self.type = type
self.word = word
self.flipped = False
| true | true |
1c0e27049b28f600d6a4dc679a4c897594323e8e | 1,428 | py | Python | saleor/graphql/order/utils.py | overboardfreak/Project-On-Saleor | 3dd05c2705f614d3472d249e2a79f6ed82274a43 | [
"BSD-3-Clause"
] | 1 | 2019-01-18T19:56:47.000Z | 2019-01-18T19:56:47.000Z | saleor/graphql/order/utils.py | overboardfreak/Project-On-Saleor | 3dd05c2705f614d3472d249e2a79f6ed82274a43 | [
"BSD-3-Clause"
] | 5 | 2021-03-18T23:51:16.000Z | 2022-03-11T23:45:26.000Z | saleor/graphql/order/utils.py | overboardfreak/Project-On-Saleor | 3dd05c2705f614d3472d249e2a79f6ed82274a43 | [
"BSD-3-Clause"
] | null | null | null | from ...shipping import models as shipping_models
from ..core.types.common import Error
def can_finalize_draft_order(order, errors):
"""Return a list of errors associated with the order.
Checks, if given order has a proper customer data, shipping
address and method set up and return list of errors if not... | 34.829268 | 88 | 0.646359 | from ...shipping import models as shipping_models
from ..core.types.common import Error
def can_finalize_draft_order(order, errors):
if order.get_total_quantity() == 0:
errors.append(
Error(
field='lines',
message='Could not create order without any products.'))... | true | true |
1c0e2713eab416d4a63f5d6adf188cbc050a16dc | 1,139 | py | Python | algorithms_explained/users/tests/test_forms.py | Zamy97/Algorithms_Explained | 048022903da4199b3d245997e95c172cfbea508f | [
"MIT"
] | 1 | 2020-09-22T14:29:46.000Z | 2020-09-22T14:29:46.000Z | algorithms_explained/users/tests/test_forms.py | Zamy97/Algorithms_Explained | 048022903da4199b3d245997e95c172cfbea508f | [
"MIT"
] | null | null | null | algorithms_explained/users/tests/test_forms.py | Zamy97/Algorithms_Explained | 048022903da4199b3d245997e95c172cfbea508f | [
"MIT"
] | null | null | null | import pytest
from algorithms_explained.users.forms import UserCreationForm
from algorithms_explained.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
# A user with proto_user params does not exist yet.
proto_u... | 27.780488 | 66 | 0.602283 | import pytest
from algorithms_explained.users.forms import UserCreationForm
from algorithms_explained.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
proto_user = UserFactory.build()
form = UserCreati... | true | true |
1c0e2722eada4ae6385656094c02f981122ade54 | 515 | py | Python | src/core/exceptions.py | BuildForSDG/team-177-backend | 1b7fe7ca4e02b3c42ae3ad9c81579343c1058974 | [
"MIT"
] | null | null | null | src/core/exceptions.py | BuildForSDG/team-177-backend | 1b7fe7ca4e02b3c42ae3ad9c81579343c1058974 | [
"MIT"
] | 18 | 2020-05-10T11:23:44.000Z | 2021-09-22T19:03:30.000Z | src/core/exceptions.py | BuildForSDG/team-177-backend | 1b7fe7ca4e02b3c42ae3ad9c81579343c1058974 | [
"MIT"
] | 2 | 2020-05-07T11:33:12.000Z | 2020-05-19T09:14:28.000Z | from rest_framework.views import exception_handler
def core_exception_handler(exc, context):
response = exception_handler(exc, context)
handlers = {
'ValidationError': _handle_generic_error
}
exception_class = exc.__class__.__name__
if exception_class in handlers:
return handlers... | 23.409091 | 64 | 0.716505 | from rest_framework.views import exception_handler
def core_exception_handler(exc, context):
response = exception_handler(exc, context)
handlers = {
'ValidationError': _handle_generic_error
}
exception_class = exc.__class__.__name__
if exception_class in handlers:
return handlers... | true | true |
1c0e2919a6a4b936e8a38a4a6ce22b324fd0d050 | 9,315 | py | Python | freetests.py | wsandbox/CMPUT404-assignment-web-client | 48798d5a0536211a38282ded14f61f45b4732156 | [
"Apache-2.0"
] | null | null | null | freetests.py | wsandbox/CMPUT404-assignment-web-client | 48798d5a0536211a38282ded14f61f45b4732156 | [
"Apache-2.0"
] | null | null | null | freetests.py | wsandbox/CMPUT404-assignment-web-client | 48798d5a0536211a38282ded14f61f45b4732156 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# Copyright 2013 Abram Hindle
#
# 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 ... | 33.628159 | 86 | 0.593344 |
import unittest
import httpclient
import http.server
import threading
import socketserver
import random
import time
import urllib.parse
import json
BASEHOST = '127.0.0.1'
BASEPORT = 27600 + random.randint(1,100)
httpclass = httpclient
class MyHTTPHandler(http.server.BaseHTTPRequestHandler):
post = None
ge... | true | true |
1c0e291b00a1ae9b7d2b78f46e08208c212e2503 | 694 | py | Python | solvable/tutorial/eventhandlers.py | avatao-content/tutorial | bdbd531bc238a00851b1d55400696c412a6dbd58 | [
"Apache-2.0"
] | null | null | null | solvable/tutorial/eventhandlers.py | avatao-content/tutorial | bdbd531bc238a00851b1d55400696c412a6dbd58 | [
"Apache-2.0"
] | null | null | null | solvable/tutorial/eventhandlers.py | avatao-content/tutorial | bdbd531bc238a00851b1d55400696c412a6dbd58 | [
"Apache-2.0"
] | null | null | null | from tfwsdk import sdk
def on_step(current_state: int):
sdk.message_send('CURRENT STATE: ' + str(current_state))
def on_deploy(current_state: int):
sdk.message_send('DEPLOY BUTTON CLICKED')
return True # if deploy was successful
def on_message_button_click(current_state: int, button_value: str):
sdk.... | 31.545455 | 78 | 0.743516 | from tfwsdk import sdk
def on_step(current_state: int):
sdk.message_send('CURRENT STATE: ' + str(current_state))
def on_deploy(current_state: int):
sdk.message_send('DEPLOY BUTTON CLICKED')
return True
def on_message_button_click(current_state: int, button_value: str):
sdk.message_send('MESSAGE BUTTO... | true | true |
1c0e297ec294d5a155a8e1891f359342928a204e | 5,525 | py | Python | components/vision.py | Ninjakow/pydeepspace | 859c1c339c60dbca2e956218d33ae080383cd515 | [
"MIT"
] | 4 | 2019-01-31T14:11:48.000Z | 2019-11-21T18:31:57.000Z | components/vision.py | Ninjakow/pydeepspace | 859c1c339c60dbca2e956218d33ae080383cd515 | [
"MIT"
] | 74 | 2019-01-20T02:38:09.000Z | 2019-07-22T05:00:50.000Z | components/vision.py | Ninjakow/pydeepspace | 859c1c339c60dbca2e956218d33ae080383cd515 | [
"MIT"
] | 15 | 2019-01-08T03:31:14.000Z | 2021-01-16T07:00:29.000Z | import time
from collections import deque
from typing import Deque, NamedTuple, Tuple
import hal
from networktables import NetworkTablesInstance
from pyswervedrive.chassis import SwerveChassis
from utilities.functions import rotate_vector
class Odometry(NamedTuple):
x: float
y: float
heading: float
... | 34.748428 | 111 | 0.650317 | import time
from collections import deque
from typing import Deque, NamedTuple, Tuple
import hal
from networktables import NetworkTablesInstance
from pyswervedrive.chassis import SwerveChassis
from utilities.functions import rotate_vector
class Odometry(NamedTuple):
x: float
y: float
heading: float
... | true | true |
1c0e2a2933d4612f3cbd2b97c520eba62af46883 | 1,871 | py | Python | biot_1.5/utils.py | javacasm/biot | 1f0496de13f2f6e15ee911467a703728f4ddb3c5 | [
"MIT"
] | null | null | null | biot_1.5/utils.py | javacasm/biot | 1f0496de13f2f6e15ee911467a703728f4ddb3c5 | [
"MIT"
] | null | null | null | biot_1.5/utils.py | javacasm/biot | 1f0496de13f2f6e15ee911467a703728f4ddb3c5 | [
"MIT"
] | null | null | null | # Utils
import time
class RelojLOCAL:
'''
Classe para el control personal de los tiempos.
crea un reloj con la hora local del sistema en el que corre el sistema de registro de datos
El reloj adquiere la fecha/hora actuales al iniciarse, y
OJO, solo se actualiza con el metodo update()
y hasta e... | 38.183673 | 108 | 0.505612 |
import time
class RelojLOCAL:
def __init__(self):
self.update()
def update(self):
self.tiempo_str = time.strftime("%Y/%m/%d-%H:%M:%S", time.localtime(time.time())) self.tiempo = time.time() self.fechayhora = self.tiempo_str[:]
self.fecha = self... | true | true |
1c0e2ac4cc4399d66704762a2c7663f9e79c6702 | 206 | py | Python | jas1101finalproject/scripts/get_globular_clusters/setup_package.py | nstarman/jas1101_project | f54620b715eb2f7dbe7bd39d4a1e21e50bc06541 | [
"BSD-3-Clause"
] | 1 | 2020-11-20T18:27:20.000Z | 2020-11-20T18:27:20.000Z | jas1101finalproject/scripts/get_globular_clusters/setup_package.py | nstarman/jas1101_project | f54620b715eb2f7dbe7bd39d4a1e21e50bc06541 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T00:15:40.000Z | 2021-12-20T00:16:27.000Z | jas1101finalproject/scripts/normalize_globular_clusters/setup_package.py | nstarman/jas1101_project | f54620b715eb2f7dbe7bd39d4a1e21e50bc06541 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import
def get_package_data():
return {'jas1101finalproject.scripts.get_globular_clusters': ['data/*']}
| 29.428571 | 76 | 0.776699 | from __future__ import absolute_import
def get_package_data():
return {'jas1101finalproject.scripts.get_globular_clusters': ['data/*']}
| true | true |
1c0e2b13f24d41b33ace1184928bfceab1f8c338 | 4,933 | py | Python | test/integration/test_sampler.py | Qiskit/qiskit-ibm-runtime | 03b27fc32e462f87bcd246071ca09c75beeb573e | [
"Apache-2.0"
] | 20 | 2021-11-24T07:38:45.000Z | 2022-03-27T06:54:30.000Z | test/integration/test_sampler.py | Qiskit/qiskit-ibm-runtime | 03b27fc32e462f87bcd246071ca09c75beeb573e | [
"Apache-2.0"
] | 188 | 2021-11-18T18:59:38.000Z | 2022-03-31T23:35:29.000Z | test/integration/test_sampler.py | Qiskit/qiskit-ibm-runtime | 03b27fc32e462f87bcd246071ca09c75beeb573e | [
"Apache-2.0"
] | 20 | 2021-11-18T21:28:59.000Z | 2022-03-24T13:46:06.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2022.
#
# 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 derivative wo... | 44.441441 | 98 | 0.660855 |
from qiskit.circuit.library import RealAmplitudes
from qiskit.test.reference_circuits import ReferenceCircuits
from qiskit_ibm_runtime import Sampler, BaseSampler, SamplerResult
from ..decorators import run_integration_test
from ..ibm_test_case import IBMIntegrationTestCase
class TestIntegrationIBMSampler(IBMInte... | true | true |
1c0e2bb8f4ff0d4e29a1148e6828da2b321aa132 | 3,367 | py | Python | tests/test_lnk_heymac_cmd.py | dwhall/HeyMac | 18c86b5855d65d3d6ffe9ee9d5913396cee40d81 | [
"MIT"
] | 5 | 2018-03-25T03:31:52.000Z | 2021-11-23T03:17:01.000Z | tests/test_lnk_heymac_cmd.py | dwhall/HeyMac | 18c86b5855d65d3d6ffe9ee9d5913396cee40d81 | [
"MIT"
] | 10 | 2018-05-18T20:53:45.000Z | 2021-08-22T03:01:31.000Z | tests/test_lnk_heymac_cmd.py | dwhall/HeyMac | 18c86b5855d65d3d6ffe9ee9d5913396cee40d81 | [
"MIT"
] | 1 | 2020-06-14T16:31:34.000Z | 2020-06-14T16:31:34.000Z | #!/usr/bin/env python3
import unittest
from heymac.lnk import *
PUB_KEY = b"\xb2R\x96\xff\xdeb\x84S\xe6\xcd\x8cU\x84W!" \
b"\xaf\xa8,Vf\\\x8c\x03\x7f'\x1d\x88^8\x07?" \
b"U\xbbl\x18\xec\xc8*PC\x88}'\xf1\x84\xd7\xed\xc6" \
b"\x9bH9\xfa\xa0\xe0\xbdS5\xbf\x16h\xc8\x0f}\x9d" \
b... | 33.336634 | 96 | 0.615979 |
import unittest
from heymac.lnk import *
PUB_KEY = b"\xb2R\x96\xff\xdeb\x84S\xe6\xcd\x8cU\x84W!" \
b"\xaf\xa8,Vf\\\x8c\x03\x7f'\x1d\x88^8\x07?" \
b"U\xbbl\x18\xec\xc8*PC\x88}'\xf1\x84\xd7\xed\xc6" \
b"\x9bH9\xfa\xa0\xe0\xbdS5\xbf\x16h\xc8\x0f}\x9d" \
b"\xc3\xe9\x10:beb~\xf5\... | true | true |
1c0e2c9cb2935b74274f333871e030145964c054 | 883 | py | Python | Python/Algorithms/1417.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | 2 | 2021-01-15T17:22:54.000Z | 2021-05-16T19:58:02.000Z | Python/Algorithms/1417.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | Python/Algorithms/1417.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | from string import digits
class Solution:
def reformat(self, s):
d = {*digits}
nums, chars = [], []
for ch in s:
if ch in d:
nums.append(ch)
else:
chars.append(ch)
# Counted chars, return a permutation.
diff = len(num... | 24.527778 | 49 | 0.439411 | from string import digits
class Solution:
def reformat(self, s):
d = {*digits}
nums, chars = [], []
for ch in s:
if ch in d:
nums.append(ch)
else:
chars.append(ch)
diff = len(nums) - len(chars)
arr = []
... | true | true |
1c0e2e93a458c87c0131cf732efa60f53674f5fc | 1,923 | py | Python | tests/nlu/emulators/test_wit.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 9,701 | 2019-04-16T15:46:27.000Z | 2022-03-31T11:52:18.000Z | tests/nlu/emulators/test_wit.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 6,420 | 2019-04-16T15:58:22.000Z | 2022-03-31T17:54:35.000Z | tests/nlu/emulators/test_wit.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 3,063 | 2019-04-16T15:23:52.000Z | 2022-03-31T00:01:12.000Z | def test_wit_request():
from rasa.nlu.emulators.wit import WitEmulator
em = WitEmulator()
norm = em.normalise_request_json({"text": ["arb text"]})
assert norm == {"text": "arb text", "time": None}
def test_wit_response():
from rasa.nlu.emulators.wit import WitEmulator
em = WitEmulator()
... | 28.279412 | 74 | 0.379095 | def test_wit_request():
from rasa.nlu.emulators.wit import WitEmulator
em = WitEmulator()
norm = em.normalise_request_json({"text": ["arb text"]})
assert norm == {"text": "arb text", "time": None}
def test_wit_response():
from rasa.nlu.emulators.wit import WitEmulator
em = WitEmulator()
... | true | true |
1c0e2fb7d8965aadd0faff590366537cb81c875f | 1,783 | py | Python | tests/test_cryptoball_transition.py | CryptoBall/contracts | 3e85445f50ee8d8c430fd05f08f1186288dc9128 | [
"MIT"
] | null | null | null | tests/test_cryptoball_transition.py | CryptoBall/contracts | 3e85445f50ee8d8c430fd05f08f1186288dc9128 | [
"MIT"
] | null | null | null | tests/test_cryptoball_transition.py | CryptoBall/contracts | 3e85445f50ee8d8c430fd05f08f1186288dc9128 | [
"MIT"
] | null | null | null | import ethereum
import pytest
from eth_utils import to_wei
from tests.utils.asserts import assert_approx_eq
def test_cryptoball_transition(state, cryptoball):
# 4 days until the next draw
with pytest.raises(ethereum.tester.TransactionFailed):
cryptoball.transact().drawLottery()
state.forward_tim... | 29.229508 | 58 | 0.722939 | import ethereum
import pytest
from eth_utils import to_wei
from tests.utils.asserts import assert_approx_eq
def test_cryptoball_transition(state, cryptoball):
with pytest.raises(ethereum.tester.TransactionFailed):
cryptoball.transact().drawLottery()
state.forward_time(days=3, hours=23, minutes=5... | true | true |
1c0e3022b6384c8323dac1c8d27a4b44f3e4dcb2 | 8,072 | py | Python | Include/project/light_model.py | maslankam/Photometric-Stereo-Assistent | e3af46c8a984df10f37747b77630cdb5125e0b7f | [
"MIT"
] | null | null | null | Include/project/light_model.py | maslankam/Photometric-Stereo-Assistent | e3af46c8a984df10f37747b77630cdb5125e0b7f | [
"MIT"
] | 2 | 2021-03-08T22:31:49.000Z | 2021-03-18T21:03:47.000Z | Include/project/light_model.py | maslankam/Photometric-Stereo-Assistant | e3af46c8a984df10f37747b77630cdb5125e0b7f | [
"MIT"
] | null | null | null | from Include.project.segment import Segment
from Include.project.image_reader import ImageReader
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from mpl_toolkits.mplot3d import Axes3D
import shutil
import os, cv2, csv, math
class LightModel(Segment):
"""LightModel segment reponsible... | 29.035971 | 132 | 0.49393 | from Include.project.segment import Segment
from Include.project.image_reader import ImageReader
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from mpl_toolkits.mplot3d import Axes3D
import shutil
import os, cv2, csv, math
class LightModel(Segment):
def __init__(self, project):
... | true | true |
1c0e306e40dd9fb53246243ed9635ace017948ca | 1,263 | py | Python | movement_primitives/dmp/__init__.py | maotto/movement_primitives | b79c78a5a0667cc24a26b7b6cc64a5762d8f4dd4 | [
"BSD-3-Clause"
] | 17 | 2021-11-17T15:36:16.000Z | 2022-03-26T08:49:25.000Z | movement_primitives/dmp/__init__.py | DavidYaonanZhu/movement_primitives | ce355837f06cb5fada24be7259cb0305e8ea5d91 | [
"BSD-3-Clause"
] | 9 | 2021-12-01T10:33:04.000Z | 2022-03-23T12:41:39.000Z | movement_primitives/dmp/__init__.py | DavidYaonanZhu/movement_primitives | ce355837f06cb5fada24be7259cb0305e8ea5d91 | [
"BSD-3-Clause"
] | 8 | 2021-11-25T03:53:40.000Z | 2022-03-31T03:19:25.000Z | """Dynamical movement primitive variants."""
from ._dmp import DMP, dmp_transformation_system
from ._dmp_with_final_velocity import DMPWithFinalVelocity
from ._cartesian_dmp import CartesianDMP
from ._dual_cartesian_dmp import DualCartesianDMP
from ._coupling_terms import (
CouplingTermObstacleAvoidance2D, Coupling... | 52.625 | 79 | 0.846397 | from ._dmp import DMP, dmp_transformation_system
from ._dmp_with_final_velocity import DMPWithFinalVelocity
from ._cartesian_dmp import CartesianDMP
from ._dual_cartesian_dmp import DualCartesianDMP
from ._coupling_terms import (
CouplingTermObstacleAvoidance2D, CouplingTermObstacleAvoidance3D,
CouplingTermPos1... | true | true |
1c0e3089443dcb7f7f76e286e316bb701fe72d18 | 11,194 | py | Python | train_cpg_transformer.py | gdewael/cpg-transformer | 970248d192739af194c9e9df5823c9eda8c2fa75 | [
"MIT"
] | 10 | 2021-05-28T16:51:35.000Z | 2022-02-08T04:05:18.000Z | train_cpg_transformer.py | gdewael/cpg-transformer | 970248d192739af194c9e9df5823c9eda8c2fa75 | [
"MIT"
] | 1 | 2021-11-04T17:53:03.000Z | 2021-12-01T13:48:10.000Z | train_cpg_transformer.py | gdewael/cpg-transformer | 970248d192739af194c9e9df5823c9eda8c2fa75 | [
"MIT"
] | 4 | 2021-07-20T08:05:12.000Z | 2022-03-30T12:14:59.000Z | import numpy as np
from argparse import ArgumentParser
import argparse
import torch
import pytorch_lightning as pl
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor
from pytorch_lightning.callbacks.... | 64.705202 | 653 | 0.679828 | import numpy as np
from argparse import ArgumentParser
import argparse
import torch
import pytorch_lightning as pl
from pytorch_lightning import Trainer
from pytorch_lightning.loggers import TensorBoardLogger
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor
from pytorch_lightning.callbacks.... | true | true |
1c0e361b11f5954f585296a17338f61d87e01acf | 9,035 | py | Python | py/desispec/io/frame.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/desispec/io/frame.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/desispec/io/frame.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | """
desispec.io.frame
=================
I/O routines for Frame objects
"""
import os.path
import numpy as np
import scipy, scipy.sparse
from astropy.io import fits
from astropy.table import Table
import warnings
from desiutil.depend import add_dependencies
from desiutil.io import encode_table
from ..frame import Fr... | 33.712687 | 104 | 0.62767 | import os.path
import numpy as np
import scipy, scipy.sparse
from astropy.io import fits
from astropy.table import Table
import warnings
from desiutil.depend import add_dependencies
from desiutil.io import encode_table
from ..frame import Frame
from .meta import findfile, get_nights, get_exposures
from .util import ... | true | true |
1c0e365db691146048b2879d7578c5a0337bb088 | 2,295 | py | Python | app/main.py | adamsqi/dockerized-product-rest-api | 0d0db91c4c25d5b82df1d6d006cc264ac8add177 | [
"MIT"
] | null | null | null | app/main.py | adamsqi/dockerized-product-rest-api | 0d0db91c4c25d5b82df1d6d006cc264ac8add177 | [
"MIT"
] | null | null | null | app/main.py | adamsqi/dockerized-product-rest-api | 0d0db91c4c25d5b82df1d6d006cc264ac8add177 | [
"MIT"
] | null | null | null | import os
from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'db.sqlite')
app.config['SQLALCH... | 26.686047 | 92 | 0.693682 | import os
from flask import Flask, request, jsonify
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
app = Flask(__name__)
basedir = os.path.abspath(os.path.dirname(__file__))
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'db.sqlite')
app.config['SQLALCH... | true | true |
1c0e37171691d23d3bf8c943ff3cabcf2cf9e031 | 7,510 | py | Python | fsactivity_plugin.py | cjnaz/lanmonitor | 18e727d74fbc3ef411176f555aea828718a40ecf | [
"MIT"
] | 3 | 2021-01-29T19:33:48.000Z | 2021-06-06T18:04:59.000Z | fsactivity_plugin.py | cjnaz/lanmonitor | 18e727d74fbc3ef411176f555aea828718a40ecf | [
"MIT"
] | null | null | null | fsactivity_plugin.py | cjnaz/lanmonitor | 18e727d74fbc3ef411176f555aea828718a40ecf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""LAN Monitor plugin - fsactivity_plugin
The age of files at the `<path to directory or file>` is checked for at least one file being more recent than `<age>` ago.
Note that sub-directories are not recursed - only the listed top-level directory is checked for the newest file.
MonType_Act... | 48.766234 | 241 | 0.60506 |
__version__ = "V1.1 210523"
import re
import datetime
import globvars
from lanmonfuncs import RTN_PASS, RTN_WARNING, RTN_FAIL, RTN_CRITICAL, cmd_check, convert_time
from funcs3 import logging
LSMATCH = re.compile(r'[ldrwx\-.]+\s+[\d*]\s+[\w\d]+\s+[\w\d]+\s+[\d]+\s+([\d\-]+)+\s([\d:.]+)\s([\d\-]+)')
class... | true | true |
1c0e3807a9a7b854d6fbb96752a89d0bd287f5c6 | 9,390 | py | Python | models/wrn_pytorch.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | models/wrn_pytorch.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | models/wrn_pytorch.py | MPCAICDM/MPCA | c996435a0578ea4160f934bc01041c2ef23468f3 | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
__all__ = ['wrn']
class BasicBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride, dropRate=0.0):
super(BasicBlock, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.re... | 41.365639 | 116 | 0.576038 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
__all__ = ['wrn']
class BasicBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride, dropRate=0.0):
super(BasicBlock, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.re... | true | true |
1c0e383c0d7c9ec002b1d1633c67a2c6389de907 | 796 | py | Python | python/phonenumbers/shortdata/region_GU.py | vishnuku/python-phonenumbers | 6ac2cdd06b7ccf709a8efb21629cf2c5f030e627 | [
"Apache-2.0"
] | 3 | 2018-12-02T23:09:00.000Z | 2018-12-02T23:16:59.000Z | python/phonenumbers/shortdata/region_GU.py | carljm/python-phonenumbers | 494044aaf75443dbfd62b8d1352b441af6a458ae | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/shortdata/region_GU.py | carljm/python-phonenumbers | 494044aaf75443dbfd62b8d1352b441af6a458ae | [
"Apache-2.0"
] | null | null | null | """Auto-generated file, do not edit by hand. GU metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GU = PhoneMetadata(id='GU', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='9\\d{2}', possible_number_pattern='\\d{... | 61.230769 | 140 | 0.771357 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_GU = PhoneMetadata(id='GU', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='9\\d{2}', possible_number_pattern='\\d{3}', possible_length=(3,)),
toll_free=PhoneNumberDesc(),... | true | true |
1c0e390c5b2f7fa91d62f256e3d97f2a8824f301 | 23,112 | py | Python | db/data/2012/10/process.py | nataliemcmullen/WikiMiney | 562177a74179cb28469604f4fb9d021cebeed0a6 | [
"MIT"
] | 1 | 2020-11-18T19:20:58.000Z | 2020-11-18T19:20:58.000Z | db/data/2012/10/process.py | nataliemcmullen/WikiMiney | 562177a74179cb28469604f4fb9d021cebeed0a6 | [
"MIT"
] | null | null | null | db/data/2012/10/process.py | nataliemcmullen/WikiMiney | 562177a74179cb28469604f4fb9d021cebeed0a6 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import os
urls = [
"pagecounts-20121001-000000",
"pagecounts-20121001-010000",
"pagecounts-20121001-020000",
"pagecounts-20121001-030000",
"pagecounts-20121001-040000",
"pagecounts-20121001-050000",
"pagecounts-20121001-060001",
"pagecounts-20121001-070000",
"pagecounts-20121001-0... | 29.706941 | 57 | 0.791883 | from __future__ import with_statement
import os
urls = [
"pagecounts-20121001-000000",
"pagecounts-20121001-010000",
"pagecounts-20121001-020000",
"pagecounts-20121001-030000",
"pagecounts-20121001-040000",
"pagecounts-20121001-050000",
"pagecounts-20121001-060001",
"pagecounts-20121001-070000",
"pagecounts-20121001-0... | false | true |
1c0e39afd596e4e57a314150a7b52028572b7b77 | 1,156 | py | Python | test/test_extensions_v1beta1_run_as_user_strategy_options.py | tantioch/aiokubernetes | 2f332498598ece14d22f8e59ecb02665db6db68d | [
"Apache-2.0"
] | 24 | 2018-07-07T15:12:19.000Z | 2021-09-01T07:33:11.000Z | test/test_extensions_v1beta1_run_as_user_strategy_options.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 5 | 2018-07-11T00:09:17.000Z | 2018-10-22T16:41:54.000Z | test/test_extensions_v1beta1_run_as_user_strategy_options.py | revoteon/aiokubernetes | 730eae03e4779563740f07ad3ecef180b511ac18 | [
"Apache-2.0"
] | 3 | 2018-07-10T10:16:57.000Z | 2018-10-20T19:32:05.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... | 28.195122 | 144 | 0.765571 |
from __future__ import absolute_import
import unittest
import aiokubernetes
from aiokubernetes.models.extensions_v1beta1_run_as_user_strategy_options import ExtensionsV1beta1RunAsUserStrategyOptions from aiokubernetes.rest import ApiException
class TestExtensionsV1beta1RunAsUserStrategyOptions(unittest.TestCase... | true | true |
1c0e39e1446bef22469d4fc95cec3896f34b9439 | 3,963 | py | Python | examples/neural_networks/plot_mlp_training_curves.py | sourcery-ai-bot/scikit-learn | 0f7933a8f7527d13e822217cb2d42340be3cdfa4 | [
"BSD-3-Clause"
] | null | null | null | examples/neural_networks/plot_mlp_training_curves.py | sourcery-ai-bot/scikit-learn | 0f7933a8f7527d13e822217cb2d42340be3cdfa4 | [
"BSD-3-Clause"
] | null | null | null | examples/neural_networks/plot_mlp_training_curves.py | sourcery-ai-bot/scikit-learn | 0f7933a8f7527d13e822217cb2d42340be3cdfa4 | [
"BSD-3-Clause"
] | null | null | null | """
========================================================
Compare Stochastic learning strategies for MLPClassifier
========================================================
This example visualizes some training loss curves for different stochastic
learning strategies, including SGD and Adam. Because of time-constrai... | 40.438776 | 77 | 0.603331 |
print(__doc__)
import warnings
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import MinMaxScaler
from sklearn import datasets
from sklearn.exceptions import ConvergenceWarning
params = [{'solver': 'sgd', 'learning_rate': 'constant', 'momentum': 0,
... | true | true |
1c0e3a33a787cc88a5d0ec61003edecfcfee2f03 | 3,744 | py | Python | webtypes/server/router.py | abetkin/webtypes | af62501b91368f18acb569d6c3a587f0b7a125f7 | [
"BSD-3-Clause"
] | null | null | null | webtypes/server/router.py | abetkin/webtypes | af62501b91368f18acb569d6c3a587f0b7a125f7 | [
"BSD-3-Clause"
] | null | null | null | webtypes/server/router.py | abetkin/webtypes | af62501b91368f18acb569d6c3a587f0b7a125f7 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import re
from urllib.parse import urlparse
import werkzeug
from werkzeug.routing import Map, Rule
from webtypes import exceptions
from webtypes.compat import dict_type
from webtypes.server.core import Include, Route
class BaseRouter():
def lookup(self, path: str, method: str):
raise NotI... | 34.348624 | 81 | 0.543269 | import inspect
import re
from urllib.parse import urlparse
import werkzeug
from werkzeug.routing import Map, Rule
from webtypes import exceptions
from webtypes.compat import dict_type
from webtypes.server.core import Include, Route
class BaseRouter():
def lookup(self, path: str, method: str):
raise NotI... | true | true |
1c0e3a796c22598a1f6c3a72ff397552951cc812 | 1,065 | py | Python | oura/models/helper.py | kevingoldsmith/python-ouraring | aa398b93efd95a4b26c29b3db542e9fd914045d5 | [
"MIT"
] | null | null | null | oura/models/helper.py | kevingoldsmith/python-ouraring | aa398b93efd95a4b26c29b3db542e9fd914045d5 | [
"MIT"
] | null | null | null | oura/models/helper.py | kevingoldsmith/python-ouraring | aa398b93efd95a4b26c29b3db542e9fd914045d5 | [
"MIT"
] | null | null | null | import logging
import json
logger = logging.getLogger(__name__)
class OuraModel:
# TODO factor out common keys, like "summary_date"
_KEYS = []
def __init__(self, json_raw=None, json_parsed=None):
obj = json_parsed if json_parsed is not None else json.loads(json_raw)
set_attrs(self, obj)
... | 27.307692 | 136 | 0.658216 | import logging
import json
logger = logging.getLogger(__name__)
class OuraModel:
_KEYS = []
def __init__(self, json_raw=None, json_parsed=None):
obj = json_parsed if json_parsed is not None else json.loads(json_raw)
set_attrs(self, obj)
def __str__(self):
return ", ".join( [... | true | true |
1c0e3ccfd1df2daa785269791cefdc6e8321c94d | 7,649 | py | Python | src/main/resources/pytz/zoneinfo/America/Louisville.py | TheEin/swagger-maven-plugin | cf93dce2d5c8d3534f4cf8c612b11e2d2313871b | [
"Apache-2.0"
] | 65 | 2015-11-14T13:46:01.000Z | 2021-08-14T05:54:04.000Z | lib/pytz/zoneinfo/America/Louisville.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 13 | 2016-03-31T20:00:17.000Z | 2021-08-20T14:52:31.000Z | lib/pytz/zoneinfo/America/Louisville.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 20 | 2015-03-18T08:41:37.000Z | 2020-12-18T02:58:30.000Z | '''tzinfo timezone information for America/Louisville.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Louisville(DstTzInfo):
'''America/Louisville timezone definition. See datetime.tzinfo for details'''
zone = 'America/L... | 20.397333 | 81 | 0.565695 | from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Louisville(DstTzInfo):
zone = 'America/Louisville'
_utc_transition_times = [
d(1,1,1,0,0,0),
d(1918,3,31,8,0,0),
d(1918,10,27,7,0,0),
d(1919,3,30,8,0,0),
d(1919,10,26,7,0,0),
... | true | true |
1c0e3ce50fe385996ed3368c44fe54bb9728152d | 5,496 | py | Python | movie/fresh_tomatoes.py | andrevst/study-python | e27aefa79778080b916b230d6dc38b15c4f8b551 | [
"MIT"
] | null | null | null | movie/fresh_tomatoes.py | andrevst/study-python | e27aefa79778080b916b230d6dc38b15c4f8b551 | [
"MIT"
] | 2 | 2017-12-27T00:20:43.000Z | 2017-12-27T00:21:22.000Z | movie/fresh_tomatoes.py | andrevst/study-python | e27aefa79778080b916b230d6dc38b15c4f8b551 | [
"MIT"
] | null | null | null | import webbrowser
import os
import re
# Styles and scripting for the page
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fresh Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.... | 32.714286 | 144 | 0.573872 | import webbrowser
import os
import re
main_page_head = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fresh Tomatoes!</title>
<!-- Bootstrap 3 -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<link rel="stylesheet"... | true | true |
1c0e3d4c9f5b7e787fc16e69c38269d85a41236c | 977 | py | Python | scrape_data.py | pavansainov15/MatchPrediction | 79a3782dae086586ac699947d66c75f7286ede1d | [
"Apache-2.0"
] | null | null | null | scrape_data.py | pavansainov15/MatchPrediction | 79a3782dae086586ac699947d66c75f7286ede1d | [
"Apache-2.0"
] | null | null | null | scrape_data.py | pavansainov15/MatchPrediction | 79a3782dae086586ac699947d66c75f7286ede1d | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from bs4 import BeautifulSoup
import requests
# For player ranks
url = 'http://www.cricmetric.com/ipl/ranks/'
pd.read_html(requests.get(url).content)[-1].to_csv("./Dataset/_player_rank.csv", index=False, header=None)
# Store the sum of EF score by team.
data = pd.read_csv('./Dataset/_player_rank.c... | 42.478261 | 111 | 0.735926 | import pandas as pd
from bs4 import BeautifulSoup
import requests
url = 'http://www.cricmetric.com/ipl/ranks/'
pd.read_html(requests.get(url).content)[-1].to_csv("./Dataset/_player_rank.csv", index=False, header=None)
data = pd.read_csv('./Dataset/_player_rank.csv')
team_rank = pd.DataFrame(
data.groupby('Team')[... | true | true |
1c0e3d4f2a6918051549ab29b8c0d536e71c3c84 | 2,422 | py | Python | docDAL/mysql.py | pengyang486868/PY-read-Document | 8d1d145cc6c384a64b3a28781dbcce1733b77513 | [
"Apache-2.0"
] | null | null | null | docDAL/mysql.py | pengyang486868/PY-read-Document | 8d1d145cc6c384a64b3a28781dbcce1733b77513 | [
"Apache-2.0"
] | 4 | 2021-03-31T19:32:41.000Z | 2022-01-13T02:13:05.000Z | docDAL/mysql.py | pengyang486868/PY-read-Document | 8d1d145cc6c384a64b3a28781dbcce1733b77513 | [
"Apache-2.0"
] | null | null | null | import os
from sqlalchemy import create_engine
import pandas as pd
import config
from model import FileInfo, ImageInfo
def get_dw_constr():
conStr = os.environ.get("DBCONSTR")
return conStr if conStr is not None else config.default_constr
def get_dw_engine():
return create_engine(get_dw_constr()).connec... | 25.765957 | 89 | 0.621387 | import os
from sqlalchemy import create_engine
import pandas as pd
import config
from model import FileInfo, ImageInfo
def get_dw_constr():
conStr = os.environ.get("DBCONSTR")
return conStr if conStr is not None else config.default_constr
def get_dw_engine():
return create_engine(get_dw_constr()).connec... | true | true |
1c0e3d53dfc50755b150ce0577dace319c765f09 | 26,027 | py | Python | pennylane/plugins/default_gaussian.py | AroosaIjaz/Mypennylane | 40f2219b5e048d4bd93df815811ca5ed3f5327fa | [
"Apache-2.0"
] | 1 | 2019-05-12T22:43:42.000Z | 2019-05-12T22:43:42.000Z | pennylane/plugins/default_gaussian.py | AroosaIjaz/Mypennylane | 40f2219b5e048d4bd93df815811ca5ed3f5327fa | [
"Apache-2.0"
] | null | null | null | pennylane/plugins/default_gaussian.py | AroosaIjaz/Mypennylane | 40f2219b5e048d4bd93df815811ca5ed3f5327fa | [
"Apache-2.0"
] | 1 | 2022-03-04T02:17:11.000Z | 2022-03-04T02:17:11.000Z | # Copyright 2018 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 applicable law or agre... | 29.916092 | 100 | 0.579975 |
import numpy as np
from scipy.special import factorial as fac
import pennylane as qml
from pennylane import Device
tolerance = 1e-10
def partitions(s, include_singles=True):
if len(s) == 2:
if include_singles:
yield (s[0],), (s[1],)
yield tuple(s),
else:
... | true | true |
1c0e3e8ebb0d63e3e6e648c67a80e58c3121540b | 3,847 | py | Python | ppgan/utils/config.py | wangna11BD/PaddleGAN | fa1e1f261e31eebd3eab37a8ff8999018f96abc8 | [
"Apache-2.0"
] | 6,852 | 2020-06-18T10:56:27.000Z | 2022-03-31T10:17:47.000Z | ppgan/utils/config.py | wangna11BD/PaddleGAN | fa1e1f261e31eebd3eab37a8ff8999018f96abc8 | [
"Apache-2.0"
] | 283 | 2020-07-09T13:29:58.000Z | 2022-03-23T02:50:25.000Z | ppgan/utils/config.py | wangna11BD/PaddleGAN | fa1e1f261e31eebd3eab37a8ff8999018f96abc8 | [
"Apache-2.0"
] | 973 | 2020-06-18T11:15:35.000Z | 2022-03-30T10:50:16.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 30.054688 | 80 | 0.579672 | import os
import yaml
__all__ = ['get_config']
class AttrDict(dict):
def __getattr__(self, key):
try:
return self[key]
except KeyError:
raise AttributeError(key)
def __setattr__(self, key, value):
if key in self.__dict__:
self.__dict__[key]... | true | true |
1c0e3f60fb8976ca62f2abe9f8b2f979715a626e | 10,869 | py | Python | rnn_prof/run_irt.py | LiangbeiXu/edm2016 | 728e3605d1af5113ed75883f11fea2f1271fd427 | [
"Apache-2.0"
] | 64 | 2016-06-03T03:45:04.000Z | 2021-12-02T06:15:57.000Z | rnn_prof/run_irt.py | LiangbeiXu/edm2016 | 728e3605d1af5113ed75883f11fea2f1271fd427 | [
"Apache-2.0"
] | 10 | 2016-12-12T02:47:38.000Z | 2019-01-29T06:38:15.000Z | rnn_prof/run_irt.py | LiangbeiXu/edm2016 | 728e3605d1af5113ed75883f11fea2f1271fd427 | [
"Apache-2.0"
] | 34 | 2016-05-20T20:44:03.000Z | 2022-03-23T20:31:57.000Z | """
Script for running basic online IRT
"""
import logging
import numpy as np
import pandas as pd
from scipy import sparse as sp
from .data.constants import (ITEM_IDX_KEY, TEMPLATE_IDX_KEY, USER_IDX_KEY, CORRECT_KEY,
CONCEPT_IDX_KEY)
from .data.wrapper import DEFAULT_DATA_OPTS
from .irt i... | 51.028169 | 100 | 0.684516 | import logging
import numpy as np
import pandas as pd
from scipy import sparse as sp
from .data.constants import (ITEM_IDX_KEY, TEMPLATE_IDX_KEY, USER_IDX_KEY, CORRECT_KEY,
CONCEPT_IDX_KEY)
from .data.wrapper import DEFAULT_DATA_OPTS
from .irt import TEST_RESPONSES_KEY, OFFSET_COEFFS_KEY
... | true | true |
1c0e3f643a8254a16b3b464ac460823f347ed7f5 | 112,338 | py | Python | tests/core/full_node/test_mempool.py | neurosis69/chia-blockchain | d346ef89f1e1aa9eec1e06f1ef93862c097f6bd7 | [
"Apache-2.0"
] | null | null | null | tests/core/full_node/test_mempool.py | neurosis69/chia-blockchain | d346ef89f1e1aa9eec1e06f1ef93862c097f6bd7 | [
"Apache-2.0"
] | 2 | 2022-02-14T00:16:34.000Z | 2022-02-14T00:16:44.000Z | tests/core/full_node/test_mempool.py | neurosis69/chia-blockchain | d346ef89f1e1aa9eec1e06f1ef93862c097f6bd7 | [
"Apache-2.0"
] | null | null | null | import dataclasses
import logging
from typing import Dict, List, Optional, Tuple, Callable
from clvm.casts import int_to_bytes
import pytest
import chia.server.ws_connection as ws
from chia.full_node.mempool import Mempool
from chia.full_node.full_node_api import FullNodeAPI
from chia.protocols import full_node_pro... | 44.54322 | 354 | 0.682841 | import dataclasses
import logging
from typing import Dict, List, Optional, Tuple, Callable
from clvm.casts import int_to_bytes
import pytest
import chia.server.ws_connection as ws
from chia.full_node.mempool import Mempool
from chia.full_node.full_node_api import FullNodeAPI
from chia.protocols import full_node_pro... | true | true |
1c0e3fad93c04929b0601eeddec6a5bbb9a92061 | 1,528 | py | Python | chinese_ocr/train_use_new_dataset.py | bing1zhi2/chinese_ocr | d5b70457079e9ae5c965588c940020da742ea9c1 | [
"MIT"
] | 43 | 2019-07-23T11:28:18.000Z | 2022-01-17T12:51:18.000Z | chinese_ocr/train_use_new_dataset.py | dun933/chinese_ocr-1 | d5b70457079e9ae5c965588c940020da742ea9c1 | [
"MIT"
] | 4 | 2019-07-25T05:04:40.000Z | 2020-01-06T08:01:36.000Z | chinese_ocr/train_use_new_dataset.py | dun933/chinese_ocr-1 | d5b70457079e9ae5c965588c940020da742ea9c1 | [
"MIT"
] | 13 | 2019-09-07T03:34:56.000Z | 2020-10-14T22:12:01.000Z | # -*- coding:utf-8 -*-
# bing1
# 2019/8/21
"""
MIT License
Copyright (c) 2019 Hyman Chen
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 ri... | 37.268293 | 104 | 0.776832 |
from chinese_ocr.train.train_with_param import train_with_param
dataset_url="/media/chenhao/study/code/other/out"
train_with_param( dataset_url, 3, 20, class_id_file="char_7476.txt", train_label_name="label_train.txt",
val_label_name="label_val.txt", dataset_format= 0, sub_img_folder="default... | true | true |
1c0e4110a91e206ec179358496ced8fb8e7ee51b | 4,149 | py | Python | week_9/05_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | week_9/05_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | week_9/05_lesson.py | SekachVitaliy/Python | 4d199a571cfedca51ec6e724e4d8c98e086e984d | [
"Unlicense"
] | null | null | null | """
Пусть экземпляр класса Matrix задаёт систему линейных алгебраических уравнений.
Тогда добавьте в класс метод solve, принимающий вектор-строку свободных членов и возвращающий строку-список,
состоящую из float — решение системы, если оно единственно. Если решений нет или оно не единственно — выдайте
какую-нибудь ... | 34.008197 | 112 | 0.52832 |
from sys import stdin
from copy import deepcopy
class MatrixError(BaseException):
def __init__(self, matrix1, matrix2):
self.matrix1 = matrix1
self.matrix2 = matrix2
class Matrix:
def __init__(self, lists):
self.lists = deepcopy(lists)
def __str__(self):
strRep = ""
... | true | true |
1c0e4211ea3114a1d2827eb00d0fb6b33555879e | 2,347 | py | Python | pygments/styles/inkpot.py | btashton/pygments | ceaad0372055ed0064121020fea032fdda429779 | [
"BSD-2-Clause"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | pygments/styles/inkpot.py | btashton/pygments | ceaad0372055ed0064121020fea032fdda429779 | [
"BSD-2-Clause"
] | 301 | 2020-10-03T10:46:31.000Z | 2022-03-27T23:46:23.000Z | pygments/styles/inkpot.py | btashton/pygments | ceaad0372055ed0064121020fea032fdda429779 | [
"BSD-2-Clause"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | # -*- coding: utf-8 -*-
"""
pygments.styles.inkpot
~~~~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by the Inkpot theme for VIM.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from p... | 34.514706 | 76 | 0.445249 |
from pygments.style import Style
from pygments.token import Text, Other, Keyword, Name, Comment, String, \
Error, Number, Operator, Generic, Whitespace, Punctuation
class InkPotStyle(Style):
background_color = "#1e1e27"
default_style = ""
styles = {
Text: "#cfbfad",
... | true | true |
1c0e437b41196bf1e56e2048e11029725b01da2e | 7,863 | py | Python | sdk/python/tests/test_util.py | rpatil524/arvados | c89213f5a5e303050caaebe4f8fdf2980fc65605 | [
"ECL-2.0",
"Apache-2.0"
] | 81 | 2020-01-03T04:24:14.000Z | 2022-03-25T10:01:45.000Z | sdk/python/tests/test_util.py | rpatil524/arvados | c89213f5a5e303050caaebe4f8fdf2980fc65605 | [
"ECL-2.0",
"Apache-2.0"
] | 42 | 2019-12-10T18:00:06.000Z | 2022-03-07T20:12:46.000Z | sdk/python/tests/test_util.py | rpatil524/arvados | c89213f5a5e303050caaebe4f8fdf2980fc65605 | [
"ECL-2.0",
"Apache-2.0"
] | 31 | 2020-04-13T10:39:26.000Z | 2022-03-05T09:39:53.000Z | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
import os
import subprocess
import unittest
import arvados
import arvados.util
class MkdirDashPTest(unittest.TestCase):
def setUp(self):
try:
os.path.mkdir('./tmp')
except:
pa... | 44.174157 | 168 | 0.46509 |
import os
import subprocess
import unittest
import arvados
import arvados.util
class MkdirDashPTest(unittest.TestCase):
def setUp(self):
try:
os.path.mkdir('./tmp')
except:
pass
def tearDown(self):
try:
os.unlink('./tmp/bar')
os.rmdir('.... | true | true |
1c0e43d816074e0f3657d5f3d6970786d54d7f50 | 3,949 | py | Python | timevortex/tests/tests_daily_report.py | timevortexproject/timevortex | 2bc1a50b255524af8582e6624dee280d64d3c9f3 | [
"MIT"
] | null | null | null | timevortex/tests/tests_daily_report.py | timevortexproject/timevortex | 2bc1a50b255524af8582e6624dee280d64d3c9f3 | [
"MIT"
] | null | null | null | timevortex/tests/tests_daily_report.py | timevortexproject/timevortex | 2bc1a50b255524af8582e6624dee280d64d3c9f3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*-
# pylint: disable=R0904
"""
Test file for FileStorage class.
"""
from datetime import datetime
from django.test import TestCase
from timevortex.utils.filestorage import FILE_STORAGE_SPACE
from timevortex.utils.globals import KEY... | 30.851563 | 112 | 0.637123 |
from datetime import datetime
from django.test import TestCase
from timevortex.utils.filestorage import FILE_STORAGE_SPACE
from timevortex.utils.globals import KEY_ERROR, KEY_SITE_ID, KEY_VARIABLE_ID, KEY_VALUE, KEY_DATE
from timevortex.utils.globals import KEY_DST_TIMEZONE, KEY_NON_DST_TIMEZONE
from timevortex.manag... | true | true |
1c0e43f1725b56fb3b420ee6c26d96884723336c | 1,319 | py | Python | ooobuild/dyn/xml/dom/x_document.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/xml/dom/x_document.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/xml/dom/x_document.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... | 35.648649 | 75 | 0.756634 | from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.xml.dom import XDocument as XDocument
setattr(XDocument, '__ooo_ns__... | true | true |
1c0e44af9ef039741351b4448ba7767b66fa4c86 | 4,540 | py | Python | sky130/custom/scripts/process_params.py | proppy/open_pdks | 22f014dd191f23f92abff4334c34f8544d0287b9 | [
"Apache-2.0"
] | 103 | 2020-07-05T20:02:08.000Z | 2022-03-30T17:21:08.000Z | sky130/custom/scripts/process_params.py | proppy/open_pdks | 22f014dd191f23f92abff4334c34f8544d0287b9 | [
"Apache-2.0"
] | 231 | 2020-07-08T18:43:58.000Z | 2022-03-31T21:42:08.000Z | sky130/custom/scripts/process_params.py | proppy/open_pdks | 22f014dd191f23f92abff4334c34f8544d0287b9 | [
"Apache-2.0"
] | 59 | 2020-07-08T09:45:38.000Z | 2022-03-27T08:50:26.000Z | #!/usr/bin/env python3
#
#--------------------------------------------------------------------
# Parse the SPICE model files from sky130 and use the (commented out)
# statistics block to generate the correct monte carlo expressions
# in the parameters for process variation.
#--------------------------------------------... | 33.382353 | 135 | 0.49185 |
import os
import re
import sys
pr_switch_param = 'MC_PR_SWITCH'
walkpath = 'sky130A/libs.tech/ngspice'
if len(sys.argv) > 1:
walkpath = sys.argv[1]
process_params = []
parmrex = re.compile('^\.param[ \t]+')
prrex = re.compile('^\*[ \t]*process[ \t]+\{')
endrex = re.compile('^\*[ \t]*\}')
filelist = []
for ... | true | true |
1c0e451c6050249d54429528fc1fe9bcabdfd991 | 7,031 | py | Python | tasks/deit/models.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | 3 | 2021-10-31T21:00:36.000Z | 2022-03-03T13:04:16.000Z | tasks/deit/models.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | null | null | null | tasks/deit/models.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | 2 | 2022-02-19T05:25:09.000Z | 2022-03-17T15:41:14.000Z | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
# https://github.com/facebookresearch/deit/blob/cb29b5efd522a0ac83d64aa8b41fe27cead3a030/models.py
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.reg... | 38.845304 | 116 | 0.691082 | import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_tiny_patch16_224', 'deit_small_patch16_224', 'deit_base_patch16_224',
... | true | true |
1c0e469b195fb05ca5766fffaaafb8f5773491c1 | 47,616 | py | Python | tools/accuracy_checker/tests/test_dlsdk_launcher.py | bosques-urbanos/open_model_zoo | c1deee7b0707621c248e6d74b43b1564e94cf001 | [
"Apache-2.0"
] | 1 | 2021-01-05T09:38:41.000Z | 2021-01-05T09:38:41.000Z | tools/accuracy_checker/tests/test_dlsdk_launcher.py | bosques-urbanos/open_model_zoo | c1deee7b0707621c248e6d74b43b1564e94cf001 | [
"Apache-2.0"
] | 1 | 2021-11-15T15:52:24.000Z | 2021-11-15T15:52:24.000Z | tools/accuracy_checker/tests/test_dlsdk_launcher.py | bosques-urbanos/open_model_zoo | c1deee7b0707621c248e6d74b43b1564e94cf001 | [
"Apache-2.0"
] | 1 | 2020-12-11T03:01:50.000Z | 2020-12-11T03:01:50.000Z | """
Copyright (c) 2018-2020 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 to in wri... | 38.153846 | 116 | 0.628864 |
import subprocess
import pytest
pytest.importorskip('accuracy_checker.launcher.dlsdk_launcher')
import os
import cv2
import numpy as np
from pathlib import Path
from unittest.mock import PropertyMock
from accuracy_checker.config import ConfigError
from accuracy_checker.launcher import DLSDKLauncher
from accuracy_ch... | true | true |
1c0e47a28d53980cb81ecdb45fa3887151c4177e | 8,376 | py | Python | nevergrad/benchmark/test_plotting.py | juliendehos/nevergrad | b31a66bdc883e29a6c8572e341b4b56cc4157a9d | [
"MIT"
] | null | null | null | nevergrad/benchmark/test_plotting.py | juliendehos/nevergrad | b31a66bdc883e29a6c8572e341b4b56cc4157a9d | [
"MIT"
] | null | null | null | nevergrad/benchmark/test_plotting.py | juliendehos/nevergrad | b31a66bdc883e29a6c8572e341b4b56cc4157a9d | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import plotting # pylint: disable=wrong-import-position, wrong-import-order
from unittest.mock import patch
from ... | 41.671642 | 105 | 0.648997 |
from . import plotting from unittest.mock import patch
from pathlib import Path
import typing as tp
import pytest
import numpy as np
import pandas as pd
import matplotlib
from nevergrad.common import testing
from . import utils
matplotlib.use("Agg")
def test_get_winners_df() -> None:
data = [["alg0", 46424, 0.... | true | true |
1c0e47ca110120fe4a40a987330d456ea95f9562 | 600 | py | Python | profesionales/migrations/0009_profesional_user.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 6 | 2020-03-16T02:51:16.000Z | 2020-11-10T00:58:01.000Z | profesionales/migrations/0009_profesional_user.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 204 | 2019-09-19T02:00:57.000Z | 2022-02-10T10:48:52.000Z | profesionales/migrations/0009_profesional_user.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 3 | 2019-09-16T22:59:24.000Z | 2022-03-21T22:52:44.000Z | # Generated by Django 2.2.4 on 2019-11-16 15:04
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('profesionales', '0008_au... | 27.272727 | 124 | 0.683333 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('profesionales', '0008_auto_20191111_2348'),
]
operations = [
... | true | true |
1c0e48d28ad7523340a98b6d24515a625ac6b539 | 612 | py | Python | testapp/migrations/0002_test_unique_nullable_part1.py | sparrowt/django-mssql-backend | 5eec3e1926206c3a633897c42e8f6f621e1ee0c5 | [
"BSD-3-Clause"
] | 1 | 2020-07-04T16:08:52.000Z | 2020-07-04T16:08:52.000Z | testapp/migrations/0002_test_unique_nullable_part1.py | sparrowt/django-mssql-backend | 5eec3e1926206c3a633897c42e8f6f621e1ee0c5 | [
"BSD-3-Clause"
] | null | null | null | testapp/migrations/0002_test_unique_nullable_part1.py | sparrowt/django-mssql-backend | 5eec3e1926206c3a633897c42e8f6f621e1ee0c5 | [
"BSD-3-Clause"
] | null | null | null | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testapp', '0001_initial'),
]
operations = [
# Create with a field that is unique *and* nullable so it is implemented with a filtered unique index.
migrations.CreateModel(
... | 30.6 | 114 | 0.611111 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testapp', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='TestUniqueNullableModel',
fields=[
('id', models.AutoField(auto_cre... | true | true |
1c0e48fe3479888e019881cd765ee89251050fce | 1,757 | py | Python | datatracer/column_map/basic.py | HDI-Project/DataTracer | 4bb0906f1716bbcfeb0881cade5d6d47bca90764 | [
"MIT"
] | 15 | 2020-05-27T11:55:05.000Z | 2022-02-08T11:07:54.000Z | datatracer/column_map/basic.py | HDI-Project/DataTracer | 4bb0906f1716bbcfeb0881cade5d6d47bca90764 | [
"MIT"
] | 21 | 2020-06-02T11:56:13.000Z | 2021-07-29T21:50:27.000Z | datatracer/column_map/basic.py | HDI-Project/DataTracer | 4bb0906f1716bbcfeb0881cade5d6d47bca90764 | [
"MIT"
] | 3 | 2021-01-19T17:10:58.000Z | 2021-08-13T20:47:33.000Z | import logging
from sklearn.ensemble import RandomForestRegressor
from datatracer.column_map.base import ColumnMapSolver
from datatracer.column_map.transformer import Transformer
LOGGER = logging.getLogger(__name__)
class BasicColumnMapSolver(ColumnMapSolver):
"""Basic Solver for the data lineage problem of co... | 33.788462 | 79 | 0.6642 | import logging
from sklearn.ensemble import RandomForestRegressor
from datatracer.column_map.base import ColumnMapSolver
from datatracer.column_map.transformer import Transformer
LOGGER = logging.getLogger(__name__)
class BasicColumnMapSolver(ColumnMapSolver):
def __init__(self, *args, **kwargs):
self... | true | true |
1c0e495624d8ed56b1b6f777d82e165afc18d5cc | 1,695 | py | Python | py/py_demo2/gettext.py | st843391622/Learn | ff7b6d5f06dcc687c87cb42776abe08dc211d7d0 | [
"MIT"
] | null | null | null | py/py_demo2/gettext.py | st843391622/Learn | ff7b6d5f06dcc687c87cb42776abe08dc211d7d0 | [
"MIT"
] | null | null | null | py/py_demo2/gettext.py | st843391622/Learn | ff7b6d5f06dcc687c87cb42776abe08dc211d7d0 | [
"MIT"
] | null | null | null | # *-* coding:utf-8 *-*
from __future__ import print_function
import requests
import bs4
from bs4 import BeautifulSoup
import re
global name
global book
def getHtml(url):
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
r.encoding = r.apparent_encoding
... | 22.302632 | 56 | 0.532153 |
from __future__ import print_function
import requests
import bs4
from bs4 import BeautifulSoup
import re
global name
global book
def getHtml(url):
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
r.encoding = r.apparent_encoding
return r.text
exc... | true | true |
1c0e4ac733270ab84fef8571ddc423b09293e5cf | 2,380 | py | Python | bpr.py | Tongzhenguo/bpr-spark | ee2c95bce32e045564384033ce00299c387d1d76 | [
"MIT"
] | 41 | 2016-07-13T09:15:53.000Z | 2021-10-05T10:32:48.000Z | bpr.py | zhouyonglong/Bayesian-Personalized-Ranking-for-Spark | 5ee01ba09b2dc7247052296b6097eb63d52f0dca | [
"MIT"
] | 4 | 2017-01-15T09:28:13.000Z | 2019-09-23T03:20:19.000Z | bpr.py | zhouyonglong/Bayesian-Personalized-Ranking-for-Spark | 5ee01ba09b2dc7247052296b6097eb63d52f0dca | [
"MIT"
] | 28 | 2016-06-21T08:58:33.000Z | 2022-02-24T01:20:08.000Z | import random
from tqdm import tqdm
import numpy as np
def _gradient_single_point(user_id, prod_id, prod_id_neg,
user_mat, prod_mat, lambda_reg, alpha):
x_uij = user_mat[user_id].dot(prod_mat[prod_id]) - \
user_mat[user_id].dot(prod_mat[prod_id_neg])
step_size = np.exp(-x_... | 30.126582 | 78 | 0.62395 | import random
from tqdm import tqdm
import numpy as np
def _gradient_single_point(user_id, prod_id, prod_id_neg,
user_mat, prod_mat, lambda_reg, alpha):
x_uij = user_mat[user_id].dot(prod_mat[prod_id]) - \
user_mat[user_id].dot(prod_mat[prod_id_neg])
step_size = np.exp(-x_... | true | true |
1c0e4b3eb977e190e9372df3d5478fde8ece1076 | 2,120 | py | Python | cv_recommender/account/forms.py | hhhameem/CV-Recommender | b85d53934f0d888835ab8201be388d7d69f0693d | [
"MIT"
] | 1 | 2021-09-14T17:40:17.000Z | 2021-09-14T17:40:17.000Z | cv_recommender/account/forms.py | mjohra/Cv-Recommender-Python-Django | d231092f7bd989b513210dd6031fb23e28bd5dfe | [
"MIT"
] | 1 | 2021-03-31T17:45:15.000Z | 2021-03-31T17:45:15.000Z | cv_recommender/account/forms.py | mjohra/Cv-Recommender-Python-Django | d231092f7bd989b513210dd6031fb23e28bd5dfe | [
"MIT"
] | 1 | 2021-03-31T16:58:50.000Z | 2021-03-31T16:58:50.000Z | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Applicant, Recruiter
Role = (
('applicant', 'Applicant'),
('recruiter', 'Recruiter'),
)
class DateInput(forms.DateInput):
input_type = 'date'
class CreateUser... | 29.444444 | 79 | 0.642925 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Applicant, Recruiter
Role = (
('applicant', 'Applicant'),
('recruiter', 'Recruiter'),
)
class DateInput(forms.DateInput):
input_type = 'date'
class CreateUser... | true | true |
1c0e4b4d83d42654a8eb7f73b137046e69c12d71 | 5,011 | py | Python | src/python/twitter/common/python/installer.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:27.000Z | 2019-12-20T14:13:27.000Z | src/python/twitter/common/python/installer.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | null | null | null | src/python/twitter/common/python/installer.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:29.000Z | 2019-12-20T14:13:29.000Z | from __future__ import print_function
import os
import pkg_resources
import subprocess
import sys
import tempfile
from twitter.common.dirutil import safe_mkdtemp, safe_rmtree
from .tracer import TRACER
from pkg_resources import Distribution, PathMetadata
class Installer(object):
"""
Install an unpacked dist... | 32.121795 | 115 | 0.67272 | from __future__ import print_function
import os
import pkg_resources
import subprocess
import sys
import tempfile
from twitter.common.dirutil import safe_mkdtemp, safe_rmtree
from .tracer import TRACER
from pkg_resources import Distribution, PathMetadata
class Installer(object):
SETUP_BOOTSTRAP = """
if '%(set... | true | true |
1c0e4b780cc263d85eb39d76b6462abab59aef03 | 27,733 | py | Python | luigi/contrib/s3.py | shopetan/luigi | 75d8c52f31feb746bf56e3d11dd3b21e4e550d74 | [
"Apache-2.0"
] | 1 | 2021-05-22T13:35:18.000Z | 2021-05-22T13:35:18.000Z | luigi/contrib/s3.py | shopetan/luigi | 75d8c52f31feb746bf56e3d11dd3b21e4e550d74 | [
"Apache-2.0"
] | null | null | null | luigi/contrib/s3.py | shopetan/luigi | 75d8c52f31feb746bf56e3d11dd3b21e4e550d74 | [
"Apache-2.0"
] | 1 | 2021-04-11T09:48:14.000Z | 2021-04-11T09:48:14.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | 35.64653 | 134 | 0.626113 |
from __future__ import division
import datetime
import io
import itertools
import logging
import os
import os.path
import warnings
from multiprocessing.pool import ThreadPool
try:
from urlparse import urlsplit
except ImportError:
from urllib.parse import urlsplit
try:
from ConfigParser import NoSectionE... | true | true |
1c0e4be70c8909faaddd03e08dd637af559220cd | 17,664 | py | Python | google-cloud-sdk/platform/bq/third_party/yaml/representer.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/platform/bq/third_party/yaml/representer.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/platform/bq/third_party/yaml/representer.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | #!/usr/bin/env python
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_re... | 36.345679 | 91 | 0.621037 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
yaml_representers = {}
yaml_multi_representers = {}
d... | true | true |
1c0e4ccf179e9aa31315e15a2c9acfc1a33fb153 | 4,022 | py | Python | smica/core_smican.py | pierreablin/smica | f56d4fac065f88788a0682e68f0121902601f161 | [
"MIT"
] | 5 | 2019-04-04T13:36:48.000Z | 2021-10-04T22:05:16.000Z | smica/core_smican.py | pierreablin/smica | f56d4fac065f88788a0682e68f0121902601f161 | [
"MIT"
] | null | null | null | smica/core_smican.py | pierreablin/smica | f56d4fac065f88788a0682e68f0121902601f161 | [
"MIT"
] | 5 | 2021-02-28T17:40:23.000Z | 2022-01-10T08:32:20.000Z | import numpy as np
from sklearn.utils import check_random_state
from .core_fitter import CovarianceFitNoise
from .utils import fourier_sampling, itakura
eps = 1e-12
def wiener(A, powers, noise_inv):
'''
The Wiener filter
'''
C = np.linalg.pinv(A.T.dot(noise_inv.dot(A)) +
np.d... | 34.376068 | 77 | 0.524366 | import numpy as np
from sklearn.utils import check_random_state
from .core_fitter import CovarianceFitNoise
from .utils import fourier_sampling, itakura
eps = 1e-12
def wiener(A, powers, noise_inv):
C = np.linalg.pinv(A.T.dot(noise_inv.dot(A)) +
np.diag(1. / (powers + eps)))
return C... | true | true |
1c0e4cf4f5a147142d661f6d96c199db116f4771 | 288 | py | Python | djangoRT/rtModels.py | ChameleonCloud/portal | 92a06fb926dc36e997b94fb8dcd22b7e0d24d3ee | [
"Apache-2.0"
] | 3 | 2015-08-04T20:53:41.000Z | 2020-02-14T22:58:20.000Z | djangoRT/rtModels.py | ChameleonCloud/portal | 92a06fb926dc36e997b94fb8dcd22b7e0d24d3ee | [
"Apache-2.0"
] | 103 | 2015-01-15T14:21:00.000Z | 2022-03-31T19:14:20.000Z | djangoRT/rtModels.py | ChameleonCloud/portal | 92a06fb926dc36e997b94fb8dcd22b7e0d24d3ee | [
"Apache-2.0"
] | 4 | 2016-02-22T16:48:20.000Z | 2021-01-08T17:13:21.000Z | class Ticket:
def __init__(
self, subject="", problem_description="", requestor="", cc="", owner=""
):
self.subject = subject
self.problem_description = problem_description
self.requestor = requestor
self.cc = cc
self.owner = owner
| 28.8 | 79 | 0.597222 | class Ticket:
def __init__(
self, subject="", problem_description="", requestor="", cc="", owner=""
):
self.subject = subject
self.problem_description = problem_description
self.requestor = requestor
self.cc = cc
self.owner = owner
| true | true |
1c0e4dcbd68fb9bc6d2bff3f1600bcaf694ab84a | 7,115 | py | Python | tce/Python-bindings/tools/pygccxml/pyplusplus/utils/__init__.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 74 | 2015-10-22T15:34:10.000Z | 2022-03-25T07:57:23.000Z | tce/Python-bindings/tools/pygccxml/pyplusplus/utils/__init__.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 79 | 2015-11-19T09:23:08.000Z | 2022-01-12T14:15:16.000Z | tce/Python-bindings/tools/pygccxml/pyplusplus/utils/__init__.py | kanishkan/tce | 430e764b4d43f46bd1dc754aeb1d5632fc742110 | [
"MIT"
] | 38 | 2015-11-17T10:12:23.000Z | 2022-03-25T07:57:24.000Z | # Copyright 2004 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
This module is a collection of unrelated algorithms, that works on code creators
tree.
"""
import os
import math
from... | 41.366279 | 110 | 0.562333 |
"""
This module is a collection of unrelated algorithms, that works on code creators
tree.
"""
import os
import math
from pygccxml import declarations
from pyplusplus import code_creators
class missing_call_policies:
@staticmethod
def _selector( creator ):
if not isinstance( creator, co... | false | true |
1c0e4e5b04714c64e8c9dc405cc58c3a89663734 | 3,954 | py | Python | Yatube/settings.py | Kolokol2002/Yatube | a21da14cae159950cfe053b9a66c908db8b9c09a | [
"BSD-3-Clause"
] | null | null | null | Yatube/settings.py | Kolokol2002/Yatube | a21da14cae159950cfe053b9a66c908db8b9c09a | [
"BSD-3-Clause"
] | null | null | null | Yatube/settings.py | Kolokol2002/Yatube | a21da14cae159950cfe053b9a66c908db8b9c09a | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for Yatube project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import os
from... | 24.7125 | 91 | 0.69044 | import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = '$$wi99itv*ox4rg$v9nm@=u5+oypxa=s4=#%ia1x35=)led0m3'
DEBUG = True
ALLOWED_HOSTS = [
"localhost",
"127.0.0.1",
"[::1]",
"testserver",
]
# Application definition
INSTALLED_APPS = (
... | true | true |
1c0e4ead16e855f7eba6a7aa9ccbbee94606622f | 6,883 | py | Python | Boilermake2018/Lib/site-packages/nltk/corpus/reader/categorized_sents.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 69 | 2020-03-31T06:40:17.000Z | 2022-02-25T11:48:18.000Z | Boilermake2018/Lib/site-packages/nltk/corpus/reader/categorized_sents.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 11 | 2019-12-26T17:21:03.000Z | 2022-03-21T22:17:07.000Z | Boilermake2018/Lib/site-packages/nltk/corpus/reader/categorized_sents.py | TejPatel98/voice_your_professional_email | 9cc48f7bcd6576a6962711755e5d5d485832128c | [
"CC0-1.0"
] | 28 | 2020-04-15T15:24:17.000Z | 2021-12-26T04:05:02.000Z | # Natural Language Toolkit: Categorized Sentences Corpus Reader
#
# Copyright (C) 2001-2018 NLTK Project
# Author: Pierpaolo Pantone <24alsecondo@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
CorpusReader structured for corpora that contain one instance on each row.
This CorpusRea... | 38.238889 | 84 | 0.652041 |
from six import string_types
from nltk.corpus.reader.api import *
from nltk.tokenize import *
class CategorizedSentencesCorpusReader(CategorizedCorpusReader, CorpusReader):
CorpusView = StreamBackedCorpusView
def __init__(self, root, fileids, word_tokenizer=WhitespaceTokenizer(),
sent_toke... | true | true |
1c0e4eee1a7161ad2fa097959ec77c18e3870e35 | 921 | py | Python | traits_futures/testing/optional_dependencies.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 10 | 2019-02-08T15:52:18.000Z | 2021-12-14T03:13:41.000Z | traits_futures/testing/optional_dependencies.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 244 | 2019-02-05T17:18:15.000Z | 2022-03-12T10:55:20.000Z | traits_futures/testing/optional_dependencies.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 1 | 2021-07-06T07:18:21.000Z | 2021-07-06T07:18:21.000Z | # (C) Copyright 2018-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 27.088235 | 72 | 0.749186 |
import unittest
try:
from pyface.qt import QtCore
except ImportError:
QtCore = None
requires_qt = unittest.skipIf(QtCore is None, "Qt not available")
try:
import wx
except ImportError:
wx = None
requires_wx = unittest.skipIf(wx is None, "wx not available")
| true | true |
1c0e4fda1e53886322ac36569bdbbf22ec454eb7 | 3,334 | py | Python | ImageCollection/linear_fit.py | OIEIEIO/earthengine-py-notebooks | 5d6c5cdec0c73bf02020ee17d42c9e30d633349f | [
"MIT"
] | 1,008 | 2020-01-27T02:03:18.000Z | 2022-03-24T10:42:14.000Z | ImageCollection/linear_fit.py | rafatieppo/earthengine-py-notebooks | 99fbc4abd1fb6ba41e3d8a55f8911217353a3237 | [
"MIT"
] | 8 | 2020-02-01T20:18:18.000Z | 2021-11-23T01:48:02.000Z | ImageCollection/linear_fit.py | rafatieppo/earthengine-py-notebooks | 99fbc4abd1fb6ba41e3d8a55f8911217353a3237 | [
"MIT"
] | 325 | 2020-01-27T02:03:36.000Z | 2022-03-25T20:33:33.000Z | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/ImageCollection/linear_fit.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_... | 39.223529 | 457 | 0.712058 |
import subprocess
try:
import geemap
except ImportError:
print('Installing geemap ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])
import ee
import geemap
Map = geemap.Map(center=[40,-100], zoom=4)
Map
def createTimeBand(img):
year = img.date().difference(ee.Date('1990-01... | true | true |
1c0e4fdd01a7e59c6bdeb41c022fa3c3f1f30401 | 2,242 | py | Python | gln/data_process/dump_graphs.py | potus28/ML-Project---GLN | 84e81b28fb8ee28ed3695f0148d6f278e82f78c3 | [
"MIT"
] | 81 | 2019-12-12T05:30:58.000Z | 2022-03-26T16:16:08.000Z | gln/data_process/dump_graphs.py | potus28/ML-Project---GLN | 84e81b28fb8ee28ed3695f0148d6f278e82f78c3 | [
"MIT"
] | 15 | 2019-12-28T10:09:15.000Z | 2022-02-14T21:34:58.000Z | gln/data_process/dump_graphs.py | potus28/ML-Project---GLN | 84e81b28fb8ee28ed3695f0148d6f278e82f78c3 | [
"MIT"
] | 23 | 2019-12-31T06:02:05.000Z | 2021-12-08T02:50:27.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import rdkit
from rdkit import Chem
import csv
import sys
import os
from tqdm import tqdm
import pickle as cp
from collections import defaultdict
from gln.common.cmd_args import cmd_args
from... | 37.366667 | 108 | 0.662355 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import numpy as np
import rdkit
from rdkit import Chem
import csv
import sys
import os
from tqdm import tqdm
import pickle as cp
from collections import defaultdict
from gln.common.cmd_args import cmd_args
from... | true | true |
1c0e512441b0b0d1ec7843861d0b354f654a0a82 | 41,243 | py | Python | network/inception_v1_i3d.py | xuyu0010/ARID_v1 | b03d0975f41547e8aa78929b8e26a62248f8e18f | [
"CC-BY-4.0"
] | 5 | 2020-06-24T07:33:36.000Z | 2021-11-30T17:52:08.000Z | network/inception_v1_i3d.py | xuyu0010/ARID_v1 | b03d0975f41547e8aa78929b8e26a62248f8e18f | [
"CC-BY-4.0"
] | 1 | 2022-03-29T05:23:24.000Z | 2022-03-29T06:19:57.000Z | network/inception_v1_i3d.py | xuyu0010/ARID_v1 | b03d0975f41547e8aa78929b8e26a62248f8e18f | [
"CC-BY-4.0"
] | 3 | 2021-02-06T10:56:30.000Z | 2022-01-18T18:50:12.000Z | import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
# from mmcv.cnn import constant_init, kaiming_init
# from mmcv.runner import load_checkpoint
# from ...registry import BACKBONES
# from mmaction.ops.reflection_pad3d import reflection_pad3d
try:
from . import initializer
... | 77.378987 | 167 | 0.769027 | import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
try:
from . import initializer
from .utils import load_state
from .utils import SimpleSpatialTemporalModule, ClsHead
except:
import initializer
from utils import load_state
from utils import SimpleSpa... | true | true |
1c0e5128a73540fe6b5f896b7260f84313033342 | 159 | py | Python | section-05-production-model-package/Z_sandbox_pytest/test_my_module.py | aogbechie/deploying-machine-learning-models | 717728e1c23ab80b4ac1ee489051f82db803c210 | [
"BSD-3-Clause"
] | null | null | null | section-05-production-model-package/Z_sandbox_pytest/test_my_module.py | aogbechie/deploying-machine-learning-models | 717728e1c23ab80b4ac1ee489051f82db803c210 | [
"BSD-3-Clause"
] | null | null | null | section-05-production-model-package/Z_sandbox_pytest/test_my_module.py | aogbechie/deploying-machine-learning-models | 717728e1c23ab80b4ac1ee489051f82db803c210 | [
"BSD-3-Clause"
] | null | null | null | from my_module import square
def test_square_gives_correct_value(input_value):
#When
subject = square(input_value)
#Then
assert subject == 16 | 19.875 | 49 | 0.735849 | from my_module import square
def test_square_gives_correct_value(input_value):
subject = square(input_value)
assert subject == 16 | true | true |
1c0e51b2a08449b1fc63e9ea170778af8815d381 | 1,594 | py | Python | misc/irqUART/irqUART.py | garymeg/mpy-lib | 0fb6e4529afe098a13a1cffa85fb03778ffb13e3 | [
"MIT"
] | 116 | 2018-07-16T14:48:44.000Z | 2022-03-16T15:24:54.000Z | misc/irqUART/irqUART.py | garymeg/mpy-lib | 0fb6e4529afe098a13a1cffa85fb03778ffb13e3 | [
"MIT"
] | 8 | 2018-07-11T14:00:30.000Z | 2022-01-20T01:30:09.000Z | misc/irqUART/irqUART.py | garymeg/mpy-lib | 0fb6e4529afe098a13a1cffa85fb03778ffb13e3 | [
"MIT"
] | 66 | 2018-07-11T08:50:00.000Z | 2022-03-28T15:36:00.000Z | '''
UART with rx irq
Author: shaoziyang
Date: 2020.6
http://www.micropython.org.cn
'''
from machine import Pin, UART, Timer
import sys
class irqUART():
# uart: uart object
# rx_pin: uart rxd pin
# rx_irq: user rxd irq
# frame_irq: user frame irq
# CHR_TMO: rxd irq delay (ms) aft... | 31.88 | 107 | 0.595358 | from machine import Pin, UART, Timer
import sys
class irqUART():
def __init__(self, uart, rx_pin, rx_irq=None, frame_irq=None, CHR_TMO=3, FRAME_TMO=100):
self._rxpin = rx_pin
self._rxirq = rx_irq
self._frameirq = frame_irq
self._CHR_TMO = CHR_TMO
self... | true | true |
1c0e5371f4c756c03d768151ee7e934875e9bdd7 | 8,663 | py | Python | pix3d_data_gen.py | DreamBlack/APCNet | d76bc9e46c3b631035c5c67e2367b6fb80621333 | [
"MIT"
] | null | null | null | pix3d_data_gen.py | DreamBlack/APCNet | d76bc9e46c3b631035c5c67e2367b6fb80621333 | [
"MIT"
] | null | null | null | pix3d_data_gen.py | DreamBlack/APCNet | d76bc9e46c3b631035c5c67e2367b6fb80621333 | [
"MIT"
] | null | null | null | import torch.utils.data as data
import os
import os.path
import torch
import numpy as np
import cv2
import json
from DatasetGeneration import dividePointCloud
import matplotlib
data_dir_imgs = '/home/dream/study/codes/PCCompletion/datasets/pix3d/pix3d'
data_out_father='/home/dream/study/codes/PCCompletion/datasets/my_... | 44.654639 | 160 | 0.630498 | import torch.utils.data as data
import os
import os.path
import torch
import numpy as np
import cv2
import json
from DatasetGeneration import dividePointCloud
import matplotlib
data_dir_imgs = '/home/dream/study/codes/PCCompletion/datasets/pix3d/pix3d'
data_out_father='/home/dream/study/codes/PCCompletion/datasets/my_... | true | true |
1c0e544e62589110ec9f0add5965bcc80f707fa4 | 5,291 | py | Python | main.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | null | null | null | main.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | null | null | null | main.py | nirzari18/Query-Analysis-Application-on-Google-App-Engine | 0b767c27b2ec173ce2fe2cbb39cbf71115eb4aba | [
"Apache-2.0"
] | null | null | null | #NAME: NIRZARI IYER
#Assignment-2
#ID NUMBER: 1001117633
#BATCH TIME- 6:00 to 8:00 p.m.
import MySQLdb
import io
import os
import cloudstorage as gcs
import csv
import timeit
from bottle import Bottle
from google.appengine.api import app_identity
from StringIO import StringIO
from bottle import route, request, response... | 35.75 | 137 | 0.596485 | import MySQLdb
import io
import os
import cloudstorage as gcs
import csv
import timeit
from bottle import Bottle
from google.appengine.api import app_identity
from StringIO import StringIO
from bottle import route, request, response, template
bottle = Bottle()
bucket_name = os.environ.get('BUCKET_NAME', app_identity.... | false | true |
1c0e5475bf897feee023719d5fea89fae8879854 | 615 | py | Python | thingity/ag.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | thingity/ag.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | thingity/ag.py | ianhomer/thingity | 7be534f0776799326acc0aae39d92813af61fb39 | [
"MIT"
] | null | null | null | from . import Environment
class Ag:
def __init__(self, environment: Environment, justArchive=False, withArchive=False):
self.path = environment.directory
self.archiveParts = self.createArchiveParts(justArchive, withArchive)
def createArchiveParts(self, justArchive, withArchive):
if ju... | 32.368421 | 87 | 0.637398 | from . import Environment
class Ag:
def __init__(self, environment: Environment, justArchive=False, withArchive=False):
self.path = environment.directory
self.archiveParts = self.createArchiveParts(justArchive, withArchive)
def createArchiveParts(self, justArchive, withArchive):
if ju... | true | true |
1c0e54a88842f474988c5f5f1fdb070f7289b407 | 26,627 | py | Python | stable_baselines3/common/distributions.py | Armandpl/stable-baselines3 | 7e60090b23494ced5175a2225fbf2c1905b80403 | [
"MIT"
] | 1 | 2022-02-11T16:10:48.000Z | 2022-02-11T16:10:48.000Z | stable_baselines3/common/distributions.py | lamdacloud/stable-baselines3 | 59bec3018058300f8892cc12593fcd1bd164ef48 | [
"MIT"
] | null | null | null | stable_baselines3/common/distributions.py | lamdacloud/stable-baselines3 | 59bec3018058300f8892cc12593fcd1bd164ef48 | [
"MIT"
] | null | null | null | """Probability distributions."""
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union
import gym
import torch as th
from gym import spaces
from torch import nn
from torch.distributions import Bernoulli, Categorical, Normal
from stable_baselines3.common.preprocessing import g... | 38.038571 | 124 | 0.669095 |
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional, Tuple, Union
import gym
import torch as th
from gym import spaces
from torch import nn
from torch.distributions import Bernoulli, Categorical, Normal
from stable_baselines3.common.preprocessing import get_action_dim
class Distributio... | true | true |
1c0e5558e157ad436236f03820123482346fb46e | 11,311 | py | Python | appmetrics/histogram.py | avalente/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 60 | 2015-01-19T05:32:32.000Z | 2021-06-08T07:35:02.000Z | appmetrics/histogram.py | alexKeleon/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 6 | 2015-03-02T19:25:02.000Z | 2021-03-27T17:26:07.000Z | appmetrics/histogram.py | alexKeleon/appmetrics | 366fc7e1ca897e49a2227cbfa43bfa02a47f1acc | [
"Apache-2.0"
] | 12 | 2015-01-19T05:04:14.000Z | 2020-09-08T07:49:54.000Z | ## Module histogram.py
##
## Copyright (c) 2014 Antonio Valente <y3sman@gmail.com>
##
## 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
#... | 29.152062 | 80 | 0.605075 |
import collections
import random
import threading
import abc
import time
import operator
import math
from . import statistics, exceptions, py3comp
DEFAULT_UNIFORM_RESERVOIR_SIZE = 1028
DEFAULT_TIME_WINDOW_SIZE = 60
DEFAULT_EXPONENTIAL_DECAY_FACTOR = 0.015
def search_greater(values, target):
first = 0
last... | true | true |
1c0e55a2939cf20ffdf465962c545bb725b0e809 | 4,482 | py | Python | RFEM/BasicObjects/frame.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 16 | 2021-10-13T21:00:11.000Z | 2022-03-21T11:12:09.000Z | RFEM/BasicObjects/frame.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 49 | 2021-10-19T13:18:51.000Z | 2022-03-30T08:20:17.000Z | RFEM/BasicObjects/frame.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 7 | 2021-10-13T06:06:24.000Z | 2022-03-29T17:48:39.000Z | # from RFEM.initModel import Model, clearAtributes, ConvertToDlString
# class Frame():
# def __init__(self,
# number_of_frames: int = 1,
# span_l: int = 2,
# height_h: int = 1,
# column_cross_section: 1,
# column_member_type = Mem... | 36.145161 | 115 | 0.504016 |
# Args:
# number_of_frames (int): Number of Frames
# span_l (int): Span Length
# height_h (int): Frame Height
# column_cross_section (int): Tag of Column Section
# column_member_type (enum): Column Member Type Enumeration
# girder_cross_section ... | true | true |
1c0e5651329827acbd0ac143267731f8aaba02a1 | 15,504 | py | Python | venv/Lib/site-packages/gensim/interfaces.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/gensim/interfaces.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/gensim/interfaces.py | arnoyu-hub/COMP0016miemie | 59af664dcf190eab4f93cefb8471908717415fea | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Basic interfaces used across the whole Gensim package.
These interfaces are used for building corpora, model transformation ... | 38.857143 | 120 | 0.612552 |
import logging
from gensim import utils, matutils
logger = logging.getLogger(__name__)
class CorpusABC(utils.SaveLoad):
def __iter__(self):
raise NotImplementedError('cannot instantiate abstract base class')
def save(self, *args, **kwargs):
import warnings
warning... | true | true |
1c0e5666fbdcfa5242a284189a0617933f0c7e09 | 7,505 | py | Python | cirq-core/cirq/testing/consistent_protocols.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/testing/consistent_protocols.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/testing/consistent_protocols.py | augustehirth/Cirq | e616710a0fa243524a9f6d7bc0d35e6b952fe3d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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 ... | 39.088542 | 100 | 0.73551 |
import itertools
from typing import Any, Dict, Optional, Sequence, Type, Union
import numpy as np
import sympy
from cirq import ops, protocols, value
from cirq.testing.consistent_act_on import assert_all_implemented_act_on_effects_match_unitary
from cirq.testing.circuit_compare import (
assert_has_consistent_app... | true | true |
1c0e56af828951923994493612f3121540489c44 | 1,993 | py | Python | phypi/motion/projectile.py | manas1316am/phypi | 5190c422d44133f5475bc7137dd5003d0ad56f2b | [
"MIT"
] | null | null | null | phypi/motion/projectile.py | manas1316am/phypi | 5190c422d44133f5475bc7137dd5003d0ad56f2b | [
"MIT"
] | null | null | null | phypi/motion/projectile.py | manas1316am/phypi | 5190c422d44133f5475bc7137dd5003d0ad56f2b | [
"MIT"
] | null | null | null | ################ Projectile Motion ####################
import math
import phypi.constant
def xdisplace(u: int, t: int, angle: int):
'''
[+] Calculate x displacement with initial velocity, time and throwing angle.
>> from phypi.motion import projectile
>> print(projectile.xdisplace(10, 5... | 32.672131 | 99 | 0.58856 |
import math
import phypi.constant
def xdisplace(u: int, t: int, angle: int):
return u*t*math.cos(angle)
def ydisplace(u: int, t: int, angle: int, g: int = phypi.constant.g):
return (u*t*(math.sin(angle))) - (0.5*g*(t**2))
def ydisplace_x(u: int, x: int, angle: int, g: int = phypi.constant.g):
return ... | true | true |
1c0e57b11f72f86ae7ab21b01d1340c445090373 | 1,218 | py | Python | server.py | MoistSenpai/Ne-PI.py | dc90c42a9ad0a198d755bc134b1227966c678395 | [
"MIT"
] | null | null | null | server.py | MoistSenpai/Ne-PI.py | dc90c42a9ad0a198d755bc134b1227966c678395 | [
"MIT"
] | null | null | null | server.py | MoistSenpai/Ne-PI.py | dc90c42a9ad0a198d755bc134b1227966c678395 | [
"MIT"
] | null | null | null | # Imports
import os
from importlib import import_module
from dotenv import load_dotenv
from flask import Flask
from flask_pymongo import PyMongo
from termcolor import colored
load_dotenv()
# Automaticly register blueprints from Routes dir
def register_bps(routes):
# Get all routes
for folder, module, prefix ... | 22.981132 | 105 | 0.669951 | import os
from importlib import import_module
from dotenv import load_dotenv
from flask import Flask
from flask_pymongo import PyMongo
from termcolor import colored
load_dotenv()
def register_bps(routes):
for folder, module, prefix in routes:
mod = import_module(folder)
if hasattr(mo... | true | true |
1c0e57d2db298a8a7026857db1968cf8cfa2cd2f | 962 | py | Python | var/spack/repos/builtin/packages/scorec-core/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/scorec-core/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/scorec-core/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class ScorecCore(CMakePackage):
"""The SCOREC Core is a set of C/C++ libraries for unstructured ... | 29.151515 | 75 | 0.656965 |
from spack import *
class ScorecCore(CMakePackage):
homepage = 'https://www.scorec.rpi.edu/'
git = 'https://github.com/SCOREC/core.git'
version('develop')
depends_on('mpi')
depends_on('zoltan')
depends_on('cmake@3.0:', type='build')
def cmake_args(self):
options = []
... | true | true |
1c0e5965f85763543ea1030af018bf7902e4089c | 6,370 | py | Python | colorscheme_builder.py | PrajvalRaval/PlainNotes | 219fce4e19f68f96ce8b21298d89b7884d409d48 | [
"MIT"
] | 300 | 2015-01-02T21:03:17.000Z | 2022-02-07T01:50:34.000Z | colorscheme_builder.py | PrajvalRaval/PlainNotes | 219fce4e19f68f96ce8b21298d89b7884d409d48 | [
"MIT"
] | 54 | 2015-01-12T09:19:10.000Z | 2021-07-06T07:59:27.000Z | colorscheme_builder.py | PrajvalRaval/PlainNotes | 219fce4e19f68f96ce8b21298d89b7884d409d48 | [
"MIT"
] | 95 | 2015-01-24T06:16:10.000Z | 2022-03-24T19:18:17.000Z | import sublime
import plistlib
import re
# TODO:
# whitest
# blackest
WHEEL = {
'red': 0,
'orange': 30,
'yellow': 60,
'lime': 90,
'green': 120,
'teal': 150,
'cyan': 180,
'lightblue': 210,
'blue': 240,
'purple': 270,
'magenta': 300,
... | 29.490741 | 95 | 0.456044 | import sublime
import plistlib
import re
WHEEL = {
'red': 0,
'orange': 30,
'yellow': 60,
'lime': 90,
'green': 120,
'teal': 150,
'cyan': 180,
'lightblue': 210,
'blue': 240,
'purple': 270,
'magenta': 300,
'pink': 330,
}
MARGIN... | true | true |
1c0e5a998eae9ae5ed73748c8c0f92143fd27c53 | 8,552 | py | Python | tests/test_responses.py | caulagi/starlette | 678589b2de9c2e5bad5253a30322ea33864898aa | [
"BSD-3-Clause"
] | 2 | 2019-03-15T02:44:45.000Z | 2019-04-29T04:25:17.000Z | tests/test_responses.py | caulagi/starlette | 678589b2de9c2e5bad5253a30322ea33864898aa | [
"BSD-3-Clause"
] | null | null | null | tests/test_responses.py | caulagi/starlette | 678589b2de9c2e5bad5253a30322ea33864898aa | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import os
import pytest
from starlette import status
from starlette.background import BackgroundTask
from starlette.requests import Request
from starlette.responses import (
FileResponse,
RedirectResponse,
Response,
StreamingResponse,
TemplateResponse,
UJSONResponse,
)
from star... | 28.224422 | 87 | 0.608746 | import asyncio
import os
import pytest
from starlette import status
from starlette.background import BackgroundTask
from starlette.requests import Request
from starlette.responses import (
FileResponse,
RedirectResponse,
Response,
StreamingResponse,
TemplateResponse,
UJSONResponse,
)
from star... | true | true |
1c0e5b68fcbda04892ec7197a13510fc85e3f861 | 1,454 | py | Python | src/memote/suite/results/__init__.py | carrascomj/memote | 81a55a163262a0e06bfcb036d98e8e551edc3873 | [
"Apache-2.0"
] | 85 | 2017-10-17T14:14:52.000Z | 2022-03-14T19:33:02.000Z | src/memote/suite/results/__init__.py | carrascomj/memote | 81a55a163262a0e06bfcb036d98e8e551edc3873 | [
"Apache-2.0"
] | 609 | 2017-08-09T15:30:06.000Z | 2022-03-28T12:17:32.000Z | src/memote/suite/results/__init__.py | carrascomj/memote | 81a55a163262a0e06bfcb036d98e8e551edc3873 | [
"Apache-2.0"
] | 22 | 2017-09-27T08:47:17.000Z | 2022-02-15T11:23:13.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | 39.297297 | 74 | 0.774415 |
from __future__ import absolute_import
from memote.suite.results.result import *
from memote.suite.results.result_manager import *
from memote.suite.results.repo_result_manager import *
from memote.suite.results.sql_result_manager import *
from memote.suite.results.history_manager import *
| true | true |
1c0e5c4674b6ed82ab17ca6071b4c1b6fb7a59d2 | 537 | py | Python | dev/thesis_initialise.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | null | null | null | dev/thesis_initialise.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | null | null | null | dev/thesis_initialise.py | rsbyrne/thesis | 44689b1d06c5b08fd44054313d7a6148b0e44a24 | [
"MIT"
] | 1 | 2021-06-10T14:35:54.000Z | 2021-06-10T14:35:54.000Z | import sys, os
workDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
resourcesDir = os.path.join(workDir, 'resources')
dataDir = os.path.join(workDir, 'data')
if not resourcesDir in sys.path:
sys.path.insert(0, resourcesDir)
everestDir = os.path.join(resourcesDir, 'everest')
if not everestDir in ... | 21.48 | 69 | 0.72067 | import sys, os
workDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
resourcesDir = os.path.join(workDir, 'resources')
dataDir = os.path.join(workDir, 'data')
if not resourcesDir in sys.path:
sys.path.insert(0, resourcesDir)
everestDir = os.path.join(resourcesDir, 'everest')
if not everestDir in ... | true | true |
1c0e5d67a1051a1b3a81c6e1681fbb31af08021f | 4,236 | py | Python | twilio/rest/events/v1/sink/sink_test.py | timgates42/twilio-python | ef29d03a4857b62b616df4a8f4f2b7c294afbb99 | [
"MIT"
] | 1 | 2021-01-07T11:41:11.000Z | 2021-01-07T11:41:11.000Z | venv/Lib/site-packages/twilio/rest/events/v1/sink/sink_test.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | null | null | null | venv/Lib/site-packages/twilio/rest/events/v1/sink/sink_test.py | syt1209/PythonProjects | 0409dbd3c0b0ddf00debc38875059c828eb31dec | [
"MIT"
] | 4 | 2021-03-25T09:00:08.000Z | 2021-08-05T06:54:23.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class SinkTestList(Lis... | 31.147059 | 84 | 0.651086 |
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class SinkTestList(ListResource):
def __init__(self, version, sid):
super(SinkTestList, self).__init__(version)
... | true | true |
1c0e5e502ea291b0ac912fd401d34e3b8dbe32b4 | 3,095 | py | Python | venv/lib/python3.7/site-packages/supervisor/socket_manager.py | basemanbase/Animal-Health | d9741aafd54126f05ba43e6f4ad6517755797c76 | [
"MIT"
] | 2 | 2019-12-04T16:24:44.000Z | 2020-04-06T21:49:34.000Z | venv/lib/python3.7/site-packages/supervisor/socket_manager.py | basemanbase/Animal-Health | d9741aafd54126f05ba43e6f4ad6517755797c76 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/supervisor/socket_manager.py | basemanbase/Animal-Health | d9741aafd54126f05ba43e6f4ad6517755797c76 | [
"MIT"
] | null | null | null | import socket
class Proxy:
""" Class for wrapping a shared resource object and getting
notified when it's deleted
"""
def __init__(self, object, **kwargs):
self.object = object
self.on_delete = kwargs.get('on_delete', None)
def __del__(self):
if self.on_delete:
... | 30.048544 | 77 | 0.60517 | import socket
class Proxy:
def __init__(self, object, **kwargs):
self.object = object
self.on_delete = kwargs.get('on_delete', None)
def __del__(self):
if self.on_delete:
self.on_delete()
def __getattr__(self, name):
return getattr(self.object, name)
def ... | true | true |
1c0e5edcc6f106a70fe532f67bb3517755f2f828 | 3,886 | py | Python | tods/tests/test_PyodCOF.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | 1 | 2020-11-29T05:50:02.000Z | 2020-11-29T05:50:02.000Z | tods/tests/test_PyodCOF.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | null | null | null | tods/tests/test_PyodCOF.py | ZhuangweiKang/tods | fe3f55f8ccb306dd292c668e0f1154f1afdfa556 | [
"Apache-2.0"
] | 1 | 2021-03-26T03:03:28.000Z | 2021-03-26T03:03:28.000Z | import unittest
from d3m import container, utils
from d3m.metadata import base as metadata_base
from tods.detection_algorithm.PyodCOF import PyodCOF
import utils as test_utils
import pandas as pd
class ABODTest(unittest.TestCase):
def test_basic(self):
self.maxDiff = None
main = container.DataFram... | 36.660377 | 103 | 0.510808 | import unittest
from d3m import container, utils
from d3m.metadata import base as metadata_base
from tods.detection_algorithm.PyodCOF import PyodCOF
import utils as test_utils
import pandas as pd
class ABODTest(unittest.TestCase):
def test_basic(self):
self.maxDiff = None
main = container.DataFram... | true | true |
1c0e5ef49c99ee737e8c69dee323f689b0c842d4 | 307 | bzl | Python | markdown/repositories.bzl | dwtj/me_dwtj_rules_markdown | f65f338a9e7ed15fe7b2630c7e1cbf47e81a2837 | [
"MIT"
] | null | null | null | markdown/repositories.bzl | dwtj/me_dwtj_rules_markdown | f65f338a9e7ed15fe7b2630c7e1cbf47e81a2837 | [
"MIT"
] | null | null | null | markdown/repositories.bzl | dwtj/me_dwtj_rules_markdown | f65f338a9e7ed15fe7b2630c7e1cbf47e81a2837 | [
"MIT"
] | null | null | null | '''This file exports public repository rule definitions for use by clients.
'''
load('//markdown:private/repository_rules/markdownlint/local_markdownlint_repository/defs.bzl', _local_markdownlint_repository = 'local_markdownlint_repository')
local_markdownlint_repository = _local_markdownlint_repository
| 43.857143 | 161 | 0.85342 |
load('//markdown:private/repository_rules/markdownlint/local_markdownlint_repository/defs.bzl', _local_markdownlint_repository = 'local_markdownlint_repository')
local_markdownlint_repository = _local_markdownlint_repository
| true | true |
1c0e5f06e762a97f4a0dd854a264ad8b271cac4a | 127 | py | Python | packages/PIPS/validation/Effects/star_adress_of.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Effects/star_adress_of.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Effects/star_adress_of.py | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | from validation import vworkspace
with vworkspace() as w:
w.all_functions.display(activate="print_code_proper_effects")
| 18.142857 | 65 | 0.795276 | from validation import vworkspace
with vworkspace() as w:
w.all_functions.display(activate="print_code_proper_effects")
| true | true |
1c0e60763be277007bed201df346027fca440b57 | 1,580 | py | Python | dice/forms.py | brmedeiros/dicey9000web | 6f57e5eea35226bf7c32bc2c024abbf0195538de | [
"MIT"
] | 1 | 2019-03-20T03:48:18.000Z | 2019-03-20T03:48:18.000Z | dice/forms.py | brmedeiros/dicey9000web | 6f57e5eea35226bf7c32bc2c024abbf0195538de | [
"MIT"
] | null | null | null | dice/forms.py | brmedeiros/dicey9000web | 6f57e5eea35226bf7c32bc2c024abbf0195538de | [
"MIT"
] | null | null | null | from django import forms
from django.core.exceptions import ValidationError
class HomeDiceRollForm(forms.Form):
number_of_dice = forms.IntegerField(min_value=1, max_value=100, label='Number of Dice')
dice_type = forms.IntegerField(min_value=1, label='Dice Type')
roll_modifier = forms.IntegerField(requ... | 40.512821 | 105 | 0.670886 | from django import forms
from django.core.exceptions import ValidationError
class HomeDiceRollForm(forms.Form):
number_of_dice = forms.IntegerField(min_value=1, max_value=100, label='Number of Dice')
dice_type = forms.IntegerField(min_value=1, label='Dice Type')
roll_modifier = forms.IntegerField(requ... | true | true |
1c0e617f50ece7627ea4d959ba07a011838ffb69 | 30,888 | py | Python | sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.374233 | 198 | 0.660839 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
1c0e618ca28bff507ec470a021b61af1226add35 | 8,312 | py | Python | examples/microjson/mutants/original.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 90 | 2015-04-07T10:26:53.000Z | 2022-03-07T15:14:57.000Z | examples/microjson/mutants/original.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 14 | 2015-10-13T16:25:59.000Z | 2021-01-21T18:31:03.000Z | examples/microjson/mutants/original.py | Anirban166/tstl | 73dac02f084b10e1bf2f172a5d1306bb5fbd7f7e | [
"Apache-2.0"
] | 32 | 2015-04-07T10:41:29.000Z | 2022-02-26T05:17:28.000Z | import math
import StringIO
import types
__pychecker__ = 'no-returnvalues'
WS = set([' ', '\t', '\r', '\n', '\x08', '\x0c'])
DIGITS = set([str(i) for i in range(0, 10)])
NUMSTART = DIGITS.union(['.', '-', '+'])
NUMCHARS = NUMSTART.union(['e', 'E'])
ESC_MAP = {'n': '\n', 't': '\t', 'r': '\r', 'b': '\x08', 'f': '\x0c'}
R... | 27.892617 | 178 | 0.526468 | import math
import StringIO
import types
__pychecker__ = 'no-returnvalues'
WS = set([' ', '\t', '\r', '\n', '\x08', '\x0c'])
DIGITS = set([str(i) for i in range(0, 10)])
NUMSTART = DIGITS.union(['.', '-', '+'])
NUMCHARS = NUMSTART.union(['e', 'E'])
ESC_MAP = {'n': '\n', 't': '\t', 'r': '\r', 'b': '\x08', 'f': '\x0c'}
R... | true | true |
1c0e623ae0474cb9f6dc4ca8ade7f61f33481776 | 3,807 | py | Python | test/functional/wallet_encryption.py | INFAQCOIN/INFAQ | 487de82c26135eb8ac93c9393e7fdb29bbc2822c | [
"MIT"
] | 1 | 2022-01-18T14:48:23.000Z | 2022-01-18T14:48:23.000Z | test/functional/wallet_encryption.py | martin-braun/INFAQ | fca6db067b8079fbedf4e9160180424c95470fed | [
"MIT"
] | null | null | null | test/functional/wallet_encryption.py | martin-braun/INFAQ | fca6db067b8079fbedf4e9160180424c95470fed | [
"MIT"
] | 1 | 2022-01-18T14:48:28.000Z | 2022-01-18T14:48:28.000Z | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Wallet encryption"""
import time
from test_framework.test_framework import infaqcoinTestFramewor... | 43.758621 | 138 | 0.70528 |
import time
from test_framework.test_framework import infaqcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
assert_greater_than,
assert_greater_than_or_equal,
)
class WalletEncryptionTest(infaqcoinTestFramework):
def set_test_params(self):
self.se... | true | true |
1c0e626b751bece4d8290b3af28aca041d588912 | 425 | py | Python | Parciales/Parcial1/configurador.py | eliecer11/Uip-prog3 | 39117b230d83945f5fd3ec8450d1d954437b0ccd | [
"MIT"
] | null | null | null | Parciales/Parcial1/configurador.py | eliecer11/Uip-prog3 | 39117b230d83945f5fd3ec8450d1d954437b0ccd | [
"MIT"
] | null | null | null | Parciales/Parcial1/configurador.py | eliecer11/Uip-prog3 | 39117b230d83945f5fd3ec8450d1d954437b0ccd | [
"MIT"
] | null | null | null | def Guardar_datos(datos):
#abrimos un archivos que sera usado para guardar los clientes que ingrese
archivo = open("Sistema_de_Ingreso.txt", "a")
archivo.write("CLIENTE".center(45, "-") )
archivo.write("\n")
#vamos recorriendo los datos de la lista y lo vamos agrgando al archivo
for x in datos:
archivo.write(... | 32.692308 | 74 | 0.715294 | def Guardar_datos(datos):
archivo = open("Sistema_de_Ingreso.txt", "a")
archivo.write("CLIENTE".center(45, "-") )
archivo.write("\n")
for x in datos:
archivo.write(x)
archivo.write(",")
archivo.write("\n")
archivo.close()
print ("Datos Guardaos Exitosamente")
| true | true |
1c0e62ca95bef3fc331a87ebf7703fb9803ad8d0 | 544 | py | Python | download_data/lambda_start_download_data_ec2.py | rafgonsi/air-pollution | 406a1ede0989eb8849af40eb782a23a593ccd26a | [
"MIT"
] | null | null | null | download_data/lambda_start_download_data_ec2.py | rafgonsi/air-pollution | 406a1ede0989eb8849af40eb782a23a593ccd26a | [
"MIT"
] | null | null | null | download_data/lambda_start_download_data_ec2.py | rafgonsi/air-pollution | 406a1ede0989eb8849af40eb782a23a593ccd26a | [
"MIT"
] | null | null | null | import json
import boto3
import os
INSTANCE_ID = os.environ['INSTANCE_ID'] # from aws environment variables
def lambda_handler(event, context):
client = boto3.client('ec2', region_name='eu-central-1')
response = client.start_instances(InstanceIds=[INSTANCE_ID])
status_code = response['Re... | 28.631579 | 76 | 0.667279 | import json
import boto3
import os
INSTANCE_ID = os.environ['INSTANCE_ID']
def lambda_handler(event, context):
client = boto3.client('ec2', region_name='eu-central-1')
response = client.start_instances(InstanceIds=[INSTANCE_ID])
status_code = response['ResponseMetadata']['HTTPStatusCode']... | true | true |
1c0e635dcf1424358797736c69c9ab9c8ff20705 | 2,307 | py | Python | molopt/optimize.py | ksh981214/icml18-jtnn | 701c363e24e38a47fc0c4509565fb021b5ba91c6 | [
"MIT"
] | null | null | null | molopt/optimize.py | ksh981214/icml18-jtnn | 701c363e24e38a47fc0c4509565fb021b5ba91c6 | [
"MIT"
] | null | null | null | molopt/optimize.py | ksh981214/icml18-jtnn | 701c363e24e38a47fc0c4509565fb021b5ba91c6 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
import math, random, sys
from optparse import OptionParser
from collections import deque
import rdkit
import rdkit.Chem as Chem
from rdkit.Chem import Descriptors
import sascorer
from jtnn import *
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit... | 33.926471 | 85 | 0.687906 | import torch
import torch.nn as nn
from torch.autograd import Variable
import math, random, sys
from optparse import OptionParser
from collections import deque
import rdkit
import rdkit.Chem as Chem
from rdkit.Chem import Descriptors
import sascorer
from jtnn import *
lg = rdkit.RDLogger.logger()
lg.setLevel(rdkit... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.