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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7694637507cf2bd327dcfbe0dc01cea8a0fb22f | 1,218 | py | Python | news/admin.py | vigen-b/FakeNews | fc19f623529d1661c9f3d475adc9db98ee95a38a | [
"Apache-2.0"
] | null | null | null | news/admin.py | vigen-b/FakeNews | fc19f623529d1661c9f3d475adc9db98ee95a38a | [
"Apache-2.0"
] | null | null | null | news/admin.py | vigen-b/FakeNews | fc19f623529d1661c9f3d475adc9db98ee95a38a | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from django import forms
from .models import News, Category
from tinymce.widgets import TinyMCE
class NewsForm(forms.ModelForm):
text = forms.CharField(widget=TinyMCE(attrs={"cols": 80, "rows": 100}))
... | 24.857143 | 88 | 0.655172 | from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from django import forms
from .models import News, Category
from tinymce.widgets import TinyMCE
class NewsForm(forms.ModelForm):
text = forms.CharField(widget=TinyMCE(attrs={"cols": 80, "rows": 100}))
... | true | true |
f769472b11159ad9d9a692f03d215729485a640d | 40,139 | py | Python | boto/auth.py | nanorepublica/boto | 98edc28326c125dd6ee76cd4383ab34ced44a606 | [
"MIT"
] | 2 | 2015-04-08T06:44:07.000Z | 2020-02-25T04:04:44.000Z | boto/auth.py | haandol/boto | a82244fc9024d122c2e16e57f35faaea51b59405 | [
"MIT"
] | 3 | 2020-05-25T02:39:14.000Z | 2021-06-07T05:26:12.000Z | boto/auth.py | haandol/boto | a82244fc9024d122c2e16e57f35faaea51b59405 | [
"MIT"
] | 5 | 2015-04-10T14:26:46.000Z | 2017-02-22T18:55:34.000Z | # Copyright 2010 Google Inc.
# Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, Eucalyptus Systems, Inc.
#
# 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 re... | 38.632339 | 92 | 0.612771 |
import base64
import boto
import boto.auth_handler
import boto.exception
import boto.plugin
import boto.utils
import copy
import datetime
from email.utils import formatdate
import hmac
import os
import posixpath
from boto.compat import urllib, encodebytes
from boto.auth_handler import AuthHandler
from boto.exceptio... | true | true |
f76948693ada050afc64f2f1793f410cd0cada7b | 1,933 | py | Python | tests/gradients/test_hamiltonian_gradient.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 712 | 2020-07-29T03:46:52.000Z | 2022-03-27T11:21:51.000Z | tests/gradients/test_hamiltonian_gradient.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 1,627 | 2020-07-28T13:07:58.000Z | 2022-03-31T21:47:29.000Z | tests/gradients/test_hamiltonian_gradient.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 249 | 2020-07-29T03:26:18.000Z | 2022-03-31T19:59:48.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicabl... | 34.517857 | 81 | 0.663735 |
import pennylane as qml
from pennylane.gradients.hamiltonian_grad import hamiltonian_grad
def test_behaviour():
dev = qml.device("default.qubit", wires=2)
with qml.tape.JacobianTape() as tape:
qml.RY(0.3, wires=0)
qml.RX(0.5, wires=1)
qml.CNOT(wires=[0, 1])
... | true | true |
f769492e11dc394c474af9c032f2f19a20c48a4c | 26,430 | py | Python | qiskit/quantum_info/states/densitymatrix.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 11 | 2019-06-27T09:53:29.000Z | 2021-03-02T04:40:30.000Z | qiskit/quantum_info/states/densitymatrix.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 12 | 2018-09-21T12:02:18.000Z | 2018-09-25T09:14:59.000Z | qiskit/quantum_info/states/densitymatrix.py | ajavadia/qiskit-sdk-py | a59e8e6be1793197e19998c1f7dcfc45e6f2f3af | [
"Apache-2.0"
] | 4 | 2019-08-05T15:35:33.000Z | 2020-09-18T18:55:02.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 39.039882 | 96 | 0.596481 |
import copy
from numbers import Number
import numpy as np
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit.instruction import Instruction
from qiskit.exceptions import QiskitError
from qiskit.quantum_info.states.quantum_state import QuantumState
from qiskit.quantum_info.operators.toleranc... | true | true |
f7694945a1eadca99c4f1d6fd96e62812d705df7 | 46 | py | Python | housemonitor/steps/test/maxvalue.py | gary-pickens/HouseMonitor | 4b169bdbeed9013e1824d4bb929970ae0c27a6c9 | [
"MIT"
] | 1 | 2021-06-28T06:52:03.000Z | 2021-06-28T06:52:03.000Z | housemonitor/steps/test/maxvalue.py | gary-pickens/HouseMonitor | 4b169bdbeed9013e1824d4bb929970ae0c27a6c9 | [
"MIT"
] | null | null | null | housemonitor/steps/test/maxvalue.py | gary-pickens/HouseMonitor | 4b169bdbeed9013e1824d4bb929970ae0c27a6c9 | [
"MIT"
] | null | null | null | '''
Created on Mar 2, 2013
@author: Gary
'''
| 7.666667 | 22 | 0.586957 | true | true | |
f76949ad4ed65efd1e021a26bd98260007b34a4b | 327 | py | Python | utils/notify_admins.py | Vladvlad9/moderator_bot | 080d4f60d3492514a9da52ee9787320d788b83ed | [
"MIT"
] | null | null | null | utils/notify_admins.py | Vladvlad9/moderator_bot | 080d4f60d3492514a9da52ee9787320d788b83ed | [
"MIT"
] | null | null | null | utils/notify_admins.py | Vladvlad9/moderator_bot | 080d4f60d3492514a9da52ee9787320d788b83ed | [
"MIT"
] | null | null | null | import logging
from aiogram import Dispatcher
from data.config import load_admins
async def on_startup_notify(dp: Dispatcher):
for admin in await load_admins():
try:
await dp.bot.send_message(admin, "Бот Запущен и готов к работе")
except Exception as err:
logging.exceptio... | 23.357143 | 76 | 0.691131 | import logging
from aiogram import Dispatcher
from data.config import load_admins
async def on_startup_notify(dp: Dispatcher):
for admin in await load_admins():
try:
await dp.bot.send_message(admin, "Бот Запущен и готов к работе")
except Exception as err:
logging.exceptio... | true | true |
f7694a13888ffd27c6666639ac291a86068d4fe0 | 13,935 | py | Python | tests/classification/test_inputs.py | alanhdu/metrics | b168272eaf1ff08b9447e75338753f9c2abf0859 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_inputs.py | alanhdu/metrics | b168272eaf1ff08b9447e75338753f9c2abf0859 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_inputs.py | alanhdu/metrics | b168272eaf1ff08b9447e75338753f9c2abf0859 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning 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 required by applicable law or agreed to i... | 42.745399 | 113 | 0.647722 | import pytest
import torch
from torch import Tensor, rand, randint, tensor
from tests.classification.inputs import Input
from tests.classification.inputs import _input_binary as _bin
from tests.classification.inputs import _input_binary_prob as _bin_prob
from tests.classification.inputs import _input_multiclass as _mc... | true | true |
f7694ab8a1fbb7fbb2f47f5d2bc8d9d368fdfb9c | 3,810 | py | Python | scrapy/katya_crawlers/settings.py | thecsw/katya-dev | f9e3af7f71ab8f80b47aa120307915e1c9e4faa4 | [
"MIT"
] | 3 | 2022-02-25T22:58:02.000Z | 2022-02-27T20:26:23.000Z | scrapy/katya_crawlers/settings.py | thecsw/katya-dev | f9e3af7f71ab8f80b47aa120307915e1c9e4faa4 | [
"MIT"
] | null | null | null | scrapy/katya_crawlers/settings.py | thecsw/katya-dev | f9e3af7f71ab8f80b47aa120307915e1c9e4faa4 | [
"MIT"
] | null | null | null | # Scrapy settings for scrapy project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.... | 32.844828 | 124 | 0.78294 |
BOT_NAME = "katya_crawlers"
SPIDER_MODULES = ["katya_crawlers.spiders"]
NEWSPIDER_MODULE = "katya_crawlers.spiders"
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36"
ROBOTSTXT_OBEY = False
CONCURRENT_REQUESTS = 1
REACTOR_THREADPOOL_MAXSI... | true | true |
f7694adde2274310bfdba2d47426dc1d52a227c6 | 2,410 | py | Python | game/combat/effects/balleffect.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 5 | 2021-06-25T16:44:38.000Z | 2021-12-31T01:29:00.000Z | game/combat/effects/balleffect.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | null | null | null | game/combat/effects/balleffect.py | Sipondo/ulix-dexflow | de46482fe08e3d600dd5da581f0524b55e5df961 | [
"MIT"
] | 1 | 2021-06-25T20:33:47.000Z | 2021-06-25T20:33:47.000Z | from .baseeffect import BaseEffect
from .genericeffect import GenericEffect
from .endbattleeffect import EndBattleEffect
from ..pokefighter import PokeFighter
import math
STATUS_BONUSES = {
"Paralysis": 1.5,
"Sleep": 2.5,
"Freeze": 2.5,
"Burn": 1.5,
"Poison": 1.5,
"BadPoison": 1.5,
}
class B... | 33.943662 | 93 | 0.576349 | from .baseeffect import BaseEffect
from .genericeffect import GenericEffect
from .endbattleeffect import EndBattleEffect
from ..pokefighter import PokeFighter
import math
STATUS_BONUSES = {
"Paralysis": 1.5,
"Sleep": 2.5,
"Freeze": 2.5,
"Burn": 1.5,
"Poison": 1.5,
"BadPoison": 1.5,
}
class B... | true | true |
f7694d0cdaaf97ce9eb0090c39bd9fe2838a3b0b | 473 | py | Python | supervised_learning/0x05-regularization/3-l2_reg_create_layer.py | Naouali/holbertonschool-machine_learning | 60b7d50cd385bdf9c1372b6004308eec408d2670 | [
"MIT"
] | null | null | null | supervised_learning/0x05-regularization/3-l2_reg_create_layer.py | Naouali/holbertonschool-machine_learning | 60b7d50cd385bdf9c1372b6004308eec408d2670 | [
"MIT"
] | null | null | null | supervised_learning/0x05-regularization/3-l2_reg_create_layer.py | Naouali/holbertonschool-machine_learning | 60b7d50cd385bdf9c1372b6004308eec408d2670 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
L2 regularization layer
"""
import tensorflow as tf
def l2_reg_create_layer(prev, n, activation, lambtha):
"""
l2 regularization layer
"""
reg = tf.contrib.layers.l2_regularizer(scale=lambtha)
w = tf.contrib.layers.variance_scaling_initializer(mode='FAN_AVG')
layer... | 21.5 | 70 | 0.676533 |
import tensorflow as tf
def l2_reg_create_layer(prev, n, activation, lambtha):
reg = tf.contrib.layers.l2_regularizer(scale=lambtha)
w = tf.contrib.layers.variance_scaling_initializer(mode='FAN_AVG')
layer = tf.layers.Dense(
units=n,
kernel_initializer=w,
kernel_regularizer=reg,
... | true | true |
f7694e92af8141d3d7cb3c7b19ad29e187ee6004 | 1,566 | py | Python | cli/setup.py | ScottRudiger/sawtooth-core | eb02055225206de14105f2b4102d352c8883e8ba | [
"Apache-2.0"
] | 2 | 2018-09-27T04:43:33.000Z | 2019-10-23T14:32:31.000Z | cli/setup.py | ScottRudiger/sawtooth-core | eb02055225206de14105f2b4102d352c8883e8ba | [
"Apache-2.0"
] | 10 | 2020-05-12T06:58:15.000Z | 2022-02-26T23:59:35.000Z | cli/setup.py | ScottRudiger/sawtooth-core | eb02055225206de14105f2b4102d352c8883e8ba | [
"Apache-2.0"
] | 1 | 2020-03-03T13:42:06.000Z | 2020-03-03T13:42:06.000Z | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 31.959184 | 80 | 0.655172 |
from __future__ import print_function
import subprocess
from setuptools import setup, find_packages
conf_dir = "/etc/sawtooth"
data_files = [
(conf_dir, ['cli.toml.example'])
]
setup(
name='sawtooth-cli',
version=subprocess.check_output(
['../bin/get_version']).decode('utf-8').strip(),
des... | true | true |
f7694feede529d6f1bd86013acfa0ce6e7083216 | 1,733 | py | Python | missions/srl/data_loader.py | kozistr/naver-nlp-challenge-2018 | e8dbdda2e5a58586678cd1494734b3cadbd570c8 | [
"MIT"
] | 2 | 2021-01-17T18:28:16.000Z | 2021-05-12T21:10:52.000Z | missions/srl/data_loader.py | kozistr/naver-nlp-challenge-2018 | e8dbdda2e5a58586678cd1494734b3cadbd570c8 | [
"MIT"
] | 2 | 2020-09-26T00:46:37.000Z | 2020-10-02T11:27:06.000Z | missions/srl/data_loader.py | kozistr/naver-nlp-challenge-2018 | e8dbdda2e5a58586678cd1494734b3cadbd570c8 | [
"MIT"
] | 1 | 2019-07-16T16:36:57.000Z | 2019-07-16T16:36:57.000Z | #-*-encoding:utf-8-*-
import os, logging
def test_data_loader(root_path):
"""
문장을 리턴한다.
return: list of sentence
"""
data_path = os.path.join(root_path, 'test', 'test_data')
return _load_data(data_path, is_train=False)
def local_test_data_loader(root_path):
"""
문장을 리턴한다.
return: list of sentence
"""
data_p... | 23.739726 | 59 | 0.645124 | import os, logging
def test_data_loader(root_path):
data_path = os.path.join(root_path, 'test', 'test_data')
return _load_data(data_path, is_train=False)
def local_test_data_loader(root_path):
data_path = os.path.join(root_path, 'test', 'test_data')
return _load_data(data_path, is_train=True)
def _load_data(data... | true | true |
f769502c86d22da4aba66b3368a642ae52fcb70f | 842 | py | Python | jobs/feeds.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:43:27.000Z | 2019-09-02T00:43:27.000Z | jobs/feeds.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | null | null | null | jobs/feeds.py | buketkonuk/pythondotorg | 4d8d9728eea7c7b2fef32eb6f24fda409cf24a06 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:51:38.000Z | 2019-09-02T00:51:38.000Z | from django.contrib.syndication.views import Feed
from django.urls import reverse_lazy
from .models import Job
class JobFeed(Feed):
""" Python.org Jobs RSS Feed """
title = "Python.org Jobs Feed"
description = "Python jobs from Python.org"
link = reverse_lazy('jobs:job_list')
def items(self):
... | 28.066667 | 77 | 0.628266 | from django.contrib.syndication.views import Feed
from django.urls import reverse_lazy
from .models import Job
class JobFeed(Feed):
title = "Python.org Jobs Feed"
description = "Python jobs from Python.org"
link = reverse_lazy('jobs:job_list')
def items(self):
return Job.objects.approved()[:... | true | true |
f769503fd21c919a5f5e31ec5395e771c93874b9 | 1,411 | py | Python | backdriveb2/api/objects/account.py | Joffreybvn/backdriveb2 | bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c | [
"MIT"
] | null | null | null | backdriveb2/api/objects/account.py | Joffreybvn/backdriveb2 | bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c | [
"MIT"
] | null | null | null | backdriveb2/api/objects/account.py | Joffreybvn/backdriveb2 | bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c | [
"MIT"
] | null | null | null |
from b2sdk.v1 import InMemoryAccountInfo, B2Api
from b2sdk.v1 import Bucket as B2Bucket
from b2sdk.exception import InvalidAuthToken
from typing import List
info = InMemoryAccountInfo()
class Account:
def __init__(self, name: str, keys: list):
self.api = B2Api(info)
self.name = name
se... | 23.915254 | 75 | 0.600992 |
from b2sdk.v1 import InMemoryAccountInfo, B2Api
from b2sdk.v1 import Bucket as B2Bucket
from b2sdk.exception import InvalidAuthToken
from typing import List
info = InMemoryAccountInfo()
class Account:
def __init__(self, name: str, keys: list):
self.api = B2Api(info)
self.name = name
se... | true | true |
f7695044e3d29fb31e24d9b3c9344a46e8dc0b4c | 4,597 | py | Python | sunshine_conversations_client/model/conversation_leave_event_all_of_payload.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 4 | 2020-09-27T14:28:25.000Z | 2022-02-02T13:51:29.000Z | sunshine_conversations_client/model/conversation_leave_event_all_of_payload.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 3 | 2021-09-30T18:18:58.000Z | 2021-12-04T07:55:23.000Z | sunshine_conversations_client/model/conversation_leave_event_all_of_payload.py | Dima2022/sunshine-conversations-python | 8085a82dc320d97f09bb0174d11dd1865a65404a | [
"Apache-2.0"
] | 5 | 2020-11-07T02:08:18.000Z | 2021-12-07T17:10:23.000Z | # coding: utf-8
"""
Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefine... | 29.850649 | 103 | 0.613226 |
import pprint
import re
import six
from sunshine_conversations_client.configuration import Configuration
from sunshine_conversations_client.undefined import Undefined
class ConversationLeaveEventAllOfPayload(object):
openapi_types = {
'conversation': 'ConversationTruncated',
'user': 'UserT... | true | true |
f769515cbab67dc8d8300fa2cb44faf278fb63f6 | 6,757 | py | Python | proj04_lists/proj11_tests.py | evavanatta/vsaprograms | 9bdbcc04622a17cb972c81a4adbff2e48006a117 | [
"MIT"
] | null | null | null | proj04_lists/proj11_tests.py | evavanatta/vsaprograms | 9bdbcc04622a17cb972c81a4adbff2e48006a117 | [
"MIT"
] | null | null | null | proj04_lists/proj11_tests.py | evavanatta/vsaprograms | 9bdbcc04622a17cb972c81a4adbff2e48006a117 | [
"MIT"
] | null | null | null | ## proj11: Tests
import proj11
from proj11 import addStar
from proj11 import harmonicSum
from proj11 import isPalindrome
from proj11 import replace
# from fractions import gcd
## Uncomment tests as you need them!
########### sumList ###############
def sumList_test(lst):
if proj11.sumList(lst) == sum(lst):
... | 24.660584 | 89 | 0.508954 |
import proj11
from proj11 import addStar
from proj11 import harmonicSum
from proj11 import isPalindrome
from proj11 import replace
def sumList_test(lst):
if proj11.sumList(lst) == sum(lst):
return True
sumList_pass = True
lists = [[], [1], [4,7], [13,2,53], [13,27,31,45], [21,26,37,94,5]]
for lst in... | false | true |
f769516086ea72ddfb41c3f2fff278cb516025b4 | 3,191 | py | Python | napari/layers/shapes/_shapes_models/rectangle.py | d-v-b/napari | f0ab04af8bf3854325af1e44b5214c4710cab980 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/shapes/_shapes_models/rectangle.py | d-v-b/napari | f0ab04af8bf3854325af1e44b5214c4710cab980 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/shapes/_shapes_models/rectangle.py | d-v-b/napari | f0ab04af8bf3854325af1e44b5214c4710cab980 | [
"BSD-3-Clause"
] | 1 | 2020-07-19T18:03:35.000Z | 2020-07-19T18:03:35.000Z | import numpy as np
from .shape import Shape
from .._shapes_utils import find_corners, rectangle_to_box
class Rectangle(Shape):
"""Class for a single rectangle
Parameters
----------
data : (4, D) or (2, 2) array
Either a (2, 2) array specifying the two corners of an axis aligned
rectan... | 30.980583 | 79 | 0.577875 | import numpy as np
from .shape import Shape
from .._shapes_utils import find_corners, rectangle_to_box
class Rectangle(Shape):
def __init__(
self,
data,
*,
edge_width=1,
edge_color='black',
face_color='white',
opacity=1,
z_index=0,
dims_orde... | true | true |
f7695167fbc80d7d2ff3727f21bce94a904917c0 | 41,674 | py | Python | eval.py | banayoyo/yoolact | 9dd0ee01ce5d5d238f89fa0886e24627ec3ffbe6 | [
"MIT"
] | 9 | 2019-06-14T13:21:42.000Z | 2022-02-12T06:33:37.000Z | eval.py | banayoyo/yoolact | 9dd0ee01ce5d5d238f89fa0886e24627ec3ffbe6 | [
"MIT"
] | null | null | null | eval.py | banayoyo/yoolact | 9dd0ee01ce5d5d238f89fa0886e24627ec3ffbe6 | [
"MIT"
] | 2 | 2019-06-14T05:00:54.000Z | 2019-12-21T11:34:36.000Z | from data import COCODetection, get_label_map, MEANS, COLORS
from yolact import Yolact
from utils.augmentations import BaseTransform, FastBaseTransform, Resize
from utils.functions import MovingAverage, ProgressBar
from layers.box_utils import jaccard, center_size
from utils import timer
from utils.functions import Sav... | 41.179842 | 159 | 0.596295 | from data import COCODetection, get_label_map, MEANS, COLORS
from yolact import Yolact
from utils.augmentations import BaseTransform, FastBaseTransform, Resize
from utils.functions import MovingAverage, ProgressBar
from layers.box_utils import jaccard, center_size
from utils import timer
from utils.functions import Sav... | true | true |
f76952a109bcf5f080f4b810200aa82427a7a1bd | 9,826 | py | Python | xero_python/payrollau/models/leave_type.py | sromero84/xero-python | 89558c0baa8080c3f522701eb1b94f909248dbd7 | [
"MIT"
] | null | null | null | xero_python/payrollau/models/leave_type.py | sromero84/xero-python | 89558c0baa8080c3f522701eb1b94f909248dbd7 | [
"MIT"
] | null | null | null | xero_python/payrollau/models/leave_type.py | sromero84/xero-python | 89558c0baa8080c3f522701eb1b94f909248dbd7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Xero Payroll AU
This is the Xero Payroll API for orgs in Australia region. # noqa: E501
OpenAPI spec version: 2.3.4
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class LeaveType(Bas... | 31.49359 | 186 | 0.634643 |
import re
from xero_python.models import BaseModel
class LeaveType(BaseModel):
openapi_types = {
"name": "str",
"type_of_units": "str",
"leave_type_id": "str",
"normal_entitlement": "float",
"leave_loading_rate": "float",
"updated_date_utc": "datetime[ms-forma... | true | true |
f769531b4ac4902be19754e3c2aeffb0239a47ed | 960 | py | Python | scripts/Obstacle Avoidance using PointCloud/pcl_obstacle_avoidance.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 17 | 2020-03-27T10:33:16.000Z | 2021-06-07T10:29:13.000Z | scripts/Obstacle Avoidance using PointCloud/pcl_obstacle_avoidance.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | null | null | null | scripts/Obstacle Avoidance using PointCloud/pcl_obstacle_avoidance.py | leander-dsouza/Gazebo | 4e4c92115c9132b096f9b5a7fc9a9c0f5ed9e598 | [
"MIT"
] | 7 | 2020-03-06T03:53:57.000Z | 2021-01-15T14:31:31.000Z | #!/usr/bin/env python3
import rospy
from std_msgs.msg import String
from geometry_msgs.msg import Twist
mag=0.0
dir=0.0
max_linear_speed = 1.0
max_rotational_speed = 2.5
def callback_vector(msg):
global mag, dir
mag,dir = float(msg.data.split(",")[0]),float(msg.data.split(",")[1])
def obs_avoider():
g... | 20.869565 | 76 | 0.671875 | import rospy
from std_msgs.msg import String
from geometry_msgs.msg import Twist
mag=0.0
dir=0.0
max_linear_speed = 1.0
max_rotational_speed = 2.5
def callback_vector(msg):
global mag, dir
mag,dir = float(msg.data.split(",")[0]),float(msg.data.split(",")[1])
def obs_avoider():
global mag, dir, max_lin... | true | true |
f769539e9d68b6c86ae99096439f88d5451c2728 | 12,868 | py | Python | dataprep/clean/clean_text.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 1 | 2022-02-14T07:18:00.000Z | 2022-02-14T07:18:00.000Z | dataprep/clean/clean_text.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | dataprep/clean/clean_text.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | """
Clean a DataFrame column containing text data.
"""
import re
import string
from functools import partial, update_wrapper
from typing import Any, Callable, Dict, List, Optional, Set, Union
from unicodedata import normalize
import dask.dataframe as dd
import numpy as np
import pandas as pd
from ..assets.english_sto... | 28.852018 | 99 | 0.612683 | import re
import string
from functools import partial, update_wrapper
from typing import Any, Callable, Dict, List, Optional, Set, Union
from unicodedata import normalize
import dask.dataframe as dd
import numpy as np
import pandas as pd
from ..assets.english_stopwords import english_stopwords
from .utils import NULL... | true | true |
f769540873dd9be93d48bc04567395c91bbe0e93 | 21,854 | py | Python | src/transformers/training_args.py | xiye17/transformers | 924989e70d9425e3276ca76f148a0fcd4bbd58cf | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | xiye17/transformers | 924989e70d9425e3276ca76f148a0fcd4bbd58cf | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | xiye17/transformers | 924989e70d9425e3276ca76f148a0fcd4bbd58cf | [
"Apache-2.0"
] | null | null | null | import dataclasses
import json
import os
import warnings
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
from .file_utils import cached_property, is_torch_available, is_torch_tpu_available, torch_required
from .trainer_utils import EvaluationStrategy
f... | 48.564444 | 142 | 0.641896 | import dataclasses
import json
import os
import warnings
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
from .file_utils import cached_property, is_torch_available, is_torch_tpu_available, torch_required
from .trainer_utils import EvaluationStrategy
f... | true | true |
f769543a9a870e731912faf1c1f538270c16d8b6 | 3,247 | py | Python | KGQA/RoBERTa/pruning_model.py | LB0828/EmbedKGQA_Learning | db4bb5a91f99db8a36efdf3ae4f668d60ba018d3 | [
"Apache-2.0"
] | 306 | 2020-05-20T17:21:55.000Z | 2022-03-28T01:40:59.000Z | KGQA/RoBERTa/pruning_model.py | LB0828/EmbedKGQA_Learning | db4bb5a91f99db8a36efdf3ae4f668d60ba018d3 | [
"Apache-2.0"
] | 116 | 2020-06-18T09:05:12.000Z | 2022-03-16T03:39:58.000Z | KGQA/RoBERTa/pruning_model.py | LB0828/EmbedKGQA_Learning | db4bb5a91f99db8a36efdf3ae4f668d60ba018d3 | [
"Apache-2.0"
] | 81 | 2020-05-31T14:01:09.000Z | 2022-03-22T05:53:09.000Z | import torch
import torch
import torch.nn as nn
import torch.nn.utils
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
import torch.nn.functional as F
import numpy as np
from torch.nn.init import xavier_normal_
from transformers... | 38.2 | 116 | 0.681552 | import torch
import torch
import torch.nn as nn
import torch.nn.utils
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
import torch.nn.functional as F
import numpy as np
from torch.nn.init import xavier_normal_
from transformers... | true | true |
f769552d4f2831c615647c2b60050c8abcc4f65b | 27 | py | Python | src/euler_python_package/euler_python/medium/p263.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p263.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/medium/p263.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | def problem263():
pass
| 9 | 17 | 0.62963 | def problem263():
pass
| true | true |
f769565872768cac4deeb727103ba7b486c21b1d | 2,413 | py | Python | ohos/testfwk/test_py_file_copy.py | ShadowCCY/build | 5c88ebad21093ef816087c9160bda8e5e9035008 | [
"Apache-2.0"
] | null | null | null | ohos/testfwk/test_py_file_copy.py | ShadowCCY/build | 5c88ebad21093ef816087c9160bda8e5e9035008 | [
"Apache-2.0"
] | 14 | 2021-09-07T08:39:43.000Z | 2021-09-17T08:50:23.000Z | ohos/testfwk/test_py_file_copy.py | ShadowCCY/build | 5c88ebad21093ef816087c9160bda8e5e9035008 | [
"Apache-2.0"
] | 1 | 2021-09-13T11:17:38.000Z | 2021-09-13T11:17:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 36.560606 | 76 | 0.675922 |
import sys
import os
import argparse
import shutil
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)))))
from scripts.util.file_utils import write_file from scripts.util import build_utils
def copy_file(target_base_dir, source_files, output_dir):
output_fil... | true | true |
f7695670d5d606d299639db02a398f5f11f5fab6 | 6,993 | py | Python | certbot/certbot/_internal/constants.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | 1 | 2022-01-14T20:53:16.000Z | 2022-01-14T20:53:16.000Z | certbot/certbot/_internal/constants.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | null | null | null | certbot/certbot/_internal/constants.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | 2 | 2022-03-25T20:23:51.000Z | 2022-03-25T21:05:15.000Z | """Certbot constants."""
import logging
import pkg_resources
from acme import challenges
from certbot.compat import misc
from certbot.compat import os
SETUPTOOLS_PLUGINS_ENTRY_POINT = "certbot.plugins"
"""Setuptools entry point group name for plugins."""
OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
""... | 29.757447 | 88 | 0.732447 | import logging
import pkg_resources
from acme import challenges
from certbot.compat import misc
from certbot.compat import os
SETUPTOOLS_PLUGINS_ENTRY_POINT = "certbot.plugins"
OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
CLI_DEFAULTS = dict(
config_files=[
os.path.join(misc.get_default_f... | true | true |
f7695679fbb010e00670725f3fdc421117a9ce69 | 22,981 | py | Python | model.py | Labyrinthine-Unreal/lbrys_sub | c1a5b7d168d107b4820d5c40fbcfc895bf124f86 | [
"MIT"
] | null | null | null | model.py | Labyrinthine-Unreal/lbrys_sub | c1a5b7d168d107b4820d5c40fbcfc895bf124f86 | [
"MIT"
] | null | null | null | model.py | Labyrinthine-Unreal/lbrys_sub | c1a5b7d168d107b4820d5c40fbcfc895bf124f86 | [
"MIT"
] | null | null | null | # Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import MinMaxScaler as mini
from sklearn.model_selection import train_test_split
# Importing the libraries
import numpy as np
import... | 33.945347 | 97 | 0.753666 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import MinMaxScaler as mini
from sklearn.model_selection import train_test_split
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import... | true | true |
f769571299e9a9180ee6bfaad867b46761178e18 | 8,509 | py | Python | projection.py | uncle-ben-z/cloudutils | c1b5a751af3f9c322963be40f5a77dd282ef4257 | [
"Apache-2.0"
] | null | null | null | projection.py | uncle-ben-z/cloudutils | c1b5a751af3f9c322963be40f5a77dd282ef4257 | [
"Apache-2.0"
] | null | null | null | projection.py | uncle-ben-z/cloudutils | c1b5a751af3f9c322963be40f5a77dd282ef4257 | [
"Apache-2.0"
] | null | null | null | import os
import cv2
import numpy as np
import xml.etree.ElementTree as ET
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
# cf. nas/repos/cloud-colorizer/projection/... and repos/projection_utils/...
class View:
""" View class representing the extrinsics and intrinsics of an imag... | 36.208511 | 118 | 0.554354 | import os
import cv2
import numpy as np
import xml.etree.ElementTree as ET
import matplotlib
matplotlib.use("TkAgg")
from matplotlib import pyplot as plt
class View:
def __init__(self, label, Rt, camera):
self.label = label
self.Rt = Rt
self.camera = camera
def __str__(self):
... | true | true |
f76957158e87558e05cd098a218a6a2667b82be4 | 5,084 | py | Python | qiskit/providers/aer/pulse/controllers/unitary_controller.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | qiskit/providers/aer/pulse/controllers/unitary_controller.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 4 | 2020-09-18T15:35:31.000Z | 2020-11-10T17:15:15.000Z | qiskit/providers/aer/pulse/controllers/unitary_controller.py | sagarpahwa/qiskit-aer | 77e40c8d99fd0490d85285e96f87e4905017b646 | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... | 33.012987 | 96 | 0.68391 |
import time
import numpy as np
from scipy.linalg.blas import get_blas_funcs
from qiskit.tools.parallel import parallel_map, CPU_COUNT
from .pulse_sim_options import PulseSimOptions
from .pulse_de_solver import setup_de_solver
from .pulse_utils import occ_probabilities, write_shots_memory
dznrm2 = get_blas_funcs("z... | true | true |
f7695788f0890dd441cbeba18adfd700952af776 | 4,775 | py | Python | experiments/battery/manager_reduced_joints_efficiency.py | MRebolle/Battery-Robot | 1b97e8c77cf7eff7d5cc7e417b4e5ec97e4011e7 | [
"Apache-1.1"
] | null | null | null | experiments/battery/manager_reduced_joints_efficiency.py | MRebolle/Battery-Robot | 1b97e8c77cf7eff7d5cc7e417b4e5ec97e4011e7 | [
"Apache-1.1"
] | null | null | null | experiments/battery/manager_reduced_joints_efficiency.py | MRebolle/Battery-Robot | 1b97e8c77cf7eff7d5cc7e417b4e5ec97e4011e7 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/env python3
import asyncio
from pyrevolve import parser
from pyrevolve.evolution import fitness
from pyrevolve.evolution.selection import multiple_selection, tournament_selection
from pyrevolve.evolution.population import Population, PopulationConfig
from pyrevolve.evolution.pop_management.steady_state impo... | 39.46281 | 123 | 0.750576 | import asyncio
from pyrevolve import parser
from pyrevolve.evolution import fitness
from pyrevolve.evolution.selection import multiple_selection, tournament_selection
from pyrevolve.evolution.population import Population, PopulationConfig
from pyrevolve.evolution.pop_management.steady_state import steady_state_populat... | true | true |
f769578b02722e2f446af53bdd60f0b0050fca64 | 946 | py | Python | LeetCode/1-1000/401-500/426-450/429. N-ary Tree Level Order Traversal/solution-python.py | adubois85/coding_challenge_websites | 7867a05847a216661eff3b24b1cb1480fb7d3030 | [
"Apache-2.0"
] | null | null | null | LeetCode/1-1000/401-500/426-450/429. N-ary Tree Level Order Traversal/solution-python.py | adubois85/coding_challenge_websites | 7867a05847a216661eff3b24b1cb1480fb7d3030 | [
"Apache-2.0"
] | null | null | null | LeetCode/1-1000/401-500/426-450/429. N-ary Tree Level Order Traversal/solution-python.py | adubois85/coding_challenge_websites | 7867a05847a216661eff3b24b1cb1480fb7d3030 | [
"Apache-2.0"
] | null | null | null | from typing import List
from collections import deque
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
class Solution:
# This is a spin-off of my third solution to LeetCode #589. Once I had
# that one working, this... | 28.666667 | 79 | 0.560254 | from typing import List
from collections import deque
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
class Solution:
def levelOrder(self, root: 'Node') -> List[List[int]]:
if not root:
return root
order = [... | true | true |
f7695849a66f4d6b5bb7815f17037efe1e9a47e6 | 945 | py | Python | laia/data/image_dataset.py | eivtho/PyLaia | 2a7a6e2eeb9b5af68c0faed0c564b02063e72be0 | [
"MIT"
] | null | null | null | laia/data/image_dataset.py | eivtho/PyLaia | 2a7a6e2eeb9b5af68c0faed0c564b02063e72be0 | [
"MIT"
] | null | null | null | laia/data/image_dataset.py | eivtho/PyLaia | 2a7a6e2eeb9b5af68c0faed0c564b02063e72be0 | [
"MIT"
] | 1 | 2020-11-26T11:18:54.000Z | 2020-11-26T11:18:54.000Z | from typing import Any, Callable, Dict, List, Optional
import torch
from PIL import Image
class ImageDataset(torch.utils.data.Dataset):
def __init__(
self, imgs: List[str], transform: Optional[Callable[[Image.Image], Any]] = None
):
assert isinstance(imgs, (list, tuple))
super().__ini... | 32.586207 | 105 | 0.615873 | from typing import Any, Callable, Dict, List, Optional
import torch
from PIL import Image
class ImageDataset(torch.utils.data.Dataset):
def __init__(
self, imgs: List[str], transform: Optional[Callable[[Image.Image], Any]] = None
):
assert isinstance(imgs, (list, tuple))
super().__ini... | true | true |
f7695866641dffc5fd8594dc029c2c926c8bfb58 | 41,084 | py | Python | lib/rucio/core/permission/escape.py | KarthikSundar2002/rucio | 82a4fe7f3b12120c5815fc1f6b6d231f24949268 | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/permission/escape.py | KarthikSundar2002/rucio | 82a4fe7f3b12120c5815fc1f6b6d231f24949268 | [
"Apache-2.0"
] | null | null | null | lib/rucio/core/permission/escape.py | KarthikSundar2002/rucio | 82a4fe7f3b12120c5815fc1f6b6d231f24949268 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021-2022 CERN
#
# 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 a... | 38.253259 | 189 | 0.704654 |
import rucio.core.scope
from rucio.core.account import list_account_attributes, has_account_attribute
from rucio.core.identity import exist_identity_account
from rucio.core.lifetime_exception import list_exceptions
from rucio.core.rse import list_rse_attributes
from rucio.core.rse_expression_parser import parse_expres... | true | true |
f76958c400d26897a3a5a405607a4aec476a183c | 81,763 | py | Python | tripleo_common/image/image_uploader.py | d0ugal/tripleo-common | dcf76e1e905613170d2011d0430bed5d35fe1006 | [
"Apache-2.0"
] | 2 | 2016-05-25T14:55:27.000Z | 2020-04-13T09:53:09.000Z | tripleo_common/image/image_uploader.py | d0ugal/tripleo-common | dcf76e1e905613170d2011d0430bed5d35fe1006 | [
"Apache-2.0"
] | null | null | null | tripleo_common/image/image_uploader.py | d0ugal/tripleo-common | dcf76e1e905613170d2011d0430bed5d35fe1006 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 37.540404 | 79 | 0.568631 |
import base64
from concurrent import futures
import hashlib
import json
import netifaces
import os
import random
import re
import requests
from requests import auth as requests_auth
from requests.adapters import HTTPAdapter
import shutil
import six
from six.moves.urllib import parse
import subprocess
import tempfile
i... | true | true |
f76959145001aa53bac2e9ff1b10d00b94fc2e24 | 1,377 | py | Python | ENV/lib/python3.5/site-packages/pyrogram/api/functions/contacts/__init__.py | block1o1/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | ENV/lib/python3.5/site-packages/pyrogram/api/functions/contacts/__init__.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | null | null | null | ENV/lib/python3.5/site-packages/pyrogram/api/functions/contacts/__init__.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | 40.5 | 74 | 0.8061 |
from .get_statuses import GetStatuses
from .get_contacts import GetContacts
from .import_contacts import ImportContacts
from .delete_contact import DeleteContact
from .delete_contacts import DeleteContacts
from .block import Block
from .unblock import Unblock
from .get_blocked import GetBlocked
from .export_card impor... | true | true |
f7695927f99f11ca454a30471704f2db88b0b417 | 19,106 | py | Python | graphscale/grapple/grapple_parser.py | schrockntemp/graphscaletemp | 59a0982f000dfbfe62f9773fb71204f2eadf73d4 | [
"MIT"
] | null | null | null | graphscale/grapple/grapple_parser.py | schrockntemp/graphscaletemp | 59a0982f000dfbfe62f9773fb71204f2eadf73d4 | [
"MIT"
] | null | null | null | graphscale/grapple/grapple_parser.py | schrockntemp/graphscaletemp | 59a0982f000dfbfe62f9773fb71204f2eadf73d4 | [
"MIT"
] | null | null | null | import re
from datetime import datetime
from uuid import UUID
from enum import Enum, auto
from graphql.language.source import Source
from graphql.language.parser import parse
from graphql.language.ast import (
ObjectTypeDefinition,
NamedType,
NonNullType,
ListType,
InputObjectTypeDefinition,
E... | 34.117857 | 107 | 0.683503 | import re
from datetime import datetime
from uuid import UUID
from enum import Enum, auto
from graphql.language.source import Source
from graphql.language.parser import parse
from graphql.language.ast import (
ObjectTypeDefinition,
NamedType,
NonNullType,
ListType,
InputObjectTypeDefinition,
E... | true | true |
f769599560f49962cb5e20ad70ceb8ecd6817b47 | 801 | py | Python | Python/debugMode.py | EDULISES/iot_ar_mqtt | 1b811b25dbd3055866137853638ffa9e2c6226e2 | [
"Apache-2.0"
] | null | null | null | Python/debugMode.py | EDULISES/iot_ar_mqtt | 1b811b25dbd3055866137853638ffa9e2c6226e2 | [
"Apache-2.0"
] | null | null | null | Python/debugMode.py | EDULISES/iot_ar_mqtt | 1b811b25dbd3055866137853638ffa9e2c6226e2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Description: If you need enable debug mode use this script to allow that the
# Adafruit HUZZAH ESP8266 prints messages in the serial port of the activity
# that it is executed
# Author: Edward U. Benitez Rendon
# Date: 11-07-17
import paho.mqtt.client as mqtt
import time
import argparse
parse... | 29.666667 | 78 | 0.716604 |
import paho.mqtt.client as mqtt
import time
import argparse
parser = argparse.ArgumentParser(description='Enable Debug Mode in Modules.')
parser.add_argument('board', type=int,
help='Specify the board to enable debug mode')
parser.add_argument('debug', type=int,
help='Enable de... | true | true |
f7695a9e0eb455fa66fb4d86b08d49dd78a58709 | 2,097 | py | Python | aries_cloudagent/indy/sdk/verifier.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 3 | 2020-05-19T05:25:25.000Z | 2021-08-05T07:19:13.000Z | aries_cloudagent/indy/sdk/verifier.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 51 | 2021-01-12T05:50:50.000Z | 2022-03-25T06:03:13.000Z | aries_cloudagent/indy/sdk/verifier.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 4 | 2020-04-08T10:00:58.000Z | 2022-01-27T13:47:01.000Z | """Indy SDK verifier implementation."""
import json
import logging
import indy.anoncreds
from indy.error import IndyError
from ...core.profile import Profile
from ..verifier import IndyVerifier
LOGGER = logging.getLogger(__name__)
class IndySdkVerifier(IndyVerifier):
"""Indy-SDK verifier implementation."""
... | 26.884615 | 83 | 0.581784 |
import json
import logging
import indy.anoncreds
from indy.error import IndyError
from ...core.profile import Profile
from ..verifier import IndyVerifier
LOGGER = logging.getLogger(__name__)
class IndySdkVerifier(IndyVerifier):
def __init__(self, profile: Profile):
self.profile = profile
async ... | true | true |
f7695bf9e279f3a4fdab03ce74563d6768c3f91e | 1,140 | py | Python | Script/Commands/Raw_Reaction/Reaction_add/close_ticket.py | PowerEvolved/Clash-Of-Clans-Discord-Bot | 3c2c534c85d314e3cf35786220a49b1d563b022f | [
"BSD-3-Clause"
] | 7 | 2021-12-01T13:49:34.000Z | 2022-03-02T08:27:09.000Z | Script/Commands/Raw_Reaction/Reaction_add/close_ticket.py | BilouKass/Clash-Of-Clans-Discord-Bot | 4dad2349581e2be1c2280b9f8bd4070777db1ef4 | [
"BSD-3-Clause"
] | null | null | null | Script/Commands/Raw_Reaction/Reaction_add/close_ticket.py | BilouKass/Clash-Of-Clans-Discord-Bot | 4dad2349581e2be1c2280b9f8bd4070777db1ef4 | [
"BSD-3-Clause"
] | 5 | 2021-05-01T14:26:20.000Z | 2022-02-13T19:10:15.000Z | # Processes the ticket deletion confirmation
from Script.import_emojis import Emojis
from Script.import_functions import create_embed
async def reaction_add_close_ticket(self, reaction, member):
if (reaction.emoji in [Emojis["Yes"], Emojis["No"]]) and (reaction.message.embeds[0].title == "Close this ticket"):
... | 51.818182 | 169 | 0.664035 |
from Script.import_emojis import Emojis
from Script.import_functions import create_embed
async def reaction_add_close_ticket(self, reaction, member):
if (reaction.emoji in [Emojis["Yes"], Emojis["No"]]) and (reaction.message.embeds[0].title == "Close this ticket"):
if reaction.emoji == Emojis['Yes']:
... | true | true |
f7695d16f55db5c8c973585144a712d75fbbdf0c | 1,734 | py | Python | section_test.py | y-k-k/python_pytest | 0793d60c84a4b26edf86468c17afd5541b281b63 | [
"MIT"
] | null | null | null | section_test.py | y-k-k/python_pytest | 0793d60c84a4b26edf86468c17afd5541b281b63 | [
"MIT"
] | null | null | null | section_test.py | y-k-k/python_pytest | 0793d60c84a4b26edf86468c17afd5541b281b63 | [
"MIT"
] | null | null | null | import section
import pytest
# 作成
class Test_2つの整数を引数に閉区間オブジェクトをつくる:
def test_3から8の閉区間を作れる(self):
x=section.Section(3,8)
assert x.lower==3 and x.upper==8
def test_3から8の閉区間を作れる(self):
x=section.Section(3,3)
assert x.lower==3 and x.upper==3
# 作成(例外処理)
class Test_整数以外では閉区間オブジェクトをつ... | 25.130435 | 43 | 0.625144 | import section
import pytest
class Test_2つの整数を引数に閉区間オブジェクトをつくる:
def test_3から8の閉区間を作れる(self):
x=section.Section(3,8)
assert x.lower==3 and x.upper==8
def test_3から8の閉区間を作れる(self):
x=section.Section(3,3)
assert x.lower==3 and x.upper==3
class Test_整数以外では閉区間オブジェクトをつくれない:
def te... | true | true |
f7695f0d187810f59681c2b0fd80cfab8515725c | 27,825 | py | Python | objectpath/core/interpreter.py | SREnity/ObjectPath | 25958956ef482009be911a8b0a8e679b9f636fc9 | [
"MIT"
] | 327 | 2015-01-02T13:20:39.000Z | 2022-03-28T11:30:25.000Z | objectpath/core/interpreter.py | SREnity/ObjectPath | 25958956ef482009be911a8b0a8e679b9f636fc9 | [
"MIT"
] | 71 | 2015-02-03T08:22:58.000Z | 2021-06-20T07:01:51.000Z | objectpath/core/interpreter.py | SREnity/ObjectPath | 25958956ef482009be911a8b0a8e679b9f636fc9 | [
"MIT"
] | 89 | 2015-02-10T01:02:42.000Z | 2021-08-09T07:17:33.000Z | #!/usr/bin/env python
# This file is part of ObjectPath released under MIT license.
# Copyright (C) 2010-2014 Adrian Kalbarczyk
import sys, re
from .parser import parse
from objectpath.core import *
import objectpath.utils.colorify as color # pylint: disable=W0614
from objectpath.utils import flatten, filter_dict, t... | 36.372549 | 140 | 0.503073 |
import sys, re
from .parser import parse
from objectpath.core import *
import objectpath.utils.colorify as color from objectpath.utils import flatten, filter_dict, timeutils, skip
from objectpath.utils.json_ext import py2JSON
from objectpath.core import ITER_TYPES, generator, chain
from objectpath.utils.debugger imp... | true | true |
f7695f31f132d234497c1754f82132aaad34412f | 1,933 | py | Python | kytos/core/events.py | slinksoft/kytos | 8246e155d454736331152a759cdbf2a0e495bf6e | [
"MIT"
] | 43 | 2017-03-27T14:30:20.000Z | 2022-02-04T12:42:10.000Z | kytos/core/events.py | slinksoft/kytos | 8246e155d454736331152a759cdbf2a0e495bf6e | [
"MIT"
] | 612 | 2017-03-09T19:22:16.000Z | 2021-05-31T21:48:52.000Z | kytos/core/events.py | slinksoft/kytos | 8246e155d454736331152a759cdbf2a0e495bf6e | [
"MIT"
] | 54 | 2017-03-03T19:11:26.000Z | 2022-02-16T15:31:49.000Z | """Module with Kytos Events."""
from kytos.core.helpers import now
class KytosEvent:
"""Base Event class.
The event data will be passed in the `content` attribute, which should be a
dictionary.
"""
def __init__(self, name=None, content=None):
"""Create an event to be published.
... | 26.847222 | 79 | 0.593378 |
from kytos.core.helpers import now
class KytosEvent:
def __init__(self, name=None, content=None):
self.name = name
self.content = content if content is not None else {}
self.timestamp = now()
def __str__(self):
return self.name
def __repr__(self):
return f"Kytos... | true | true |
f7695f796c9dfe4810417efb6ead3f6cf6b334b5 | 5,796 | py | Python | py_wake/tests/test_blockage_models/test_selfsimilarity.py | luqidndx/PyWake | 3d046eb14c4597de49ac2fee3771b8e0e68820ad | [
"MIT"
] | null | null | null | py_wake/tests/test_blockage_models/test_selfsimilarity.py | luqidndx/PyWake | 3d046eb14c4597de49ac2fee3771b8e0e68820ad | [
"MIT"
] | null | null | null | py_wake/tests/test_blockage_models/test_selfsimilarity.py | luqidndx/PyWake | 3d046eb14c4597de49ac2fee3771b8e0e68820ad | [
"MIT"
] | null | null | null | import pytest
import matplotlib.pyplot as plt
import numpy as np
from py_wake.deficit_models import SelfSimilarityDeficit
from py_wake.deficit_models.no_wake import NoWakeDeficit
from py_wake.deficit_models.noj import NOJDeficit
from py_wake.examples.data import hornsrev1
from py_wake.examples.data.hornsrev1 import Ho... | 42.617647 | 116 | 0.575052 | import pytest
import matplotlib.pyplot as plt
import numpy as np
from py_wake.deficit_models import SelfSimilarityDeficit
from py_wake.deficit_models.no_wake import NoWakeDeficit
from py_wake.deficit_models.noj import NOJDeficit
from py_wake.examples.data import hornsrev1
from py_wake.examples.data.hornsrev1 import Ho... | true | true |
f7696177341a89aac24e5c4b7417df19957458a2 | 1,405 | py | Python | packages/models-library/src/models_library/settings/services_common.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | packages/models-library/src/models_library/settings/services_common.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | packages/models-library/src/models_library/settings/services_common.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | from pydantic import BaseSettings, Field, PositiveInt
_MINUTE = 60
_HOUR = 60 * _MINUTE
class ServicesCommonSettings(BaseSettings):
# set this interval to 1 hour
director_dynamic_service_save_timeout: PositiveInt = Field(
_HOUR,
description=(
"When stopping a dynamic service, if i... | 36.025641 | 79 | 0.639858 | from pydantic import BaseSettings, Field, PositiveInt
_MINUTE = 60
_HOUR = 60 * _MINUTE
class ServicesCommonSettings(BaseSettings):
director_dynamic_service_save_timeout: PositiveInt = Field(
_HOUR,
description=(
"When stopping a dynamic service, if it has "
"big paylo... | true | true |
f7696179087cddc7f323657d3632d55c77c0abdc | 353 | py | Python | basics/RDD/count.py | nickyongzhang/pyspark_learning | 1942f7c9a2b23858903868c4b9accd9bcf5889ff | [
"Apache-2.0"
] | null | null | null | basics/RDD/count.py | nickyongzhang/pyspark_learning | 1942f7c9a2b23858903868c4b9accd9bcf5889ff | [
"Apache-2.0"
] | null | null | null | basics/RDD/count.py | nickyongzhang/pyspark_learning | 1942f7c9a2b23858903868c4b9accd9bcf5889ff | [
"Apache-2.0"
] | null | null | null | # count()
# Number of elements in the RDD is returned.
from pyspark import SparkContext
sc = SparkContext("local", "count app")
words = sc.parallelize (
["scala",
"java",
"hadoop",
"spark",
"akka",
"spark vs hadoop",
"pyspark",
"pyspark and spark"]
)
counts = words.count()
print "Number of ... | 22.0625 | 50 | 0.626062 | from pyspark import SparkContext
sc = SparkContext("local", "count app")
words = sc.parallelize (
["scala",
"java",
"hadoop",
"spark",
"akka",
"spark vs hadoop",
"pyspark",
"pyspark and spark"]
)
counts = words.count()
print "Number of elements in RDD -> %i" % (counts) | false | true |
f769640b2711e1a98beddd9d0a9950b6362b4e62 | 215,689 | py | Python | zerver/tests/test_subs.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | 1 | 2020-08-12T23:28:41.000Z | 2020-08-12T23:28:41.000Z | zerver/tests/test_subs.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_subs.py | AllenCaoo/zulip | 110c96951d4d35318b79ea74edbcf7269909468e | [
"Apache-2.0"
] | null | null | null | import hashlib
import random
from datetime import timedelta
from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Union
from unittest import mock
import orjson
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.utils.time... | 41.808296 | 273 | 0.638428 | import hashlib
import random
from datetime import timedelta
from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Union
from unittest import mock
import orjson
from django.conf import settings
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.utils.time... | true | true |
f7696457cd730aeae0cb01eb5820a886bca28bf9 | 63 | py | Python | PROJECT_NAME/my_class.py | agounaris/python_skeleton | 3cac5b51c0e737cfe1b738519148188f2cd65208 | [
"MIT"
] | null | null | null | PROJECT_NAME/my_class.py | agounaris/python_skeleton | 3cac5b51c0e737cfe1b738519148188f2cd65208 | [
"MIT"
] | null | null | null | PROJECT_NAME/my_class.py | agounaris/python_skeleton | 3cac5b51c0e737cfe1b738519148188f2cd65208 | [
"MIT"
] | null | null | null | class MyClass:
def my_function(self, n):
return n
| 12.6 | 29 | 0.603175 | class MyClass:
def my_function(self, n):
return n
| true | true |
f769649ef7f63fe19fb7773839068518ce2f72c0 | 865 | py | Python | tests/searches/test_binary_search.py | dpazel/tryinggithub | 3e786dfd9b6bea0f7b3644229674721473894751 | [
"MIT"
] | null | null | null | tests/searches/test_binary_search.py | dpazel/tryinggithub | 3e786dfd9b6bea0f7b3644229674721473894751 | [
"MIT"
] | null | null | null | tests/searches/test_binary_search.py | dpazel/tryinggithub | 3e786dfd9b6bea0f7b3644229674721473894751 | [
"MIT"
] | null | null | null | import unittest
from collections import OrderedDict
from fractions import Fraction
from searches.binary_search import find_lower
class MyTestCase(unittest.TestCase):
def test_binary_search(self):
lisst = [1, 7, 9, 14, 23, 80]
lisst[find_lower(lisst, 80)]
for i in range(1, 81):
... | 23.378378 | 63 | 0.544509 | import unittest
from collections import OrderedDict
from fractions import Fraction
from searches.binary_search import find_lower
class MyTestCase(unittest.TestCase):
def test_binary_search(self):
lisst = [1, 7, 9, 14, 23, 80]
lisst[find_lower(lisst, 80)]
for i in range(1, 81):
... | false | true |
f76964befa954c6f96bb36b0ce3865232e9deef4 | 13,246 | py | Python | tests/test_pool.py | julianit/aioodbc | 33638ae988ebc1cd1790e3f529f032a0c38e3827 | [
"Apache-2.0"
] | null | null | null | tests/test_pool.py | julianit/aioodbc | 33638ae988ebc1cd1790e3f529f032a0c38e3827 | [
"Apache-2.0"
] | null | null | null | tests/test_pool.py | julianit/aioodbc | 33638ae988ebc1cd1790e3f529f032a0c38e3827 | [
"Apache-2.0"
] | null | null | null | import asyncio
import pytest
import aioodbc
from aioodbc import Pool, Connection
from pyodbc import Error
@pytest.mark.asyncio
async def test_create_pool(loop, pool_maker, dsn):
pool = await pool_maker(loop, dsn=dsn)
assert isinstance(pool, Pool)
assert 10 == pool.minsize
assert 10 == pool.maxsize
... | 26.977597 | 83 | 0.640495 | import asyncio
import pytest
import aioodbc
from aioodbc import Pool, Connection
from pyodbc import Error
@pytest.mark.asyncio
async def test_create_pool(loop, pool_maker, dsn):
pool = await pool_maker(loop, dsn=dsn)
assert isinstance(pool, Pool)
assert 10 == pool.minsize
assert 10 == pool.maxsize
... | true | true |
f7696516209c683ae334ca63ce1da6b2cc5eb66c | 334 | py | Python | lupe/__init__.py | 19cah/19cah-pip | 95dbb438667c3316df0d189712aff6b30598d5c9 | [
"MIT"
] | 6 | 2018-10-14T06:42:13.000Z | 2018-12-31T17:10:54.000Z | lupe/__init__.py | 19cah/19cah-pip | 95dbb438667c3316df0d189712aff6b30598d5c9 | [
"MIT"
] | null | null | null | lupe/__init__.py | 19cah/19cah-pip | 95dbb438667c3316df0d189712aff6b30598d5c9 | [
"MIT"
] | 1 | 2021-09-19T12:56:48.000Z | 2021-09-19T12:56:48.000Z | """
Lupe: The CLI helper you need
lupe(help_message, options?)
Example:
```python
import lupe
cli = lupe('usage: foo [options]')
# display help
cli.show_help()
```
Read more on the [documentation](https://github.com/abranhe/lupe)
"""
import sys
from lupe.core import Lupe
__version__ = '0.1.12'
sys.modules[__n... | 12.37037 | 65 | 0.697605 |
import sys
from lupe.core import Lupe
__version__ = '0.1.12'
sys.modules[__name__] = Lupe
| true | true |
f769666f9c3cd1494d99d61c881867ba71d5c86a | 392 | py | Python | pacote-download/pythonProject/exercicios_python_guanabara/ex097.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex097.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | pacote-download/pythonProject/exercicios_python_guanabara/ex097.py | oliveirajonathas/python_estudos | 28921672d7e5d0866030c45b077a28998905f752 | [
"MIT"
] | null | null | null | """
Faça um programa que tenha uma função chamada escreva(), que recebe um texto qualquer como parâmetro e mostre uma mensa-
gem com tamanho adaptável.
ex:
escreva('Olá, Mundo!')
saída:
----------
Olá Mundo!
----------
"""
def escreva(msg):
tam = len(msg) + 5
print('~'*tam)
print(f'{msg:^{tam}}')
prin... | 17.818182 | 120 | 0.607143 |
def escreva(msg):
tam = len(msg) + 5
print('~'*tam)
print(f'{msg:^{tam}}')
print('~' * tam)
escreva('Olá, Mundo!')
escreva('Meu nome é Jonathas!!!')
| true | true |
f76966d84357054c22587b6228a697415fc53083 | 887 | py | Python | d2/detr/config.py | qilei123/detr | 69b7ab177d4c93fbd8736a3fbee99d15fececbc1 | [
"Apache-2.0"
] | null | null | null | d2/detr/config.py | qilei123/detr | 69b7ab177d4c93fbd8736a3fbee99d15fececbc1 | [
"Apache-2.0"
] | null | null | null | d2/detr/config.py | qilei123/detr | 69b7ab177d4c93fbd8736a3fbee99d15fececbc1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from detectron2.config import CfgNode as CN
def add_detr_config(cfg):
"""
Add config for DETR.
"""
cfg.MODEL.DETR = CN()
cfg.MODEL.DETR.NUM_CLASSES = 2
# For Segmentation
cfg.MODEL.DETR.FROZEN_W... | 25.342857 | 70 | 0.6708 | from detectron2.config import CfgNode as CN
def add_detr_config(cfg):
cfg.MODEL.DETR = CN()
cfg.MODEL.DETR.NUM_CLASSES = 2
cfg.MODEL.DETR.FROZEN_WEIGHTS = ''
cfg.MODEL.DETR.GIOU_WEIGHT = 2.0
cfg.MODEL.DETR.L1_WEIGHT = 5.0
cfg.MODEL.DETR.DEEP_SUPERVISION = True
cfg.MODEL.DETR.NO_O... | true | true |
f76968419f702d4a246f8a4c39d0c28b09437a2d | 31,058 | py | Python | software/glasgow/applet/interface/jtag_probe/__init__.py | rvolgers/Glasgow | b209775efd6ce5ae1e39efe2a8a597271f341474 | [
"Apache-2.0",
"0BSD"
] | null | null | null | software/glasgow/applet/interface/jtag_probe/__init__.py | rvolgers/Glasgow | b209775efd6ce5ae1e39efe2a8a597271f341474 | [
"Apache-2.0",
"0BSD"
] | null | null | null | software/glasgow/applet/interface/jtag_probe/__init__.py | rvolgers/Glasgow | b209775efd6ce5ae1e39efe2a8a597271f341474 | [
"Apache-2.0",
"0BSD"
] | null | null | null | import struct
import logging
import asyncio
from bitarray import bitarray
from migen import *
from migen.genlib.cdc import MultiReg
from ....support.pyrepl import *
from ....gateware.pads import *
from ....database.jedec import *
from ....arch.jtag import *
from ... import *
class JTAGProbeBus(Module):
def __ini... | 37.374248 | 99 | 0.549713 | import struct
import logging
import asyncio
from bitarray import bitarray
from migen import *
from migen.genlib.cdc import MultiReg
from ....support.pyrepl import *
from ....gateware.pads import *
from ....database.jedec import *
from ....arch.jtag import *
from ... import *
class JTAGProbeBus(Module):
def __ini... | true | true |
f76968f97ed0590f0b3286581b10afb3e1409c07 | 1,832 | py | Python | addons/hw_drivers/event_manager.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/hw_drivers/event_manager.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/hw_drivers/event_manager.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from threading import Event
import time
from odoo.http import request
class EventManager(object):
def __init__(self):
self.events = []
self.sessions = {}
def _delete_expired_session... | 32.140351 | 125 | 0.598253 |
import json
from threading import Event
import time
from odoo.http import request
class EventManager(object):
def __init__(self):
self.events = []
self.sessions = {}
def _delete_expired_sessions(self, max_time=70):
now = time.time()
expired_sessions = [
session
... | true | true |
f7696907c8f74f19ffa69b2c581301d5b5506958 | 2,546 | py | Python | WEB(BE)/crawler/crawler/db.py | dev-taewon-kim/ai_web_RISKOUT_BTS | 6b5650f8ecf068185ad87af62074627aca566018 | [
"MIT"
] | 1 | 2021-11-04T07:54:58.000Z | 2021-11-04T07:54:58.000Z | WEB(BE)/crawler/crawler/db.py | mslee300/ai_web_RISKOUT_BTS | e01b3d27f68a0187b619920bf5c1f2de0cbc0f7d | [
"MIT"
] | null | null | null | WEB(BE)/crawler/crawler/db.py | mslee300/ai_web_RISKOUT_BTS | e01b3d27f68a0187b619920bf5c1f2de0cbc0f7d | [
"MIT"
] | null | null | null | import sqlite3
import os
class DB:
def __init__(self):
path= os.path.dirname(os.path.abspath(__file__))
self.filename = path + "/database.db"
self.dbfile = sqlite3.connect(self.filename)
self.dbcursor = self.dbfile.cursor()
self.create_db()
def create_db(self):
... | 26.8 | 69 | 0.495679 | import sqlite3
import os
class DB:
def __init__(self):
path= os.path.dirname(os.path.abspath(__file__))
self.filename = path + "/database.db"
self.dbfile = sqlite3.connect(self.filename)
self.dbcursor = self.dbfile.cursor()
self.create_db()
def create_db(self):
... | true | true |
f76969ba78dfcf5e6f02d521c59192a1407dbf3d | 7,161 | py | Python | python/pyarrow/ipc.py | Metronlab/arrow | 45a0ad38929699c600dee8a7b44898f49da19a26 | [
"Apache-2.0"
] | 1 | 2020-06-20T00:45:11.000Z | 2020-06-20T00:45:11.000Z | python/pyarrow/ipc.py | Metronlab/arrow | 45a0ad38929699c600dee8a7b44898f49da19a26 | [
"Apache-2.0"
] | 8 | 2020-04-10T19:03:51.000Z | 2021-01-21T01:06:28.000Z | python/pyarrow/ipc.py | signavio/arrow | 866e6a82e2794b151235c19b8c5cbf1fcaf780ef | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0"
] | 1 | 2020-09-23T12:12:19.000Z | 2020-09-23T12:12:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.826667 | 79 | 0.694875 |
import pyarrow as pa
from pyarrow.lib import (Message, MessageReader, read_message, read_record_batch, read_schema,
read_tensor, write_tensor,
get_record_batch_size, get_tensor_size)
import pyarrow.lib as lib
class _ReadPandasOption:
... | true | true |
f76969f96af8eb3b471628ec73d560bd46dd6899 | 1,579 | py | Python | social_core/backends/atlassian.py | rameshananth/social-core | eeee9763862d768627e134a42e4664456b6eabec | [
"BSD-3-Clause"
] | 745 | 2016-12-03T16:38:37.000Z | 2022-03-29T17:18:52.000Z | social_core/backends/atlassian.py | rameshananth/social-core | eeee9763862d768627e134a42e4664456b6eabec | [
"BSD-3-Clause"
] | 624 | 2016-12-06T16:01:46.000Z | 2022-03-29T15:50:35.000Z | social_core/backends/atlassian.py | rameshananth/social-core | eeee9763862d768627e134a42e4664456b6eabec | [
"BSD-3-Clause"
] | 583 | 2016-12-03T16:40:38.000Z | 2022-03-28T05:32:37.000Z | from social_core.backends.oauth import BaseOAuth2
class AtlassianOAuth2(BaseOAuth2):
name = 'atlassian'
AUTHORIZATION_URL = 'https://auth.atlassian.com/authorize'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://auth.atlassian.com/oauth/token'
DEFAULT_SCOPE = ['read:jira-user', 'offline_ac... | 41.552632 | 118 | 0.60988 | from social_core.backends.oauth import BaseOAuth2
class AtlassianOAuth2(BaseOAuth2):
name = 'atlassian'
AUTHORIZATION_URL = 'https://auth.atlassian.com/authorize'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://auth.atlassian.com/oauth/token'
DEFAULT_SCOPE = ['read:jira-user', 'offline_ac... | true | true |
f7696ac2139a55c3dc5cba6c2b70b60d2fed3fc6 | 3,949 | py | Python | alipay/aop/api/request/AlipayFundAuthOrderFreezeRequest.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/AlipayFundAuthOrderFreezeRequest.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/AlipayFundAuthOrderFreezeRequest.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.AlipayFundAuthOrderFreezeModel import AlipayFundAuthOrderFreezeModel
class AlipayFundAuthOrderFreezeRequest(object):
def __init... | 27.234483 | 148 | 0.642694 | import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayFundAuthOrderFreezeModel import AlipayFundAuthOrderFreezeModel
class AlipayFundAuthOrderFreezeRequest(object):
def __init__(self, biz_model=None):
self._biz_mo... | true | true |
f7696ce3be8a0e9974ebda10f2a7c8f3baea02f6 | 25,362 | py | Python | train.py | pranshu2hike/fewshot-egnn | dde036c9bd6a4af32a5db369f764c0b3a5038a77 | [
"MIT"
] | null | null | null | train.py | pranshu2hike/fewshot-egnn | dde036c9bd6a4af32a5db369f764c0b3a5038a77 | [
"MIT"
] | null | null | null | train.py | pranshu2hike/fewshot-egnn | dde036c9bd6a4af32a5db369f764c0b3a5038a77 | [
"MIT"
] | null | null | null | from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader, TieredImagenetLoaderCustom
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
#import seaborn as sns
class ModelTrainer(object):
def __init__(self,
enc_module,
... | 53.058577 | 292 | 0.623295 | from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader, TieredImagenetLoaderCustom
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
class ModelTrainer(object):
def __init__(self,
enc_module,
gnn_module,
... | true | true |
f7696cf36aa634e693959f5d6deee5ebd052a56c | 6,100 | py | Python | splitImages.py | NikolaySokolov152/Unet_multiclass | d07f6809b422519097560b07f67d0f139e718381 | [
"MIT"
] | null | null | null | splitImages.py | NikolaySokolov152/Unet_multiclass | d07f6809b422519097560b07f67d0f139e718381 | [
"MIT"
] | null | null | null | splitImages.py | NikolaySokolov152/Unet_multiclass | d07f6809b422519097560b07f67d0f139e718381 | [
"MIT"
] | null | null | null | import skimage.io as io
import numpy as np
import os
def to_0_255_format_img(in_img):
max_val = in_img[:,:].max()
if max_val <= 1:
out_img = np.round(in_img * 255)
return out_img.astype(np.uint8)
else:
return in_img
def to_0_1_format_img(in_img):
max_val = in_img[:,:].max()
i... | 32.275132 | 165 | 0.55623 | import skimage.io as io
import numpy as np
import os
def to_0_255_format_img(in_img):
max_val = in_img[:,:].max()
if max_val <= 1:
out_img = np.round(in_img * 255)
return out_img.astype(np.uint8)
else:
return in_img
def to_0_1_format_img(in_img):
max_val = in_img[:,:].max()
i... | true | true |
f7696e9604867a881f6e20d2ecea07edff622f67 | 13 | py | Python | projects/flask/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/flask/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/flask/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import flask
| 6.5 | 12 | 0.846154 | import flask
| true | true |
f7696fdc6815184604d8b2543eb7b446fc9299c6 | 4,691 | py | Python | experiments/vgg_mcdropout_cifar10.py | llv22/baal_tf2.4_mac | 6eed225f8b57e61d8d16b1868ea655384c566700 | [
"Apache-2.0"
] | null | null | null | experiments/vgg_mcdropout_cifar10.py | llv22/baal_tf2.4_mac | 6eed225f8b57e61d8d16b1868ea655384c566700 | [
"Apache-2.0"
] | null | null | null | experiments/vgg_mcdropout_cifar10.py | llv22/baal_tf2.4_mac | 6eed225f8b57e61d8d16b1868ea655384c566700 | [
"Apache-2.0"
] | null | null | null | import argparse
import random
from copy import deepcopy
import torch
import torch.backends
from torch import optim
from torch.hub import load_state_dict_from_url
from torch.nn import CrossEntropyLoss
from torchvision import datasets
from torchvision.models import vgg16
from torchvision.transforms import transforms
fro... | 31.483221 | 96 | 0.665317 | import argparse
import random
from copy import deepcopy
import torch
import torch.backends
from torch import optim
from torch.hub import load_state_dict_from_url
from torch.nn import CrossEntropyLoss
from torchvision import datasets
from torchvision.models import vgg16
from torchvision.transforms import transforms
fro... | true | true |
f76971fd59dcfca2b68fef5ccf81cb05e7d4ded5 | 895 | py | Python | setup.py | rnd0101/json-graph-lite | c4bc103f1d2967075f2525f28663b3f01d592979 | [
"MIT"
] | 1 | 2020-04-30T18:48:40.000Z | 2020-04-30T18:48:40.000Z | setup.py | rnd0101/json-graph-lite | c4bc103f1d2967075f2525f28663b3f01d592979 | [
"MIT"
] | null | null | null | setup.py | rnd0101/json-graph-lite | c4bc103f1d2967075f2525f28663b3f01d592979 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="json-graph-lite",
version="0.8a0",
author="Roman Suzi",
author_email="roman.suzi@gmail.com",
description="Lightweight graph implementation with JSON serialization",
long_description=lo... | 33.148148 | 75 | 0.660335 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="json-graph-lite",
version="0.8a0",
author="Roman Suzi",
author_email="roman.suzi@gmail.com",
description="Lightweight graph implementation with JSON serialization",
long_description=lo... | true | true |
f76972b44a91d38d6179ce7a23355db2ef11b2e3 | 1,824 | py | Python | keras_gym/policies/value_based.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 16 | 2019-07-01T10:56:26.000Z | 2021-01-31T18:56:56.000Z | keras_gym/policies/value_based.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 10 | 2019-03-10T21:56:10.000Z | 2020-09-06T21:49:55.000Z | keras_gym/policies/value_based.py | KristianHolsheimer/keras-gym | 0296ddcc8685e1ce732c3173caaa0fd25af9ef58 | [
"MIT"
] | 5 | 2019-08-02T22:11:19.000Z | 2020-04-19T20:18:38.000Z | import numpy as np
from ..base.mixins import RandomStateMixin
from ..policies.base import BasePolicy
from ..utils import argmax
__all__ = (
'EpsilonGreedy',
# 'BoltzmannPolicy', #TODO: implement
)
class EpsilonGreedy(BasePolicy, RandomStateMixin):
"""
Value-based policy to select actions using eps... | 23.384615 | 78 | 0.597588 | import numpy as np
from ..base.mixins import RandomStateMixin
from ..policies.base import BasePolicy
from ..utils import argmax
__all__ = (
'EpsilonGreedy',
)
class EpsilonGreedy(BasePolicy, RandomStateMixin):
def __init__(self, q_function, epsilon=0.1, random_seed=None):
self.q_function = q_fu... | true | true |
f7697342a32bdde0e55d3b53406523e909ab287b | 9,679 | py | Python | tests/nightly/gpu/test_controllable.py | takatoy/ParlAI | 58aa4e0bf068b6bdd28b705da22b7a0269e32714 | [
"MIT"
] | 1 | 2019-12-04T20:00:28.000Z | 2019-12-04T20:00:28.000Z | tests/nightly/gpu/test_controllable.py | takatoy/ParlAI | 58aa4e0bf068b6bdd28b705da22b7a0269e32714 | [
"MIT"
] | 3 | 2021-05-08T09:44:24.000Z | 2021-07-21T14:03:28.000Z | tests/nightly/gpu/test_controllable.py | takatoy/ParlAI | 58aa4e0bf068b6bdd28b705da22b7a0269e32714 | [
"MIT"
] | 1 | 2020-04-16T15:56:29.000Z | 2020-04-16T15:56:29.000Z | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
"""
Integration tests for the Controllable Dialogue project... | 36.662879 | 90 | 0.567621 |
import unittest
import parlai.utils.testing as testing_utils
FAST_MODE = True
NUM_EXAMPLES = 512 if FAST_MODE else -1
NO_REPETITION = 'extrep_2gram:-3.5,extrep_nonstopword:-1e20,intrep_nonstopword:-1e20'
@testing_utils.skipUnlessGPU
class TestControllableDialogue(unittest.TestCase):
def test_dataset_integrit... | true | true |
f7697382f6a34a72462f61f67d327953466154ff | 412 | py | Python | rapidsms/contrib/registration/urls.py | fakegit/rapidsms | a77e96e5b0ccf0dd01d7fba8c10961e7ecc458d7 | [
"BSD-3-Clause"
] | null | null | null | rapidsms/contrib/registration/urls.py | fakegit/rapidsms | a77e96e5b0ccf0dd01d7fba8c10961e7ecc458d7 | [
"BSD-3-Clause"
] | null | null | null | rapidsms/contrib/registration/urls.py | fakegit/rapidsms | a77e96e5b0ccf0dd01d7fba8c10961e7ecc458d7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.urls import path
from . import views
urlpatterns = (
path('', views.registration, name="registration"),
path('contact/add/', views.contact, name="registration_contact_add"),
path('contact/bulk_add/', views.contact_bulk_add, name="registration... | 29.428571 | 84 | 0.708738 |
from django.urls import path
from . import views
urlpatterns = (
path('', views.registration, name="registration"),
path('contact/add/', views.contact, name="registration_contact_add"),
path('contact/bulk_add/', views.contact_bulk_add, name="registration_bulk_add"),
path('<int:pk>/edit/', views.conta... | true | true |
f769744c5ad7c696c221338ba07f4ae8a39ad240 | 17,571 | py | Python | lib/Coveringarray/CoveringarrayImpl.py | DrewCross/Coveringarray | db8f833f7cbbf16d8800ab3e085e8eeff4c7ed7b | [
"MIT"
] | null | null | null | lib/Coveringarray/CoveringarrayImpl.py | DrewCross/Coveringarray | db8f833f7cbbf16d8800ab3e085e8eeff4c7ed7b | [
"MIT"
] | null | null | null | lib/Coveringarray/CoveringarrayImpl.py | DrewCross/Coveringarray | db8f833f7cbbf16d8800ab3e085e8eeff4c7ed7b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
import copy
import traceback
import json
from biokbase.workspace.client import Workspace
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseReport
#END_HEADER
class Coveringarray:
'''
... | 38.617582 | 192 | 0.513061 | import logging
import os
import copy
import traceback
import json
from biokbase.workspace.client import Workspace
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseReport
class Coveringarray:
VERSION = "0.1.2"
GIT_URL = ... | true | true |
f769751d2d592c9e763cb4f8fb6a5ded530982ab | 5,829 | py | Python | hummingbot/client/command/create_command.py | maxadss/hummingbot | 48aea1716dc02c010af230f80d50ef273086ba6d | [
"Apache-2.0"
] | 4 | 2021-09-15T02:56:57.000Z | 2022-03-01T19:59:19.000Z | hummingbot/client/command/create_command.py | maxadss/hummingbot | 48aea1716dc02c010af230f80d50ef273086ba6d | [
"Apache-2.0"
] | 8 | 2020-10-01T05:17:54.000Z | 2020-11-09T13:38:19.000Z | hummingbot/client/command/create_command.py | maxadss/hummingbot | 48aea1716dc02c010af230f80d50ef273086ba6d | [
"Apache-2.0"
] | 1 | 2021-11-03T15:13:47.000Z | 2021-11-03T15:13:47.000Z | import os
import shutil
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.client.config.config_helpers import (
get_strategy_config_map,
parse_cvar_value,
default_strategy_file_path,
save_to_yml,
get_strategy_t... | 42.547445 | 103 | 0.641105 | import os
import shutil
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.core.utils.async_utils import safe_ensure_future
from hummingbot.client.config.config_helpers import (
get_strategy_config_map,
parse_cvar_value,
default_strategy_file_path,
save_to_yml,
get_strategy_t... | true | true |
f76977dd545a48cb6c27fbd6b391f5fba7c76aea | 4,131 | py | Python | codeforces/500/soln/d_network.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | codeforces/500/soln/d_network.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | codeforces/500/soln/d_network.py | cripplet/practice | e79700aa29dfa8ad6f8f1c2073e06f9b5ae2dfa0 | [
"MIT"
] | null | null | null | import fileinput, math
### ###
# utility func #
### ###
dbug = True
def pd(s, label=''):
global dbug
if dbug:
header = 'debug:'
if label != '':
header += ' (%s)\t' % label
print header, s
def stoi(s):
return([ int(x) for x in s.split() ])
def perm(n, k, wheels=True):
if wheels:
ass... | 23.605714 | 161 | 0.57589 | import fileinput, math
dbug = True
def pd(s, label=''):
global dbug
if dbug:
header = 'debug:'
if label != '':
header += ' (%s)\t' % label
print header, s
def stoi(s):
return([ int(x) for x in s.split() ])
def perm(n, k, wheels=True):
if wheels:
assert(n > 0)
assert(k > 0)
return math.factorial(n... | false | true |
f76978a99df727b83d9359d06fd0d1f4dbf40b9f | 3,060 | py | Python | Hospital_MARL/play.py | Staeffy/Hospital_MARL | 94b011cdb6ebeae555837974192ce9fa6120e4b1 | [
"MIT"
] | null | null | null | Hospital_MARL/play.py | Staeffy/Hospital_MARL | 94b011cdb6ebeae555837974192ce9fa6120e4b1 | [
"MIT"
] | null | null | null | Hospital_MARL/play.py | Staeffy/Hospital_MARL | 94b011cdb6ebeae555837974192ce9fa6120e4b1 | [
"MIT"
] | null | null | null | """Script to play the allocation game based on the previously trained policies
"""
# external imports
import os
import random
import copy
import numpy as np
import sys
from numpy.random import permutation
import rl_setup
def play(patient_list, doc_stats, folder_name, rounds=10):
patients = patient_list
doc... | 28.867925 | 104 | 0.610131 | import os
import random
import copy
import numpy as np
import sys
from numpy.random import permutation
import rl_setup
def play(patient_list, doc_stats, folder_name, rounds=10):
patients = patient_list
doc_stats = doc_stats
treatment_stats = rl_setup.load_json("treatment_stats")
hosp = rl_setup.Hos... | true | true |
f769796942cdf773106c237baf748dee5bca3811 | 1,560 | py | Python | setup.py | rchristie/mapclientplugins.datatrimmerstep | d282ac938aae7dc8a20e2a4b7fd8ff53b2ef4c66 | [
"Apache-2.0"
] | null | null | null | setup.py | rchristie/mapclientplugins.datatrimmerstep | d282ac938aae7dc8a20e2a4b7fd8ff53b2ef4c66 | [
"Apache-2.0"
] | 1 | 2020-05-04T04:34:34.000Z | 2020-05-11T23:52:22.000Z | setup.py | rchristie/mapclientplugins.datatrimmerstep | d282ac938aae7dc8a20e2a4b7fd8ff53b2ef4c66 | [
"Apache-2.0"
] | 6 | 2020-05-07T03:11:51.000Z | 2021-05-27T21:22:08.000Z | from setuptools import setup, find_packages
from setuptools.command.install import install
import os
import io
SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
# List all of your Python package dependencies in the
# requirements.txt file
def readfile(filename, split=False):
with io.open(filename, encoding... | 28.888889 | 94 | 0.685897 | from setuptools import setup, find_packages
from setuptools.command.install import install
import os
import io
SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
def readfile(filename, split=False):
with io.open(filename, encoding="utf-8") as stream:
if split:
return stream.read().split(... | true | true |
f769799d453d2b00d57bdc4d7e41ef5dcadfddb3 | 3,253 | py | Python | iredis/config.py | crhan/iredis | 2823fa8e14d6976cf0d15cf783de5179da2b1ca6 | [
"BSD-3-Clause"
] | null | null | null | iredis/config.py | crhan/iredis | 2823fa8e14d6976cf0d15cf783de5179da2b1ca6 | [
"BSD-3-Clause"
] | null | null | null | iredis/config.py | crhan/iredis | 2823fa8e14d6976cf0d15cf783de5179da2b1ca6 | [
"BSD-3-Clause"
] | null | null | null | import os
import logging
from configobj import ConfigObj, ConfigObjError
from iredis import project_data
# TODO verbose logger to print to stdout
logger = logging.getLogger(__name__)
system_config_file = "/etc/iredisrc"
default_config_file = os.path.join(project_data, "iredisrc")
pwd_config_file = os.path.join(os.g... | 29.572727 | 88 | 0.649554 | import os
import logging
from configobj import ConfigObj, ConfigObjError
from iredis import project_data
logger = logging.getLogger(__name__)
system_config_file = "/etc/iredisrc"
default_config_file = os.path.join(project_data, "iredisrc")
pwd_config_file = os.path.join(os.getcwd(), ".iredisrc")
class Config:
... | true | true |
f76979bf6b29d22f613ba0dddb96c1ee69b68993 | 330 | py | Python | Sem3/Python/assignment4/11_divisors.py | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | null | null | null | Sem3/Python/assignment4/11_divisors.py | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | null | null | null | Sem3/Python/assignment4/11_divisors.py | nsudhanva/mca-code | 812348ce53edbe0f42f85a9c362bfc8aad64e1e7 | [
"MIT"
] | 2 | 2018-10-12T06:38:14.000Z | 2019-01-30T04:38:03.000Z | num = int(input('Enter a number: '))
def find_divisors(num):
divisors = []
for i in range(1, num + 1):
if num % i == 0:
divisors.append(i)
return divisors
print('Divisors: ', find_divisors(num))
print('Divisors Sum: ', sum(find_divisors(num)))
print('Divisors Count: ', len(find_divis... | 23.571429 | 50 | 0.615152 | num = int(input('Enter a number: '))
def find_divisors(num):
divisors = []
for i in range(1, num + 1):
if num % i == 0:
divisors.append(i)
return divisors
print('Divisors: ', find_divisors(num))
print('Divisors Sum: ', sum(find_divisors(num)))
print('Divisors Count: ', len(find_divis... | true | true |
f7697a30626e6a69011ccb5dbe0f4aa05a5cecad | 1,680 | py | Python | PyOpenGL-3.0.2/OpenGL/GL/APPLE/vertex_array_object.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/GL/APPLE/vertex_array_object.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | PyOpenGL-3.0.2/OpenGL/GL/APPLE/vertex_array_object.py | frederica07/Dragon_Programming_Process | c0dff2e20c1be6db5adc6f9977efae8f7f888ef5 | [
"BSD-2-Clause"
] | null | null | null | '''OpenGL extension APPLE.vertex_array_object
This module customises the behaviour of the
OpenGL.raw.GL.APPLE.vertex_array_object to provide a more
Python-friendly API
Overview (from the spec)
This extension introduces named vertex array objects which encapsulate
vertex array state on the client side. The main ... | 44.210526 | 77 | 0.810714 | from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions, wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.APPLE.vertex_array_object import *
| true | true |
f7697a49edb6d9bebd6502896001b5ca98b51380 | 2,642 | py | Python | api-dev/venv/lib/python3.6/site-packages/google/protobuf/duration_pb2.py | twaddle-dev/CoVid-19 | 37b1ca12d7ca1a066ab1c0d4a02d9b038d44e62f | [
"Apache-2.0"
] | 56 | 2015-11-17T09:51:20.000Z | 2022-03-29T10:53:36.000Z | api-dev/venv/lib/python3.6/site-packages/google/protobuf/duration_pb2.py | twaddle-dev/CoVid-19 | 37b1ca12d7ca1a066ab1c0d4a02d9b038d44e62f | [
"Apache-2.0"
] | 299 | 2015-03-27T09:23:33.000Z | 2022-03-30T11:35:07.000Z | webhook/venv/lib/python3.7/site-packages/google/protobuf/duration_pb2.py | tlgevers/dialogflow-chatbot-python | da159cee4efee29e57a60bf8d6cf829cb2d828a6 | [
"Apache-2.0"
] | 65 | 2015-03-19T09:59:23.000Z | 2022-03-09T17:32:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/duration.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_data... | 34.311688 | 350 | 0.763815 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='google/p... | true | true |
f7697b71e197f3407ce54745bde3fe639458e93f | 24,784 | py | Python | api/proquest/client.py | arielmorelli/circulation | 6008f79c502f58484dd8c800ccc90c34b6d5e9d7 | [
"Apache-2.0"
] | null | null | null | api/proquest/client.py | arielmorelli/circulation | 6008f79c502f58484dd8c800ccc90c34b6d5e9d7 | [
"Apache-2.0"
] | null | null | null | api/proquest/client.py | arielmorelli/circulation | 6008f79c502f58484dd8c800ccc90c34b6d5e9d7 | [
"Apache-2.0"
] | null | null | null | import logging
from contextlib import contextmanager
import requests
from flask_babel import lazy_gettext as _
from requests import HTTPError, Request
from core.exceptions import BaseError
from core.model import DeliveryMechanism
from core.model.configuration import (
ConfigurationAttributeType,
Configuration... | 34.857947 | 118 | 0.622176 | import logging
from contextlib import contextmanager
import requests
from flask_babel import lazy_gettext as _
from requests import HTTPError, Request
from core.exceptions import BaseError
from core.model import DeliveryMechanism
from core.model.configuration import (
ConfigurationAttributeType,
Configuration... | true | true |
f7697de685499a66d39f9f712127a52cbb4afeb5 | 2,761 | py | Python | examples/interface/BPComplex.py | justusc/Elemental | 145ccb28411f3f0c65ca30ecea776df33297e4ff | [
"BSD-3-Clause"
] | null | null | null | examples/interface/BPComplex.py | justusc/Elemental | 145ccb28411f3f0c65ca30ecea776df33297e4ff | [
"BSD-3-Clause"
] | null | null | null | examples/interface/BPComplex.py | justusc/Elemental | 145ccb28411f3f0c65ca30ecea776df33297e4ff | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2009-2015, Jack Poulson
# All rights reserved.
#
# This file is part of Elemental and is under the BSD 2-Clause License,
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
import El, time
n0=20
n1=20
output = False
display = Tr... | 27.336634 | 73 | 0.653024 | import El, time
n0=20
n1=20
output = False
display = True
worldSize = El.mpi.WorldSize()
worldRank = El.mpi.WorldRank()
def ConcatFD2D(N0,N1):
A = El.DistSparseMatrix(El.zTag)
height = N0*N1
width = 2*N0*N1
A.Resize(height,width)
localHeight = A.LocalHeight()
A.Reserve(11*localHeight)
for sLoc in xrange... | false | true |
f7697ed220aa1bc7891a7aae077598066e0fc400 | 1,793 | py | Python | python/profiling/csv_data_analysis.py | zkan/100DaysOfCode | 3c713ead94a9928e2d0f8d794e49ec202dc64ba3 | [
"MIT"
] | 2 | 2019-05-01T00:32:30.000Z | 2019-11-20T05:23:05.000Z | python/profiling/csv_data_analysis.py | zkan/100DaysOfCode | 3c713ead94a9928e2d0f8d794e49ec202dc64ba3 | [
"MIT"
] | 15 | 2020-09-05T18:35:04.000Z | 2022-03-11T23:44:47.000Z | python/profiling/csv_data_analysis.py | zkan/100DaysOfCode | 3c713ead94a9928e2d0f8d794e49ec202dc64ba3 | [
"MIT"
] | null | null | null | import collections
import cProfile
import csv
from pathlib import Path
profiler = cProfile.Profile()
profiler.disable()
Record = collections.namedtuple(
'Record',
'airline, fatal_accidents_85_99, fatalities_85_99, '
'fatal_accidents_00_14, fatalities_00_14'
)
def parse_row(row):
record = Record(
... | 25.253521 | 70 | 0.655884 | import collections
import cProfile
import csv
from pathlib import Path
profiler = cProfile.Profile()
profiler.disable()
Record = collections.namedtuple(
'Record',
'airline, fatal_accidents_85_99, fatalities_85_99, '
'fatal_accidents_00_14, fatalities_00_14'
)
def parse_row(row):
record = Record(
... | true | true |
f7697f4d2d2c1880bcf71777b3a8c2cbbcb6e178 | 11,650 | py | Python | tests/test_session_configuration.py | pyansys/openapi-common | 869869b6b8d59165e46d3357e44e07c70f18a294 | [
"MIT"
] | 1 | 2022-02-17T21:03:18.000Z | 2022-02-17T21:03:18.000Z | tests/test_session_configuration.py | pyansys/openapi-common | 869869b6b8d59165e46d3357e44e07c70f18a294 | [
"MIT"
] | 46 | 2022-02-09T17:29:18.000Z | 2022-03-21T13:42:59.000Z | tests/test_session_configuration.py | pyansys/openapi-common | 869869b6b8d59165e46d3357e44e07c70f18a294 | [
"MIT"
] | null | null | null | import http.cookiejar
import secrets
import tempfile
import time
from unittest.mock import MagicMock
import pytest
import requests
import requests_mock
from requests.utils import CaseInsensitiveDict
from ansys.openapi.common import SessionConfiguration
from ansys.openapi.common._session import _RequestsTimeoutAdapter... | 35.626911 | 88 | 0.701202 | import http.cookiejar
import secrets
import tempfile
import time
from unittest.mock import MagicMock
import pytest
import requests
import requests_mock
from requests.utils import CaseInsensitiveDict
from ansys.openapi.common import SessionConfiguration
from ansys.openapi.common._session import _RequestsTimeoutAdapter... | true | true |
f7697ff2b2d32dba63c33fb55ea02305fed07a7b | 5,967 | py | Python | Task_1_1.py | Vrittik/Audio_Epic_analysis | d9cf6cb4eaf554285b86aae3365d7b4f7dc521dc | [
"Apache-2.0"
] | 3 | 2019-02-12T12:02:08.000Z | 2019-03-06T20:01:54.000Z | Task_1_1.py | Vrittik/Audio_Epic_analysis | d9cf6cb4eaf554285b86aae3365d7b4f7dc521dc | [
"Apache-2.0"
] | null | null | null | Task_1_1.py | Vrittik/Audio_Epic_analysis | d9cf6cb4eaf554285b86aae3365d7b4f7dc521dc | [
"Apache-2.0"
] | null | null | null |
## Mocking Bot - Task 1.1: Note Detection
# Instructions
# ------------
#
# This file contains Main function and note_detect function. Main Function helps you to check your output
# for practice audio files provided. Do not make any changes in the Main Function.
# You have to complete only the note_detect functi... | 29.835 | 106 | 0.541478 |
import numpy as np
import math
import wave
import os
import struct
import scipy.signal
def note_detect(audio_file):
sampling_freq = 44100
window = 399
dft = []
start = []
end = []
Identified_Notes = []
Identified_Notes[:] = []
start[:] = []
end[:] = []
... | false | true |
f769819dccfeb769892c96d8e74d96574662e051 | 1,167 | py | Python | chat/utils.py | libremente/uniTicket | 6f41f0ce9bd0f1238bffcde1c4e12a38266c781b | [
"Apache-2.0"
] | null | null | null | chat/utils.py | libremente/uniTicket | 6f41f0ce9bd0f1238bffcde1c4e12a38266c781b | [
"Apache-2.0"
] | null | null | null | chat/utils.py | libremente/uniTicket | 6f41f0ce9bd0f1238bffcde1c4e12a38266c781b | [
"Apache-2.0"
] | null | null | null | from django.apps import apps
from organizational_area.models import OrganizationalStructure
from uni_ticket.utils import user_is_in_default_office
def chat_operator(user, structure_slug):
if not structure_slug: return False
if not user: return False
structure = OrganizationalStructure.objects.filter(slug... | 41.678571 | 87 | 0.696658 | from django.apps import apps
from organizational_area.models import OrganizationalStructure
from uni_ticket.utils import user_is_in_default_office
def chat_operator(user, structure_slug):
if not structure_slug: return False
if not user: return False
structure = OrganizationalStructure.objects.filter(slug... | true | true |
f769821f869e4442655b54f8bac604135861892c | 56 | py | Python | helpersdetc/exploredfs/__init__.py | taylor-curran/helpersdetc | c147d4b2d0417ccb66b856b272b741d77f454159 | [
"MIT"
] | null | null | null | helpersdetc/exploredfs/__init__.py | taylor-curran/helpersdetc | c147d4b2d0417ccb66b856b272b741d77f454159 | [
"MIT"
] | null | null | null | helpersdetc/exploredfs/__init__.py | taylor-curran/helpersdetc | c147d4b2d0417ccb66b856b272b741d77f454159 | [
"MIT"
] | null | null | null | import pandas as pd # type: ignore
import numpy as np
| 11.2 | 34 | 0.732143 | import pandas as pd import numpy as np
| true | true |
f7698234331d51c0406d14ef893c73d79390b05e | 7,463 | py | Python | attalos/evaluation/evaluation.py | Lab41/attalos | 43b5b61f6b2a2b5f4a49ef1286b4577f1bf4e140 | [
"Apache-2.0"
] | 101 | 2016-06-03T00:15:52.000Z | 2021-11-12T11:57:46.000Z | attalos/evaluation/evaluation.py | Lab41/attalos | 43b5b61f6b2a2b5f4a49ef1286b4577f1bf4e140 | [
"Apache-2.0"
] | 70 | 2016-05-27T21:05:33.000Z | 2017-08-09T05:13:45.000Z | attalos/evaluation/evaluation.py | Lab41/attalos | 43b5b61f6b2a2b5f4a49ef1286b4577f1bf4e140 | [
"Apache-2.0"
] | 46 | 2016-05-27T16:19:20.000Z | 2019-06-24T12:37:22.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import scipy as sp
from sklearn import metrics
class Evaluation(object):
"""
Assumes:
predicted: matrix of label prediction confidence [trial, tag]
eval_... | 34.391705 | 79 | 0.605119 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import scipy as sp
from sklearn import metrics
class Evaluation(object):
def __init__(self, truth, predictions, k=0.5):
self.predictions_raw = prediction... | true | true |
f76982699093d56f2eef53eb660778221c155a82 | 1,025 | py | Python | workalendar/oceania/marshall_islands.py | taiyeoguns/workalendar | 35ef15b0fe166ab2e73e419c83ad45738a62ac8d | [
"MIT"
] | 405 | 2017-11-21T14:33:58.000Z | 2021-06-03T01:58:55.000Z | workalendar/oceania/marshall_islands.py | taiyeoguns/workalendar | 35ef15b0fe166ab2e73e419c83ad45738a62ac8d | [
"MIT"
] | 236 | 2017-11-20T16:11:50.000Z | 2021-05-28T08:02:53.000Z | workalendar/oceania/marshall_islands.py | taiyeoguns/workalendar | 35ef15b0fe166ab2e73e419c83ad45738a62ac8d | [
"MIT"
] | 126 | 2017-12-12T14:04:25.000Z | 2021-05-29T14:27:11.000Z | from ..core import WesternCalendar, FRI
from ..registry_tools import iso_register
@iso_register('MH')
class MarshallIslands(WesternCalendar):
"Marshall Islands"
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(3, 3, "Remembrance Day"),
(5, 1, "Constitution Day"),
(11, 17, "Presiden... | 29.285714 | 68 | 0.589268 | from ..core import WesternCalendar, FRI
from ..registry_tools import iso_register
@iso_register('MH')
class MarshallIslands(WesternCalendar):
FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
(3, 3, "Remembrance Day"),
(5, 1, "Constitution Day"),
(11, 17, "Presidents' Day"),
(12,... | true | true |
f76982ffdb67ba4acf4de8b848eef9d1636e50ae | 1,748 | py | Python | ml_volatility/ml_volatility/cli.py | JacobGrig/ML-volatility | a93f68d30eb6655f131c6115ca5301cd819ca075 | [
"MIT"
] | null | null | null | ml_volatility/ml_volatility/cli.py | JacobGrig/ML-volatility | a93f68d30eb6655f131c6115ca5301cd819ca075 | [
"MIT"
] | null | null | null | ml_volatility/ml_volatility/cli.py | JacobGrig/ML-volatility | a93f68d30eb6655f131c6115ca5301cd819ca075 | [
"MIT"
] | null | null | null | import argparse
import sys
from pathlib import Path
# from ml_volatility.algos.extractor import Extractor
# from ml_volatility.algos.extractor import ExtractorWithJumps
from ml_volatility.algos.extractor import FinalExtractor
# Default paths for intermediate output files, meta paths
DATA_PATH: Path = Path(__file__).p... | 25.705882 | 89 | 0.703661 | import argparse
import sys
from pathlib import Path
from ml_volatility.algos.extractor import FinalExtractor
DATA_PATH: Path = Path(__file__).parent / "data"
DATA_PATH_RESULTS: Path = DATA_PATH
DATA_PATH.mkdir() if not DATA_PATH.exists() else None
MAIN_CMD_NAME = "volatility"
def get_prog_name() -> str:
ret... | true | true |
f76984ea04a4dda09303bdd4e29a483aeaa06ebf | 16,669 | py | Python | opennmt/decoders/rnn_decoder.py | syang1993/OpenNMT-tf | 48bd0becabdf11c99cd08c313599807b55d62178 | [
"MIT"
] | 1 | 2021-10-02T12:30:16.000Z | 2021-10-02T12:30:16.000Z | opennmt/decoders/rnn_decoder.py | rragrawal/OpenNMT-tf | eaeb2970c14dd6a6e1b9d261e15a645b589852e8 | [
"MIT"
] | null | null | null | opennmt/decoders/rnn_decoder.py | rragrawal/OpenNMT-tf | eaeb2970c14dd6a6e1b9d261e15a645b589852e8 | [
"MIT"
] | 1 | 2019-06-17T21:36:56.000Z | 2019-06-17T21:36:56.000Z | """Define RNN-based decoders."""
import inspect
import tensorflow as tf
from tensorflow.python.estimator.util import fn_args
from opennmt.decoders.decoder import Decoder, logits_to_cum_log_probs, build_output_layer
from opennmt.utils.cell import build_cell
class RNNDecoder(Decoder):
"""A basic RNN decoder."""
... | 36.080087 | 96 | 0.652709 |
import inspect
import tensorflow as tf
from tensorflow.python.estimator.util import fn_args
from opennmt.decoders.decoder import Decoder, logits_to_cum_log_probs, build_output_layer
from opennmt.utils.cell import build_cell
class RNNDecoder(Decoder):
def __init__(self,
num_layers,
... | true | true |
f769858d64f43a3ac5cb230049542593a22fdc65 | 1,654 | py | Python | footer.py | donkirkby/donimoes | 100e83e1d8701015e1a06f850935a3f3a52a0f5e | [
"MIT"
] | 4 | 2017-02-19T03:08:50.000Z | 2021-11-08T12:04:00.000Z | footer.py | donkirkby/donimoes | 100e83e1d8701015e1a06f850935a3f3a52a0f5e | [
"MIT"
] | 68 | 2016-10-07T05:56:40.000Z | 2022-02-14T03:48:53.000Z | footer.py | donkirkby/donimoes | 100e83e1d8701015e1a06f850935a3f3a52a0f5e | [
"MIT"
] | 3 | 2019-07-23T15:40:12.000Z | 2022-03-29T18:25:47.000Z | from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER
class FooterCanvas(canvas.Canvas):
def __init__(self, *args, is_booklet=False, font_name='Times-Roman', **kwargs):
canvas.Canvas.__init__(self, *args, **kwargs)
self.pages = []
self.is_booklet = is_booklet
... | 34.458333 | 83 | 0.569528 | from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import LETTER
class FooterCanvas(canvas.Canvas):
def __init__(self, *args, is_booklet=False, font_name='Times-Roman', **kwargs):
canvas.Canvas.__init__(self, *args, **kwargs)
self.pages = []
self.is_booklet = is_booklet
... | true | true |
f76985e97ecb6b292355718480effb0323404e51 | 3,367 | py | Python | plot_M_diff.py | alexfmsu/pyquantum | 78b09987cbfecf549e67b919bb5cb2046b21ad44 | [
"MIT"
] | null | null | null | plot_M_diff.py | alexfmsu/pyquantum | 78b09987cbfecf549e67b919bb5cb2046b21ad44 | [
"MIT"
] | null | null | null | plot_M_diff.py | alexfmsu/pyquantum | 78b09987cbfecf549e67b919bb5cb2046b21ad44 | [
"MIT"
] | 2 | 2020-07-28T08:40:06.000Z | 2022-02-16T23:04:58.000Z | from PyQuantum.Tools.CSV import *
import plotly.graph_objs as go
import numpy as np
from PyQuantum.Tools.PlotBuilder2D import *
# data = []
# data.append(go.Scatter(
# x=[1, 2, 3],
# y=[4, 5, 6],
# name="w_0['title']",
# ))
# plot_builder = PlotBuilder2D({
# 'title': 'M[p<sub>sink</sub>]<sub>|t<sub>0... | 22.446667 | 124 | 0.494505 | from PyQuantum.Tools.CSV import *
import plotly.graph_objs as go
import numpy as np
from PyQuantum.Tools.PlotBuilder2D import *
data = []
M_str = ''
M_list = {
's_2': [],
't_0': []
}
for w_0 in [
{
'name': 's_2',
'title': '|s<sub>2</sub>〉',
},
{
'name': 't_0... | true | true |
f76986f2d2a136e66358f57663f73d32868e953c | 2,859 | py | Python | coderedcms/blocks/layout_blocks.py | mikiec84/coderedcms | d72de2118d777f23d9512dc348691d3d7b46d0e5 | [
"BSD-3-Clause"
] | null | null | null | coderedcms/blocks/layout_blocks.py | mikiec84/coderedcms | d72de2118d777f23d9512dc348691d3d7b46d0e5 | [
"BSD-3-Clause"
] | null | null | null | coderedcms/blocks/layout_blocks.py | mikiec84/coderedcms | d72de2118d777f23d9512dc348691d3d7b46d0e5 | [
"BSD-3-Clause"
] | null | null | null | """
Layout blocks are essentially a wrapper around content.
e.g. rows, columns, hero units, etc.
"""
from django.utils.translation import ugettext_lazy as _
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
from coderedcms.settings import cr_settings
from .base_blocks import BaseLay... | 25.756757 | 110 | 0.631689 |
from django.utils.translation import ugettext_lazy as _
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
from coderedcms.settings import cr_settings
from .base_blocks import BaseLayoutBlock, CoderedAdvColumnSettings
class ColumnBlock(BaseLayoutBlock):
column_size = blocks.C... | true | true |
f76986ff2849c32efd561ecbcf6573ed4dc479cd | 21,821 | py | Python | rewardpredictive/mdp.py | lucaslehnert/rewardpredictive | 273da5a2566a263678159ed81dfb202b180a45a1 | [
"MIT"
] | 1 | 2020-08-04T18:01:53.000Z | 2020-08-04T18:01:53.000Z | rewardpredictive/mdp.py | lucaslehnert/rewardpredictive | 273da5a2566a263678159ed81dfb202b180a45a1 | [
"MIT"
] | 5 | 2020-07-14T20:06:36.000Z | 2022-02-10T01:52:53.000Z | rewardpredictive/mdp.py | lucaslehnert/rewardpredictive | 273da5a2566a263678159ed81dfb202b180a45a1 | [
"MIT"
] | 1 | 2020-11-09T16:11:14.000Z | 2020-11-09T16:11:14.000Z | #
# Copyright (c) 2020 Lucas Lehnert <lucas_lehnert@brown.edu>
#
# This source code is licensed under an MIT license found in the LICENSE file in the root directory of this project.
#
from itertools import product, combinations
import numpy as np
import rlutils as rl
from rlutils.environment.gridworld import pt_to_idx... | 37.300855 | 116 | 0.589386 | from itertools import product, combinations
import numpy as np
import rlutils as rl
from rlutils.environment.gridworld import pt_to_idx, idx_to_pt, \
generate_gridworld_transition_function, \
generate_gridworld_transition_function_with_barrier, \
generate_mdp_from_transition_and_reward_function
from .util... | true | true |
f769876e88c8e128dc8aaab3251bb88448594839 | 417 | py | Python | shop/migrations/0007_auto_20180907_1837.py | sebapaik/django-shop | 00c7190ac6614ebe1eb0c0ea444f8e91c2e7f7a8 | [
"MIT"
] | null | null | null | shop/migrations/0007_auto_20180907_1837.py | sebapaik/django-shop | 00c7190ac6614ebe1eb0c0ea444f8e91c2e7f7a8 | [
"MIT"
] | null | null | null | shop/migrations/0007_auto_20180907_1837.py | sebapaik/django-shop | 00c7190ac6614ebe1eb0c0ea444f8e91c2e7f7a8 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2018-09-07 21:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0006_auto_20180907_1837'),
]
operations = [
migrations.AlterField(
model_name='order',
name='ordertoral',
... | 21.947368 | 81 | 0.613909 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0006_auto_20180907_1837'),
]
operations = [
migrations.AlterField(
model_name='order',
name='ordertoral',
field=models.DecimalField(decimal_plac... | true | true |
f769878c682bf6288b72a5e83216ed5712e9e16b | 626 | py | Python | manage.py | nihanaydin/track-rent-management | 970f4406ac7fee868fbb440ca18e0b7c7d57067b | [
"MIT"
] | null | null | null | manage.py | nihanaydin/track-rent-management | 970f4406ac7fee868fbb440ca18e0b7c7d57067b | [
"MIT"
] | 7 | 2020-06-05T23:19:41.000Z | 2021-09-22T18:57:38.000Z | manage.py | nihanaydin/track-rent-management | 970f4406ac7fee868fbb440ca18e0b7c7d57067b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wwttms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportE... | 28.454545 | 73 | 0.682109 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wwttms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f76988636febcc33fb36775812da45e5abffae6b | 214 | py | Python | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | benchmark/overhead.py | keithyipkw/InSync | 3744b45f31f713de2dfc8c30507e67db96915e07 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import pandas as pd
def main():
df = pd.read_csv(sys.argv[1], names=["Method", "Time"])
print(df.groupby("Method").describe().to_csv())
if __name__ == "__main__":
main() | 19.454545 | 59 | 0.64486 | import sys
import numpy as np
import pandas as pd
def main():
df = pd.read_csv(sys.argv[1], names=["Method", "Time"])
print(df.groupby("Method").describe().to_csv())
if __name__ == "__main__":
main() | true | true |
f769888043104b03ffa5a46728bd3f29ef20b7a6 | 906 | py | Python | src/aria/aria/loading/literal.py | tliron/aria-ng | 55cf7af3b0a8fe62d422dd687dd7da3849824524 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/aria/aria/loading/literal.py | tliron/aria-ng | 55cf7af3b0a8fe62d422dd687dd7da3849824524 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/aria/aria/loading/literal.py | tliron/aria-ng | 55cf7af3b0a8fe62d422dd687dd7da3849824524 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-06-16T09:52:49.000Z | 2020-06-16T14:52:45.000Z | #
# Copyright (c) 2016 GigaSpaces Technologies Ltd. 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 requ... | 29.225806 | 75 | 0.715232 |
from .loader import Loader
class LiteralLoader(Loader):
def __init__(self, location):
self.location = location
def load(self):
return self.location.content
| true | true |
f76988db85d52994898db85fcd18ffd8543ebfd2 | 1,033 | py | Python | backend/backend/database/db_connections/bible/bible_crawler_connection_rethink.py | ppeetteerrs/LivingWater | 8ce1cac05dd623b3f86ef87a227c36881311dbb7 | [
"MIT"
] | null | null | null | backend/backend/database/db_connections/bible/bible_crawler_connection_rethink.py | ppeetteerrs/LivingWater | 8ce1cac05dd623b3f86ef87a227c36881311dbb7 | [
"MIT"
] | 5 | 2021-01-28T19:42:47.000Z | 2022-03-25T18:37:12.000Z | backend/backend/database/db_connections/bible/bible_crawler_connection_rethink.py | ppeetteerrs/LivingWater | 8ce1cac05dd623b3f86ef87a227c36881311dbb7 | [
"MIT"
] | null | null | null | import rethinkdb as r
class BibleCrawlerConnection(object):
def __init__(self, version: str, url: str, books):
self.connection = r.connect("localhost", 28015)
self.DB = r.db("bible")
self.table = self.setup_table(version)
self.create_books(books)
def setup_table(self, bible_v... | 39.730769 | 105 | 0.678606 | import rethinkdb as r
class BibleCrawlerConnection(object):
def __init__(self, version: str, url: str, books):
self.connection = r.connect("localhost", 28015)
self.DB = r.db("bible")
self.table = self.setup_table(version)
self.create_books(books)
def setup_table(self, bible_v... | true | true |
f769896b8112e389a242b0d730af440e5fa4ee42 | 26 | py | Python | config/__init__.py | mschneider85/dimitrij-py | 78a07034ae20fe5bf238622924c0a79481f2fbb3 | [
"MIT"
] | null | null | null | config/__init__.py | mschneider85/dimitrij-py | 78a07034ae20fe5bf238622924c0a79481f2fbb3 | [
"MIT"
] | 1 | 2019-04-18T06:06:16.000Z | 2019-04-18T06:06:16.000Z | config/__init__.py | mschneider85/dimitrij-py | 78a07034ae20fe5bf238622924c0a79481f2fbb3 | [
"MIT"
] | null | null | null | from credentials import *
| 13 | 25 | 0.807692 | from credentials import *
| true | true |
f7698a132db5486e53258f3f4b8f0c4c5901b980 | 1,459 | py | Python | ModelTests/test_Pathfinder.py | ProjectBlackFalcon/DatBot | 8b2cc64af78757b832d8bc6a1373fb74b7a4316f | [
"MIT"
] | 7 | 2017-11-22T13:28:41.000Z | 2019-10-17T08:47:40.000Z | ModelTests/test_Pathfinder.py | ProjectBlackFalcon/DatBot | 8b2cc64af78757b832d8bc6a1373fb74b7a4316f | [
"MIT"
] | 3 | 2018-10-07T15:59:34.000Z | 2019-01-15T11:56:18.000Z | ModelTests/test_Pathfinder.py | ProjectBlackFalcon/DatBot | 8b2cc64af78757b832d8bc6a1373fb74b7a4316f | [
"MIT"
] | null | null | null | from Pathfinder import PathFinder
import numpy as np
import winsound
def generate_map_collage():
maps_coords = pf.get_maps_coords()
maps = []
shape = (abs(end[1] - start[1]) + 1, abs(end[0] - start[0]) + 1)
counter = 0
for coord in maps_coords:
map_infos = pf.llf.coord_fetch_map(coord, pf.... | 28.607843 | 141 | 0.610692 | from Pathfinder import PathFinder
import numpy as np
import winsound
def generate_map_collage():
maps_coords = pf.get_maps_coords()
maps = []
shape = (abs(end[1] - start[1]) + 1, abs(end[0] - start[0]) + 1)
counter = 0
for coord in maps_coords:
map_infos = pf.llf.coord_fetch_map(coord, pf.... | true | true |
f7698aa99bd8c83e773d00be63b76e897281e0eb | 48,464 | py | Python | python/ccxt/bitz.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | 1 | 2019-10-30T13:32:54.000Z | 2019-10-30T13:32:54.000Z | python/ccxt/bitz.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | null | null | null | python/ccxt/bitz.py | alok46/ccxt | ea94147e03e6974384727ead440a7cd2e80f7078 | [
"MIT"
] | 2 | 2019-12-02T10:32:52.000Z | 2020-03-22T00:58:58.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 42.216028 | 180 | 0.406776 |
from ccxt.base.exchange import Exchange
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import Inval... | true | true |
f7698afb21ccc7cf612425ff54d7c2e1516a24c3 | 1,276 | py | Python | modules/signatures/windows/deepfreeze_mutex.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 24 | 2021-06-21T07:35:37.000Z | 2022-03-22T03:33:59.000Z | modules/signatures/windows/deepfreeze_mutex.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 3 | 2021-07-01T08:09:05.000Z | 2022-01-28T03:38:36.000Z | modules/signatures/windows/deepfreeze_mutex.py | Yuanmessi/Bold-Falcon | 00fcaba0b3d9c462b9d20ecb256ff85db5d119e2 | [
"BSD-3-Clause"
] | 6 | 2021-06-22T05:32:57.000Z | 2022-02-11T02:05:45.000Z | # Copyright (C) 2015 KillerInstinct, Updated 2017 for Cuckoo 2.0
#
# This program 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) any later version.
#
# T... | 34.486486 | 71 | 0.703762 |
from lib.cuckoo.common.abstracts import Signature
class DeepFreezeMutex(Signature):
name = "deepfreeze_mutex"
description = "Checks for a known DeepFreeze Frozen State Mutex"
severity = 3
categories = ["anti-sandbox"]
authors = ["KillerInstinct"]
minimum = "2.0"
mutexes_re = [
"Fr... | true | true |
f7698b1f46c59ef4b40b7ed87dfddf8a94a5a2e6 | 201 | py | Python | heightmap-png.py | tsmorrill/MIDI-gen | dc9a0379991f5c5541befa18bb6af76146385247 | [
"MIT"
] | null | null | null | heightmap-png.py | tsmorrill/MIDI-gen | dc9a0379991f5c5541befa18bb6af76146385247 | [
"MIT"
] | null | null | null | heightmap-png.py | tsmorrill/MIDI-gen | dc9a0379991f5c5541befa18bb6af76146385247 | [
"MIT"
] | null | null | null | from midigen import heightmap
map = heightmap.diamond_square(8, 0.5, "Math Center", None)
map = heightmap.heightmap_normalize(map)
print("Map in memory")
heightmap.heightmap_to_png(map, "mathcenter")
| 28.714286 | 59 | 0.781095 | from midigen import heightmap
map = heightmap.diamond_square(8, 0.5, "Math Center", None)
map = heightmap.heightmap_normalize(map)
print("Map in memory")
heightmap.heightmap_to_png(map, "mathcenter")
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.