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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7706048f619ad0461137d7b9323e0e8bd82c533 | 3,328 | py | Python | python/paddle_edl/collective/executor.py | gongweibao/edl | 0a8ddcf8daafc4e621fa5d98f3785f6bc9fa57c9 | [
"Apache-2.0"
] | null | null | null | python/paddle_edl/collective/executor.py | gongweibao/edl | 0a8ddcf8daafc4e621fa5d98f3785f6bc9fa57c9 | [
"Apache-2.0"
] | null | null | null | python/paddle_edl/collective/executor.py | gongweibao/edl | 0a8ddcf8daafc4e621fa5d98f3785f6bc9fa57c9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.616162 | 99 | 0.609075 |
import paddle
import paddle.fluid.executor.Executor as PaddleExecutor
from six.moves.queue import Queue
from meta_reader import MetaReader
class Executor(PaddleExecutor):
def __init__(self, place):
func = PaddleExecutor.__init__
assert func.__code__.co_varnames == ('self', 'place'), \
... | true | true |
f77061330b77cb3841ab19c5efa6a28127c9c104 | 1,478 | py | Python | promoterz/locale.py | caux/japonicus | 3a9f000f1ff1eb01fa569b531ebf682dd73db90d | [
"MIT"
] | null | null | null | promoterz/locale.py | caux/japonicus | 3a9f000f1ff1eb01fa569b531ebf682dd73db90d | [
"MIT"
] | null | null | null | promoterz/locale.py | caux/japonicus | 3a9f000f1ff1eb01fa569b531ebf682dd73db90d | [
"MIT"
] | null | null | null | #!/bin/python
from deap import tools
from deap import base
import promoterz
import statistics
class Locale():
def __init__(self, World, name, position, loop):
self.World = World
self.name = name
self.EPOCH = 0
self.position = position
self.EvolutionStatistics = []
... | 35.190476 | 84 | 0.660352 | from deap import tools
from deap import base
import promoterz
import statistics
class Locale():
def __init__(self, World, name, position, loop):
self.World = World
self.name = name
self.EPOCH = 0
self.position = position
self.EvolutionStatistics = []
self.HallOfFam... | true | true |
f7706159a0d10ee10392f42931f3f2884a24338b | 20,648 | py | Python | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_06_01_preview/aio/operations/_certificates_operations.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 46.295964 | 218 | 0.670331 | from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineRes... | true | true |
f770617df381cfb22b7f2a8536547a078f0bafeb | 1,853 | py | Python | packages/tencent-cloud-sdk-auth/tests/cloud/auth/credentials.py | nobody-night/tencent-cloud-sdk-python | 4b02c49c587da002c96fff6cadbd0cf6dbae40f9 | [
"MIT"
] | 3 | 2020-07-31T13:29:20.000Z | 2021-04-07T09:06:39.000Z | packages/tencent-cloud-sdk-auth/tests/cloud/auth/credentials.py | nobody-night/tencent-cloud-sdk-python | 4b02c49c587da002c96fff6cadbd0cf6dbae40f9 | [
"MIT"
] | null | null | null | packages/tencent-cloud-sdk-auth/tests/cloud/auth/credentials.py | nobody-night/tencent-cloud-sdk-python | 4b02c49c587da002c96fff6cadbd0cf6dbae40f9 | [
"MIT"
] | 1 | 2020-02-06T16:54:56.000Z | 2020-02-06T16:54:56.000Z | # tests.cloud.auth.credentials is python-3.6 source file
# MIT License
#
# Copyright (c) 2021 Handle.
#
# 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 witho... | 39.425532 | 80 | 0.736104 |
import time
def run_unit_tests():
from tencent.cloud.auth import credentials
credentials_context: credentials.Credentials = credentials.Credentials(
secret_id = 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLF',
secret_key = 'Gu5t9xGARNpq86cd98joQYCN3EXAMPLF'
)
credentials_context.generate_an... | true | true |
f770634dab5e3b87bb74a49fb251696f8c40404b | 1,958 | py | Python | lena/core/check_sequence_type.py | ynikitenko/lena | d0fbae47f21007685edbd4e77bc91413421bebd1 | [
"Apache-2.0"
] | 4 | 2020-03-01T14:01:48.000Z | 2021-02-23T19:33:36.000Z | lena/core/check_sequence_type.py | ynikitenko/lena | d0fbae47f21007685edbd4e77bc91413421bebd1 | [
"Apache-2.0"
] | 1 | 2021-05-09T15:47:17.000Z | 2021-05-09T16:12:03.000Z | lena/core/check_sequence_type.py | ynikitenko/lena | d0fbae47f21007685edbd4e77bc91413421bebd1 | [
"Apache-2.0"
] | null | null | null | """Check whether a sequence can be converted to a Lena Sequence."""
# otherwise import errors arise
# from . import source
def is_fill_compute_el(obj):
"""Object contains executable methods 'fill' and 'compute'."""
return hasattr(obj, 'fill') and hasattr(obj, 'compute') \
and callable(obj.fill) an... | 29.223881 | 72 | 0.668539 |
def is_fill_compute_el(obj):
return hasattr(obj, 'fill') and hasattr(obj, 'compute') \
and callable(obj.fill) and callable(obj.compute)
def is_fill_compute_seq(seq):
if is_source(seq):
return False
is_fcseq = False
try:
is_fcseq = any(map(is_fill_compute_el, seq))
exc... | true | true |
f7706446c3ca1232a1e417bf240279efd27100b6 | 51,706 | py | Python | tlslite/recordlayer.py | tomato42/tlslite-1 | 4631799cdfac8f90b567d455e698b05d7a917599 | [
"Unlicense"
] | 121 | 2015-05-28T18:14:37.000Z | 2020-11-18T11:23:59.000Z | tlslite/recordlayer.py | tomato42/tlslite-1 | 4631799cdfac8f90b567d455e698b05d7a917599 | [
"Unlicense"
] | 340 | 2015-05-28T15:56:11.000Z | 2020-11-04T11:40:45.000Z | tlslite/recordlayer.py | tomato42/tlslite-1 | 4631799cdfac8f90b567d455e698b05d7a917599 | [
"Unlicense"
] | 60 | 2015-07-10T20:07:02.000Z | 2020-10-22T08:04:20.000Z | # Copyright (c) 2014, Hubert Kario
#
# See the LICENSE file for legal information regarding use of this file.
"""Implementation of the TLS Record Layer protocol"""
import socket
import errno
import copy
try:
# in python 3 the native zip() returns iterator
from itertools import izip
except ImportError:
izi... | 38.019118 | 80 | 0.576161 |
import socket
import errno
import copy
try:
from itertools import izip
except ImportError:
izip = zip
try:
xrange
except NameError:
xrange = range
from .utils import tlshashlib as hashlib
from .constants import ContentType, CipherSuite
from .messages import RecordHeader3, RecordHeader2, Messa... | true | true |
f77064dc43372810965aefddef8c9487358caddc | 723 | py | Python | flyingpigeon/tests/test_wps_point_inspection.py | Ouranosinc/flyingpigeon | 657c4023e128342f380c847103e5fd78edad17db | [
"Apache-2.0"
] | 1 | 2016-12-04T18:01:49.000Z | 2016-12-04T18:01:49.000Z | flyingpigeon/tests/test_wps_point_inspection.py | Ouranosinc/flyingpigeon | 657c4023e128342f380c847103e5fd78edad17db | [
"Apache-2.0"
] | 13 | 2017-03-16T15:44:21.000Z | 2019-08-19T16:56:04.000Z | flyingpigeon/tests/test_wps_point_inspection.py | Ouranosinc/flyingpigeon | 657c4023e128342f380c847103e5fd78edad17db | [
"Apache-2.0"
] | null | null | null | from pywps import Service
from pywps.tests import assert_response_success
from flyingpigeon.processes import PointinspectionProcess
from flyingpigeon.tests.common import TESTDATA, client_for, CFG_FILE
import os
datainputs_fmt = (
"resource=files@xlink:href={0};"
"coords={1};"
)
def test_wps_point_inspectio... | 27.807692 | 73 | 0.717842 | from pywps import Service
from pywps.tests import assert_response_success
from flyingpigeon.processes import PointinspectionProcess
from flyingpigeon.tests.common import TESTDATA, client_for, CFG_FILE
import os
datainputs_fmt = (
"resource=files@xlink:href={0};"
"coords={1};"
)
def test_wps_point_inspectio... | true | true |
f770654f25cb9e6bade73dd349fffc09b7b56709 | 8,705 | py | Python | targets/matrix_voice/base.py | matrix-io/litex-buildenv | 69e2426279a9c0a3befe0fa14102652e8d72e7fa | [
"BSD-2-Clause"
] | null | null | null | targets/matrix_voice/base.py | matrix-io/litex-buildenv | 69e2426279a9c0a3befe0fa14102652e8d72e7fa | [
"BSD-2-Clause"
] | null | null | null | targets/matrix_voice/base.py | matrix-io/litex-buildenv | 69e2426279a9c0a3befe0fa14102652e8d72e7fa | [
"BSD-2-Clause"
] | null | null | null | # Support for the MATRIX Voice
# https://www.matrix.one/products/voice
# Author: Andres Calderon <andres.calderon@admobilize.com>
# FPGA: Spartan 6 xc6slx9-2-ftg256
# Copyright 2020 MATRIX Labs
# License: BSD
from fractions import Fraction
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
... | 38.0131 | 94 | 0.592188 |
from fractions import Fraction
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from migen.genlib.misc import WaitTimer
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litedram.modules import MT47H32M16
from litedram.phy import s6ddrphy
fro... | true | true |
f77065a3c82b76ba704d7535d3bf1066d1716c36 | 58 | py | Python | ts/model_service/__init__.py | vvekic/serve | f02a56bf1f0de1705fd9f399c1115d36e343c90c | [
"Apache-2.0"
] | 2 | 2022-03-26T05:17:45.000Z | 2022-03-26T05:44:53.000Z | ts/model_service/__init__.py | vvekic/serve | f02a56bf1f0de1705fd9f399c1115d36e343c90c | [
"Apache-2.0"
] | 3 | 2022-03-12T01:08:09.000Z | 2022-03-15T10:56:14.000Z | ts/model_service/__init__.py | vvekic/serve | f02a56bf1f0de1705fd9f399c1115d36e343c90c | [
"Apache-2.0"
] | 4 | 2020-04-23T17:55:41.000Z | 2020-04-27T17:06:33.000Z |
"""
Model services code
"""
from . import model_service
| 8.285714 | 27 | 0.689655 |
from . import model_service
| true | true |
f77065fe4af7f952ad9728e9e89dc7822a0b87a1 | 4,995 | py | Python | tasks/tests.py | SpeedyCoder/task-manager | 1f7d98bad6b8251e94bd8cd63f14e3f4524c4f72 | [
"MIT"
] | null | null | null | tasks/tests.py | SpeedyCoder/task-manager | 1f7d98bad6b8251e94bd8cd63f14e3f4524c4f72 | [
"MIT"
] | null | null | null | tasks/tests.py | SpeedyCoder/task-manager | 1f7d98bad6b8251e94bd8cd63f14e3f4524c4f72 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from tasks.models import Task
class ViewsTest(TestCase):
user_model = get_user_model()
def setUp(self):
self.user = self.user_model(username='testuser', email='test@test.com')
self.user.set_password('qwertyuiop')... | 43.434783 | 102 | 0.679079 | from django.test import TestCase
from django.contrib.auth import get_user_model
from tasks.models import Task
class ViewsTest(TestCase):
user_model = get_user_model()
def setUp(self):
self.user = self.user_model(username='testuser', email='test@test.com')
self.user.set_password('qwertyuiop')... | true | true |
f77066005f42adf471f7c6ec5f3394565249574c | 931 | py | Python | denga/genda.py | ankitshaw/DenGa | 92dfb0f3760c30dd9a32d650da92d5c3276099d1 | [
"MIT"
] | 2 | 2020-04-19T15:41:13.000Z | 2020-05-04T08:20:47.000Z | denga/genda.py | ankitshaw/DenGa | 92dfb0f3760c30dd9a32d650da92d5c3276099d1 | [
"MIT"
] | 6 | 2020-03-31T08:13:56.000Z | 2021-03-27T10:07:41.000Z | denga/genda.py | ankitshaw/DenGa | 92dfb0f3760c30dd9a32d650da92d5c3276099d1 | [
"MIT"
] | 1 | 2020-03-26T18:43:58.000Z | 2020-03-26T18:43:58.000Z |
import denga.augment as au
import pandas as pd
class Genda():
def __init__(self,filepath):
self.filepath = filepath
self.dataset = None
try:
self.dataset = pd.read_csv(self.filepath, header= None, error_bad_lines=False)
except:
raise Exception("ERROR: File Missing")
self.data = None
def generat... | 28.212121 | 82 | 0.690655 |
import denga.augment as au
import pandas as pd
class Genda():
def __init__(self,filepath):
self.filepath = filepath
self.dataset = None
try:
self.dataset = pd.read_csv(self.filepath, header= None, error_bad_lines=False)
except:
raise Exception("ERROR: File Missing")
self.data = None
def generat... | true | true |
f770662fbd7e407e58b0a23b6566f3ac0d9cae98 | 4,223 | py | Python | server.py | NCHU-NLP-Lab/api | afd3a7e5a848438860e39ffaeae655a3a92369b3 | [
"MIT"
] | null | null | null | server.py | NCHU-NLP-Lab/api | afd3a7e5a848438860e39ffaeae655a3a92369b3 | [
"MIT"
] | 2 | 2021-10-05T18:27:39.000Z | 2021-10-05T18:30:54.000Z | server.py | NCHU-NLP-Lab/api | afd3a7e5a848438860e39ffaeae655a3a92369b3 | [
"MIT"
] | null | null | null | import json
import os
from typing import List
from fastapi import BackgroundTasks, Body, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, RedirectResponse
from data.model import (
DisItem,
DistractorOrder,
Distractors,
DistractorSelectionStrategry,... | 26.39375 | 105 | 0.729103 | import json
import os
from typing import List
from fastapi import BackgroundTasks, Body, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse, RedirectResponse
from data.model import (
DisItem,
DistractorOrder,
Distractors,
DistractorSelectionStrategry,... | true | true |
f770676d0ca7cacb9c612666ec3c9b55ed889cef | 833 | py | Python | addons/sms/models/sms_api.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/sms/models/sms_api.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/sms/models/sms_api.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.exceptions import UserError
from odoo.addons.iap.models import iap
DEFAULT_ENDPOINT = 'https://iap-sms.odoo.com'
class SmsApi(models.AbstractModel):
_name = 'sms.api'... | 29.75 | 101 | 0.632653 |
from odoo import api, fields, models
from odoo.exceptions import UserError
from odoo.addons.iap.models import iap
DEFAULT_ENDPOINT = 'https://iap-sms.odoo.com'
class SmsApi(models.AbstractModel):
_name = 'sms.api'
_description = 'SMS API'
@api.model
def _send_sms(self, numbers, message):
ac... | true | true |
f7706916df3545b51a231268d0f359e892ea5cfb | 3,592 | py | Python | utils/stm32parser/gd32/const/gd32vf1xx_i2c_const.py | fstqwq/awesome-mcu | c468fbcac9f6dae082867cb615c61bab95585359 | [
"MIT"
] | 4 | 2021-09-09T12:07:16.000Z | 2021-12-19T11:39:41.000Z | utils/stm32parser/gd32/const/gd32vf1xx_i2c_const.py | fstqwq/awesome-mcu | c468fbcac9f6dae082867cb615c61bab95585359 | [
"MIT"
] | 1 | 2021-12-02T16:52:12.000Z | 2021-12-02T16:52:12.000Z | utils/stm32parser/gd32/const/gd32vf1xx_i2c_const.py | fstqwq/awesome-mcu | c468fbcac9f6dae082867cb615c61bab95585359 | [
"MIT"
] | 1 | 2021-12-17T17:40:52.000Z | 2021-12-17T17:40:52.000Z | from enum import IntEnum
class CTL0(IntEnum):
SRESET = 0x1 << 15 # Software reset
SALT = 0x1 << 13 # SMBus alert
PECTRANS = 0x1 << 12 # PEC Transfer
POAP = 0x1 << 11 # Position of ACK and PEC when receiving
ACKEN = 0x1 << 10 # Whether or not to send an ACK
STOP = 0x1... | 47.893333 | 107 | 0.61637 | from enum import IntEnum
class CTL0(IntEnum):
SRESET = 0x1 << 15 SALT = 0x1 << 13 PECTRANS = 0x1 << 12 POAP = 0x1 << 11 ACKEN = 0x1 << 10 STOP = 0x1 << 9 START = 0x1 << 8 SS = 0x1 << 7 GCEN = 0x1 << 6 PECEN = 0x1 << 5 ... | true | true |
f77069e2dba91e718c7fd3c6003908f4eb5b5e36 | 1,187 | py | Python | abc195/c.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | 1 | 2021-03-09T04:28:13.000Z | 2021-03-09T04:28:13.000Z | abc195/c.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | abc195/c.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | # included from snippets/main.py
def debug(*x, msg=""):
import sys
print(msg, *x, file=sys.stderr)
def solve(SOLVE_PARAMS):
pass
def main():
N = int(input())
d = 999
ret = 0
while N > d:
ret += N - d
d = d * 1000 + 999
print(ret)
# tests
T1 = """
1010
"""
TEST_T1 = ... | 16.957143 | 59 | 0.546757 | def debug(*x, msg=""):
import sys
print(msg, *x, file=sys.stderr)
def solve(SOLVE_PARAMS):
pass
def main():
N = int(input())
d = 999
ret = 0
while N > d:
ret += N - d
d = d * 1000 + 999
print(ret)
T1 = """
1010
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
11
"""
T2... | true | true |
f7706a8dd4c8634dedab90f122248867df6d43ac | 2,014 | py | Python | haws/services/lx_api_connector.py | vg-leanix/aws_sancheck | a53526ad41cf4710cc26b72ea7a9034f4cf7d821 | [
"Apache-2.0"
] | null | null | null | haws/services/lx_api_connector.py | vg-leanix/aws_sancheck | a53526ad41cf4710cc26b72ea7a9034f4cf7d821 | [
"Apache-2.0"
] | null | null | null | haws/services/lx_api_connector.py | vg-leanix/aws_sancheck | a53526ad41cf4710cc26b72ea7a9034f4cf7d821 | [
"Apache-2.0"
] | null | null | null | import json
import requests
import pandas as pd
from typing import List
from haws.services.setup_helper import get_runtime_settings
from haws.main import logger
# Get the bearer token - see https://dev.leanix.net/v4.0/docs/authentication
def authenticate():
settings = get_runtime_settings()
api_token = setti... | 35.964286 | 127 | 0.680238 | import json
import requests
import pandas as pd
from typing import List
from haws.services.setup_helper import get_runtime_settings
from haws.main import logger
def authenticate():
settings = get_runtime_settings()
api_token = settings['lx_apitoken']
lx_host = settings['lx_host']
auth_url = f'https:/... | true | true |
f7706b6665274475a3553a620613ea05eb0ac853 | 2,515 | py | Python | src/modlunky2/sprites/hud.py | d11z/modlunky2 | 0651362e7452dfa240e1277ecc33e08c95c450ae | [
"Apache-2.0"
] | 41 | 2020-11-08T01:54:40.000Z | 2022-03-10T16:28:07.000Z | src/modlunky2/sprites/hud.py | d11z/modlunky2 | 0651362e7452dfa240e1277ecc33e08c95c450ae | [
"Apache-2.0"
] | 103 | 2020-11-11T10:18:57.000Z | 2022-03-29T10:14:49.000Z | src/modlunky2/sprites/hud.py | d11z/modlunky2 | 0651362e7452dfa240e1277ecc33e08c95c450ae | [
"Apache-2.0"
] | 41 | 2020-11-11T06:07:46.000Z | 2022-03-19T20:29:07.000Z | from pathlib import Path
from modlunky2.sprites.base_classes import BaseSpriteLoader
class HudSheet(BaseSpriteLoader):
_sprite_sheet_path = Path("Data/Textures/hud.png")
_chunk_size = 32
_chunk_map = {
# What are these things?
"hud_bar_long": (0, 0, 8, 2),
"hud_bar_medium": (9, 0,... | 37.537313 | 59 | 0.492247 | from pathlib import Path
from modlunky2.sprites.base_classes import BaseSpriteLoader
class HudSheet(BaseSpriteLoader):
_sprite_sheet_path = Path("Data/Textures/hud.png")
_chunk_size = 32
_chunk_map = {
"hud_bar_long": (0, 0, 8, 2),
"hud_bar_medium": (9, 0, 15, 2),
"hud_bar... | true | true |
f7706be6c32bfb223d5f2cb28f8cfd46be86f718 | 3,718 | py | Python | poem.py | awordforthat/rhymes | b7d47b48a9b641e4736ed04058a183afc0a83b04 | [
"MIT"
] | null | null | null | poem.py | awordforthat/rhymes | b7d47b48a9b641e4736ed04058a183afc0a83b04 | [
"MIT"
] | null | null | null | poem.py | awordforthat/rhymes | b7d47b48a9b641e4736ed04058a183afc0a83b04 | [
"MIT"
] | 1 | 2021-02-16T03:06:38.000Z | 2021-02-16T03:06:38.000Z | from itertools import chain
from rhymes import (
read_cmu_dict,
analyze_rhyme
)
WORD_KEYS, _ = read_cmu_dict()
class Poem:
def __init__(self, lines, title=""):
self.read_lines(lines)
self.title = title or str(self.stanzas[0].lines[0])
def read_l... | 28.6 | 75 | 0.568316 | from itertools import chain
from rhymes import (
read_cmu_dict,
analyze_rhyme
)
WORD_KEYS, _ = read_cmu_dict()
class Poem:
def __init__(self, lines, title=""):
self.read_lines(lines)
self.title = title or str(self.stanzas[0].lines[0])
def read_l... | true | true |
f7706c78f31b6c96e8a1bcc06273aa6cf4809bb5 | 5,573 | py | Python | .history/DEBER_20210904225345.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | .history/DEBER_20210904225345.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | .history/DEBER_20210904225345.py | Alopezm5/PROYECTO-PARTE-1 | bd7a8594edf08d41c6ca544cf6bac01ea4fcb684 | [
"MIT"
] | null | null | null | import os
class Empresa():
def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr=""):
self.nombre=nom
self.ruc=ruc
self.direccion=dire
self.telefono=tele
self.ciudad=ciud
self.tipoEmpresa=tipEmpr
def datosEmpresa(self):#3
self.nombre=input("Ingres... | 40.977941 | 251 | 0.674323 | import os
class Empresa():
def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr=""):
self.nombre=nom
self.ruc=ruc
self.direccion=dire
self.telefono=tele
self.ciudad=ciud
self.tipoEmpresa=tipEmpr
def datosEmpresa(self): self.nombre=input("Ingresar ... | true | true |
f7706d68d7f1eaebc3eed0e5b6d09518115b24ae | 1,396 | py | Python | Toolkits/VCS/repology__repology-api/repology/fetcher/rsync.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | Toolkits/VCS/repology__repology-api/repology/fetcher/rsync.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | Toolkits/VCS/repology__repology-api/repology/fetcher/rsync.py | roscopecoltran/SniperKit-Core | 4600dffe1cddff438b948b6c22f586d052971e04 | [
"MIT"
] | null | null | null | # Copyright (C) 2017 Dmitry Marakasov <amdmi3@amdmi3.ru>
#
# This file is part of repology
#
# repology is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | 34.04878 | 125 | 0.686963 |
import os
import shutil
from repology.logger import NoopLogger
from repology.subprocess import RunSubprocess
class RsyncFetcher():
def __init__(self, url):
self.url = url
def Fetch(self, statepath, update=True, logger=NoopLogger()):
if os.path.isdir(statepath) and not update:
lo... | true | true |
f7706d7fe0a0b57a7fe5d5d5989d406e373769d0 | 10,164 | py | Python | Coberny/graph_min_cost/best_price_path.py | ABernard27/PROJET-groupe-3 | a9ab9d80c10724ded9e20751fda018a7ed05589b | [
"MIT"
] | 3 | 2021-12-11T16:06:37.000Z | 2021-12-12T14:41:27.000Z | Coberny/graph_min_cost/best_price_path.py | ABernard27/PROJET-groupe-3 | a9ab9d80c10724ded9e20751fda018a7ed05589b | [
"MIT"
] | null | null | null | Coberny/graph_min_cost/best_price_path.py | ABernard27/PROJET-groupe-3 | a9ab9d80c10724ded9e20751fda018a7ed05589b | [
"MIT"
] | 5 | 2021-11-15T15:53:24.000Z | 2021-12-10T08:59:52.000Z | import pandas as pd
import networkx as nx
from networkx.algorithms import dijkstra_path
import itertools
import time
import datetime as dt
# import matplotlib.pyplot as plt
# Retourne la liste de toutes les villes du dataframe
def GetListOfcolnames(data):
listofColnames = list(data.columns)[1:]
return listofC... | 44.77533 | 262 | 0.68595 | import pandas as pd
import networkx as nx
from networkx.algorithms import dijkstra_path
import itertools
import time
import datetime as dt
def GetListOfcolnames(data):
listofColnames = list(data.columns)[1:]
return listofColnames
def GetListOfVertexPath(data, entrance, outlet):
listofColnames = GetListOf... | true | true |
f7706debfc3e5a72f66dc1226b2ce1e0aa2fa04e | 57 | py | Python | constants/constants.py | caiovini/python_blockchain | c4b9da8e0ae5ccab79605ab3fd4f55dddfca3ef5 | [
"MIT"
] | null | null | null | constants/constants.py | caiovini/python_blockchain | c4b9da8e0ae5ccab79605ab3fd4f55dddfca3ef5 | [
"MIT"
] | null | null | null | constants/constants.py | caiovini/python_blockchain | c4b9da8e0ae5ccab79605ab3fd4f55dddfca3ef5 | [
"MIT"
] | null | null | null | DIFFICULTY = 5
DB_FILE = "blockchain_db/blockchain.db"
| 19 | 40 | 0.754386 | DIFFICULTY = 5
DB_FILE = "blockchain_db/blockchain.db"
| true | true |
f7706ebd4ccc61b41b8d11296f2650beee97c144 | 270 | py | Python | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | exercicios curso em video/ex037.py | Nilton-Miguel/Prog_Python3 | 4cabcb1a30dde6ababce3cb8d1fbb7d417cb1d8b | [
"MIT"
] | null | null | null | n = int(input('digite um número inteiro: '))
op = int(input('''escolha uma opção de conversão:
[ 1 ] Binário
[ 2 ] Octal
[ 3 ] Hexadecimal'''))
if op == 1:
print(bin(n)[2:])
elif op == 2:
print(oct(n)[2:])
elif op == 3:
print(hex(n)[2:])
| 16.875 | 51 | 0.522222 | n = int(input('digite um número inteiro: '))
op = int(input('''escolha uma opção de conversão:
[ 1 ] Binário
[ 2 ] Octal
[ 3 ] Hexadecimal'''))
if op == 1:
print(bin(n)[2:])
elif op == 2:
print(oct(n)[2:])
elif op == 3:
print(hex(n)[2:])
| true | true |
f7707071da49fecfb5c10658dd03b17b1b3a46b4 | 2,084 | py | Python | mmdeploy/mmcv/ops/roi_align_rotated.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 746 | 2021-12-27T10:50:28.000Z | 2022-03-31T13:34:14.000Z | mmdeploy/mmcv/ops/roi_align_rotated.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 253 | 2021-12-28T05:59:13.000Z | 2022-03-31T18:22:25.000Z | mmdeploy/mmcv/ops/roi_align_rotated.py | grimoire/mmdeploy | e84bc30f4a036dd19cb3af854203922a91098e84 | [
"Apache-2.0"
] | 147 | 2021-12-27T10:50:33.000Z | 2022-03-30T10:44:20.000Z | # Copyright (c) OpenMMLab. All rights reserved.
from typing import List
from torch import Tensor
from mmdeploy.core import SYMBOLIC_REWRITER
# Here using mmcv.ops.roi_align_rotated.__self__ to find
# mmcv.ops.roi_align.RoIAlignRotatedFunction, because RoIAlignRotatedFunction
# is not visible in mmcv.
@SYMBOLIC_REWR... | 40.076923 | 77 | 0.663628 | from typing import List
from torch import Tensor
from mmdeploy.core import SYMBOLIC_REWRITER
@SYMBOLIC_REWRITER.register_symbolic(
'mmcv.ops.roi_align_rotated.__self__', backend='default')
def roi_align_rotated_default(ctx, g, input: Tensor, rois: Tensor,
output_size: List[int], sp... | true | true |
f770710f182182ef7adf5288a2a0b0189795f80b | 453 | py | Python | post/urls.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | post/urls.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | post/urls.py | kelvin-daniel/instagram | 2ede5319266f4312a9440d4985d098bc7545c2ae | [
"MIT"
] | null | null | null | from django.urls import path
from post.views import index,NewPost, PostDetails, tags, like, favorite
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('newpost/', NewPost, name='newpost'),
path('<uuid:post_id>', PostDetails, name='postdetails'),
path('tag/<slug:tag_slug>', tags, name... | 37.75 | 71 | 0.693157 | from django.urls import path
from post.views import index,NewPost, PostDetails, tags, like, favorite
from . import views
urlpatterns = [
path('', views.index, name='index'),
path('newpost/', NewPost, name='newpost'),
path('<uuid:post_id>', PostDetails, name='postdetails'),
path('tag/<slug:tag_slug>', tags, name... | true | true |
f7707148dc9ff83a86cf975acc4eb1deaea4e803 | 880 | py | Python | utils/overwrite.py | AliasPedroKarim/Kagura | 892ee3daab31f0e55e7c810413617e89d5ce1317 | [
"MIT"
] | null | null | null | utils/overwrite.py | AliasPedroKarim/Kagura | 892ee3daab31f0e55e7c810413617e89d5ce1317 | [
"MIT"
] | null | null | null | utils/overwrite.py | AliasPedroKarim/Kagura | 892ee3daab31f0e55e7c810413617e89d5ce1317 | [
"MIT"
] | null | null | null | # -*- encoding:utf-8 -*-
import discord
from discord.ext.commands import check, NotOwner
def is_owner():
"""
A :func:`.check` that checks if the person invoking this command is the
owner of the bot.
This is powered by :meth:`.Bot.is_owner`.
This check raises a special exception, :exc:`.NotOwner`... | 30.344828 | 132 | 0.628409 | import discord
from discord.ext.commands import check, NotOwner
def is_owner():
async def predicate(ctx):
if not await ctx.bot.is_owner(ctx.author):
embed = discord.Embed()
embed.set_author(name=f' | You do not own this bot.', url=ctx.author.avatar_url,
... | true | true |
f770749ec5b9b4094ff477a797edf277d1d80cef | 12,434 | py | Python | ucscentralsdk/mometa/ether/EtherRxStats.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/ether/EtherRxStats.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/ether/EtherRxStats.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for EtherRxStats ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class EtherRxStatsConsts():
SUSPECT_FALSE = "false"
SUSPECT_NO = "... | 80.219355 | 273 | 0.702751 |
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class EtherRxStatsConsts():
SUSPECT_FALSE = "false"
SUSPECT_NO = "no"
SUSPECT_TRUE = "true"
SUSPECT_YES = "yes"
class EtherRxStats(ManagedO... | true | true |
f770757cb6019637df6ddd4f84fd94ec18280aa0 | 2,832 | py | Python | code/kg2/drugcentral_psql_to_drugcentral_json.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/kg2/drugcentral_psql_to_drugcentral_json.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/kg2/drugcentral_psql_to_drugcentral_json.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
''' drugcentral_psql_to_drugcentral_json.py: Converts a PostgreSQL output
file and the query that produced it and stores it under a key in
a JSON file.
Usage: drugcentral_psql_to_drugcentral_json.py <inputFile.txt>
<outputFile.json> <outputKey> --query <query>
'''
import json
i... | 34.962963 | 78 | 0.663136 |
import json
import argparse
__author__ = 'Erica Wood'
__copyright__ = 'Oregon State University'
__credits__ = ['Stephen Ramsey', 'Erica Wood']
__license__ = 'MIT'
__version__ = '0.1.0'
__maintainer__ = ''
__email__ = ''
__status__ = 'Prototype'
def get_args():
description = "drugcentral_psql_to_drugcentral_jso... | true | true |
f770760f6873629808beb9b9aff0cbcd308d75a7 | 164 | py | Python | applications/orion/index/models.py | FrederichRiver/neutrino | e91db53486e56ddeb83ae9714311d606b33fb165 | [
"BSD-3-Clause"
] | 2 | 2019-02-10T15:14:23.000Z | 2019-02-12T13:59:52.000Z | applications/orion/index/models.py | FrederichRiver/neutrino | e91db53486e56ddeb83ae9714311d606b33fb165 | [
"BSD-3-Clause"
] | null | null | null | applications/orion/index/models.py | FrederichRiver/neutrino | e91db53486e56ddeb83ae9714311d606b33fb165 | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
# Create your models here.
class StockData(models.Model):
trade_date = models.DateField()
close_price = models.FloatField()
| 18.222222 | 37 | 0.737805 | from django.db import models
class StockData(models.Model):
trade_date = models.DateField()
close_price = models.FloatField()
| true | true |
f77076e54f34d5651fc1954a7603c10ec6a0e9aa | 159,931 | py | Python | pandas/io/pytables.py | sdementen/pandas | e23e6f164209167c0fba0d32c862c5e75e6d4a8a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/io/pytables.py | sdementen/pandas | e23e6f164209167c0fba0d32c862c5e75e6d4a8a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/io/pytables.py | sdementen/pandas | e23e6f164209167c0fba0d32c862c5e75e6d4a8a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | """
High level interface to PyTables for reading and writing pandas data structures
to disk
"""
# pylint: disable-msg=E1101,W0613,W0603
from datetime import datetime, date
import time
import re
import copy
import itertools
import warnings
import os
from pandas.types.common import (is_list_like,
... | 33.869335 | 104 | 0.55457 |
from datetime import datetime, date
import time
import re
import copy
import itertools
import warnings
import os
from pandas.types.common import (is_list_like,
is_categorical_dtype,
is_timedelta64_dtype,
is_datetime64tz... | true | true |
f77078cc94441994469b4b9fb55871b84fd08121 | 1,725 | py | Python | tests/test_augment.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 13 | 2020-07-02T13:15:55.000Z | 2022-01-17T13:16:27.000Z | tests/test_augment.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 71 | 2020-06-29T08:43:20.000Z | 2022-03-29T12:03:09.000Z | tests/test_augment.py | BioinfoTongLI/deepBlink | aa819b71f380507f9fcfa0664ab0f5a8eca4b209 | [
"MIT"
] | 5 | 2020-09-18T12:32:12.000Z | 2021-11-03T07:33:43.000Z | """Unittests for the deepblink.augment module."""
# pylint: disable=missing-function-docstring
from hypothesis import given
from hypothesis.extra.numpy import arrays
import numpy as np
import pytest
from deepblink.augment import augment_batch_baseline
from deepblink.augment import flip
from deepblink.augment import g... | 28.75 | 60 | 0.717681 |
from hypothesis import given
from hypothesis.extra.numpy import arrays
import numpy as np
import pytest
from deepblink.augment import augment_batch_baseline
from deepblink.augment import flip
from deepblink.augment import gaussian_noise
from deepblink.augment import illuminate
from deepblink.augment import rotate
fro... | true | true |
f770793b798248ca404e791238689342fb38d1e4 | 4,752 | py | Python | Tools/parametric_model/src/models/multirotor_model.py | ethz-asl/data-driven-dynamics | decf4bec19c9fc4a1789f5eb4d6e6003774c75d6 | [
"BSD-3-Clause"
] | 38 | 2021-12-20T22:52:25.000Z | 2022-03-15T09:45:01.000Z | Tools/parametric_model/src/models/multirotor_model.py | ethz-asl/data-driven-dynamics | decf4bec19c9fc4a1789f5eb4d6e6003774c75d6 | [
"BSD-3-Clause"
] | 18 | 2021-12-21T09:36:20.000Z | 2022-03-20T13:03:27.000Z | Tools/parametric_model/src/models/multirotor_model.py | ethz-asl/data-driven-dynamics | decf4bec19c9fc4a1789f5eb4d6e6003774c75d6 | [
"BSD-3-Clause"
] | 8 | 2021-12-20T22:52:34.000Z | 2022-03-30T21:13:59.000Z | """
*
* Copyright (c) 2021 Manuel Yves Galliker
* 2021 Autonomous Systems Lab ETH Zurich
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source cod... | 44.411215 | 149 | 0.710859 |
__author__ = "Manuel Yves Galliker"
__maintainer__ = "Manuel Yves Galliker"
__license__ = "BSD 3"
from sklearn.linear_model import LinearRegression
from .dynamics_model import DynamicsModel
from .rotor_models import RotorModel
from .aerodynamic_models import FuselageDragModel
from .model_config import ModelConfig
imp... | true | true |
f7707a57dbf179b54ac8eaf81386174cc993a89e | 80,934 | py | Python | neutron/tests/unit/db/test_agentschedulers_db.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/test_agentschedulers_db.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/test_agentschedulers_db.py | EwaldvanGeffen/neutron | 858d7f33950a80c73501377a4b2cd36b915d0f40 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation.
#
# 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... | 48.609009 | 79 | 0.596029 |
import datetime
import mock
from neutron_lib.api.definitions import dhcpagentscheduler as das_apidef
from neutron_lib import constants
from neutron_lib import context
from neutron_lib.db import api as db_api
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from n... | true | true |
f7707bac6dd681b1703d0e8cf5604fec9231ba05 | 5,274 | py | Python | coursereg/views/dcc.py | s-gv/bheemboy | b35c6611739b6df517cb1bb642fa6d46cf1b246e | [
"MIT"
] | null | null | null | coursereg/views/dcc.py | s-gv/bheemboy | b35c6611739b6df517cb1bb642fa6d46cf1b246e | [
"MIT"
] | 105 | 2016-05-07T05:54:28.000Z | 2016-12-30T13:47:13.000Z | coursereg/views/dcc.py | s-gv/bheemboy | b35c6611739b6df517cb1bb642fa6d46cf1b246e | [
"MIT"
] | 4 | 2016-05-29T14:00:33.000Z | 2020-09-30T17:16:02.000Z | from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout
from django.contrib import me... | 45.465517 | 254 | 0.734547 | from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login, logout
from django.contrib import me... | true | true |
f7707bffeea7f123fa38fc412bc9a7d48ca9988e | 10,700 | py | Python | tacotron/models.py | rhoposit/tacotron2 | 2dad8df5ea50459789e16d9effb83fc2a25e42ed | [
"BSD-3-Clause"
] | null | null | null | tacotron/models.py | rhoposit/tacotron2 | 2dad8df5ea50459789e16d9effb83fc2a25e42ed | [
"BSD-3-Clause"
] | null | null | null | tacotron/models.py | rhoposit/tacotron2 | 2dad8df5ea50459789e16d9effb83fc2a25e42ed | [
"BSD-3-Clause"
] | null | null | null | # ==============================================================================
# Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics
# Author: Yusuke Yasuda (yasuda@nii.ac.jp)
# All rights reserved.
# ==============================================================================
""" Models. ""... | 57.219251 | 152 | 0.538505 |
import tensorflow as tf
from tacotron.modules import Embedding
from tacotron.tacotron_v1 import EncoderV1, DecoderV1
from tacotron.hooks import MetricsSaver, PostNetMetricsSaver
from util.audio import Audio
class SingleSpeakerTacotronV1Model(tf.estimator.Estimator):
def __init__(self, params, model_dir=None, co... | true | true |
f7707c4e499d87f4e0d435c7ff90577a736066ab | 12,670 | py | Python | mitxgraders/helpers/calc/mathfuncs.py | ChristopherChudzicki/mitx-grading-library | 1d9a7107f26b5e0ebe24deb552cf943779693e18 | [
"BSD-3-Clause"
] | null | null | null | mitxgraders/helpers/calc/mathfuncs.py | ChristopherChudzicki/mitx-grading-library | 1d9a7107f26b5e0ebe24deb552cf943779693e18 | [
"BSD-3-Clause"
] | null | null | null | mitxgraders/helpers/calc/mathfuncs.py | ChristopherChudzicki/mitx-grading-library | 1d9a7107f26b5e0ebe24deb552cf943779693e18 | [
"BSD-3-Clause"
] | null | null | null | """
mathfuncs.py
Contains mathematical functions for use in interpreting formulas.
Contains some helper functions used in grading formulae:
* within_tolerance
Defines:
* DEFAULT_FUNCTIONS
* DEFAULT_VARIABLES
* DEFAULT_SUFFIXES
* METRIC_SUFFIXES
"""
from __future__ import print_function, division, absolute_import, un... | 26.340956 | 118 | 0.610576 | from __future__ import print_function, division, absolute_import, unicode_literals
import six
import numpy as np
import scipy.special as special
from mitxgraders.helpers.calc.specify_domain import SpecifyDomain
from mitxgraders.helpers.calc.exceptions import FunctionEvalError
from mitxgraders.helpers.calc.math_array i... | true | true |
f7707c5d5a0115776c487e1a554ba778a6120a62 | 447 | py | Python | setup.py | gregflynn/dotsanity | 29af1477d8691394ddc10ee708066b9c4c55e73c | [
"MIT"
] | 4 | 2017-05-03T14:26:04.000Z | 2021-07-06T22:51:16.000Z | setup.py | gregflynn/dotsanity | 29af1477d8691394ddc10ee708066b9c4c55e73c | [
"MIT"
] | null | null | null | setup.py | gregflynn/dotsanity | 29af1477d8691394ddc10ee708066b9c4c55e73c | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='sanity',
version='1.0',
author='Greg Flynn',
url='https://github.com/gregflynn/dotsanity',
packages=['sanity'],
provides=['sanity'],
install_requires=[
'click==7.1.2',
'dataset==1.3.1',
'requests==2.24.0',
'tabulate=... | 19.434783 | 49 | 0.53915 | from setuptools import setup
setup(
name='sanity',
version='1.0',
author='Greg Flynn',
url='https://github.com/gregflynn/dotsanity',
packages=['sanity'],
provides=['sanity'],
install_requires=[
'click==7.1.2',
'dataset==1.3.1',
'requests==2.24.0',
'tabulate=... | true | true |
f7707c82fdad0ef56e3551736fd23fb0056223a9 | 6,013 | py | Python | detection/docker/model_handler_cpu.py | Moetaz-M-Mokhtar/ITIintake40_FaceRecognition | 570ceb5d1353efa8b8754243ee8d5db36a951998 | [
"MIT"
] | null | null | null | detection/docker/model_handler_cpu.py | Moetaz-M-Mokhtar/ITIintake40_FaceRecognition | 570ceb5d1353efa8b8754243ee8d5db36a951998 | [
"MIT"
] | 10 | 2020-05-15T13:04:01.000Z | 2022-02-09T23:40:39.000Z | detection/docker/model_handler_cpu.py | Moetaz-M-Mokhtar/ITIintake40_FaceRecognition | 570ceb5d1353efa8b8754243ee8d5db36a951998 | [
"MIT"
] | 1 | 2020-08-02T10:24:01.000Z | 2020-08-02T10:24:01.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
# http://www.apache.org/licenses/LICENSE-2.0
# or in the "license" file... | 40.355705 | 140 | 0.614668 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import cv2
import logging
import time
import base64
from mms.utils.mxnet import image, ndarray
sys.path.append('/root')
from insightface.RetinaFace.retinaface import ... | true | true |
f7707d3d77613f041682501351efa0f8b17e8ca0 | 976 | py | Python | azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:16:34.000Z | 2018-11-09T06:16:34.000Z | azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/models/policykey_resource.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 32.533333 | 76 | 0.603484 |
from msrest.serialization import Model
class PolicykeyResource(Model):
_attribute_map = {
'policy_key': {'key': 'policyKey', 'type': 'str'},
}
def __init__(self, policy_key=None):
self.policy_key = policy_key
| true | true |
f7707e1d31e7801b3c11100ff7c23456fd2dd09b | 1,516 | py | Python | test.py | luckyele/Drawing | aaf23011c0cea75de79e5bc5cc1156e12bdc06a0 | [
"Apache-2.0"
] | null | null | null | test.py | luckyele/Drawing | aaf23011c0cea75de79e5bc5cc1156e12bdc06a0 | [
"Apache-2.0"
] | null | null | null | test.py | luckyele/Drawing | aaf23011c0cea75de79e5bc5cc1156e12bdc06a0 | [
"Apache-2.0"
] | null | null | null | import math
import random
from matplotlib.pyplot import *
class Dot:
def __init__(self, x = 0.0, y = 0.0):
self.x = x
self.y = y
def distanceOf2Dot(dot1, dot2):
return ((dot2.x - dot1.x)**2 + (dot2.y - dot1.y)**2) ** 0.5
def get13dot(dot1, dot2):
return Dot(dot2.x / 3 + 2*dot... | 25.694915 | 74 | 0.542876 | import math
import random
from matplotlib.pyplot import *
class Dot:
def __init__(self, x = 0.0, y = 0.0):
self.x = x
self.y = y
def distanceOf2Dot(dot1, dot2):
return ((dot2.x - dot1.x)**2 + (dot2.y - dot1.y)**2) ** 0.5
def get13dot(dot1, dot2):
return Dot(dot2.x / 3 + 2*dot... | false | true |
f7707eaefadb30fab6a6101fe50b941217b8c3bd | 1,328 | py | Python | app/sdks/server-python/setup.py | parag60288/appwrite | b0f11b49f746ba8100cd8d906f3e4fcafc218ee0 | [
"BSD-3-Clause"
] | null | null | null | app/sdks/server-python/setup.py | parag60288/appwrite | b0f11b49f746ba8100cd8d906f3e4fcafc218ee0 | [
"BSD-3-Clause"
] | null | null | null | app/sdks/server-python/setup.py | parag60288/appwrite | b0f11b49f746ba8100cd8d906f3e4fcafc218ee0 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
setuptools.setup(
name = 'appwrite',
packages = ['appwrite', 'appwrite/services'],
version = '0.0.4',
license='BSD-3-Clause',
description = 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common develop... | 41.5 | 354 | 0.676205 | import setuptools
setuptools.setup(
name = 'appwrite',
packages = ['appwrite', 'appwrite/services'],
version = '0.0.4',
license='BSD-3-Clause',
description = 'Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common develop... | true | true |
f7707f01473dcefa56b714edd3406113bf1ef3e9 | 266 | py | Python | tests/artificial/transf_None/trend_PolyTrend/cycle_5/ar_/test_artificial_1024_None_PolyTrend_5__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_None/trend_PolyTrend/cycle_5/ar_/test_artificial_1024_None_PolyTrend_5__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_None/trend_PolyTrend/cycle_5/ar_/test_artificial_1024_None_PolyTrend_5__100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 0); | 38 | 161 | 0.729323 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 0); | true | true |
f7707fa9d6675993b9c5d341ef33da5db8c50e8e | 4,390 | py | Python | examples/strategies/king_keltner_strategy.py | zxc1342802/leijmtrader | f24d5593d8708e48f2a9180d9469a6c2af93a08d | [
"MIT"
] | null | null | null | examples/strategies/king_keltner_strategy.py | zxc1342802/leijmtrader | f24d5593d8708e48f2a9180d9469a6c2af93a08d | [
"MIT"
] | null | null | null | examples/strategies/king_keltner_strategy.py | zxc1342802/leijmtrader | f24d5593d8708e48f2a9180d9469a6c2af93a08d | [
"MIT"
] | null | null | null | from jiamtrader.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager,
)
import pandas_ta as ta
import pandas as pd
class KingKeltnerStrategy(CtaTemplate):
""""""
author = "用Python的交易员"
kk_length = 11
kk_... | 27.4375 | 94 | 0.579271 | from jiamtrader.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager,
)
import pandas_ta as ta
import pandas as pd
class KingKeltnerStrategy(CtaTemplate):
author = "用Python的交易员"
kk_length = 11
kk_dev = 1.6
... | true | true |
f770816650e63feaa6a225c44eeddac4743629ec | 125,326 | py | Python | salt/state.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/state.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/state.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The module used to execute states in salt. A state is unlike a module
execution in that instead of just executing a command it ensure that a
certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state fun... | 42.339865 | 132 | 0.422187 | '''
The module used to execute states in salt. A state is unlike a module
execution in that instead of just executing a command it ensure that a
certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state function name>',
'nam... | false | true |
f77081b2ef494d7aa08d8730b33d24fbbe1a57df | 16,746 | py | Python | util/utils.py | abhishekmaha23/synthetic_data_generation_attempt | 99ee858cdf405641fd0e2797bfc14c1a736547eb | [
"Unlicense"
] | null | null | null | util/utils.py | abhishekmaha23/synthetic_data_generation_attempt | 99ee858cdf405641fd0e2797bfc14c1a736547eb | [
"Unlicense"
] | null | null | null | util/utils.py | abhishekmaha23/synthetic_data_generation_attempt | 99ee858cdf405641fd0e2797bfc14c1a736547eb | [
"Unlicense"
] | null | null | null | import matplotlib.pyplot as plt
from datetime import datetime
import numpy as np
import torch
import os
import time
from scipy.ndimage.filters import gaussian_filter1d
from itertools import repeat
import copy
import gym
# import torch.multiprocessing as multiprocessing
import multiprocessing
import pickle
import matplo... | 54.019355 | 199 | 0.699092 | import matplotlib.pyplot as plt
from datetime import datetime
import numpy as np
import torch
import os
import time
from scipy.ndimage.filters import gaussian_filter1d
from itertools import repeat
import copy
import gym
import multiprocessing
import pickle
import matplotlib
matplotlib.use("TkAgg")
from collections impo... | true | true |
f77081d68a4a94aa46d39afecb00e022b63ff5f6 | 1,761 | py | Python | cogs/utils/ping.py | zz-xx/robox86 | 55bb2a763bd178771271b1ca8abe848d18ad0507 | [
"MIT"
] | null | null | null | cogs/utils/ping.py | zz-xx/robox86 | 55bb2a763bd178771271b1ca8abe848d18ad0507 | [
"MIT"
] | null | null | null | cogs/utils/ping.py | zz-xx/robox86 | 55bb2a763bd178771271b1ca8abe848d18ad0507 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from x86 import helpers
class Ping:
"""Ping command"""
@commands.command()
@commands.cooldown(6,12)
async def ping(self, ctx):
"""Ping the bot"""
#heartbeat latency (i'll be honest, dont really understand how it works)
... | 33.865385 | 145 | 0.609313 | import discord
from discord.ext import commands
from x86 import helpers
class Ping:
@commands.command()
@commands.cooldown(6,12)
async def ping(self, ctx):
hb_latency = round(ctx.bot.latency*1000, 2)
#only valid if bot gets big enough
if ctx.guild and len(... | true | true |
f77081d9e826efe2394ae425cd9af8f2134de686 | 206 | py | Python | tests/data/sqlalchemy_types.py | iFreilicht/pylint_flask_sqlalchemy | 1cc72a6d85ec9aafd5b64a2dcc4204b070977b59 | [
"MIT"
] | 4 | 2020-07-27T09:39:32.000Z | 2021-12-16T10:06:22.000Z | tests/data/sqlalchemy_types.py | iFreilicht/pylint_flask_sqlalchemy | 1cc72a6d85ec9aafd5b64a2dcc4204b070977b59 | [
"MIT"
] | 6 | 2020-01-09T15:43:29.000Z | 2022-02-19T08:09:52.000Z | tests/data/sqlalchemy_types.py | iFreilicht/pylint_flask_sqlalchemy | 1cc72a6d85ec9aafd5b64a2dcc4204b070977b59 | [
"MIT"
] | 2 | 2021-10-14T08:57:27.000Z | 2021-12-15T12:25:12.000Z | """Test sqlalchemy types."""
from .common import db
class Test(db.Model):
"""Test."""
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True, nullable=False)
| 22.888889 | 64 | 0.660194 | from .common import db
class Test(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True, nullable=False)
| true | true |
f770857ee76068953d02f81cb88b4ac4676daebe | 13,320 | py | Python | tests/functional/kvpy/lc_test_fwd.py | efeslab/hse | 44fa02e7503c107158ce70f05af1f3ff15e5c210 | [
"Apache-2.0"
] | 558 | 2020-04-27T12:05:39.000Z | 2022-03-28T15:20:22.000Z | tests/functional/kvpy/lc_test_fwd.py | efeslab/hse | 44fa02e7503c107158ce70f05af1f3ff15e5c210 | [
"Apache-2.0"
] | 103 | 2020-04-27T21:44:55.000Z | 2022-03-29T21:36:10.000Z | tests/functional/kvpy/lc_test_fwd.py | efeslab/hse | 44fa02e7503c107158ce70f05af1f3ff15e5c210 | [
"Apache-2.0"
] | 61 | 2020-04-22T11:02:14.000Z | 2022-03-14T19:32:17.000Z | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2021 Micron Technology, Inc. All rights reserved.
'''
To add keys to LC and make sure that an unintended ingest doesn't move it all to cn set these
two run time params:
1. durability.enabled = false // kvdb_sync() ingests to lc + cn
... | 29.534368 | 139 | 0.521697 |
from contextlib import ExitStack
from hse2 import hse
from utility import lifecycle, cli
def separate_keys(kvdb: hse.Kvdb, kvs: hse.Kvs):
with kvdb.transaction() as t:
kvs.put(b"ab01", b"val-cn", txn=t)
with kvdb.transaction() as t:
kvs.put(b"ab02", b"val-lc", txn=t)
kvdb.sync()
... | true | true |
f77085ec0351604c5a745321937bd20be630e3cf | 476 | py | Python | lemur/tests/plugins/destination_plugin.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | lemur/tests/plugins/destination_plugin.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | 2 | 2020-04-03T09:28:20.000Z | 2020-04-04T04:56:35.000Z | lemur/tests/plugins/destination_plugin.py | x-lhan/lemur | 1d8aaa4a242af610363e961167bc31691b358773 | [
"Apache-2.0"
] | null | null | null | from lemur.plugins.bases import DestinationPlugin
class TestDestinationPlugin(DestinationPlugin):
title = 'Test'
slug = 'test-destination'
description = 'Enables testing'
author = 'Kevin Glisson'
author_url = 'https://github.com/netflix/lemur.git'
def __init__(self, *args, **kwargs):
... | 28 | 77 | 0.695378 | from lemur.plugins.bases import DestinationPlugin
class TestDestinationPlugin(DestinationPlugin):
title = 'Test'
slug = 'test-destination'
description = 'Enables testing'
author = 'Kevin Glisson'
author_url = 'https://github.com/netflix/lemur.git'
def __init__(self, *args, **kwargs):
... | true | true |
f77085ef7fbe7c8af592240e843f48a49954c44e | 1,861 | py | Python | modules/auth/models.py | Maurilearn/learnings | 0af03e5646c9053b3cfc27465983ce466ad2f3cb | [
"MIT"
] | null | null | null | modules/auth/models.py | Maurilearn/learnings | 0af03e5646c9053b3cfc27465983ce466ad2f3cb | [
"MIT"
] | null | null | null | modules/auth/models.py | Maurilearn/learnings | 0af03e5646c9053b3cfc27465983ce466ad2f3cb | [
"MIT"
] | null | null | null | from werkzeug.security import generate_password_hash, check_password_hash
from shopyoapi.init import db
from flask_login import UserMixin
from modules.course.models import Course
from modules.lightcourse.models import LightCourse
from modules.course.models import QuizHistory
course_subs = db.Table('course_subs',
... | 34.462963 | 80 | 0.698012 | from werkzeug.security import generate_password_hash, check_password_hash
from shopyoapi.init import db
from flask_login import UserMixin
from modules.course.models import Course
from modules.lightcourse.models import LightCourse
from modules.course.models import QuizHistory
course_subs = db.Table('course_subs',
... | true | true |
f77085fce63d62cdec3eac02285b97be004f6ddf | 1,430 | py | Python | package/loss.py | ngbsLab/Korean-Speech-Recognition | 3867bf7d23222da6812c9b98a93d3c6f7b3c80fc | [
"Apache-2.0"
] | 1 | 2021-06-30T02:17:56.000Z | 2021-06-30T02:17:56.000Z | package/loss.py | ngbsLab/Korean-Speech-Recognition | 3867bf7d23222da6812c9b98a93d3c6f7b3c80fc | [
"Apache-2.0"
] | null | null | null | package/loss.py | ngbsLab/Korean-Speech-Recognition | 3867bf7d23222da6812c9b98a93d3c6f7b3c80fc | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
class LabelSmoothingLoss(nn.Module):
"""
Provides Label-Smoothing loss.
Args:
class_num (int): the number of classfication
ignore_index (int): Indexes that are ignored when calculating loss
smoothing (float): ratio of smoothing (confidence = 1.0 -... | 38.648649 | 101 | 0.665734 | import torch
import torch.nn as nn
class LabelSmoothingLoss(nn.Module):
def __init__(self, class_num, ignore_index, smoothing=0.1, dim=-1):
super(LabelSmoothingLoss, self).__init__()
self.confidence = 1.0 - smoothing
self.smoothing = smoothing
self.class_num = class_num
self... | true | true |
f770862d5ed4893c22ac54c327266f7ff0b14edf | 974 | py | Python | tests/test_celery_beat_scheduler.py | LaudateCorpus1/squest | 98304f20c1d966fb3678d348ffd7c5be438bb6be | [
"Apache-2.0"
] | 112 | 2021-04-21T08:52:55.000Z | 2022-03-01T15:09:19.000Z | tests/test_celery_beat_scheduler.py | LaudateCorpus1/squest | 98304f20c1d966fb3678d348ffd7c5be438bb6be | [
"Apache-2.0"
] | 216 | 2021-04-21T09:06:47.000Z | 2022-03-30T14:21:28.000Z | tests/test_celery_beat_scheduler.py | LaudateCorpus1/squest | 98304f20c1d966fb3678d348ffd7c5be438bb6be | [
"Apache-2.0"
] | 21 | 2021-04-20T13:53:54.000Z | 2022-03-30T21:43:04.000Z | from unittest import mock
from django_celery_beat.models import PeriodicTask, CrontabSchedule
from service_catalog.celery_beat_scheduler import DatabaseSchedulerWithCleanup
from tests.test_service_catalog.base import BaseTest
from service_catalog.celery import app
class TestCeleryBeatScheduler(BaseTest):
@moc... | 40.583333 | 84 | 0.776181 | from unittest import mock
from django_celery_beat.models import PeriodicTask, CrontabSchedule
from service_catalog.celery_beat_scheduler import DatabaseSchedulerWithCleanup
from tests.test_service_catalog.base import BaseTest
from service_catalog.celery import app
class TestCeleryBeatScheduler(BaseTest):
@moc... | true | true |
f770865e84d3632f69f049bae278b520926814d8 | 40,857 | py | Python | sympy/simplify/tests/test_hyperexpand.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | 1 | 2022-01-17T12:38:24.000Z | 2022-01-17T12:38:24.000Z | sympy/simplify/tests/test_hyperexpand.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | null | null | null | sympy/simplify/tests/test_hyperexpand.py | gum3ng/sympy | e9414fafa976b26aa0b701a0217ab0f3b561989f | [
"BSD-3-Clause"
] | null | null | null | from random import randrange
from sympy.simplify.hyperexpand import (ShiftA, ShiftB, UnShiftA, UnShiftB,
MeijerShiftA, MeijerShiftB, MeijerShiftC, MeijerShiftD,
MeijerUnShiftA, MeijerUnShiftB, MeijerUnShiftC,
MeijerUnShiftD,
Re... | 38.508011 | 103 | 0.525222 | from random import randrange
from sympy.simplify.hyperexpand import (ShiftA, ShiftB, UnShiftA, UnShiftB,
MeijerShiftA, MeijerShiftB, MeijerShiftC, MeijerShiftD,
MeijerUnShiftA, MeijerUnShiftB, MeijerUnShiftC,
MeijerUnShiftD,
Re... | true | true |
f77086ed8af858c21b5d3ad04ccf74dd52879c36 | 3,113 | py | Python | app/models.py | KarlSalmi/Bergsalsitex | 1a1a29c3fb9b24e40bc9db9dca389aa5549c518e | [
"MIT"
] | null | null | null | app/models.py | KarlSalmi/Bergsalsitex | 1a1a29c3fb9b24e40bc9db9dca389aa5549c518e | [
"MIT"
] | null | null | null | app/models.py | KarlSalmi/Bergsalsitex | 1a1a29c3fb9b24e40bc9db9dca389aa5549c518e | [
"MIT"
] | null | null | null | from datetime import datetime
from hashlib import md5
from time import time
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
from app import app, db, login
followers = db.Table(
'followers',
db.Column('follower_id', db.Integer, db.ForeignKe... | 33.836957 | 75 | 0.652425 | from datetime import datetime
from hashlib import md5
from time import time
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
import jwt
from app import app, db, login
followers = db.Table(
'followers',
db.Column('follower_id', db.Integer, db.ForeignKe... | true | true |
f77087427d84b106253d30b7b2d3f3abc05d57d0 | 431 | py | Python | ARC_A/ARC051_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ARC_A/ARC051_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ARC_A/ARC051_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | x1, y1, r = map(int, input().split())
x2, y2, x3, y3 = map(int, input().split())
ans1 = 'YES'
if x2 <= x1-r and x1+r <= x3 and y2 <= y1-r and y1+r <= y3:
ans1 = 'NO'
ans2 = 'YES'
if (x3 - x1) ** 2 + (y3 - y1) ** 2 <= r ** 2 and \
(x2 - x1) ** 2 + (y2 - y1) ** 2 <= r ** 2 and \
(x3 - x1) ** 2 + (y2 - y1) *... | 26.9375 | 59 | 0.415313 | x1, y1, r = map(int, input().split())
x2, y2, x3, y3 = map(int, input().split())
ans1 = 'YES'
if x2 <= x1-r and x1+r <= x3 and y2 <= y1-r and y1+r <= y3:
ans1 = 'NO'
ans2 = 'YES'
if (x3 - x1) ** 2 + (y3 - y1) ** 2 <= r ** 2 and \
(x2 - x1) ** 2 + (y2 - y1) ** 2 <= r ** 2 and \
(x3 - x1) ** 2 + (y2 - y1) *... | true | true |
f770878ec19ad94932aa083b1078a91190e9b2a2 | 2,581 | py | Python | IGitt/Interfaces/Hoster.py | GitMateIO/IGitt | ddb9164fe9efbb157abb66e05a38527884015866 | [
"MIT"
] | 6 | 2017-11-18T03:00:38.000Z | 2021-08-04T05:27:05.000Z | IGitt/Interfaces/Hoster.py | GitMateIO/IGitt | ddb9164fe9efbb157abb66e05a38527884015866 | [
"MIT"
] | null | null | null | IGitt/Interfaces/Hoster.py | GitMateIO/IGitt | ddb9164fe9efbb157abb66e05a38527884015866 | [
"MIT"
] | 2 | 2018-03-16T16:30:03.000Z | 2018-03-16T17:36:51.000Z | """
Contains the git Hoster abstraction.
"""
from typing import Iterator, Set, Union
from IGitt.Interfaces import IGittObject, Token
from IGitt.Interfaces.Repository import Repository
from IGitt.Interfaces.Issue import Issue
from IGitt.Interfaces.MergeRequest import MergeRequest
class Hoster(IGittObject):
"""
... | 31.096386 | 80 | 0.597055 | from typing import Iterator, Set, Union
from IGitt.Interfaces import IGittObject, Token
from IGitt.Interfaces.Repository import Repository
from IGitt.Interfaces.Issue import Issue
from IGitt.Interfaces.MergeRequest import MergeRequest
class Hoster(IGittObject):
@staticmethod
def get_repo_name(webhook) -> str... | true | true |
f770883d6109ebd548cc44852ed0b4db7874c963 | 752 | py | Python | util/statuschanger.py | MarkThe/Mark-Tools | c755d2b2e095b9f83fcbaba3ac74ec927bcddf26 | [
"MIT"
] | 1 | 2022-01-04T18:09:50.000Z | 2022-01-04T18:09:50.000Z | util/statuschanger.py | MarkThe/Mark-Tools | c755d2b2e095b9f83fcbaba3ac74ec927bcddf26 | [
"MIT"
] | null | null | null | util/statuschanger.py | MarkThe/Mark-Tools | c755d2b2e095b9f83fcbaba3ac74ec927bcddf26 | [
"MIT"
] | null | null | null | import requests
import Mark
from colorama import Fore
from util.plugins.common import print_slow, getheaders, proxy
def StatusChanger(token, Status):
#change status
CustomStatus = {"custom_status": {"text": Status}} #{"text": Status, "emoji_name": "☢"} if you want to add an emoji to the status
try:
... | 44.235294 | 152 | 0.676862 | import requests
import Mark
from colorama import Fore
from util.plugins.common import print_slow, getheaders, proxy
def StatusChanger(token, Status):
CustomStatus = {"custom_status": {"text": Status}} try:
r = requests.patch("https://discord.com/api/v9/users/@me/settings", proxies={"ftp": f'{proxy... | true | true |
f77088bdd91f5049318ba9c92070990c005d0b2d | 1,354 | py | Python | gradient_free_optimizers/memory.py | gtr8/Gradient-Free-Optimizers | 19dcde35d93f048721bac3600f33696ca21ec669 | [
"MIT"
] | null | null | null | gradient_free_optimizers/memory.py | gtr8/Gradient-Free-Optimizers | 19dcde35d93f048721bac3600f33696ca21ec669 | [
"MIT"
] | null | null | null | gradient_free_optimizers/memory.py | gtr8/Gradient-Free-Optimizers | 19dcde35d93f048721bac3600f33696ca21ec669 | [
"MIT"
] | 1 | 2021-03-01T12:25:19.000Z | 2021-03-01T12:25:19.000Z | # Author: Simon Blanke
# Email: simon.blanke@yahoo.com
# License: MIT License
import numpy as np
import pandas as pd
class Memory:
def __init__(self, warm_start, conv):
self.memory_dict = {}
self.memory_dict_new = {}
self.conv = conv
if warm_start is None:
return
... | 27.08 | 76 | 0.606352 |
import numpy as np
import pandas as pd
class Memory:
def __init__(self, warm_start, conv):
self.memory_dict = {}
self.memory_dict_new = {}
self.conv = conv
if warm_start is None:
return
if not isinstance(warm_start, pd.DataFrame):
print("Memory wa... | true | true |
f77088cb654adecd19b2764410f3f58a8167aec7 | 3,613 | py | Python | telemarketing_teleop/src/serial.py | ECisneros20/Telemarketing-robot | 2237d6c6433c0a0b33faa673a734e863d9f7456e | [
"MIT"
] | null | null | null | telemarketing_teleop/src/serial.py | ECisneros20/Telemarketing-robot | 2237d6c6433c0a0b33faa673a734e863d9f7456e | [
"MIT"
] | null | null | null | telemarketing_teleop/src/serial.py | ECisneros20/Telemarketing-robot | 2237d6c6433c0a0b33faa673a734e863d9f7456e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Fuente: https://www.youtube.com/watch?v=aE7RQNhwnPQ / 7:45
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Float64MultiArray, Header
from sensor_msgs.msg import LaserScan
''' Teleop '''
R = 0.1016 # Radio de las ruedas en metros
L = 0.3219 # Distancia entre las rued... | 25.624113 | 97 | 0.729034 |
import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import Float64MultiArray, Header
from sensor_msgs.msg import LaserScan
R = 0.1016 L = 0.3219 vel_motor_der = 0.0 vel_motor_izq = 0.0
vel_des = Float64MultiArray()
vel_des.data.append(0.0)
vel_des.data.append(0.0)
num_sensors = 18
sensor_data = Fl... | true | true |
f7708ab1615b4a82913779f8e110a06b8d068330 | 2,483 | py | Python | wriiten by zwang/view_chembl.py | ashinwz/lmmd_experiments | 05f235236fe7ffc9902b4452fe2b3ec00d447c14 | [
"MIT"
] | null | null | null | wriiten by zwang/view_chembl.py | ashinwz/lmmd_experiments | 05f235236fe7ffc9902b4452fe2b3ec00d447c14 | [
"MIT"
] | null | null | null | wriiten by zwang/view_chembl.py | ashinwz/lmmd_experiments | 05f235236fe7ffc9902b4452fe2b3ec00d447c14 | [
"MIT"
] | null | null | null | #coding=utf-8
#filter for chembl_chemicals
#CHOOSE "uM,nM,microM,M,umol/L,nmol/L"
#FILEOUT:
f2=open("chembl_filter_2.txt","w")
f1=open("chembl_filter_1.txt","w")
with open("chembl_all.txt","r") as f:
a=f.readline().split("\t")
f.seek(0,0)
i=0
chembl_set=set()
try:
while a[0]!=""... | 43.561404 | 88 | 0.383004 | f2=open("chembl_filter_2.txt","w")
f1=open("chembl_filter_1.txt","w")
with open("chembl_all.txt","r") as f:
a=f.readline().split("\t")
f.seek(0,0)
i=0
chembl_set=set()
try:
while a[0]!="":
a=f.readline().replace("\"","").split("\t")
#print a
i+=... | false | true |
f7708b95b7db1ec9e2b5a444b28f6967b496d50e | 395 | py | Python | fw_django/wsgi.py | Hajsru/fw-back-django | bc6caafac35fb0823632d8b0672833c94ef4915d | [
"MIT"
] | null | null | null | fw_django/wsgi.py | Hajsru/fw-back-django | bc6caafac35fb0823632d8b0672833c94ef4915d | [
"MIT"
] | 3 | 2020-02-11T23:32:36.000Z | 2021-06-10T21:04:41.000Z | fw_django/wsgi.py | Hajsru/fw-back-django | bc6caafac35fb0823632d8b0672833c94ef4915d | [
"MIT"
] | null | null | null | """
WSGI config for fw_django project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fw_django.settings')
application = get_wsgi_application()
| true | true |
f7708c22117e5305887a8505b02e883ef1e18893 | 7,997 | py | Python | supercell/provider.py | retresco/supercell | 0440017e93fc6fdf9787dfc00811764e38b42217 | [
"Apache-2.0"
] | 13 | 2016-06-28T13:15:56.000Z | 2019-02-13T15:23:03.000Z | supercell/provider.py | retresco/supercell | 0440017e93fc6fdf9787dfc00811764e38b42217 | [
"Apache-2.0"
] | 13 | 2017-03-03T13:38:37.000Z | 2020-08-11T08:14:46.000Z | supercell/provider.py | retresco/supercell | 0440017e93fc6fdf9787dfc00811764e38b42217 | [
"Apache-2.0"
] | 4 | 2017-04-07T12:29:25.000Z | 2018-07-03T16:05:38.000Z | # vim: set fileencoding=utf-8 :
#
# Copyright (c) 2013 Daniel Truemper <truemped at googlemail.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/LICENS... | 34.619048 | 79 | 0.63899 | from __future__ import (absolute_import, division, print_function,
with_statement)
import json
from collections import defaultdict
from schematics.exceptions import ModelValidationError
from tornado.web import HTTPError
from tornado import escape
from supercell._compat import with_metaclass, e... | true | true |
f7708c2a2161cc11e048e3408618ef3bc8596300 | 529 | py | Python | main.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | main.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | main.py | mayronceccon/olist-python-labs-project | 217188212158ba2401866e06173d762e346ebeee | [
"MIT"
] | null | null | null | from models.mensagem import Mensagem
from views.principal import Principal as PrincipalView
mensagem = Mensagem()
def sair():
mensagem.titulo("Saindo...")
mensagem.alerta("Obrigado por utilizar nosso sistema!")
exit()
if __name__ == '__main__':
principal = PrincipalView()
principal.inicial()
... | 24.045455 | 80 | 0.674858 | from models.mensagem import Mensagem
from views.principal import Principal as PrincipalView
mensagem = Mensagem()
def sair():
mensagem.titulo("Saindo...")
mensagem.alerta("Obrigado por utilizar nosso sistema!")
exit()
if __name__ == '__main__':
principal = PrincipalView()
principal.inicial()
... | true | true |
f7708c3d4f311229ae3861729cd3211073d6321c | 1,142 | py | Python | robot/utils/__init__.py | avasanthc/Autonomous-Robot-Code | b18409b5fdd54baf235316958935fc86de88a009 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | robot/utils/__init__.py | avasanthc/Autonomous-Robot-Code | b18409b5fdd54baf235316958935fc86de88a009 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | robot/utils/__init__.py | avasanthc/Autonomous-Robot-Code | b18409b5fdd54baf235316958935fc86de88a009 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Björn Larsson
#
# 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 r... | 49.652174 | 80 | 0.768827 | true | true | |
f7708c4c2055950b791e852858175cf4f30a0aa2 | 47 | py | Python | netijen/Yash/validation.py | ahmadjaved97/hacktoberfest-2019 | 75ae1a78949934dcec1f558c836b66b01973278a | [
"WTFPL"
] | 4 | 2019-10-12T11:41:32.000Z | 2019-10-22T04:05:24.000Z | netijen/Yash/validation.py | ahmadjaved97/hacktoberfest-2019 | 75ae1a78949934dcec1f558c836b66b01973278a | [
"WTFPL"
] | 5 | 2020-10-19T14:18:44.000Z | 2021-10-04T07:22:37.000Z | netijen/Yash/validation.py | ahmadjaved97/hacktoberfest-2019 | 75ae1a78949934dcec1f558c836b66b01973278a | [
"WTFPL"
] | 4 | 2019-10-10T15:13:06.000Z | 2020-07-21T06:27:16.000Z | if "a" == "a":
print("a")
else:
print("b")
| 9.4 | 14 | 0.425532 | if "a" == "a":
print("a")
else:
print("b")
| true | true |
f7708c7266d9cbab4d7f1919958c0f686b392b41 | 321 | py | Python | treetest/abstract_vertex.py | Christian-B/my_spinnaker | b19f4025878bc4fbd6d81d78cec8c284929e148b | [
"MIT"
] | null | null | null | treetest/abstract_vertex.py | Christian-B/my_spinnaker | b19f4025878bc4fbd6d81d78cec8c284929e148b | [
"MIT"
] | null | null | null | treetest/abstract_vertex.py | Christian-B/my_spinnaker | b19f4025878bc4fbd6d81d78cec8c284929e148b | [
"MIT"
] | null | null | null | from six import add_metaclass
from abc import ABCMeta
from abstract_has_constraints \
import AbstractHasConstraints
from abstract_has_label \
import AbstractHasLabel
@add_metaclass(ABCMeta)
class AbstractVertex(AbstractHasConstraints, AbstractHasLabel):
""" A vertex in a graph
"""
__slots__ = ()... | 20.0625 | 63 | 0.76947 | from six import add_metaclass
from abc import ABCMeta
from abstract_has_constraints \
import AbstractHasConstraints
from abstract_has_label \
import AbstractHasLabel
@add_metaclass(ABCMeta)
class AbstractVertex(AbstractHasConstraints, AbstractHasLabel):
__slots__ = ()
| true | true |
f7708c8752b25a8d9b9507341f03ba21756d9371 | 439 | py | Python | cotiza/migrations/0014_todo_kms.py | crewxart/gestor-cicloverde | 3a1289649037f9d3420be8a98af4080ebeb7111e | [
"CC0-1.0"
] | null | null | null | cotiza/migrations/0014_todo_kms.py | crewxart/gestor-cicloverde | 3a1289649037f9d3420be8a98af4080ebeb7111e | [
"CC0-1.0"
] | null | null | null | cotiza/migrations/0014_todo_kms.py | crewxart/gestor-cicloverde | 3a1289649037f9d3420be8a98af4080ebeb7111e | [
"CC0-1.0"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-11 05:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cotiza', '0013_todo_fecha'),
]
operations = [
migrations.AddField(
model_name='todo',
name='kms',
field=... | 21.95 | 83 | 0.599089 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cotiza', '0013_todo_fecha'),
]
operations = [
migrations.AddField(
model_name='todo',
name='kms',
field=models.DecimalField(decimal_places=1, default=66... | true | true |
f7708d4af289e41a22fb7b11ca366ae649f96981 | 1,456 | py | Python | tests/testInterference.py | KOLANICH/lazyImport.py | ee6574c10c941973de8f4ea3b67af3e94fc9668d | [
"Unlicense"
] | null | null | null | tests/testInterference.py | KOLANICH/lazyImport.py | ee6574c10c941973de8f4ea3b67af3e94fc9668d | [
"Unlicense"
] | null | null | null | tests/testInterference.py | KOLANICH/lazyImport.py | ee6574c10c941973de8f4ea3b67af3e94fc9668d | [
"Unlicense"
] | null | null | null | import sys
from pathlib import Path
import unittest
thisDir = Path(__file__).parent.absolute()
sys.path.insert(0, str(thisDir.parent))
sys.path.insert(0, str(thisDir))
from ImportTimeline import ImportTimelineTestCase
class Tests(ImportTimelineTestCase):
def testInterference(self):
self.etalon = [
"from lazil... | 27.471698 | 52 | 0.739698 | import sys
from pathlib import Path
import unittest
thisDir = Path(__file__).parent.absolute()
sys.path.insert(0, str(thisDir.parent))
sys.path.insert(0, str(thisDir))
from ImportTimeline import ImportTimelineTestCase
class Tests(ImportTimelineTestCase):
def testInterference(self):
self.etalon = [
"from lazil... | true | true |
f7708d8090f20e00a310ff3297d49bd5186eed9e | 11,360 | py | Python | cbcl_read.py | EdinburghGenomics/well_duplicates | 7d1a68dd359edf3c09937ca00a32ecd0b2549f58 | [
"BSD-2-Clause"
] | 11 | 2017-07-22T12:40:20.000Z | 2020-03-26T23:19:25.000Z | cbcl_read.py | EdinburghGenomics/well_duplicates | 7d1a68dd359edf3c09937ca00a32ecd0b2549f58 | [
"BSD-2-Clause"
] | 3 | 2016-04-26T09:33:56.000Z | 2017-12-04T11:44:31.000Z | cbcl_read.py | EdinburghGenomics/well_duplicates | 7d1a68dd359edf3c09937ca00a32ecd0b2549f58 | [
"BSD-2-Clause"
] | 2 | 2019-08-23T07:42:44.000Z | 2020-02-29T17:21:11.000Z | #!/usr/bin/env python3
import os, sys, re
import struct
import gzip
from itertools import chain
# This is a stand-alone script to inspect a CBCL file - see the format description at
# https://support.illumina.com/content/dam/illumina-support/documents/documentation/software_documentation/bcl2fastq/bcl2fastq2_guide_150... | 50.941704 | 149 | 0.595775 | import os, sys, re
import struct
import gzip
from itertools import chain
def main(cbcl_file):
def p(key, val): print(" {}: {}".format(key, val))
def w(msg): print("!! {} !!".format(msg))
# First job is to open the file and inspect the header...
with open(cbcl_file, 'rb') as fh:
# First 12 ... | true | true |
f7708da98610e1ad57fd5899ec48627d8c6afb84 | 1,823 | py | Python | Basic Response.py | HarshitSati/Basic_Discord_Bot | ef493b500fe47b9c5f5c30a2f197e3bf844bea7e | [
"MIT"
] | null | null | null | Basic Response.py | HarshitSati/Basic_Discord_Bot | ef493b500fe47b9c5f5c30a2f197e3bf844bea7e | [
"MIT"
] | null | null | null | Basic Response.py | HarshitSati/Basic_Discord_Bot | ef493b500fe47b9c5f5c30a2f197e3bf844bea7e | [
"MIT"
] | 1 | 2020-09-25T15:26:17.000Z | 2020-09-25T15:26:17.000Z | import discord
from discord.ext import commands
import random
# This determines a keyword that the bot will look for. Having nothing means it can reply even when the bot isnt called
client = commands.Bot(command_prefix="")
# this will print as soon as the bot is live
@client.event
async def on_ready():
print("bot is... | 30.383333 | 119 | 0.687877 | import discord
from discord.ext import commands
import random
client = commands.Bot(command_prefix="")
@client.event
async def on_ready():
print("bot is ready.")
@client.command()
async def uwu(ctx):
await ctx.send("> owo")
# Replies to 'ayy' with 'lmao'
@client.command()
async def ayy(ctx):
await ctx.send("> lm... | false | true |
f7708de3a647ad2c896f1636e8a25fad6e22d678 | 3,984 | py | Python | alipay/aop/api/request/ZhimaCustomerCertificationQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/ZhimaCustomerCertificationQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/ZhimaCustomerCertificationQueryRequest.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCustomerCertificationQueryModel import ZhimaCustomerCertificationQueryModel
class ZhimaCustomerCertificationQueryRequest(object... | 27.475862 | 148 | 0.646084 | import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ZhimaCustomerCertificationQueryModel import ZhimaCustomerCertificationQueryModel
class ZhimaCustomerCertificationQueryRequest(object):
def __init__(self, biz_model=None):
... | true | true |
f7708e3099ae019de13ec24d6ee7307a9e02bf1b | 588 | py | Python | examples/API_v2/get_users_tweets.py | eggplants/tweepy | ef3a4d45ad2d88b32ce0a5fc8704050cf4a78b61 | [
"MIT"
] | 1 | 2022-03-24T14:09:24.000Z | 2022-03-24T14:09:24.000Z | examples/API_v2/get_users_tweets.py | eggplants/tweepy | ef3a4d45ad2d88b32ce0a5fc8704050cf4a78b61 | [
"MIT"
] | 1 | 2019-10-30T19:48:02.000Z | 2019-10-30T19:48:02.000Z | examples/API_v2/get_users_tweets.py | eggplants/tweepy | ef3a4d45ad2d88b32ce0a5fc8704050cf4a78b61 | [
"MIT"
] | null | null | null | import tweepy
bearer_token = ""
client = tweepy.Client(bearer_token)
# Get User's Tweets
# This endpoint/method returns Tweets composed by a single user, specified by
# the requested user ID
user_id = 2244994945
response = client.get_users_tweets(user_id)
# By default, only the ID and text fields of each Tweet ... | 23.52 | 77 | 0.768707 | import tweepy
bearer_token = ""
client = tweepy.Client(bearer_token)
# This endpoint/method returns Tweets composed by a single user, specified by
# the requested user ID
user_id = 2244994945
response = client.get_users_tweets(user_id)
# By default, only the ID and text fields of each Tweet will be returned
for... | true | true |
f7708eba486b599aff2f19f682193e818d78fb0b | 54,083 | py | Python | src/transformers/models/deberta/modeling_deberta.py | djroxx2000/transformers | 77770ec79883343d32051cfb6a04f64523cd8df1 | [
"Apache-2.0"
] | 723 | 2020-07-16T13:02:25.000Z | 2022-03-31T21:03:55.000Z | src/transformers/models/deberta/modeling_deberta.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 170 | 2020-07-16T14:39:11.000Z | 2022-03-31T13:02:11.000Z | src/transformers/models/deberta/modeling_deberta.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 131 | 2020-07-16T14:38:16.000Z | 2022-03-29T19:43:18.000Z | # coding=utf-8
# Copyright 2020 Microsoft and the Hugging Face Inc. team.
#
# 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 require... | 39.390386 | 128 | 0.653625 |
import math
from collections.abc import Sequence
import torch
from torch import _softmax_backward_data, nn
from torch.nn import CrossEntropyLoss
from ...activations import ACT2FN
from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
from ...modeling_outputs... | true | true |
f7708f66bcc19dd5f992f1e2ad16676b1e49469f | 2,451 | py | Python | src/backend/database_migrations/versions/20210224_105823_make_read_reads.py | chanzuckerberg/czgenepi | 87bd2b1739acdfe2c7c25663fafb01dc24c5e2fd | [
"MIT"
] | 5 | 2021-02-04T20:18:46.000Z | 2021-09-09T13:42:42.000Z | src/backend/database_migrations/versions/20210224_105823_make_read_reads.py | chanzuckerberg/aspen | 9853778a7ef68b0446751657af5a835f98dde3dc | [
"MIT"
] | 422 | 2021-01-30T04:16:00.000Z | 2022-01-31T23:18:44.000Z | src/backend/database_migrations/versions/20210224_105823_make_read_reads.py | chanzuckerberg/covidr | afe05d703d30ec18ac83944bfb551c313cb216c4 | [
"MIT"
] | 1 | 2021-05-20T14:54:39.000Z | 2021-05-20T14:54:39.000Z | """make read -> reads
Create Date: 2021-02-24 10:58:25.108079
"""
import enumtables # noqa: F401
from alembic import op
# revision identifiers, used by Alembic.
revision = "20210224_105823"
down_revision = "20210222_220412"
branch_labels = None
depends_on = None
def upgrade():
op.rename_table(
"sequen... | 27.852273 | 72 | 0.666667 | import enumtables from alembic import op
revision = "20210224_105823"
down_revision = "20210222_220412"
branch_labels = None
depends_on = None
def upgrade():
op.rename_table(
"sequencing_read_collections",
"sequencing_reads_collections",
schema="aspen",
)
op.rename_table(
... | true | true |
f7709011a2e49aee497f111e0e51c01f78aa6534 | 12,639 | py | Python | schema_salad/main.py | PlatformedTasks/PLAS-cwl-tes | 5e66a5f9309906d1e8caa0f7148b8517a17f840d | [
"Apache-2.0"
] | null | null | null | schema_salad/main.py | PlatformedTasks/PLAS-cwl-tes | 5e66a5f9309906d1e8caa0f7148b8517a17f840d | [
"Apache-2.0"
] | null | null | null | schema_salad/main.py | PlatformedTasks/PLAS-cwl-tes | 5e66a5f9309906d1e8caa0f7148b8517a17f840d | [
"Apache-2.0"
] | null | null | null | """Command line interface to schema-salad."""
from __future__ import absolute_import, print_function
import argparse
import logging
import os
import sys
from typing import Any, Dict, List, Mapping, MutableSequence, Optional, Union, cast
import pkg_resources # part of setuptools
import six
from rdflib.parser import P... | 31.756281 | 88 | 0.631933 | from __future__ import absolute_import, print_function
import argparse
import logging
import os
import sys
from typing import Any, Dict, List, Mapping, MutableSequence, Optional, Union, cast
import pkg_resources import six
from rdflib.parser import Parser
from rdflib.plugin import register
from six.moves import urll... | true | true |
f77090b5a0b17c3d8e1fb66ccb196ec38c20e050 | 810 | py | Python | output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_enumeration_5_xsd/nistschema_sv_iv_atomic_integer_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_enumeration_5_xsd/nistschema_sv_iv_atomic_integer_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_enumeration_5_xsd/nistschema_sv_iv_atomic_integer_enumeration_5.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-integer-enumeration-5-NS"
class NistschemaSvIvAtomicIntegerEnumeration5Type(Enum):
VALUE_MINUS_165130515156176 = -165130515156176
VALUE_MINUS_4149 = -4149
VALUE_848 = 848
... | 27 | 73 | 0.730864 | from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-integer-enumeration-5-NS"
class NistschemaSvIvAtomicIntegerEnumeration5Type(Enum):
VALUE_MINUS_165130515156176 = -165130515156176
VALUE_MINUS_4149 = -4149
VALUE_848 = 848
... | true | true |
f770915f025b8d556fb579a18a360838334675ca | 1,586 | py | Python | tests/cases_py/test_abstract_numbers.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 2 | 2022-02-02T11:37:53.000Z | 2022-03-30T18:19:06.000Z | tests/cases_py/test_abstract_numbers.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 25 | 2022-02-28T21:19:11.000Z | 2022-03-23T21:26:20.000Z | tests/cases_py/test_abstract_numbers.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | null | null | null | """Unit tests for numbers.py."""
import math
import operator
import unittest
from numbers import Complex, Real, Rational, Integral
class TestNumbers(unittest.TestCase):
def test_int(self):
self.assertTrue(issubclass(int, Integral))
# self.assertTrue(issubclass(int, Complex)) # Error in Julia
... | 35.244444 | 70 | 0.656999 |
import math
import operator
import unittest
from numbers import Complex, Real, Rational, Integral
class TestNumbers(unittest.TestCase):
def test_int(self):
self.assertTrue(issubclass(int, Integral))
self.assertEqual(7, int(7).real)
self.assertEqual(0, int(7).imag)
self.asse... | true | true |
f7709180acc972d47930a904b86f86b89bdc9d67 | 2,404 | py | Python | horizon_bsn/content/connections/routerrules/views.py | mmxiong/horizon-bsn | 3cc843f3a7809c2f5e8b98be4c98084cfb9221c9 | [
"Apache-2.0"
] | null | null | null | horizon_bsn/content/connections/routerrules/views.py | mmxiong/horizon-bsn | 3cc843f3a7809c2f5e8b98be4c98084cfb9221c9 | [
"Apache-2.0"
] | null | null | null | horizon_bsn/content/connections/routerrules/views.py | mmxiong/horizon-bsn | 3cc843f3a7809c2f5e8b98be4c98084cfb9221c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013, Big Switch Networks
#
# 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 ... | 33.859155 | 78 | 0.699667 |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon.utils import memoized
from horizon_bsn.content.connections.routerrules import forms as rrforms
from openstack_dashboard import ap... | true | true |
f77091a2ba61406f6efb27e60dc84ea7a1dcdbc1 | 7,441 | py | Python | DaikinInterface.py | jamespauly/udi-daikin-poly | 2fc09f7776e3cba720362395030a1582d5c0f932 | [
"MIT"
] | null | null | null | DaikinInterface.py | jamespauly/udi-daikin-poly | 2fc09f7776e3cba720362395030a1582d5c0f932 | [
"MIT"
] | 1 | 2021-08-18T19:39:06.000Z | 2021-08-19T15:53:36.000Z | DaikinInterface.py | jamespauly/udi-daikin-poly | 2fc09f7776e3cba720362395030a1582d5c0f932 | [
"MIT"
] | null | null | null | """Pydaikin appliance, represent a Daikin BRP069 device."""
import logging
from pydaikin.daikin_base import Appliance
_LOGGER = logging.getLogger(__name__)
class DaikinInterface(Appliance):
TRANSLATIONS = {
'mode': {
'2': 'dry',
'3': 'cool',
'4': 'hot',
... | 30.621399 | 88 | 0.527483 |
import logging
from pydaikin.daikin_base import Appliance
_LOGGER = logging.getLogger(__name__)
class DaikinInterface(Appliance):
TRANSLATIONS = {
'mode': {
'2': 'dry',
'3': 'cool',
'4': 'hot',
'6': 'fan',
'0': 'auto',
'1': 'auto-... | true | true |
f77091d2c37d77101b062cd3270c734b7ae7b98a | 761 | py | Python | src/pcc-master/chapter_15/dice_visual.py | chris-kuo/elements_of_programming_interview | 8947980fdf60dfbb577600052b33d37f782216b5 | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | src/pcc-master/chapter_15/dice_visual.py | chris-kuo/elements_of_programming_interview | 8947980fdf60dfbb577600052b33d37f782216b5 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | PYTHON/Python-Arquivos_txt/CURSO_EXTENSIVO_PYTHON/chapter_15/dice_visual.py | angrycaptain19/Estudos | bbdc6a7399635312da272a62639157132bcff4a0 | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | import pygal
from die import Die
# Create two D6 dice.
die_1 = Die()
die_2 = Die()
# Make some rolls, and store results in a list.
results = []
for roll_num in range(1000):
result = die_1.roll() + die_2.roll()
results.append(result)
# Analyze the results.
frequencies = []
max_result = die_1.num_sides + ... | 23.78125 | 74 | 0.668857 | import pygal
from die import Die
die_1 = Die()
die_2 = Die()
results = []
for roll_num in range(1000):
result = die_1.roll() + die_2.roll()
results.append(result)
frequencies = []
max_result = die_1.num_sides + die_2.num_sides
for value in range(2, max_result+1):
frequency = results.count(value)
... | true | true |
f770947975cf38c5f7e000d6c1f4927d906e1f3d | 2,964 | py | Python | WGIBDscan/WGIBDScan.py | jtb324/WGIBDscan | c579e91f6e78bd2f0964cb88b39fd6d4ca0162ba | [
"MIT"
] | null | null | null | WGIBDscan/WGIBDScan.py | jtb324/WGIBDscan | c579e91f6e78bd2f0964cb88b39fd6d4ca0162ba | [
"MIT"
] | null | null | null | WGIBDscan/WGIBDScan.py | jtb324/WGIBDscan | c579e91f6e78bd2f0964cb88b39fd6d4ca0162ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import typer
from typing import List, Tuple
import callbacks
import ersa_search
import logger
from os import environ
import colors
import search_ibd_files
app = typer.Typer(add_completion=False)
color_formatter: colors.Color = colors.Color()
def display_input(grid_list: str, cores: int, ibd_fil... | 43.588235 | 202 | 0.704116 | import typer
from typing import List, Tuple
import callbacks
import ersa_search
import logger
from os import environ
import colors
import search_ibd_files
app = typer.Typer(add_completion=False)
color_formatter: colors.Color = colors.Color()
def display_input(grid_list: str, cores: int, ibd_files: List[str], output: ... | true | true |
f770949c6abbdf8e0255a1151a0aea620436214f | 16,124 | py | Python | evalne/evaluation/pipeline.py | bhevencious/EvalNE | a62bd11901ea891535f6cb2a05e7abb65b1f3e6f | [
"MIT"
] | null | null | null | evalne/evaluation/pipeline.py | bhevencious/EvalNE | a62bd11901ea891535f6cb2a05e7abb65b1f3e6f | [
"MIT"
] | null | null | null | evalne/evaluation/pipeline.py | bhevencious/EvalNE | a62bd11901ea891535f6cb2a05e7abb65b1f3e6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Mara Alexandru Cristian
# Contact: alexandru.mara@ugent.be
# Date: 18/12/2018
# The manager module contains functions and classes for reading, parsing and using a configuration file to
# run a complete evaluation of network embedding methods.
from __future__ imp... | 35.12854 | 120 | 0.599107 |
from __future__ import division
import os
from evalne.utils import util
from sklearn.linear_model import LogisticRegression
from sklearn.linear_model import LogisticRegressionCV
from sklearn.tree import DecisionTreeClassifier
from sklearn.svm import LinearSVC
from sklearn.model_selection import GridSearchCV
class... | true | true |
f770965de150479b6ef771fa6ec1ead94cce2c52 | 2,944 | py | Python | airflow/sensors/python.py | shreejitverma/airflow | 7a9ab1d7170567b1d53938b2f7345dae2026c6ea | [
"Apache-2.0"
] | 27 | 2019-02-25T14:20:36.000Z | 2022-03-22T09:35:13.000Z | airflow/sensors/python.py | shreejitverma/airflow | 7a9ab1d7170567b1d53938b2f7345dae2026c6ea | [
"Apache-2.0"
] | 200 | 2019-01-09T15:33:06.000Z | 2022-01-12T09:13:42.000Z | airflow/sensors/python.py | shreejitverma/airflow | 7a9ab1d7170567b1d53938b2f7345dae2026c6ea | [
"Apache-2.0"
] | 14 | 2019-06-25T17:08:29.000Z | 2022-03-29T13:25:53.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.783784 | 86 | 0.713995 | from typing import Any, Callable, Dict, List, Mapping, Optional
from airflow.sensors.base import BaseSensorOperator
from airflow.utils.context import Context
from airflow.utils.operator_helpers import determine_kwargs
class PythonSensor(BaseSensorOperator):
template_fields = ('templates_dict', 'op_args', 'op_kw... | true | true |
f77096eb17b7fee5c7cee6dc65c469d08e7086c1 | 421 | py | Python | Python Basics/Pre-Exam Exercise/02. Beer And Chips.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python Basics/Pre-Exam Exercise/02. Beer And Chips.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python Basics/Pre-Exam Exercise/02. Beer And Chips.py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | import math
name = input()
budget = float(input())
beer_count = int(input())
chips_count = int(input())
beer = 1.20
beer_cost = beer_count * beer
b = beer_cost * 0.45
chips_cost = math.ceil(b * chips_count)
total_sum = beer_cost + chips_cost
if total_sum <= budget:
print(f"{name} bought a snack and has {budget ... | 20.047619 | 79 | 0.68171 | import math
name = input()
budget = float(input())
beer_count = int(input())
chips_count = int(input())
beer = 1.20
beer_cost = beer_count * beer
b = beer_cost * 0.45
chips_cost = math.ceil(b * chips_count)
total_sum = beer_cost + chips_cost
if total_sum <= budget:
print(f"{name} bought a snack and has {budget ... | true | true |
f770973182f45ac8afd8e237be4097bc65559eb8 | 3,001 | py | Python | ooobuild/lo/ucb/property_command_argument.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/property_command_argument.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/property_command_argument.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... | 30.622449 | 145 | 0.663112 | from ooo.oenv.env_const import UNO_NONE
import typing
from ..beans.property import Property as Property_8f4e0a76
class PropertyCommandArgument(object):
__ooo_ns__: str = 'com.sun.star.ucb'
__ooo_full_ns__: str = 'com.sun.star.ucb.PropertyCommandArgument'
__ooo_type_name__: str = 'struct'
typeName: str... | true | true |
f77097c4d8dd9c9e8fe04d93d5b258e695842d1e | 623 | py | Python | var/spack/repos/builtin/packages/py-terminado/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/py-terminado/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-terminado/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 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 PyTerminado(PythonPackage):
"""Terminals served to term.js using Tornado websockets"""
... | 32.789474 | 81 | 0.711075 |
from spack import *
class PyTerminado(PythonPackage):
homepage = "https://pypi.python.org/pypi/terminado"
url = "https://pypi.io/packages/source/t/terminado/terminado-0.6.tar.gz"
version('0.6', '5b6c65da27fe1ed07a9f80f0588cdaba')
depends_on('py-tornado@4:', type=('build', 'run'))
depends_... | true | true |
f77097e60c611d910f90f2c8765b773cc3d15eb1 | 1,019 | py | Python | pyunity/examples/example7/__init__.py | Knight1632/pyunity | 4d96311bef1bb51aee6afbdcc156f9a290c29815 | [
"MIT"
] | null | null | null | pyunity/examples/example7/__init__.py | Knight1632/pyunity | 4d96311bef1bb51aee6afbdcc156f9a290c29815 | [
"MIT"
] | null | null | null | pyunity/examples/example7/__init__.py | Knight1632/pyunity | 4d96311bef1bb51aee6afbdcc156f9a290c29815 | [
"MIT"
] | null | null | null | from pyunity import Behaviour, GameObject, SceneManager, Material, Color, Mesh, Vector3, MeshRenderer
class Switch(Behaviour):
def Start(self):
self.a = 3
def Update(self, dt):
self.a -= dt
if self.a < 0:
SceneManager.LoadSceneByIndex(1)
def main():
scene =... | 28.305556 | 102 | 0.641806 | from pyunity import Behaviour, GameObject, SceneManager, Material, Color, Mesh, Vector3, MeshRenderer
class Switch(Behaviour):
def Start(self):
self.a = 3
def Update(self, dt):
self.a -= dt
if self.a < 0:
SceneManager.LoadSceneByIndex(1)
def main():
scene =... | true | true |
f770988a4eec104ddf01425714339f1edb353c1c | 23,043 | py | Python | test/functional/test_framework/util.py | sergiucolitovv/covidcoin | 9c8afc481c35503e195d54d9ff8e41563d2c363e | [
"MIT"
] | 1 | 2021-03-03T06:40:44.000Z | 2021-03-03T06:40:44.000Z | test/functional/test_framework/util.py | sergiucolitovv/covidcoin | 9c8afc481c35503e195d54d9ff8e41563d2c363e | [
"MIT"
] | null | null | null | test/functional/test_framework/util.py | sergiucolitovv/covidcoin | 9c8afc481c35503e195d54d9ff8e41563d2c363e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | 38.024752 | 142 | 0.649698 |
from base64 import b64encode
from binascii import hexlify, unhexlify
from decimal import Decimal, ROUND_DOWN
import hashlib
import json
import logging
import os
import random
import re
from subprocess import CalledProcessError
import time
from . import coverage
from .authproxy import AuthServiceProxy, JSONRPCExceptio... | true | true |
f770992cb1ccba30de4b984fca763f8d64eb42a8 | 1,971 | py | Python | text.py | nicksolomon/lib_game | 77012590526148d03957e38a6313865e1233bdb1 | [
"BSD-3-Clause"
] | null | null | null | text.py | nicksolomon/lib_game | 77012590526148d03957e38a6313865e1233bdb1 | [
"BSD-3-Clause"
] | null | null | null | text.py | nicksolomon/lib_game | 77012590526148d03957e38a6313865e1233bdb1 | [
"BSD-3-Clause"
] | null | null | null | # Lot's of stuff for making text prettier
# try to import all the needed libraries, if it doesn't work,
# make all the functions do nothing.
try:
import colorama
from termcolor import colored
colorama.init()
def bold(string):
return colored(string, attrs = ["bold"])
def underline(string):
... | 28.565217 | 95 | 0.590056 | # try to import all the needed libraries, if it doesn't work,
try:
import colorama
from termcolor import colored
colorama.init()
def bold(string):
return colored(string, attrs = ["bold"])
def underline(string):
return colored(string, attrs = ["underline"])
def red(string):
... | true | true |
f7709a96764d220fcffa4ebe5515f2fec4776da2 | 62 | py | Python | demo/apps/partner/__init__.py | azaan6260/mysite | 394406198fa885b051054f858065cb7ef38ec87f | [
"MIT"
] | 22 | 2016-06-17T09:00:16.000Z | 2021-09-15T03:51:50.000Z | demo/apps/partner/__init__.py | azaan6260/mysite | 394406198fa885b051054f858065cb7ef38ec87f | [
"MIT"
] | 3 | 2016-07-27T19:00:41.000Z | 2017-06-04T14:32:24.000Z | demo/apps/partner/__init__.py | azaan6260/mysite | 394406198fa885b051054f858065cb7ef38ec87f | [
"MIT"
] | 9 | 2016-07-26T10:16:19.000Z | 2021-02-25T21:46:37.000Z | default_app_config = 'demo.apps.partner.config.PartnerConfig'
| 31 | 61 | 0.83871 | default_app_config = 'demo.apps.partner.config.PartnerConfig'
| true | true |
f7709afeb38fbca74ac9f6d9054ead7bc7db0771 | 2,833 | py | Python | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_materializations.py | hebo-yang/dagster | 553ad7fbb209e690907a477ca18e03ae519199f9 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_materializations.py | hebo-yang/dagster | 553ad7fbb209e690907a477ca18e03ae519199f9 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_materializations.py | hebo-yang/dagster | 553ad7fbb209e690907a477ca18e03ae519199f9 | [
"Apache-2.0"
] | null | null | null | from dagster_graphql.test.utils import infer_pipeline_selector
from dagster_graphql_tests.graphql.setup import LONG_INT
from .graphql_context_test_suite import ExecutingGraphQLContextTestMatrix
from .utils import sync_execute_get_events
class TestMaterializations(ExecutingGraphQLContextTestMatrix):
def test_mate... | 38.808219 | 99 | 0.662549 | from dagster_graphql.test.utils import infer_pipeline_selector
from dagster_graphql_tests.graphql.setup import LONG_INT
from .graphql_context_test_suite import ExecutingGraphQLContextTestMatrix
from .utils import sync_execute_get_events
class TestMaterializations(ExecutingGraphQLContextTestMatrix):
def test_mate... | true | true |
f7709bfc59d99549607a467d401b2a086bcaacd0 | 952 | py | Python | dynamic_sample.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | 6 | 2020-09-29T03:01:24.000Z | 2022-03-24T02:09:43.000Z | dynamic_sample.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | 16 | 2020-11-23T20:49:44.000Z | 2022-03-14T19:41:07.000Z | dynamic_sample.py | DaYuM/veracode-api-py | 12965d8919d9a7752398e7cd19bdcc4a81bc3c9e | [
"MIT"
] | 7 | 2021-05-08T18:34:53.000Z | 2022-03-01T19:47:03.000Z | from veracode_api_py.dynamic import Analyses, Scans, ScanCapacitySummary, ScanOccurrences, ScannerVariables, DynUtils, Occurrences
url = DynUtils().setup_url('http://www.example.com','DIRECTORY_AND_SUBDIRECTORY',False)
allowed_hosts = [url]
auth = DynUtils().setup_auth('AUTO','admin','smithy')
auth_config = DynUtil... | 38.08 | 130 | 0.797269 | from veracode_api_py.dynamic import Analyses, Scans, ScanCapacitySummary, ScanOccurrences, ScannerVariables, DynUtils, Occurrences
url = DynUtils().setup_url('http://www.example.com','DIRECTORY_AND_SUBDIRECTORY',False)
allowed_hosts = [url]
auth = DynUtils().setup_auth('AUTO','admin','smithy')
auth_config = DynUtil... | true | true |
f7709c49f6b9bea5614756d3bdd160789e8d701c | 1,773 | py | Python | API Development/rec-demo1.py | mmeck001/MATTWFP | 19fbf6bd7c6a1af382af610ebb0502ae26fe91e8 | [
"Apache-2.0"
] | null | null | null | API Development/rec-demo1.py | mmeck001/MATTWFP | 19fbf6bd7c6a1af382af610ebb0502ae26fe91e8 | [
"Apache-2.0"
] | null | null | null | API Development/rec-demo1.py | mmeck001/MATTWFP | 19fbf6bd7c6a1af382af610ebb0502ae26fe91e8 | [
"Apache-2.0"
] | null | null | null | ## Recommendation.py will take in a set of 4 numbers representing which illness the person has
import re #regular expression library - powerful tool for processing text
import sys
survey = sys.argv
#print str(survey)
disease = ''
#print(survey[1])
if survey[1] == '1':
disease = 'PTSD'
data = open('ptsd.txt')
e... | 23.328947 | 151 | 0.695431 |
import re
import sys
survey = sys.argv
disease = ''
if survey[1] == '1':
disease = 'PTSD'
data = open('ptsd.txt')
else:
if survey[2] == '1':
disease = 'Depression'
data = open('depression.txt')
else:
disease = 'Anxiety'
data = open('anxiety.txt')
plaintext = data.read()
rev1 = re.sub('\r\n\r\n', '... | true | true |
f7709d957d4d35f22a4107ac91c555300f369fba | 160 | py | Python | src/flask_cli/config.py | DonalChilde/flask_cli | 036f772e957100caa6fbed99d40c6dde52aea7e3 | [
"MIT"
] | null | null | null | src/flask_cli/config.py | DonalChilde/flask_cli | 036f772e957100caa6fbed99d40c6dde52aea7e3 | [
"MIT"
] | null | null | null | src/flask_cli/config.py | DonalChilde/flask_cli | 036f772e957100caa6fbed99d40c6dde52aea7e3 | [
"MIT"
] | null | null | null | """Default configuration
Use env var to override
"""
import os
ENV = os.getenv("FLASK_ENV")
DEBUG = ENV == "development"
SECRET_KEY = os.getenv("SECRET_KEY")
| 16 | 36 | 0.7125 | import os
ENV = os.getenv("FLASK_ENV")
DEBUG = ENV == "development"
SECRET_KEY = os.getenv("SECRET_KEY")
| true | true |
f7709f8f354ca8d5fcedea1fb4085d3edb525aad | 6,169 | py | Python | metrics/perceptual_path_length.py | GiovanniCalore/BigGAN-Tensorflow-master | 1fcf72fc8b9cbfdd047b9641f656afcfd0972604 | [
"MIT"
] | null | null | null | metrics/perceptual_path_length.py | GiovanniCalore/BigGAN-Tensorflow-master | 1fcf72fc8b9cbfdd047b9641f656afcfd0972604 | [
"MIT"
] | null | null | null | metrics/perceptual_path_length.py | GiovanniCalore/BigGAN-Tensorflow-master | 1fcf72fc8b9cbfdd047b9641f656afcfd0972604 | [
"MIT"
] | null | null | null | # Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, visit
# https://nvlabs.github.io/stylegan2/license.html
"""Perceptual Path Length (PPL)."""
import numpy as np
import tensorflow as tf
import dnnlib... | 45.360294 | 142 | 0.558924 |
import numpy as np
import tensorflow as tf
import dnnlib.tflib as tflib
from metrics import metric_base
import misc
import sys
def normalize(v):
return v / tf.sqrt(tf.reduce_sum(tf.square(v), axis=-1, keepdims=True))
def slerp(a, b, t):
a = normalize(a)
b = normalize(b)
d = tf.reduce_sum(a * b, ax... | true | true |
f7709fb714a6faadef804816a38100a0049be1a7 | 297 | py | Python | ca_on_north_dumfries/__init__.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 19 | 2015-05-26T03:18:50.000Z | 2022-01-31T03:27:41.000Z | ca_on_north_dumfries/__init__.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 119 | 2015-01-09T06:09:35.000Z | 2022-01-20T23:05:05.000Z | ca_on_north_dumfries/__init__.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 17 | 2015-11-23T05:00:10.000Z | 2021-09-15T16:03:33.000Z | from utils import CanadianJurisdiction
class NorthDumfries(CanadianJurisdiction):
classification = 'legislature'
division_id = 'ocd-division/country:ca/csd:3530004'
division_name = 'North Dumfries'
name = 'North Dumfries Township Council'
url = 'http://www.northdumfries.ca'
| 29.7 | 55 | 0.747475 | from utils import CanadianJurisdiction
class NorthDumfries(CanadianJurisdiction):
classification = 'legislature'
division_id = 'ocd-division/country:ca/csd:3530004'
division_name = 'North Dumfries'
name = 'North Dumfries Township Council'
url = 'http://www.northdumfries.ca'
| true | true |
f770a02b25570b78622ed2b0e1c3f8d8cd29eef8 | 8,845 | py | Python | lib/spack/spack/cmd/find.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | lib/spack/spack/cmd/find.py | BlueBrain/spack | 047fa4b21b90abfd227dd70a77689bb473cd1a57 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | lib/spack/spack/cmd/find.py | genric/spack | e35a99e5d6da729f197954802d697d75e02aefe0 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 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 __future__ import print_function
import copy
import os
import sys
import llnl.util.tty as tty
import llnl.util.tty.... | 34.550781 | 77 | 0.623855 |
from __future__ import print_function
import copy
import os
import sys
import llnl.util.tty as tty
import llnl.util.tty.color as color
import llnl.util.lang
import spack.environment as ev
import spack.repo
import spack.cmd as cmd
import spack.cmd.common.arguments as arguments
import spack.user_environment as uenv
f... | true | true |
f770a0a50f44f4465f56832fce74d9e285061793 | 588 | py | Python | thistle/patterns.py | jgmitchell257/thistle | 8abfbf1c7baa8020b60c7808bdf23d977b177e06 | [
"MIT"
] | null | null | null | thistle/patterns.py | jgmitchell257/thistle | 8abfbf1c7baa8020b60c7808bdf23d977b177e06 | [
"MIT"
] | null | null | null | thistle/patterns.py | jgmitchell257/thistle | 8abfbf1c7baa8020b60c7808bdf23d977b177e06 | [
"MIT"
] | null | null | null | """
patterns
--------
Common regex patterns for including in scripts.
"""
us_phone = r"\(\d\d\d\) \d\d\d-?\d\d\d\d"
short_date = r"\d?\d/\d?\d/\d\d\d\d"
ssn = r"\d\d\d-\d\d-\d\d\d\d"
time_format = r"[0-9]?[0-9]:[0-9][0-9]"
zip_code = r"\d{5}-\d{4}|\d{5}"
last_first = r"([\w\-]+)\s*,\s*(\w+)\s*"
ip_address = r"\d{1,3}... | 29.4 | 65 | 0.460884 |
us_phone = r"\(\d\d\d\) \d\d\d-?\d\d\d\d"
short_date = r"\d?\d/\d?\d/\d\d\d\d"
ssn = r"\d\d\d-\d\d-\d\d\d\d"
time_format = r"[0-9]?[0-9]:[0-9][0-9]"
zip_code = r"\d{5}-\d{4}|\d{5}"
last_first = r"([\w\-]+)\s*,\s*(\w+)\s*"
ip_address = r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"
mac_address = r"(?:[0-9a-fA-F]{2}\:){5}[0-9a-... | true | true |
f770a0d4b07c60fa3c98f5231daeb0fba40d8468 | 109 | py | Python | Python_proficiency_test/latex/codes/9.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 6 | 2020-04-24T08:16:51.000Z | 2021-11-01T09:50:46.000Z | Python_proficiency_test/latex/codes/9.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | null | null | null | Python_proficiency_test/latex/codes/9.py | ALFA-group/neural_program_comprehension | 0253911f376cf282af5a5627e38e0a591ad38860 | [
"MIT"
] | 4 | 2021-02-17T20:21:31.000Z | 2022-02-14T12:43:23.000Z | import copy
a = [1,2,3,4]
b = copy.copy(a) # Shallow copy
print(a)
print(b)
b.append(1)
print(a)
print(b)
| 9.083333 | 31 | 0.623853 | import copy
a = [1,2,3,4]
b = copy.copy(a)
print(a)
print(b)
b.append(1)
print(a)
print(b)
| true | true |
f770a11bfb5a1afee6d828b9ea33f3bd11b62d44 | 21,837 | py | Python | localspelling/gb_us.py | fastdatascience/localspelling | 382a220bd05330b990cef277f7f18262db462faf | [
"MIT"
] | 1 | 2020-09-23T00:53:35.000Z | 2020-09-23T00:53:35.000Z | localspelling/gb_us.py | fastdatascience/localspelling | 382a220bd05330b990cef277f7f18262db462faf | [
"MIT"
] | null | null | null | localspelling/gb_us.py | fastdatascience/localspelling | 382a220bd05330b990cef277f7f18262db462faf | [
"MIT"
] | null | null | null | DICTIONARY = '''acclimatisation acclimatization
acclimatise acclimatize
acclimatised acclimatized
acclimatising acclimatizing
actualisation actualization
actualise actualize
actualised actualized
actualising actualizing
aeon eon
aeons eons
aeroplane airplane
aetiology etiology
aggrandise aggrandize
aggrandised aggrandi... | 21.706759 | 47 | 0.907451 | DICTIONARY = '''acclimatisation acclimatization
acclimatise acclimatize
acclimatised acclimatized
acclimatising acclimatizing
actualisation actualization
actualise actualize
actualised actualized
actualising actualizing
aeon eon
aeons eons
aeroplane airplane
aetiology etiology
aggrandise aggrandize
aggrandised aggrandi... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.