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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0b8a99b1e14b6d986caaee597320e6c041bdaf | 486 | py | Python | ex29.py | YuneMeMeMon/python-exercises | 1bd62397508c53ceb28e0892a59c281befd11233 | [
"MIT"
] | null | null | null | ex29.py | YuneMeMeMon/python-exercises | 1bd62397508c53ceb28e0892a59c281befd11233 | [
"MIT"
] | null | null | null | ex29.py | YuneMeMeMon/python-exercises | 1bd62397508c53ceb28e0892a59c281befd11233 | [
"MIT"
] | null | null | null | people = 20
cats = 30
dogs = 15
if people < cats:
print("Too many cats! The world is doomed!")
if people > cats:
print("Not many cats! The world is saved!")
if people < dogs:
print("The world is drooled on!")
if people > dogs:
print("The world is dry!")
dogs += 5
if people >= dogs:
print("... | 18 | 54 | 0.627572 | people = 20
cats = 30
dogs = 15
if people < cats:
print("Too many cats! The world is doomed!")
if people > cats:
print("Not many cats! The world is saved!")
if people < dogs:
print("The world is drooled on!")
if people > dogs:
print("The world is dry!")
dogs += 5
if people >= dogs:
print("... | true | true |
1c0b8ab502e1157ad325860e5fe62575234c7e7b | 276 | py | Python | fizz_buzz.py | JimBob3000/python_mini_projects | 28e4af718bb74fe1b2fdb581bdba0f3702d1cfb9 | [
"MIT"
] | null | null | null | fizz_buzz.py | JimBob3000/python_mini_projects | 28e4af718bb74fe1b2fdb581bdba0f3702d1cfb9 | [
"MIT"
] | null | null | null | fizz_buzz.py | JimBob3000/python_mini_projects | 28e4af718bb74fe1b2fdb581bdba0f3702d1cfb9 | [
"MIT"
] | null | null | null | def fizz_buzz(number):
if number % 3 == 0 and number % 5 == 0:
return "FizzBuzz"
if number % 5 == 0:
return "Buzz"
if number % 3 == 0:
return"Fizz"
return number
# From 1 to 15
for number in range(1, 16):
print(fizz_buzz(number))
| 19.714286 | 43 | 0.554348 | def fizz_buzz(number):
if number % 3 == 0 and number % 5 == 0:
return "FizzBuzz"
if number % 5 == 0:
return "Buzz"
if number % 3 == 0:
return"Fizz"
return number
for number in range(1, 16):
print(fizz_buzz(number))
| true | true |
1c0b8c3d4270bffb6ec5c290beaac5c7b02ce58b | 56,367 | py | Python | tests/strategies/staggered_orders/test_staggered_orders_complex.py | birake/DEXBot-1 | a2ec28b4f9df2be5da77d1307f6440271ee86df5 | [
"MIT"
] | 1 | 2021-04-22T09:18:55.000Z | 2021-04-22T09:18:55.000Z | tests/strategies/staggered_orders/test_staggered_orders_complex.py | birake/DEXBot-1 | a2ec28b4f9df2be5da77d1307f6440271ee86df5 | [
"MIT"
] | null | null | null | tests/strategies/staggered_orders/test_staggered_orders_complex.py | birake/DEXBot-1 | a2ec28b4f9df2be5da77d1307f6440271ee86df5 | [
"MIT"
] | 2 | 2021-02-13T10:58:33.000Z | 2022-03-04T14:01:58.000Z | import logging
import pytest
import math
from datetime import datetime
from bitshares.account import Account
from bitshares.amount import Amount
# Turn on debug for dexbot logger
log = logging.getLogger("dexbot")
log.setLevel(logging.DEBUG)
MODES = ['mountain', 'valley', 'neutral', 'buy_slope', 'sell_slope']
def g... | 43.526641 | 120 | 0.703 | import logging
import pytest
import math
from datetime import datetime
from bitshares.account import Account
from bitshares.amount import Amount
log = logging.getLogger("dexbot")
log.setLevel(logging.DEBUG)
MODES = ['mountain', 'valley', 'neutral', 'buy_slope', 'sell_slope']
def get_spread(worker):
if worker.b... | true | true |
1c0b8c801c6d2663233b2c83a462069407d7884d | 321 | py | Python | group/urls.py | Showme-Prologue/Prologue-BE | 5e452820a71640e328a5634b43f619fb02b1836b | [
"MIT"
] | null | null | null | group/urls.py | Showme-Prologue/Prologue-BE | 5e452820a71640e328a5634b43f619fb02b1836b | [
"MIT"
] | 8 | 2021-11-14T16:24:37.000Z | 2021-11-21T21:03:45.000Z | group/urls.py | Showme-Prologue/Prologue-BE | 5e452820a71640e328a5634b43f619fb02b1836b | [
"MIT"
] | null | null | null | from django.urls import path, include
from group import views
urlpatterns = [
# introductions list
path('groups', views.group_list, name='group_list'),
path('groups/', views.group_list, name='group_list'),
# introduction item
#path('groups/<int:userId>', views.introduction, name='introduction'),
... | 26.75 | 74 | 0.700935 | from django.urls import path, include
from group import views
urlpatterns = [
path('groups', views.group_list, name='group_list'),
path('groups/', views.group_list, name='group_list'),
] | true | true |
1c0b8cc747f3b2677e809d23981b57be93b8cc61 | 2,222 | py | Python | realworldrl_suite/utils/loggers.py | Roryoung/realworldrl_suite | dfcbb700eff20c39c649e235e16d087393bf7e9a | [
"Apache-2.0"
] | 284 | 2020-03-23T17:10:46.000Z | 2022-03-27T08:35:12.000Z | realworldrl_suite/utils/loggers.py | dylanamiller/rwrl_pybullet | be7a51cffa7f5f9cb77a387c16bad209e0f851f8 | [
"Apache-2.0"
] | 2 | 2021-05-21T14:04:51.000Z | 2021-11-29T12:33:08.000Z | realworldrl_suite/utils/loggers.py | dylanamiller/rwrl_pybullet | be7a51cffa7f5f9cb77a387c16bad209e0f851f8 | [
"Apache-2.0"
] | 21 | 2020-07-29T03:23:31.000Z | 2022-01-16T11:37:49.000Z | # coding=utf-8
# Copyright 2020 The Real-World RL Suite Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 28.487179 | 79 | 0.689919 |
import copy
import io
import os
import time
from absl import logging
import numpy as np
class PickleLogger(object):
def __init__(self, path):
self._meta = []
self._stack = []
# been checkpointed in between.
ts = str(int(time.time()))
split = os.path.split(path)
self._pickle_path... | true | true |
1c0b8ce924c9979164bbd437640f3a10b8fda646 | 1,545 | py | Python | solr/test_solr.py | madanadit/dataproc-initialization-actions | 41df2a910d0b85568073087d9e288d4397143b51 | [
"Apache-2.0"
] | null | null | null | solr/test_solr.py | madanadit/dataproc-initialization-actions | 41df2a910d0b85568073087d9e288d4397143b51 | [
"Apache-2.0"
] | null | null | null | solr/test_solr.py | madanadit/dataproc-initialization-actions | 41df2a910d0b85568073087d9e288d4397143b51 | [
"Apache-2.0"
] | null | null | null | """
This module provides testing functionality of the Apache Solr Init Action.
"""
import os
import unittest
from parameterized import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class SolrTestCase(DataprocTestCase):
COMPONENT = 'solr'
INIT_ACTIONS = ['solr/solr.sh']
... | 32.1875 | 78 | 0.616181 |
import os
import unittest
from parameterized import parameterized
from integration_tests.dataproc_test_case import DataprocTestCase
class SolrTestCase(DataprocTestCase):
COMPONENT = 'solr'
INIT_ACTIONS = ['solr/solr.sh']
TEST_SCRIPT_FILE_NAME = 'verify_solr.py'
def verify_instance(self, name):
... | true | true |
1c0b8d7bb5746bb2d3a52b3932bbc762c9d9d367 | 976 | py | Python | nova/api/openstack/compute/legacy_v2/contrib/multiple_create.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/api/openstack/compute/legacy_v2/contrib/multiple_create.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/api/openstack/compute/legacy_v2/contrib/multiple_create.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 37.538462 | 78 | 0.713115 |
from nova.api.openstack import extensions
class Multiple_create(extensions.ExtensionDescriptor):
name = "MultipleCreate"
alias = "os-multiple-create"
namespace = ("http://docs.openstack.org/compute/ext/"
"multiplecreate/api/v1.1")
updated = "2012-08-07T00:00:00Z"
| true | true |
1c0b8e0e647effe292eb9f138cf1eeb04f680940 | 1,554 | py | Python | Taller_Diccionarios/Ejercicio_4.py | Mariajosedibo19/Talleres_de_Algoritmos | db8f1eecc345be1877d9d7a62a3fa8cf3af2df7d | [
"MIT"
] | null | null | null | Taller_Diccionarios/Ejercicio_4.py | Mariajosedibo19/Talleres_de_Algoritmos | db8f1eecc345be1877d9d7a62a3fa8cf3af2df7d | [
"MIT"
] | null | null | null | Taller_Diccionarios/Ejercicio_4.py | Mariajosedibo19/Talleres_de_Algoritmos | db8f1eecc345be1877d9d7a62a3fa8cf3af2df7d | [
"MIT"
] | null | null | null |
estudiantes = {
"1": {
"nombre": "Lorea",
"nota": 8
},
"2": {
"nombre": "Markel",
"nota": 4.2
},
"3": {
"nombre": "Julen",
"nota": 6.5
}
}
keys=[]
lista=[]
estudiantes_lista=3
while True:
datos=input("Inserte nombre y nota final (La nota debe ser de 0 a 10) ")
nom_nt=(nom,nt)=datos.split(" ")
n... | 19.923077 | 82 | 0.587516 |
estudiantes = {
"1": {
"nombre": "Lorea",
"nota": 8
},
"2": {
"nombre": "Markel",
"nota": 4.2
},
"3": {
"nombre": "Julen",
"nota": 6.5
}
}
keys=[]
lista=[]
estudiantes_lista=3
while True:
datos=input("Inserte nombre y nota final (La nota debe ser de 0 a 10) ")
nom_nt=(nom,nt)=datos.split(" ")
n... | true | true |
1c0b8e3a32ad4f2493bfbe06b65466bef9eb69e3 | 4,898 | py | Python | nuitka/plugins/standard/KivyPlugin.py | byehack/Nuitka | 6d868e6d6c371f46ce627f8b774ad3db3d14cab3 | [
"Apache-2.0"
] | 1,228 | 2015-01-01T15:12:50.000Z | 2018-09-21T20:41:11.000Z | nuitka/plugins/standard/KivyPlugin.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 131 | 2015-09-13T05:43:05.000Z | 2018-09-22T08:34:41.000Z | nuitka/plugins/standard/KivyPlugin.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 92 | 2015-02-02T21:05:35.000Z | 2018-09-07T00:14:43.000Z | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 36.014706 | 80 | 0.642711 |
from nuitka.Options import isStandaloneMode
from nuitka.plugins.PluginBase import NuitkaPluginBase
class NuitkaPluginKivy(NuitkaPluginBase):
plugin_name = "kivy"
plugin_desc = "Required by kivy package"
@staticmethod
def isAlwaysEnabled():
return True
@classmethod
def isRelevant(cl... | true | true |
1c0b8e3e21a1f8514da8a38ba7652b0eb97acfe6 | 4,314 | py | Python | custom_components/dscriptmodule_old/board.py | mk-maddin/dScriptModule-HA | 3243742c7aaa1ca9b874b723879f0c128d0be4f2 | [
"Apache-2.0"
] | 1 | 2021-12-30T04:56:04.000Z | 2021-12-30T04:56:04.000Z | custom_components/dscriptmodule_old/board.py | mk-maddin/dScriptModule-HA | 3243742c7aaa1ca9b874b723879f0c128d0be4f2 | [
"Apache-2.0"
] | null | null | null | custom_components/dscriptmodule_old/board.py | mk-maddin/dScriptModule-HA | 3243742c7aaa1ca9b874b723879f0c128d0be4f2 | [
"Apache-2.0"
] | null | null | null | """Board creation functions"""
from __future__ import annotations
from typing import Final
import logging
import asyncio
from homeassistant.const import (
CONF_ENTITIES,
CONF_MAC,
CONF_NAME,
)
from homeassistant.helpers import discovery
from dScriptModule import dScriptBoard
from .const import (
DATA... | 39.944444 | 159 | 0.640241 |
from __future__ import annotations
from typing import Final
import logging
import asyncio
from homeassistant.const import (
CONF_ENTITIES,
CONF_MAC,
CONF_NAME,
)
from homeassistant.helpers import discovery
from dScriptModule import dScriptBoard
from .const import (
DATA_BOARDS,
DEFAULT_AESKEY,
... | true | true |
1c0b8ea4bd92737267d2d1621ebec10d282f7ea7 | 1,007 | py | Python | otp/login/SecretFriendsInfoPanel.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 8 | 2017-10-10T11:41:01.000Z | 2021-02-23T12:55:47.000Z | otp/login/SecretFriendsInfoPanel.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | otp/login/SecretFriendsInfoPanel.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 2 | 2020-11-08T03:38:35.000Z | 2021-09-02T07:03:47.000Z | from pandac.PandaModules import *
from otp.otpbase.OTPGlobals import *
from direct.gui.DirectGui import *
from MultiPageTextFrame import *
from otp.otpbase import OTPLocalizer
from otp.otpgui import OTPDialog
class SecretFriendsInfoPanel(getGlobalDialogClass()):
def __init__(self, doneEvent, hidePageNum = 0, page... | 53 | 256 | 0.7428 | from pandac.PandaModules import *
from otp.otpbase.OTPGlobals import *
from direct.gui.DirectGui import *
from MultiPageTextFrame import *
from otp.otpbase import OTPLocalizer
from otp.otpgui import OTPDialog
class SecretFriendsInfoPanel(getGlobalDialogClass()):
def __init__(self, doneEvent, hidePageNum = 0, page... | true | true |
1c0b8f20929615f1578de633ca470052bde5dfce | 9,046 | py | Python | setup.py | sintax1/o365-email-processor | 37e7f80ceb538c4d4b8ed1b16efb4ed08499033c | [
"MIT"
] | 1 | 2018-01-06T16:49:55.000Z | 2018-01-06T16:49:55.000Z | setup.py | sintax1/o365-email-processor | 37e7f80ceb538c4d4b8ed1b16efb4ed08499033c | [
"MIT"
] | 4 | 2016-02-16T19:15:37.000Z | 2016-02-19T17:29:23.000Z | setup.py | sintax1/o365-email-processor | 37e7f80ceb538c4d4b8ed1b16efb4ed08499033c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import imp
import subprocess
## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
... | 31.085911 | 113 | 0.668804 | from __future__ import print_function
import os
import sys
import imp
import subprocess
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
cmd_args, *args,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
... | true | true |
1c0b8fdeadb41b78650e82bfbcdedc063dcb4559 | 4,161 | py | Python | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/AnalysisDisplayDiagramSettings.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/AnalysisDisplayDiagramSettings.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/Analysis_parts/AnalysisDisplayDiagramSettings.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class AnalysisDisplayDiagramSettings(object, IDisposable):
"""
Contains diagram settings for analysis display style element.
AnalysisDisplayDiagramSettings()
AnalysisDisplayDiagramSettings(other: AnalysisDisplayDiagramSettings)
"""
def Dispose(self):
""" Dispose(self: AnalysisDispl... | 23.913793 | 221 | 0.671954 | class AnalysisDisplayDiagramSettings(object, IDisposable):
def Dispose(self):
pass
def IsEqual(self, other):
pass
def ReleaseUnmanagedResources(self, *args):
pass
def __enter__(self, *args):
pass
def __exit__(self, *args):
pass
def _... | true | true |
1c0b8fed01a4879f94e908cb37d6468936fdbca2 | 64 | py | Python | statsmanager/main/settings.py | bugg86/CSC490-League-Stat-Manager | 243236432dd4addf5dc08bfc6a6edd41add1f0c1 | [
"MIT"
] | null | null | null | statsmanager/main/settings.py | bugg86/CSC490-League-Stat-Manager | 243236432dd4addf5dc08bfc6a6edd41add1f0c1 | [
"MIT"
] | null | null | null | statsmanager/main/settings.py | bugg86/CSC490-League-Stat-Manager | 243236432dd4addf5dc08bfc6a6edd41add1f0c1 | [
"MIT"
] | null | null | null | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | 64 | 64 | 0.84375 | EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' | true | true |
1c0b903d8687967243078b1f54ffa3c2c0661092 | 13,049 | py | Python | homeassistant/components/binary_sensor/xiaomi_aqara.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 37 | 2018-05-22T07:17:26.000Z | 2022-03-03T13:14:46.000Z | homeassistant/components/binary_sensor/xiaomi_aqara.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 34 | 2018-05-22T07:19:40.000Z | 2022-03-11T23:21:03.000Z | homeassistant/components/binary_sensor/xiaomi_aqara.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 8 | 2018-05-30T20:05:26.000Z | 2021-02-19T14:17:05.000Z | """Support for Xiaomi aqara binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.xiaomi_aqara import (PY_XIAOMI_GATEWAY,
XiaomiDevice)
_LOGGER = logging.getLogger(__name__)
NO_CLOSE = '... | 33.981771 | 79 | 0.5674 | import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.xiaomi_aqara import (PY_XIAOMI_GATEWAY,
XiaomiDevice)
_LOGGER = logging.getLogger(__name__)
NO_CLOSE = 'no_close'
ATTR_OPEN_SINCE = 'Open since'
MOTIO... | true | true |
1c0b90a4600d9d36a80c5355f4f9884431a5c989 | 8,221 | py | Python | samos/analysis/rdf.py | lorisercole/samos | e0756f341a1f2faf86aa9c1d47d823879be2f084 | [
"MIT"
] | 2 | 2019-11-01T10:05:18.000Z | 2020-04-22T14:07:21.000Z | samos/analysis/rdf.py | lorisercole/samos | e0756f341a1f2faf86aa9c1d47d823879be2f084 | [
"MIT"
] | null | null | null | samos/analysis/rdf.py | lorisercole/samos | e0756f341a1f2faf86aa9c1d47d823879be2f084 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial.distance import cdist
from ase import Atoms
from samos.trajectory import Trajectory
from samos.utils.attributed_array import AttributedArray
from samos.lib.rdf import calculate_rdf, calculate_angular_spec
import itertools
from abc import ABCMeta, abstractm... | 46.710227 | 147 | 0.607104 |
import numpy as np
from scipy.spatial.distance import cdist
from ase import Atoms
from samos.trajectory import Trajectory
from samos.utils.attributed_array import AttributedArray
from samos.lib.rdf import calculate_rdf, calculate_angular_spec
import itertools
from abc import ABCMeta, abstractmethod
class BaseAnalyz... | true | true |
1c0b912c18fc728a708344ac7e9440ed7d63f915 | 723 | py | Python | test/vanilla/Expected/AcceptanceTests/Validation/validation/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/Expected/AcceptanceTests/Validation/validation/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/Expected/AcceptanceTests/Validation/validation/__init__.py | qwordy/autorest.python | 6b12df51c2a39a1285546b5a771b69f5896e794f | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 34.428571 | 94 | 0.614108 |
from ._auto_rest_validation_test import AutoRestValidationTest
from ._version import VERSION
__version__ = VERSION
__all__ = ["AutoRestValidationTest"]
try:
from ._patch import patch_sdk
patch_sdk()
except ImportError:
pass
| true | true |
1c0b91584fc46e367e22d453abbbe8ce376697a2 | 21 | py | Python | data/studio21_generated/introductory/3956/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/3956/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/introductory/3956/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | def sort_string(s):
| 10.5 | 19 | 0.714286 | def sort_string(s):
| false | true |
1c0b9195e6e46ef018fe1ce4ed7b25527b91adb5 | 31,004 | py | Python | cannab-solution/create_submission.py | Hulihrach/RoadDetector | 9fedd537d7d3a5c81a60562a185fc13370af9a99 | [
"Apache-2.0"
] | 180 | 2018-04-27T15:42:28.000Z | 2022-03-20T02:37:37.000Z | cannab-solution/create_submission.py | Hulihrach/RoadDetector | 9fedd537d7d3a5c81a60562a185fc13370af9a99 | [
"Apache-2.0"
] | 6 | 2018-09-21T18:31:37.000Z | 2020-04-28T19:11:20.000Z | cannab-solution/create_submission.py | Hulihrach/RoadDetector | 9fedd537d7d3a5c81a60562a185fc13370af9a99 | [
"Apache-2.0"
] | 82 | 2018-04-30T13:53:10.000Z | 2022-03-20T02:37:43.000Z | # -*- coding: utf-8 -*-
from os import path, listdir
import numpy as np
np.random.seed(1)
import random
random.seed(1)
import pandas as pd
import timeit
import cv2
from tqdm import tqdm
from multiprocessing import Pool
import sys
from shapely.geometry.linestring import LineString
from skimage.morphology im... | 45.594118 | 182 | 0.510257 | from os import path, listdir
import numpy as np
np.random.seed(1)
import random
random.seed(1)
import pandas as pd
import timeit
import cv2
from tqdm import tqdm
from multiprocessing import Pool
import sys
from shapely.geometry.linestring import LineString
from skimage.morphology import skeletonize_3d, squa... | true | true |
1c0b91dadf49ebc4e9d302a6a36d694deae12e27 | 2,003 | py | Python | ykdl/extractors/iqiyi/util.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | ykdl/extractors/iqiyi/util.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | ykdl/extractors/iqiyi/util.py | iovxw/ykdl | 57d2a0091a63e6fa65e36d0acf3af48520caf713 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ykdl.compact import compact_bytes
import hashlib
import random
macids = {}
js_ctx = None
def get_random_str(l):
string = []
chars = list('abcdefghijklnmopqrstuvwxyz0123456789')
size = len(chars)
for i in range(l):
string.append(random.choice... | 27.438356 | 125 | 0.604593 |
from ykdl.compact import compact_bytes
import hashlib
import random
macids = {}
js_ctx = None
def get_random_str(l):
string = []
chars = list('abcdefghijklnmopqrstuvwxyz0123456789')
size = len(chars)
for i in range(l):
string.append(random.choice(chars))
return ''.join(string)
def get_m... | true | true |
1c0b937f711925a86e7cba581e7bf4078ba39369 | 8,386 | py | Python | src/CreeDictionary/API/search/espt.py | sarahrmoeller/cree-intelligent-dictionary | 74db04b58076b7be5d9b0742d20e8b2014fb4aaa | [
"Apache-2.0"
] | 8 | 2019-06-06T14:24:40.000Z | 2020-11-11T01:43:11.000Z | src/CreeDictionary/API/search/espt.py | sarahrmoeller/cree-intelligent-dictionary | 74db04b58076b7be5d9b0742d20e8b2014fb4aaa | [
"Apache-2.0"
] | 800 | 2019-05-23T15:32:03.000Z | 2021-09-24T15:45:16.000Z | src/CreeDictionary/API/search/espt.py | sarahrmoeller/cree-intelligent-dictionary | 74db04b58076b7be5d9b0742d20e8b2014fb4aaa | [
"Apache-2.0"
] | 8 | 2020-12-17T21:57:00.000Z | 2021-09-17T20:03:51.000Z | """
ESPT: English simple phrase translation
"""
import logging
import re
from dataclasses import dataclass
from CreeDictionary.API.search.espt_crk import (
verb_tag_map,
noun_tag_map,
crk_noun_tags,
)
from CreeDictionary.API.search.types import Result
from CreeDictionary.phrase_translate.translate import e... | 34.089431 | 87 | 0.587765 | import logging
import re
from dataclasses import dataclass
from CreeDictionary.API.search.espt_crk import (
verb_tag_map,
noun_tag_map,
crk_noun_tags,
)
from CreeDictionary.API.search.types import Result
from CreeDictionary.phrase_translate.translate import eng_phrase_to_crk_features_fst
from morphodict.an... | true | true |
1c0b94a72999cc7db404c0b2d8c999ea8439af94 | 158 | py | Python | src/bxcommon/models/bdn_service_type.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 12 | 2019-11-06T17:39:10.000Z | 2022-03-01T11:26:19.000Z | src/bxcommon/models/bdn_service_type.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 8 | 2019-11-06T21:31:11.000Z | 2021-06-02T00:46:50.000Z | src/bxcommon/models/bdn_service_type.py | dolphinridercrypto/bxcommon | 8f70557c1dbff785a5dd3fcdf91176066e085c3a | [
"MIT"
] | 5 | 2019-11-14T18:08:11.000Z | 2022-02-08T09:36:22.000Z | from bxcommon.models.serializeable_enum import SerializeableEnum
class BdnServiceType(SerializeableEnum):
MSG_QUOTA = "MSG_QUOTA"
PERMIT = "PERMIT"
| 22.571429 | 64 | 0.791139 | from bxcommon.models.serializeable_enum import SerializeableEnum
class BdnServiceType(SerializeableEnum):
MSG_QUOTA = "MSG_QUOTA"
PERMIT = "PERMIT"
| true | true |
1c0b958074df56f109dda4d6dd3df3b24c9724e6 | 29,337 | py | Python | nautobot/extras/models/models.py | MatthewGP/nautobot | 93b9d9c33a49e69b8ee86da8af4ef1265873014b | [
"Apache-2.0"
] | null | null | null | nautobot/extras/models/models.py | MatthewGP/nautobot | 93b9d9c33a49e69b8ee86da8af4ef1265873014b | [
"Apache-2.0"
] | null | null | null | nautobot/extras/models/models.py | MatthewGP/nautobot | 93b9d9c33a49e69b8ee86da8af4ef1265873014b | [
"Apache-2.0"
] | null | null | null | import json
from collections import OrderedDict
from db_file_storage.model_utils import delete_file, delete_file_if_needed
from db_file_storage.storage import DatabaseFileStorage
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core... | 37.229695 | 205 | 0.676381 | import json
from collections import OrderedDict
from db_file_storage.model_utils import delete_file, delete_file_if_needed
from db_file_storage.storage import DatabaseFileStorage
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core... | true | true |
1c0b95c840fbbabf94d431d624cded59bd37e1e7 | 436 | py | Python | packages/python/plotly/plotly/validators/treemap/_meta.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/treemap/_meta.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/treemap/_meta.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="treemap", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=k... | 33.538462 | 76 | 0.651376 | import _plotly_utils.basevalidators
class MetaValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="meta", parent_name="treemap", **kwargs):
super(MetaValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok=k... | true | true |
1c0b97c6cea4de250cedcc65a38c1b83665bc394 | 13,233 | py | Python | raiden/tests/unit/test_startup.py | 0mp/raiden | 6e3844da7ecaee92208c7f6fbbeb9ae2d757d964 | [
"MIT"
] | null | null | null | raiden/tests/unit/test_startup.py | 0mp/raiden | 6e3844da7ecaee92208c7f6fbbeb9ae2d757d964 | [
"MIT"
] | null | null | null | raiden/tests/unit/test_startup.py | 0mp/raiden | 6e3844da7ecaee92208c7f6fbbeb9ae2d757d964 | [
"MIT"
] | null | null | null | from typing import Any, Dict
from unittest.mock import patch
import pytest
from eth_utils import to_canonical_address
from raiden.constants import Environment, RoutingMode
from raiden.exceptions import RaidenError
from raiden.network import pathfinding
from raiden.network.pathfinding import PFSInfo
from raiden.settin... | 40.592025 | 99 | 0.763621 | from typing import Any, Dict
from unittest.mock import patch
import pytest
from eth_utils import to_canonical_address
from raiden.constants import Environment, RoutingMode
from raiden.exceptions import RaidenError
from raiden.network import pathfinding
from raiden.network.pathfinding import PFSInfo
from raiden.settin... | true | true |
1c0b97d994eadc166ba9349aa4ca28f0969f606f | 3,751 | py | Python | travis_pypi_setup.py | zphang/sndict | 0e89a5aea43d3d03556dfa216c9e26306617072b | [
"MIT"
] | 3 | 2020-05-31T22:50:41.000Z | 2021-11-01T16:44:46.000Z | travis_pypi_setup.py | zphang/sndict | 0e89a5aea43d3d03556dfa216c9e26306617072b | [
"MIT"
] | 285 | 2017-04-03T21:06:45.000Z | 2022-03-28T11:52:20.000Z | travis_pypi_setup.py | zphang/sndict | 0e89a5aea43d3d03556dfa216c9e26306617072b | [
"MIT"
] | 1 | 2020-12-02T20:31:14.000Z | 2020-12-02T20:31:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 30.495935 | 79 | 0.70008 |
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.padding import PKCS1v15... | true | true |
1c0b98d3d17f4b220cc4b32055b93081e6c33089 | 1,279 | py | Python | testing/Leterax_1.py | albertopoljak/tortoise-discord-halloween-coding-event | a36670996a52aaaf9944fbc9515937f2642faa51 | [
"MIT"
] | 1 | 2020-08-01T08:11:51.000Z | 2020-08-01T08:11:51.000Z | testing/Leterax_1.py | albertopoljak/tortoise-discord-halloween-coding-event | a36670996a52aaaf9944fbc9515937f2642faa51 | [
"MIT"
] | null | null | null | testing/Leterax_1.py | albertopoljak/tortoise-discord-halloween-coding-event | a36670996a52aaaf9944fbc9515937f2642faa51 | [
"MIT"
] | null | null | null | """
Published under the MIT license.
Copyright (c) 2019 Leterax https://github.com/Leterax
"""
import math
from itertools import permutations
import numba as nb
def is_vampire_number_large(num):
fang_minus_1, even = divmod(int(math.log10(num)), 2)
if even:
num_split = sorted(f"{num}")
for ... | 22.839286 | 85 | 0.567631 |
import math
from itertools import permutations
import numba as nb
def is_vampire_number_large(num):
fang_minus_1, even = divmod(int(math.log10(num)), 2)
if even:
num_split = sorted(f"{num}")
for x in range(10 ** fang_minus_1, 10 ** (fang_minus_1 + 1) - 1):
b = num // x
... | true | true |
1c0b9969b2acbbc52814ddb77bc880c1e15008bb | 2,202 | py | Python | WEEKS/CD_Sata-Structures/general/practice/PYTHON/11 - isLucky.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/11 - isLucky.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/11 - isLucky.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | """Ticket numbers usually consist of an even number of digits. A ticket number is considered lucky
if the sum of the first half of the digits is equal to the sum of the second half.
Given a ticket number n, determine if it's lucky or not.
Example
- For n = 1230, the output should be isLucky(n) = true;
- For n = 239017... | 55.05 | 123 | 0.687103 |
def isLucky(n):
digits_of_n = []
summ = 0
# step to see what how each of these steps works. The important thing to mention is the "appending" step where each
# digit, where each digit is stored as an elememnt in "digits_of_n" array.
while n > 0:
rem = n % 10
... | true | true |
1c0b9985c47858223c2e0768e461f7001f305843 | 4,166 | py | Python | sgd_numpy.py | lcl1026504480/network | cf1175aa0377a4145e9a5dda2031259ef3d662c4 | [
"MIT"
] | null | null | null | sgd_numpy.py | lcl1026504480/network | cf1175aa0377a4145e9a5dda2031259ef3d662c4 | [
"MIT"
] | null | null | null | sgd_numpy.py | lcl1026504480/network | cf1175aa0377a4145e9a5dda2031259ef3d662c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: lenovouser
# @Date: 2020-09-30 16:54:52
# @Last Modified by: lenovouser
# @Last Modified time: 2020-09-30 16:54:54
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 29 14:42:21 2020
@author: lenovouser
"""
import numpy as np
from matplotlib import pyplot as plt
class nn:
def ... | 29.546099 | 75 | 0.589534 | import numpy as np
from matplotlib import pyplot as plt
class nn:
def __init__(self, inputnodes, hiddennodes, outputnodes, learningrate):
self.innodes = inputnodes
self.hidnodes = hiddennodes
self.outnodes = outputnodes
self.train_e = [0]
self.valid_e = [0]
self... | true | true |
1c0b998e0a8ed49d29c50cae1a8b0a535bf8a75f | 35,614 | py | Python | quantecon/markov/ddp.py | achop/QuantEcon.py | 3dde0bb3e78cf9e790efca6bcbbc110ae4afea68 | [
"BSD-3-Clause"
] | 2 | 2020-09-08T08:25:07.000Z | 2020-09-11T13:18:32.000Z | quantecon/markov/ddp.py | achop/QuantEcon.py | 3dde0bb3e78cf9e790efca6bcbbc110ae4afea68 | [
"BSD-3-Clause"
] | null | null | null | quantecon/markov/ddp.py | achop/QuantEcon.py | 3dde0bb3e78cf9e790efca6bcbbc110ae4afea68 | [
"BSD-3-Clause"
] | null | null | null | r"""
Module for solving dynamic programs (also known as Markov decision
processes) with finite states and actions.
Discrete Dynamic Programming
----------------------------
A discrete dynamic program consists of the following components:
* finite set of states :math:`S = \{0, \ldots, n-1\}`;
* finite set of availabl... | 31.769848 | 79 | 0.54998 | import warnings
import numpy as np
import scipy.sparse as sp
from numba import jit
from .core import MarkovChain
class DiscreteDP:
def __init__(self, R, Q, beta, s_indices=None, a_indices=None):
self._sa_pair = False
self._sparse = False
if sp.issparse(Q):
self.Q = Q.tocsr()
... | true | true |
1c0b9994c6ff69f0b76d6ae9a2691489220e17fb | 132 | py | Python | pyautocapslock/__init__.py | Glutenberg/pyautocapslock | 0800adf8ae18f9677b2726843995d2415b4bd303 | [
"MIT"
] | null | null | null | pyautocapslock/__init__.py | Glutenberg/pyautocapslock | 0800adf8ae18f9677b2726843995d2415b4bd303 | [
"MIT"
] | null | null | null | pyautocapslock/__init__.py | Glutenberg/pyautocapslock | 0800adf8ae18f9677b2726843995d2415b4bd303 | [
"MIT"
] | null | null | null | """Top-level package for pyautocapslock."""
__author__ = """Josh Coles"""
__email__ = 'josh@colescanada.com'
__version__ = '0.0.1'
| 22 | 43 | 0.69697 |
__author__ = """Josh Coles"""
__email__ = 'josh@colescanada.com'
__version__ = '0.0.1'
| true | true |
1c0b99a595d69bac3b0e57e850005684ef89caeb | 33,663 | py | Python | dataflow/core/nodes/base.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 5 | 2021-08-10T23:16:44.000Z | 2022-03-17T17:27:00.000Z | dataflow/core/nodes/base.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 330 | 2021-06-10T17:28:22.000Z | 2022-03-31T00:55:48.000Z | dataflow/core/nodes/base.py | alphamatic/amp | 5018137097159415c10eaa659a2e0de8c4e403d4 | [
"BSD-3-Clause"
] | 6 | 2021-06-10T17:20:32.000Z | 2022-03-28T08:08:03.000Z | """
Import as:
import dataflow.core.nodes.base as dtfconobas
"""
import abc
import collections
import copy
import functools
import logging
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
import pandas as pd
import dataflow.core.node as dtfcornode
import dataflow.core.utils as dtfcorutil
i... | 36.080386 | 88 | 0.59959 |
import abc
import collections
import copy
import functools
import logging
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
import pandas as pd
import dataflow.core.node as dtfcornode
import dataflow.core.utils as dtfcorutil
import helpers.hdbg as hdbg
_LOG = logging.getLogger(__name__)
... | true | true |
1c0b99e897dde26d836938a66bbf55ebbac6ffc5 | 50,772 | py | Python | django/db/models/sql/compiler.py | edevil/django | 12bf42ae0db752bf4a4387d6be7276cd145f59d1 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/sql/compiler.py | edevil/django | 12bf42ae0db752bf4a4387d6be7276cd145f59d1 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/sql/compiler.py | edevil/django | 12bf42ae0db752bf4a4387d6be7276cd145f59d1 | [
"BSD-3-Clause"
] | null | null | null | from itertools import chain
import warnings
from django.core.exceptions import FieldError
from django.db.backends.utils import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (CURSOR... | 43.506427 | 111 | 0.57126 | from itertools import chain
import warnings
from django.core.exceptions import FieldError
from django.db.backends.utils import truncate_name
from django.db.models.constants import LOOKUP_SEP
from django.db.models.query_utils import select_related_descend, QueryWrapper
from django.db.models.sql.constants import (CURSOR... | true | true |
1c0b9ad43e8e9c4a8eebf9e79623c687ae80abd6 | 80,296 | py | Python | mesonbuild/backend/vs2010backend.py | mscofield0/meson | 007c4659c2154755fc1f57d415afc8a736f81af2 | [
"Apache-2.0"
] | null | null | null | mesonbuild/backend/vs2010backend.py | mscofield0/meson | 007c4659c2154755fc1f57d415afc8a736f81af2 | [
"Apache-2.0"
] | null | null | null | mesonbuild/backend/vs2010backend.py | mscofield0/meson | 007c4659c2154755fc1f57d415afc8a736f81af2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014-2016 The Meson development 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 agree... | 52.344198 | 126 | 0.592234 |
import copy
import os
import xml.dom.minidom
import xml.etree.ElementTree as ET
import uuid
import typing as T
from pathlib import Path, PurePath
from . import backends
from .. import build
from .. import dependencies
from .. import mlog
from .. import compilers
from ..interpreter import Interpreter
from ..mesonli... | true | true |
1c0b9c21719ad8780ad8d7df23e4ec4c53baab05 | 1,148 | py | Python | python/mini_kmeans_1.py | msteptoe/gcam_vis | b02fa0a2421ef107d03b69bf9361c591f45dd61f | [
"MIT"
] | null | null | null | python/mini_kmeans_1.py | msteptoe/gcam_vis | b02fa0a2421ef107d03b69bf9361c591f45dd61f | [
"MIT"
] | null | null | null | python/mini_kmeans_1.py | msteptoe/gcam_vis | b02fa0a2421ef107d03b69bf9361c591f45dd61f | [
"MIT"
] | null | null | null | import sys
import numpy as np
import os
import warnings
from sklearn.cluster import MiniBatchKMeans
from json import dump
def mainFunc():
warnings.filterwarnings("ignore")
jobPath = "jobs" + os.path.sep + "test"
query = 'Building floorspace' + os.path.sep + 'building' + os.path.sep + 'comm'
dataTyp... | 28 | 160 | 0.61324 | import sys
import numpy as np
import os
import warnings
from sklearn.cluster import MiniBatchKMeans
from json import dump
def mainFunc():
warnings.filterwarnings("ignore")
jobPath = "jobs" + os.path.sep + "test"
query = 'Building floorspace' + os.path.sep + 'building' + os.path.sep + 'comm'
dataTyp... | true | true |
1c0b9dabddfcf95537503b789fc62dfd43446506 | 1,098 | py | Python | client.py | NickolausDS/gladier_kanzus | 79c66eaba88956ab44ff5e6e38ed3b6e6b3e1fdd | [
"MIT"
] | null | null | null | client.py | NickolausDS/gladier_kanzus | 79c66eaba88956ab44ff5e6e38ed3b6e6b3e1fdd | [
"MIT"
] | null | null | null | client.py | NickolausDS/gladier_kanzus | 79c66eaba88956ab44ff5e6e38ed3b6e6b3e1fdd | [
"MIT"
] | null | null | null | from gladier import GladierBaseClient
class KanzusClient(GladierBaseClient):
gladier_tools = [
]
flow_definition = ##TODO change that to the original flow ryan was using
##
##Arg Parsing
def parse_args():
parser = argparse.ArgumentParser()
##
return parser.parse_args()
if __name__ == '__mai... | 26.142857 | 77 | 0.664845 | from gladier import GladierBaseClient
class KanzusClient(GladierBaseClient):
gladier_tools = [
]
flow_definition =
def parse_args():
parser = argparse.ArgumentParser()
return parser.parse_args()
if __name__ == '__main__':
args = parse_args()
logger = logging.getLogger()
if args.... | false | true |
1c0b9e02ccd8d48992d2da1af87e6b040d25d23a | 176 | py | Python | wagtail/users/tests/__init__.py | melisayu/wagtail | 614ec3fc2a656b25db710b80f9e60f1c8effd7a4 | [
"BSD-3-Clause"
] | 8,851 | 2016-12-09T19:01:45.000Z | 2022-03-31T04:45:06.000Z | wagtail/users/tests/__init__.py | fenghualanglang/wagtail | 361c3d5d5448aeccedda7d03530c09b65c13e5e8 | [
"BSD-3-Clause"
] | 5,197 | 2016-12-09T19:24:37.000Z | 2022-03-31T22:17:55.000Z | wagtail/users/tests/__init__.py | fenghualanglang/wagtail | 361c3d5d5448aeccedda7d03530c09b65c13e5e8 | [
"BSD-3-Clause"
] | 2,548 | 2016-12-09T18:16:55.000Z | 2022-03-31T21:34:38.000Z | from .test_admin_views import CustomGroupViewSet, CustomUserCreationForm, CustomUserEditForm
__all__ = ['CustomGroupViewSet', 'CustomUserCreationForm', 'CustomUserEditForm']
| 35.2 | 92 | 0.846591 | from .test_admin_views import CustomGroupViewSet, CustomUserCreationForm, CustomUserEditForm
__all__ = ['CustomGroupViewSet', 'CustomUserCreationForm', 'CustomUserEditForm']
| true | true |
1c0b9ed78c9b64691ea07f5da7819dbeccbe9a58 | 3,333 | py | Python | tests/unit/file_minio_client_test.py | kabab/minio-py | c86edad235fd51b19ca0b24e6b05446d7ba62ee3 | [
"Apache-2.0"
] | null | null | null | tests/unit/file_minio_client_test.py | kabab/minio-py | c86edad235fd51b19ca0b24e6b05446d7ba62ee3 | [
"Apache-2.0"
] | null | null | null | tests/unit/file_minio_client_test.py | kabab/minio-py | c86edad235fd51b19ca0b24e6b05446d7ba62ee3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# MinIO Python Library for Amazon S3 Compatible Cloud Storage, (C)
# 2020 MinIO, 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/lic... | 37.875 | 81 | 0.682568 |
import os
from unittest import TestCase
from minio.credentials.file_minio_client import FileMinioClient
from minio.credentials.credentials import Value
from nose.tools import eq_
class FileMinioClientTest(TestCase):
def test_file_minio_(self):
os.environ.clear()
provider = FileM... | true | true |
1c0b9efdb1fd36f45ebc2ddc05e4c0a5416ece9c | 5,791 | py | Python | Preprocess_FeatureExtraction_GamePrediction/nbaDataPreprocessing.py | Coslate/DataMining_Final | 1c2519874b1005c68d97aa1003984b1f3bd936a2 | [
"MIT"
] | null | null | null | Preprocess_FeatureExtraction_GamePrediction/nbaDataPreprocessing.py | Coslate/DataMining_Final | 1c2519874b1005c68d97aa1003984b1f3bd936a2 | [
"MIT"
] | null | null | null | Preprocess_FeatureExtraction_GamePrediction/nbaDataPreprocessing.py | Coslate/DataMining_Final | 1c2519874b1005c68d97aa1003984b1f3bd936a2 | [
"MIT"
] | null | null | null | ##############################################
## Author: I-No Liao ##
## Date of update: 2018/05/15 ##
## Description: Data Mining Final Project ##
## - Data Preprocessing ##
## - Remove NaN ##
## - Add opponent label ... | 35.09697 | 103 | 0.596961 | ## - Rename and concatenate df ##
##############################################
import numpy as np
import pandas as pd
import time
#-----------------------#
# Main Function #
#-----------------------#
# @param: None
# @return: None
def main():
startTime = time.time()
# Load .csv
... | true | true |
1c0b9f3cc271f100081c0afc27534753c7b97ce7 | 195 | py | Python | backend/api/serializers.py | chaalia/docker-django-react | 8b21e3df4739eb32e145e0f5ade5c899e72a3212 | [
"MIT"
] | 1 | 2021-08-13T21:22:09.000Z | 2021-08-13T21:22:09.000Z | backend/api/serializers.py | chaalia/docker-django-react | 8b21e3df4739eb32e145e0f5ade5c899e72a3212 | [
"MIT"
] | null | null | null | backend/api/serializers.py | chaalia/docker-django-react | 8b21e3df4739eb32e145e0f5ade5c899e72a3212 | [
"MIT"
] | 1 | 2020-11-01T18:15:05.000Z | 2020-11-01T18:15:05.000Z | from rest_framework import serializers
from char_count.models import Image
class ImageSerializers(serializers.ModelSerializer):
class Meta:
model = Image
fields = "__all__"
| 21.666667 | 52 | 0.74359 | from rest_framework import serializers
from char_count.models import Image
class ImageSerializers(serializers.ModelSerializer):
class Meta:
model = Image
fields = "__all__"
| true | true |
1c0b9f67aa43d64ba8df6db4cddce8ace79b73d0 | 5,112 | py | Python | tests/catalyst/engines/test_parallel_amp.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | 1 | 2021-09-29T20:30:50.000Z | 2021-09-29T20:30:50.000Z | tests/catalyst/engines/test_parallel_amp.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | null | null | null | tests/catalyst/engines/test_parallel_amp.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | 1 | 2021-06-11T16:33:30.000Z | 2021-06-11T16:33:30.000Z | # flake8: noqa
from typing import Any, Dict, List
import logging
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader
from catalyst.callbacks import CheckpointCallback, CriterionCallback, OptimizerCallback
from catalyst.core.runner import IRunner
from c... | 33.194805 | 99 | 0.569053 |
from typing import Any, Dict, List
import logging
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader
from catalyst.callbacks import CheckpointCallback, CriterionCallback, OptimizerCallback
from catalyst.core.runner import IRunner
from catalyst.loggers... | true | true |
1c0ba15b4e4cb0bd13d08840dd43e38142d84ff3 | 9,108 | py | Python | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | ysmanman/sonic-mgmt | f6b129ede1521211370520dcd4a57279f84e940a | [
"Apache-2.0"
] | 2 | 2020-07-03T01:16:27.000Z | 2020-10-09T05:38:07.000Z | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | ysmanman/sonic-mgmt | f6b129ede1521211370520dcd4a57279f84e940a | [
"Apache-2.0"
] | 4 | 2019-07-26T08:42:01.000Z | 2020-12-16T08:34:52.000Z | ansible/roles/test/files/ptftests/ip_in_ip_tunnel_test.py | ysmanman/sonic-mgmt | f6b129ede1521211370520dcd4a57279f84e940a | [
"Apache-2.0"
] | 1 | 2020-07-02T02:49:56.000Z | 2020-07-02T02:49:56.000Z | '''
Description: This file contains the IPinIP test for dualtor testbed
Usage: Examples of how to start this script
/usr/bin/ptf --test-dir ptftests ip_in_ip_tunnel_test.IpinIPTunnelTest --platform-dir ptftests --qlen=2000 --platform remote -t hash_key_list=['src-port', 'dst-port', 'src-mac... | 46.948454 | 563 | 0.614185 | import logging
import random
from ipaddress import ip_address
import ptf
from scapy.all import IP, Ether
import ptf.packet as scapy
from ptf.base_tests import BaseTest
from ptf.mask import Mask
from ptf.testutils import *
PACKET_NUM = 10000
PACKET_NUM_FOR_NEGATIVE_CHECK = 100
DIFF = 0.25 SRC_IP_RANGE = [unicode('8.0.... | true | true |
1c0ba338794beebfefd8b4f7a3e956c7cef0612b | 3,264 | py | Python | tkplot.py | ashok-kollipara/multistrike-oi | 9ff3a792c22257aad6d5e635e1144a0f18d468a6 | [
"MIT"
] | null | null | null | tkplot.py | ashok-kollipara/multistrike-oi | 9ff3a792c22257aad6d5e635e1144a0f18d468a6 | [
"MIT"
] | null | null | null | tkplot.py | ashok-kollipara/multistrike-oi | 9ff3a792c22257aad6d5e635e1144a0f18d468a6 | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
#import matplotlib.ticker as ticker
import matplotlib.animation as animate
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg,
NavigationToolbar2Tk
)
import db_actions as db
import o... | 26.322581 | 81 | 0.643076 | import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animate
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (
FigureCanvasTkAgg,
NavigationToolbar2Tk
)
import db_actions as db
import os
matplotlib.use('TkAgg')
ax ... | true | true |
1c0ba34cba8d3a8b7f4b9923ac11117f4b7b85f1 | 3,437 | py | Python | pirates/effects/PowderKegWaterSplash.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/effects/PowderKegWaterSplash.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/effects/PowderKegWaterSplash.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from EffectController import EffectController
from PooledEffect import PooledEffect
class PowderKegWaterSplash(PooledEffect, EffectController):
def __in... | 45.223684 | 131 | 0.693337 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from EffectController import EffectController
from PooledEffect import PooledEffect
class PowderKegWaterSplash(PooledEffect, EffectController):
def __in... | true | true |
1c0ba3e1698438bf47376793c284d04c9b34e8d5 | 8,301 | py | Python | src/m5r_fancy_iterating.py | finchhg/11-Sequences | 3f562bf27f140507658cdca0d3fa206f82f0e4ec | [
"MIT"
] | null | null | null | src/m5r_fancy_iterating.py | finchhg/11-Sequences | 3f562bf27f140507658cdca0d3fa206f82f0e4ec | [
"MIT"
] | null | null | null | src/m5r_fancy_iterating.py | finchhg/11-Sequences | 3f562bf27f140507658cdca0d3fa206f82f0e4ec | [
"MIT"
] | null | null | null | """
This module shows how to ITERATE (i.e. loop) through a SEQUENCE
in ways OTHER than just going thru the sequence from BEGINNING to END.
It also shows how to SELECT items in a sequence, e.g.:
-- the items that are strings
-- the items that are even integers (e.g. 2, 4, 6, ...)
Note that:
-- SELECTING items th... | 34.443983 | 79 | 0.503192 |
def main():
run_test_sum_string_lengths()
run_test_sum_even_integers()
run_test_sum_items_at_even_indices()
def sum_string_lengths(sequence, m, n):
total = 0
for k in range(n, m - 1, -1):
s = sequence[k]
total = total + len(s)
return total
total = 0
... | true | true |
1c0ba431fa24480791a12a83cf4fb45eb81dabfe | 3,353 | py | Python | scripts/webscraping/fenixlogin.py | iluxonchik/python-general-repo | 1921c82e1a8f0a60ed665184c49647b38ea4978c | [
"MIT"
] | null | null | null | scripts/webscraping/fenixlogin.py | iluxonchik/python-general-repo | 1921c82e1a8f0a60ed665184c49647b38ea4978c | [
"MIT"
] | null | null | null | scripts/webscraping/fenixlogin.py | iluxonchik/python-general-repo | 1921c82e1a8f0a60ed665184c49647b38ea4978c | [
"MIT"
] | null | null | null | # Fenix Edu Login
# ################################################################################################################
# This script is a demo of logging in to fenixedu platform.
#
# You might be wondering what's up with all of the hardcoded url requests after sending the login
# credentials? Well, by ana... | 58.824561 | 260 | 0.688041 | # credentials? Well, by analysing the requests you can see that when loading pages, your browser sends
# some cookies to the webserver, which were set up by the webserver in the first place. Some of those
# cookies are required, so that the webservers knows who's logged in and the login is in fact valid.
import urllib... | true | true |
1c0ba44675a2d44db811d646dd2f62838c2d9fe8 | 6,261 | py | Python | zcollection/partitioning/date.py | CNES/zcollection | f14616944d92d799cb1e5ee783b44c3819344fc2 | [
"BSD-3-Clause"
] | null | null | null | zcollection/partitioning/date.py | CNES/zcollection | f14616944d92d799cb1e5ee783b44c3819344fc2 | [
"BSD-3-Clause"
] | null | null | null | zcollection/partitioning/date.py | CNES/zcollection | f14616944d92d799cb1e5ee783b44c3819344fc2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2022 CNES
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""
Partitioning by date
====================
"""
from typing import Any, ClassVar, Dict, Iterator, Sequence, Tuple
import dask.array.core
import numpy
from . import a... | 34.027174 | 79 | 0.567002 | from typing import Any, ClassVar, Dict, Iterator, Sequence, Tuple
import dask.array.core
import numpy
from . import abc
RESOLUTION = ("Y", "M", "D", "h", "m", "s")
UNITS = ("year", "month", "day", "hour", "minute", "second")
DATA_TYPES = ("uint16", "uint8", "uint8", "uint8", "uint8", "uint8")
SEPARATORS = dict(ye... | true | true |
1c0ba4578325df912414e4959ed95276385aa4ba | 440 | py | Python | backend/posts/migrations/0002_post_published.py | stevethompsonstar/django-react-blog | 88af926454901c826acc9e2996addd0d53b0626a | [
"MIT"
] | 592 | 2017-03-07T04:29:08.000Z | 2020-09-21T00:36:58.000Z | backend/posts/migrations/0002_post_published.py | stevethompsonstar/django-react-blog | 88af926454901c826acc9e2996addd0d53b0626a | [
"MIT"
] | 8 | 2017-03-08T01:22:36.000Z | 2020-08-20T15:45:42.000Z | backend/posts/migrations/0002_post_published.py | stevethompsonstar/django-react-blog | 88af926454901c826acc9e2996addd0d53b0626a | [
"MIT"
] | 102 | 2017-03-07T05:42:47.000Z | 2020-08-28T20:02:20.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-10 04:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AddField(
... | 20.952381 | 53 | 0.606818 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='published',
field=models... | true | true |
1c0ba495837b19d27857ed2212404f57fd7cadcf | 14,337 | py | Python | examples/prostate/pt/trainers/supervised_trainer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 155 | 2021-08-05T18:05:09.000Z | 2022-03-27T15:32:56.000Z | examples/prostate/pt/trainers/supervised_trainer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 216 | 2021-12-01T06:07:12.000Z | 2022-03-30T23:34:02.000Z | examples/prostate/pt/trainers/supervised_trainer.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 44 | 2021-11-24T16:03:29.000Z | 2022-03-24T23:28:39.000Z | # Copyright (c) 2021, NVIDIA 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... | 39.935933 | 109 | 0.639185 |
import copy
import json
import os
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
from nvflare.apis.dxo import DXO, DataKind, MetaKey, from_shareable
from nvflare.apis.event_type import EventType
from nvflare.apis.executor import Executor
from nvflare.apis.fl_constant import FLConte... | true | true |
1c0ba5739e2c765ba90155858ddee254bdc93ee2 | 4,828 | py | Python | data/nets/Toffoli/toffoli_noancillae_XYall/20180609h22m36/start_training.py | lucainnocenti/quantum-gate-learning-1803.07119 | cf16cbab2f1457e5cc79d8500700b8bb92846102 | [
"MIT"
] | 2 | 2018-09-05T04:38:32.000Z | 2020-03-26T02:10:58.000Z | data/nets/Toffoli/toffoli_noancillae_XYall/20180609h22m36/start_training.py | lucainnocenti/quantum-gate-learning-1803.07119 | cf16cbab2f1457e5cc79d8500700b8bb92846102 | [
"MIT"
] | null | null | null | data/nets/Toffoli/toffoli_noancillae_XYall/20180609h22m36/start_training.py | lucainnocenti/quantum-gate-learning-1803.07119 | cf16cbab2f1457e5cc79d8500700b8bb92846102 | [
"MIT"
] | 1 | 2021-05-17T19:16:38.000Z | 2021-05-17T19:16:38.000Z | """
This file is intended to be used as a script to start a training for a
specific gate.
Only the parameters at the beginning of `main` need to be modified.
"""
import glob
import os
import socket
import datetime
import itertools
import numpy as np
import scipy
import sympy
import pandas as pd
import logging
import... | 32.621622 | 86 | 0.677713 | import glob
import os
import socket
import datetime
import itertools
import numpy as np
import scipy
import sympy
import pandas as pd
import logging
import qutip
import qutip.qip.algorithms.qft
import qubit_network as qn
import qubit_network.Optimizer
import qubit_network.model
OUTPUT_DIR = os.path.dirname(os.path.... | true | true |
1c0ba6e925f34e7a615a32c4939ca5f1d9aead56 | 2,193 | py | Python | brabeion/views.py | affan2/brabeion | 381337bada416c9f20d6852b1725a310cdbf85b7 | [
"BSD-3-Clause"
] | null | null | null | brabeion/views.py | affan2/brabeion | 381337bada416c9f20d6852b1725a310cdbf85b7 | [
"BSD-3-Clause"
] | null | null | null | brabeion/views.py | affan2/brabeion | 381337bada416c9f20d6852b1725a310cdbf85b7 | [
"BSD-3-Clause"
] | 1 | 2020-01-08T09:06:26.000Z | 2020-01-08T09:06:26.000Z | from collections import defaultdict
from django.db.models import Count
from django.shortcuts import render_to_response
from django.template import RequestContext
from . import badges
from .models import BadgeAward
def badge_list(request):
if request.user.is_authenticated():
user_badges = set((slug, lev... | 35.370968 | 102 | 0.640219 | from collections import defaultdict
from django.db.models import Count
from django.shortcuts import render_to_response
from django.template import RequestContext
from . import badges
from .models import BadgeAward
def badge_list(request):
if request.user.is_authenticated():
user_badges = set((slug, lev... | true | true |
1c0ba7545fbc06be24150803ed27d971fe24fd69 | 7,695 | py | Python | saleor/graphql/translations/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 8 | 2018-07-17T13:13:21.000Z | 2022-03-01T17:02:34.000Z | saleor/graphql/translations/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 3 | 2021-03-09T16:28:16.000Z | 2022-02-10T19:08:00.000Z | saleor/graphql/translations/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 1 | 2019-05-02T17:30:49.000Z | 2019-05-02T17:30:49.000Z | import graphene
from ...discount import models as discount_models
from ...menu import models as menu_models
from ...page import models as page_models
from ...product import models as product_models
from ...shipping import models as shipping_models
from ..core.mutations import BaseMutation, ModelMutation, registry
from... | 34.2 | 84 | 0.705653 | import graphene
from ...discount import models as discount_models
from ...menu import models as menu_models
from ...page import models as page_models
from ...product import models as product_models
from ...shipping import models as shipping_models
from ..core.mutations import BaseMutation, ModelMutation, registry
from... | true | true |
1c0ba770c08d7ed1f944ab2b24facf1ddd8fc678 | 810 | py | Python | tests/tools/dump_console.py | nkraetzschmar/gardenlinux | d6925c266b95a1ca7c81931b593640f3e6b38d82 | [
"MIT"
] | 2 | 2022-03-31T10:58:38.000Z | 2022-03-31T13:29:08.000Z | tests/tools/dump_console.py | dnan0s/gardenlinux | bab6cb2b7e934cf6d180d13ba536b2938632840a | [
"MIT"
] | null | null | null | tests/tools/dump_console.py | dnan0s/gardenlinux | bab6cb2b7e934cf6d180d13ba536b2938632840a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import boto3
import click
import base64
import os
@click.command()
@click.option('--instanceid', required=True, help='InstanceID from AWS instance')
@click.option('--output', help='Append output to the file provided. Default is <instanceID>.dump')
def dump_comsole(instanceid, output):
"""... | 21.891892 | 98 | 0.674074 |
import boto3
import click
import base64
import os
@click.command()
@click.option('--instanceid', required=True, help='InstanceID from AWS instance')
@click.option('--output', help='Append output to the file provided. Default is <instanceID>.dump')
def dump_comsole(instanceid, output):
session = boto3.Session()
... | true | true |
1c0ba7cc044c8f3009c14def77d1316800a70398 | 6,083 | py | Python | scripts/shared/configurations.py | cric96/scala-native-benchmarks | f963dc7f867bfbceba611323754a4fba49d4d77e | [
"Apache-2.0"
] | null | null | null | scripts/shared/configurations.py | cric96/scala-native-benchmarks | f963dc7f867bfbceba611323754a4fba49d4d77e | [
"Apache-2.0"
] | null | null | null | scripts/shared/configurations.py | cric96/scala-native-benchmarks | f963dc7f867bfbceba611323754a4fba49d4d77e | [
"Apache-2.0"
] | 1 | 2022-03-01T17:14:20.000Z | 2022-03-01T17:14:20.000Z | import os
import shutil as sh
from shared.benchmarks import Benchmark
from shared.file_utils import slurp, mkdir, dict_from_file, dict_to_file
base_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
confs_path = base_path + '/confs'
binaries_path = base_path + '/binaries'
results_... | 33.794444 | 101 | 0.578333 | import os
import shutil as sh
from shared.benchmarks import Benchmark
from shared.file_utils import slurp, mkdir, dict_from_file, dict_to_file
base_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
confs_path = base_path + '/confs'
binaries_path = base_path + '/binaries'
results_... | true | true |
1c0baad9bc81ec1001a3b60e3933d0c58c3a2e50 | 161,201 | py | Python | gherkin/python/gherkin/parser.py | lamkr/cucumber-common | 914bc5cd72198eb4dd93d7228f2e167a16e23ac3 | [
"MIT"
] | 3,974 | 2015-01-01T10:21:24.000Z | 2021-05-07T09:51:49.000Z | gherkin/python/gherkin/parser.py | lamkr/cucumber-common | 914bc5cd72198eb4dd93d7228f2e167a16e23ac3 | [
"MIT"
] | 1,298 | 2015-01-01T08:19:06.000Z | 2021-05-07T17:12:31.000Z | gherkin/python/gherkin/parser.py | lamkr/cucumber-common | 914bc5cd72198eb4dd93d7228f2e167a16e23ac3 | [
"MIT"
] | 923 | 2015-01-02T16:14:05.000Z | 2021-05-05T05:59:48.000Z | # This file is generated. Do not edit! Edit gherkin-python.razor instead.
import sys
from collections import deque
from .ast_builder import AstBuilder
from .token_matcher import TokenMatcher
from .token_scanner import TokenScanner
from .errors import UnexpectedEOFException, UnexpectedTokenException, ParserException, Co... | 48.525286 | 179 | 0.581913 | import sys
from collections import deque
from .ast_builder import AstBuilder
from .token_matcher import TokenMatcher
from .token_scanner import TokenScanner
from .errors import UnexpectedEOFException, UnexpectedTokenException, ParserException, CompositeParserException
RULE_TYPE = [
'None',
'_EOF', '_Empty... | true | true |
1c0baca5b6fb2ee08cea723ec41d2b7c645d3e61 | 136 | py | Python | Pythonexer/ExerPython/aprendendopython/ex016.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | Pythonexer/ExerPython/aprendendopython/ex016.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | Pythonexer/ExerPython/aprendendopython/ex016.py | felipemcm3/ExerPython | d66c891eb82c0f7fd9c15203fe85a06e96d916b5 | [
"MIT"
] | null | null | null | from math import trunc
n = float(input('Informe um número real'))
print('O número real {} tem seu inteiro como {}'.format(n, trunc(n)))
| 34 | 69 | 0.698529 | from math import trunc
n = float(input('Informe um número real'))
print('O número real {} tem seu inteiro como {}'.format(n, trunc(n)))
| true | true |
1c0bad3074ae39f0d16902d487327ec4d8384d5e | 28,181 | py | Python | azurelinuxagent/common/cgroups.py | bhavik2018/WALinuxAgent | 684120121b44bfbf533dda3414be2fe10757f53a | [
"Apache-2.0"
] | 1 | 2021-01-22T05:44:51.000Z | 2021-01-22T05:44:51.000Z | azurelinuxagent/common/cgroups.py | bhavik2018/WALinuxAgent | 684120121b44bfbf533dda3414be2fe10757f53a | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/common/cgroups.py | bhavik2018/WALinuxAgent | 684120121b44bfbf533dda3414be2fe10757f53a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Microsoft 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... | 39.140278 | 119 | 0.636067 |
import errno
import os
import re
import time
from azurelinuxagent.common import logger
from azurelinuxagent.common.osutil import get_osutil
from azurelinuxagent.common.utils import fileutil
from azurelinuxagent.common.version import AGENT_NAME, CURRENT_VERSION
BASE_CGROUPS = '/sys/fs/cgroup'
WRAPPER_CGROUP_NAME = "... | true | true |
1c0baed047726c7cb352164ba83f06716ad84263 | 34,195 | py | Python | tests/test_core.py | asherf/client_python | 6214c3a5b4badeab3fb45baa17a6edcd208f57e7 | [
"Apache-2.0"
] | null | null | null | tests/test_core.py | asherf/client_python | 6214c3a5b4badeab3fb45baa17a6edcd208f57e7 | [
"Apache-2.0"
] | null | null | null | tests/test_core.py | asherf/client_python | 6214c3a5b4badeab3fb45baa17a6edcd208f57e7 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from concurrent.futures import ThreadPoolExecutor
import inspect
import time
import pytest
from prometheus_client.core import (
CollectorRegistry, Counter, CounterMetricFamily, Enum, Gauge,
GaugeHistogramMetricFamily, GaugeMetricFamily, Histogram,
HistogramMetricFa... | 44.699346 | 119 | 0.643223 | from __future__ import unicode_literals
from concurrent.futures import ThreadPoolExecutor
import inspect
import time
import pytest
from prometheus_client.core import (
CollectorRegistry, Counter, CounterMetricFamily, Enum, Gauge,
GaugeHistogramMetricFamily, GaugeMetricFamily, Histogram,
HistogramMetricFa... | true | true |
1c0baf2583f107fc6b46ef67aa5e490ecbb91afd | 5,052 | py | Python | python_modules/dagster-graphql/dagster_graphql/implementation/fetch_runs.py | naralogics/dagster | 16d599daa380b800149474fcaff2311b3f8f269a | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/implementation/fetch_runs.py | naralogics/dagster | 16d599daa380b800149474fcaff2311b3f8f269a | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/implementation/fetch_runs.py | naralogics/dagster | 16d599daa380b800149474fcaff2311b3f8f269a | [
"Apache-2.0"
] | null | null | null | from graphql.execution.base import ResolveInfo
from dagster import PipelineDefinition, check
from dagster.config.validate import validate_config
from dagster.core.definitions import create_environment_schema
from dagster.core.definitions.pipeline import ExecutionSelector
from dagster.core.storage.pipeline_run import P... | 37.422222 | 99 | 0.767023 | from graphql.execution.base import ResolveInfo
from dagster import PipelineDefinition, check
from dagster.config.validate import validate_config
from dagster.core.definitions import create_environment_schema
from dagster.core.definitions.pipeline import ExecutionSelector
from dagster.core.storage.pipeline_run import P... | true | true |
1c0baf5ed49cf59d8270be8dae5bfe3d99627a0e | 6,045 | py | Python | yt_dlp/extractor/threeqsdn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | yt_dlp/extractor/threeqsdn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | yt_dlp/extractor/threeqsdn.py | nxtreaming/yt-dlp | 385ffb467b2285e85a2a5495b90314ba1f8e0700 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
join_nonempty,
parse_iso8601,
)
class ThreeQSDNIE(InfoExtractor):
IE_NAME = '3qsdn'
IE_DESC = '3Q SDN'
_VALID_URL = r'... | 38.503185 | 112 | 0.535153 | import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
ExtractorError,
float_or_none,
int_or_none,
join_nonempty,
parse_iso8601,
)
class ThreeQSDNIE(InfoExtractor):
IE_NAME = '3qsdn'
IE_DESC = '3Q SDN'
_VALID_URL = r'... | true | true |
1c0bb0f3d267c3aaf917c2a9d5b1cee8c29d3c6e | 206 | py | Python | gcn/Preprocess/combine_test_part.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | null | null | null | gcn/Preprocess/combine_test_part.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | 4 | 2020-01-28T23:06:19.000Z | 2022-02-10T00:45:00.000Z | gcn/Preprocess/combine_test_part.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | 1 | 2019-11-16T14:55:22.000Z | 2019-11-16T14:55:22.000Z |
def combine_test_part(p_graph,train_data):
o_graph = train_data[0]
o_edges = o_graph.edges()
#change all trainidx node with p_graph information
for n in list(o_graph):
print(n)
| 17.166667 | 54 | 0.679612 |
def combine_test_part(p_graph,train_data):
o_graph = train_data[0]
o_edges = o_graph.edges()
for n in list(o_graph):
print(n)
| true | true |
1c0bb14f7e5fdcc30e1ee3a8407aab28f08d55a6 | 3,583 | py | Python | homeassistant/components/zwave/util.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 37 | 2018-05-22T07:17:26.000Z | 2022-03-03T13:14:46.000Z | homeassistant/components/zwave/util.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 34 | 2018-05-22T07:19:40.000Z | 2022-03-11T23:21:03.000Z | homeassistant/components/zwave/util.py | Klathmon/home-assistant | 82770faad71c8d2a34d427fe864686f8b213b3f0 | [
"Apache-2.0"
] | 8 | 2018-05-30T20:05:26.000Z | 2021-02-19T14:17:05.000Z | """Zwave util methods."""
import asyncio
import logging
import homeassistant.util.dt as dt_util
from . import const
_LOGGER = logging.getLogger(__name__)
def check_node_schema(node, schema):
"""Check if node matches the passed node schema."""
if (const.DISC_NODE_ID in schema and
node.node_id no... | 38.526882 | 79 | 0.652805 | import asyncio
import logging
import homeassistant.util.dt as dt_util
from . import const
_LOGGER = logging.getLogger(__name__)
def check_node_schema(node, schema):
if (const.DISC_NODE_ID in schema and
node.node_id not in schema[const.DISC_NODE_ID]):
_LOGGER.debug("node.node_id %s not in no... | true | true |
1c0bb300a2d07baa73ab7f49c89430e88ab1139c | 2,005 | py | Python | mopidy_playerfm/backend.py | konsulko/mopidy-playerfm | fe93e049ab6ba39c6b62a945002f42dc56781fac | [
"Apache-2.0"
] | null | null | null | mopidy_playerfm/backend.py | konsulko/mopidy-playerfm | fe93e049ab6ba39c6b62a945002f42dc56781fac | [
"Apache-2.0"
] | null | null | null | mopidy_playerfm/backend.py | konsulko/mopidy-playerfm | fe93e049ab6ba39c6b62a945002f42dc56781fac | [
"Apache-2.0"
] | null | null | null |
import logging
import time
from threading import Lock
from mopidy import backend
import pykka
from .library import PlayerFmLibraryProvider
from .playback import PlayerFmPlaybackProvider
from .playlists import PlayerFmPlaylistsProvider
from .repeating_timer import RepeatingTimer
from .session import PlayerFmSession
... | 31.825397 | 75 | 0.669825 |
import logging
import time
from threading import Lock
from mopidy import backend
import pykka
from .library import PlayerFmLibraryProvider
from .playback import PlayerFmPlaybackProvider
from .playlists import PlayerFmPlaylistsProvider
from .repeating_timer import RepeatingTimer
from .session import PlayerFmSession
... | true | true |
1c0bb5d8fdafd17f5c4b9c65b8a28fb5cfac544a | 2,652 | py | Python | bin/botocore/vendored/requests/packages/chardet/utf8prober.py | iilness2/bash-lambda-layer-custom | 0b054d4ccb0623460354ba1f58059258c095a494 | [
"MIT"
] | 2,177 | 2015-01-02T09:56:51.000Z | 2022-03-27T01:48:37.000Z | pip/_vendor/requests/packages/chardet/utf8prober.py | alex/pip | d51a4b345b31ec4c8defbefe7f12b996c00c67fa | [
"MIT"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | pip/_vendor/requests/packages/chardet/utf8prober.py | alex/pip | d51a4b345b31ec4c8defbefe7f12b996c00c67fa | [
"MIT"
] | 742 | 2015-08-22T23:17:54.000Z | 2022-01-18T08:55:33.000Z | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | 34.441558 | 69 | 0.645551 |
from . import constants
from .charsetprober import CharSetProber
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8SMModel
ONE_CHAR_PROB = 0.5
class UTF8Prober(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mCodingSM = CodingStateMachine(UTF8SMMod... | true | true |
1c0bb6460d8c83223555ca30054a2301ddbc21e7 | 2,804 | py | Python | sdk/python/pulumi_azure_native/containerregistry/get_registry_credentials.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerregistry/get_registry_credentials.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerregistry/get_registry_credentials.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | 35.05 | 153 | 0.686163 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'GetRegistryCredentialsResult',
'AwaitableGetRegistryCredentialsResult',
'get_registry_credentials',
]
@pulumi.output_type
class GetRegistryCreden... | true | true |
1c0bb7c54ffe239d79f00d99ffbcd8c6c6de9f92 | 2,225 | py | Python | tests/test_dlso.py | njzhaowei/zwutils | c88cdfb8f6611888954d2207df07e4a4f00f7d4b | [
"MIT"
] | null | null | null | tests/test_dlso.py | njzhaowei/zwutils | c88cdfb8f6611888954d2207df07e4a4f00f7d4b | [
"MIT"
] | null | null | null | tests/test_dlso.py | njzhaowei/zwutils | c88cdfb8f6611888954d2207df07e4a4f00f7d4b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
import time
import zwutils.dlso as dlso
# pylint: disable=no-member
def test_dict2obj():
r = dlso.dict2obj({
'ks': 'v1',
'kn': 2,
'ka': [1, '2'],
'kd': {'1':1, '2':2},
'knone': None
})
r2 = dlso.dict2obj(None)
assert r.ks ==... | 30.479452 | 100 | 0.521798 | import pytest
import time
import zwutils.dlso as dlso
def test_dict2obj():
r = dlso.dict2obj({
'ks': 'v1',
'kn': 2,
'ka': [1, '2'],
'kd': {'1':1, '2':2},
'knone': None
})
r2 = dlso.dict2obj(None)
assert r.ks == 'v1'
def test_obj2dict():
o = type('', (), {})... | true | true |
1c0bb8db6df7d5cff43fe2e88362e3c0392c5b33 | 5,937 | py | Python | src/lib/models/decode.py | xiaohangcd/PPDM | 9b7c9161a3d94a2b57d927b347810da105a74e61 | [
"MIT"
] | 179 | 2020-03-11T04:24:29.000Z | 2022-03-22T14:37:23.000Z | src/lib/models/decode.py | xiaohangcd/PPDM | 9b7c9161a3d94a2b57d927b347810da105a74e61 | [
"MIT"
] | 49 | 2020-03-12T08:07:42.000Z | 2022-03-30T11:10:53.000Z | src/lib/models/decode.py | xiaohangcd/PPDM | 9b7c9161a3d94a2b57d927b347810da105a74e61 | [
"MIT"
] | 49 | 2020-03-15T10:15:07.000Z | 2022-03-28T14:25:10.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from .utils import _gather_feat, _tranpose_and_gather_feat
import numpy as np
def _nms(heat, kernel=3):
pad = (kernel - 1) // 2
hmax = nn.functional.max_pool2d(
... | 44.639098 | 120 | 0.649992 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from .utils import _gather_feat, _tranpose_and_gather_feat
import numpy as np
def _nms(heat, kernel=3):
pad = (kernel - 1) // 2
hmax = nn.functional.max_pool2d(
... | true | true |
1c0bb98baff7fb22872723ac2f5e10ad97965bb2 | 2,095 | py | Python | commitizen/cz/customize/customize.py | janw/commitizen | 1ca22f4ae410c413c92d935bf886e0a9f36ab6ac | [
"MIT"
] | null | null | null | commitizen/cz/customize/customize.py | janw/commitizen | 1ca22f4ae410c413c92d935bf886e0a9f36ab6ac | [
"MIT"
] | null | null | null | commitizen/cz/customize/customize.py | janw/commitizen | 1ca22f4ae410c413c92d935bf886e0a9f36ab6ac | [
"MIT"
] | null | null | null | try:
from jinja2 import Template
except ImportError:
from string import Template # type: ignore
from typing import Any, Dict, List, Optional
from commitizen import defaults
from commitizen.config import BaseConfig
from commitizen.cz.base import BaseCommitizen
from commitizen.exceptions import MissingCzCustom... | 32.734375 | 81 | 0.679236 | try:
from jinja2 import Template
except ImportError:
from string import Template
from typing import Any, Dict, List, Optional
from commitizen import defaults
from commitizen.config import BaseConfig
from commitizen.cz.base import BaseCommitizen
from commitizen.exceptions import MissingCzCustomizeConfigError
... | true | true |
1c0bbcfe0fac628ddf5b7374774860095b6772b5 | 7,053 | py | Python | generate_graphs.py | allengueco/message_patterns | 0d50550187dad9fd08bacc0ff47da1fffadb1937 | [
"MIT"
] | null | null | null | generate_graphs.py | allengueco/message_patterns | 0d50550187dad9fd08bacc0ff47da1fffadb1937 | [
"MIT"
] | null | null | null | generate_graphs.py | allengueco/message_patterns | 0d50550187dad9fd08bacc0ff47da1fffadb1937 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
import sys
import nltk
from textblob import TextBlob
from wordcloud import WordCloud
if len(sys.argv) != 3:
print("Error: Usage is 'py generate_graphs.py <filename> <cont... | 33.746411 | 134 | 0.647101 | import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import seaborn as sns
import sys
import nltk
from textblob import TextBlob
from wordcloud import WordCloud
if len(sys.argv) != 3:
print("Error: Usage is 'py generate_graphs.py <filename> <cont... | true | true |
1c0bbe985213c999e3e456db506fe0b4dc43bc2d | 477 | py | Python | billy/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/tests/__init__.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | from billy.core import settings, _configure_db
settings.MONGO_DATABASE += '_test'
settings.MONGO_USER_DATABASE += '_test'
_configure_db(settings.MONGO_HOST, settings.MONGO_PORT,
settings.MONGO_DATABASE, settings.MONGO_USER_DATABASE)
import pymongo
def teardown():
host = settings.MONGO_HOST
port ... | 28.058824 | 68 | 0.765199 | from billy.core import settings, _configure_db
settings.MONGO_DATABASE += '_test'
settings.MONGO_USER_DATABASE += '_test'
_configure_db(settings.MONGO_HOST, settings.MONGO_PORT,
settings.MONGO_DATABASE, settings.MONGO_USER_DATABASE)
import pymongo
def teardown():
host = settings.MONGO_HOST
port ... | true | true |
1c0bbfe675e1abc062f12c824245ec944519cb4c | 394 | py | Python | TrekBot2_WS/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | Rafcin/RescueRoboticsLHMV | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | 1 | 2018-10-04T14:37:00.000Z | 2018-10-04T14:37:00.000Z | TrekBot2_WS/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | TrekBot2_WS/build/catkin_tools_prebuild/catkin_generated/pkg.installspace.context.pc.py | Rafcin/TrekBot | d3dc63e6c16a040b16170f143556ef358018b7da | [
"Unlicense"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "catkin_tools_prebuild"
PROJECT_SPACE_... | 43.777778 | 68 | 0.720812 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "catkin_tools_prebuild"
PROJECT_SPACE_DIR = "/xavier_ssd/TrekBot/TrekBot2_WS/install"
PROJECT_V... | true | true |
1c0bc224520da8a1c6ac1f9a4ebd3effdd7e57fd | 1,343 | py | Python | workbench/file-tuning/info-generate.py | aggresss/playground-python | 0decca5753d32fe93d184a1f9e3a03ff3ddb7543 | [
"MIT"
] | null | null | null | workbench/file-tuning/info-generate.py | aggresss/playground-python | 0decca5753d32fe93d184a1f9e3a03ff3ddb7543 | [
"MIT"
] | null | null | null | workbench/file-tuning/info-generate.py | aggresss/playground-python | 0decca5753d32fe93d184a1f9e3a03ff3ddb7543 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
import os
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog='info-generate.py',
usage=' python %(pr... | 29.195652 | 75 | 0.560685 |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import sys
import os
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog='info-generate.py',
usage=' python %(prog)s -p path -s "suffix"',
description... | true | true |
1c0bc3b7be41197153e93619c4e6ec671a331553 | 901 | py | Python | tests/python/pants_test/engine/util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/engine/util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | tests/python/pants_test/engine/util.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.testutil.engine.util import TARGET_TABLE as TARGET_TABLE # noqa
from pants.testutil.engine.util import MockConsole as MockConsole # noqa
from pants.testutil.engine.util import... | 50.055556 | 103 | 0.832408 |
from pants.testutil.engine.util import TARGET_TABLE as TARGET_TABLE from pants.testutil.engine.util import MockConsole as MockConsole from pants.testutil.engine.util import Target as Target from pants.testutil.engine.util import assert_equal_with_printing as assert_equal_with_printing from pants.testutil.engine.ut... | true | true |
1c0bc459d0dd0a1dd71443cf975f7fd97d6a7950 | 4,322 | py | Python | analysisEngines/LinearRegression.py | svadakat/MMM_SapientNitro | 58848fdebc89f00151b3d2edd8e3566a4e2dddda | [
"Apache-2.0"
] | null | null | null | analysisEngines/LinearRegression.py | svadakat/MMM_SapientNitro | 58848fdebc89f00151b3d2edd8e3566a4e2dddda | [
"Apache-2.0"
] | null | null | null | analysisEngines/LinearRegression.py | svadakat/MMM_SapientNitro | 58848fdebc89f00151b3d2edd8e3566a4e2dddda | [
"Apache-2.0"
] | null | null | null | ############ To Do #################
# 1. Exception Handling
#
#
###################################
import logging
import pymongo
from pymongo import MongoClient
import json
import time
from datetime import datetime
# imports
import pandas as pd
#import matplotlib.pyplot as plt
# this allows plots to appear directly ... | 32.253731 | 103 | 0.62795 | import logging
import pymongo
from pymongo import MongoClient
import json
import time
from datetime import datetime
import pandas as pd
import statsmodels.formula.api as smf
dependentVariable ="Sales"
features = "TV + Radio + Newspaper"
client = MongoClient()
client = MongoClient("mongodb://localhost:27017/")
db = cli... | true | true |
1c0bc497de3fc04253c311f72081d384b06de970 | 11,756 | py | Python | tutorials/rnn/ptb/ptb_word_lm.py | un-knight/models | 196f7f2eecf7938dfe4ac2372a51cebbd8a7c170 | [
"Apache-2.0"
] | null | null | null | tutorials/rnn/ptb/ptb_word_lm.py | un-knight/models | 196f7f2eecf7938dfe4ac2372a51cebbd8a7c170 | [
"Apache-2.0"
] | null | null | null | tutorials/rnn/ptb/ptb_word_lm.py | un-knight/models | 196f7f2eecf7938dfe4ac2372a51cebbd8a7c170 | [
"Apache-2.0"
] | 1 | 2018-09-25T13:43:20.000Z | 2018-09-25T13:43:20.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.602151 | 81 | 0.671742 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
import tensorflow as tf
from tensorflow.models.rnn.ptb import reader
flags = tf.flags
logging = tf.logging
flags.DEFINE_string(
"model", "small",
"A type of model. Po... | true | true |
1c0bc49ab840aac3ae9a2beb41b84db46eecc400 | 3,801 | py | Python | cdr_plugin_folder_to_folder/storage/Storage.py | hongson1981/cdr-plugin-folder-to-folder | 598a589059242341f76838bc0638895603785287 | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/storage/Storage.py | hongson1981/cdr-plugin-folder-to-folder | 598a589059242341f76838bc0638895603785287 | [
"Apache-2.0"
] | null | null | null | cdr_plugin_folder_to_folder/storage/Storage.py | hongson1981/cdr-plugin-folder-to-folder | 598a589059242341f76838bc0638895603785287 | [
"Apache-2.0"
] | 1 | 2021-07-03T13:15:14.000Z | 2021-07-03T13:15:14.000Z | import os
from os import listdir
from os.path import abspath
from osbot_utils.decorators.lists.group_by import group_by
from osbot_utils.decorators.lists.index_by import index_by
from osbot_utils.utils.Files import temp_folder, path_combine, file_exists, file_copy, folder_delete_all, folder_create
from cdr_plugin_fol... | 35.523364 | 130 | 0.666404 | import os
from os import listdir
from os.path import abspath
from osbot_utils.decorators.lists.group_by import group_by
from osbot_utils.decorators.lists.index_by import index_by
from osbot_utils.utils.Files import temp_folder, path_combine, file_exists, file_copy, folder_delete_all, folder_create
from cdr_plugin_fol... | true | true |
1c0bc509d9a056e114f48a262b06238ab53b4a36 | 654 | py | Python | tests/scripts/waf-tools/f_guidelines/tests/header_tests/header_test2.py | patkan/foxbms-2 | 329216a5b0739362512b4c744975a136f674f60c | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 47 | 2021-04-01T21:14:55.000Z | 2022-03-30T12:19:18.000Z | tests/scripts/waf-tools/f_guidelines/tests/header_tests/header_test2.py | patkan/foxbms-2 | 329216a5b0739362512b4c744975a136f674f60c | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 6 | 2021-06-01T08:25:54.000Z | 2021-11-17T07:55:05.000Z | tests/scripts/waf-tools/f_guidelines/tests/header_tests/header_test2.py | patkan/foxbms-2 | 329216a5b0739362512b4c744975a136f674f60c | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 24 | 2021-04-01T21:15:04.000Z | 2022-03-29T06:18:10.000Z | # This test should not raise a header error because header is too short
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 - @YEAR@, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in sou... | 38.470588 | 100 | 0.761468 | true | true | |
1c0bc72e1068922496c98935fb3af156433825bb | 2,807 | py | Python | codes/datasets/video_dataset.py | dreamerlin/MVFNet | ed336228ad88821ffe407a4355017acb416e4670 | [
"Apache-2.0"
] | 102 | 2020-12-16T03:55:21.000Z | 2022-03-11T03:46:03.000Z | codes/datasets/video_dataset.py | dreamerlin/MVFNet | ed336228ad88821ffe407a4355017acb416e4670 | [
"Apache-2.0"
] | 4 | 2021-06-14T18:43:53.000Z | 2022-03-28T16:28:51.000Z | codes/datasets/video_dataset.py | dreamerlin/MVFNet | ed336228ad88821ffe407a4355017acb416e4670 | [
"Apache-2.0"
] | 8 | 2021-03-03T00:18:58.000Z | 2022-02-18T07:20:06.000Z | """video dataset"""
import os.path as osp
import copy
from .base import BaseDataset
from .builder import DATASETS
import random
# TODO: More efficient
@DATASETS.register_module
class VideoDataset(BaseDataset):
"""Video dataset for action recognition.
The dataset loads raw videos and apply specified transforms t... | 36.454545 | 79 | 0.573566 | import os.path as osp
import copy
from .base import BaseDataset
from .builder import DATASETS
import random
@DATASETS.register_module
class VideoDataset(BaseDataset):
def __init__(self,
ann_file,
pipeline,
data_root=None,
test_mode=False,
... | true | true |
1c0bc74e749a8b32e0a2f79b84b77aab9f37308a | 659 | py | Python | customsepomex/__init__.py | edgarhurtado27/custom-sepomex | 0a9d9c52f27619e028e3c56f05e2343912935061 | [
"MIT"
] | null | null | null | customsepomex/__init__.py | edgarhurtado27/custom-sepomex | 0a9d9c52f27619e028e3c56f05e2343912935061 | [
"MIT"
] | null | null | null | customsepomex/__init__.py | edgarhurtado27/custom-sepomex | 0a9d9c52f27619e028e3c56f05e2343912935061 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, abort
from . import mongoclient
config = {
"DEBUG": False,
"JSON_AS_ASCII": False
}
# Instanciamos el servidor
app = Flask(__name__)
app.config.from_mapping(config)
@app.route('/')
def ping():
return jsonify({ 'mensaje': 'App Online' })
@app.route('/cp/<string:zipCode... | 20.59375 | 69 | 0.675266 | from flask import Flask, jsonify, abort
from . import mongoclient
config = {
"DEBUG": False,
"JSON_AS_ASCII": False
}
app = Flask(__name__)
app.config.from_mapping(config)
@app.route('/')
def ping():
return jsonify({ 'mensaje': 'App Online' })
@app.route('/cp/<string:zipCode>', methods=['GET'])
def cu... | true | true |
1c0bc7d7826df5a50352993c114363fd5fb24f6d | 69 | py | Python | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | from manim import *
BOLD_STROKE_WIDTH = 1.5 * DEFAULT_STROKE_WIDTH
| 13.8 | 46 | 0.782609 | from manim import *
BOLD_STROKE_WIDTH = 1.5 * DEFAULT_STROKE_WIDTH
| true | true |
1c0bc7ed8c15af2ff1ebc77c055b11943d396f35 | 6,124 | py | Python | model/train_arc.py | vbvg2008/ARC | b7b16b907d1e62608ebb079594e953179e6a31ea | [
"Apache-2.0"
] | 1 | 2021-10-11T07:28:36.000Z | 2021-10-11T07:28:36.000Z | model/train_arc.py | vbvg2008/ARC | b7b16b907d1e62608ebb079594e953179e6a31ea | [
"Apache-2.0"
] | null | null | null | model/train_arc.py | vbvg2008/ARC | b7b16b907d1e62608ebb079594e953179e6a31ea | [
"Apache-2.0"
] | 2 | 2021-06-15T21:07:53.000Z | 2021-06-17T02:41:46.000Z | import os
import pickle
import cv2
import fastestimator as fe
import numpy as np
import tensorflow as tf
from fastestimator.op.numpyop import Delete
from fastestimator.op.numpyop.meta import Sometimes
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.op.tensorop.model import ModelOp, UpdateOp
... | 37.115152 | 116 | 0.652841 | import os
import pickle
import cv2
import fastestimator as fe
import numpy as np
import tensorflow as tf
from fastestimator.op.numpyop import Delete
from fastestimator.op.numpyop.meta import Sometimes
from fastestimator.op.tensorop.loss import CrossEntropy
from fastestimator.op.tensorop.model import ModelOp, UpdateOp
... | true | true |
1c0bc8b03ac3c86f37496a3c4a0ce84c59b2806c | 20,521 | py | Python | tests/unit/python/foglamp/services/core/api/test_browser_assets.py | vaibhav-ScaleDB/FogLAMP | 445e7a588f5ec5fcae0360b49fdc4e4de0ea2ec8 | [
"Apache-2.0"
] | null | null | null | tests/unit/python/foglamp/services/core/api/test_browser_assets.py | vaibhav-ScaleDB/FogLAMP | 445e7a588f5ec5fcae0360b49fdc4e4de0ea2ec8 | [
"Apache-2.0"
] | null | null | null | tests/unit/python/foglamp/services/core/api/test_browser_assets.py | vaibhav-ScaleDB/FogLAMP | 445e7a588f5ec5fcae0360b49fdc4e4de0ea2ec8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import asyncio
import json
from unittest.mock import MagicMock, patch
from aiohttp import web
from aiohttp.web_urldispatcher import PlainResource, DynamicResource
import pytest
from foglamp.services.core.api import browser
... | 80.160156 | 573 | 0.604015 |
import asyncio
import json
from unittest.mock import MagicMock, patch
from aiohttp import web
from aiohttp.web_urldispatcher import PlainResource, DynamicResource
import pytest
from foglamp.services.core.api import browser
from foglamp.services.core import connect
from foglamp.common.storage_client.storage_client ... | true | true |
1c0bc9c6d335b193853d668fd1cfcd459cf3a67f | 488 | py | Python | setup.py | nishchay2698/stpl_2 | 6d65ef5420e5674818baaa08e2a9dd6ce191212e | [
"MIT"
] | null | null | null | setup.py | nishchay2698/stpl_2 | 6d65ef5420e5674818baaa08e2a9dd6ce191212e | [
"MIT"
] | null | null | null | setup.py | nishchay2698/stpl_2 | 6d65ef5420e5674818baaa08e2a9dd6ce191212e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in stpl_2/__init__.py
from stpl_2 import __version__ as version
setup(
name='stpl_2',
version=version,
description='v13 a... | 23.238095 | 61 | 0.754098 | from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
from stpl_2 import __version__ as version
setup(
name='stpl_2',
version=version,
description='v13 app test',
author='stpl',
author_email='info@sprics.com',
packages=find_packages(),
... | true | true |
1c0bc9f0dc3f972b6b663be73184e8a2a4c1fe77 | 29,301 | py | Python | timm/models/hrnet.py | vb7401/pytorch-image-models | d1d1115b1e07103cd97c21a63fb9dfe5af9c2047 | [
"Apache-2.0"
] | 90 | 2021-03-28T17:33:03.000Z | 2022-03-26T01:44:20.000Z | timm/models/hrnet.py | vb7401/pytorch-image-models | d1d1115b1e07103cd97c21a63fb9dfe5af9c2047 | [
"Apache-2.0"
] | 7 | 2021-03-30T10:57:59.000Z | 2021-12-19T13:40:12.000Z | timm/models/hrnet.py | vb7401/pytorch-image-models | d1d1115b1e07103cd97c21a63fb9dfe5af9c2047 | [
"Apache-2.0"
] | 19 | 2021-04-09T06:27:50.000Z | 2022-02-11T14:24:25.000Z | """ HRNet
Copied from https://github.com/HRNet/HRNet-Image-Classification
Original header:
Copyright (c) Microsoft
Licensed under the MIT License.
Written by Bin Xiao (Bin.Xiao@microsoft.com)
Modified by Ke Sun (sunk@mail.ustc.edu.cn)
"""
import logging
from typing import List
import torch
import torch.nn as... | 35.217548 | 126 | 0.57899 | import logging
from typing import List
import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from .features import FeatureInfo
from .helpers import build_model_with_cfg, default_cfg_for_features
from .layers import create_classifier
from .... | true | true |
1c0bcb698af962b02bd20fc89d00be0397b49197 | 1,973 | py | Python | src/pretix/base/migrations/0200_transaction.py | hansegucker/pretix | 1d32d7a2d213834781385052d1d92b392bf1386a | [
"Apache-2.0"
] | 1,248 | 2015-04-24T13:32:06.000Z | 2022-03-29T07:01:36.000Z | src/pretix/base/migrations/0200_transaction.py | hansegucker/pretix | 1d32d7a2d213834781385052d1d92b392bf1386a | [
"Apache-2.0"
] | 2,113 | 2015-02-18T18:58:16.000Z | 2022-03-31T11:12:32.000Z | src/pretix/base/migrations/0200_transaction.py | thegcat/pretix | 451d3fce0575d85a0ea93fd64aa0631feaced967 | [
"Apache-2.0"
] | 453 | 2015-05-13T09:29:06.000Z | 2022-03-24T13:39:16.000Z | # Generated by Django 3.2.4 on 2021-10-18 10:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0199_auto_20211005_1050'),
]
operations = [
migrations.CreateModel(
name='Transac... | 50.589744 | 142 | 0.618348 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pretixbase', '0199_auto_20211005_1050'),
]
operations = [
migrations.CreateModel(
name='Transaction',
fields=[
('id... | true | true |
1c0bcb933e6da4f64963296bc5ee74e224431b8b | 14,940 | py | Python | selfdrive/car/honda/values.py | iambluefred/Test_7 | 6dae3c55d1ea95c27b8f5694059e1ecb3e7e27a0 | [
"MIT"
] | null | null | null | selfdrive/car/honda/values.py | iambluefred/Test_7 | 6dae3c55d1ea95c27b8f5694059e1ecb3e7e27a0 | [
"MIT"
] | null | null | null | selfdrive/car/honda/values.py | iambluefred/Test_7 | 6dae3c55d1ea95c27b8f5694059e1ecb3e7e27a0 | [
"MIT"
] | null | null | null | from cereal import car
from selfdrive.car import dbc_dict
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
VisualAlert = car.CarControl.HUDControl.VisualAlert
# Car button codes
class CruiseButtons:
RES_ACCEL = 4
DECEL_SET = 3
CANCEL = 2
MAIN = 1
#car chimes: enumeration from dbc file. C... | 71.826923 | 687 | 0.578514 | from cereal import car
from selfdrive.car import dbc_dict
AudibleAlert = car.CarControl.HUDControl.AudibleAlert
VisualAlert = car.CarControl.HUDControl.VisualAlert
class CruiseButtons:
RES_ACCEL = 4
DECEL_SET = 3
CANCEL = 2
MAIN = 1
class CM:
MUTE = 0
SINGLE = 3
DOUBLE = 4
REPEATED = ... | true | true |
1c0bcc10bf53533840585aa11ba757a22e338442 | 2,065 | py | Python | nlcpy/request/__init__.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | 11 | 2020-07-31T02:21:55.000Z | 2022-03-10T03:12:11.000Z | nlcpy/request/__init__.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | null | null | null | nlcpy/request/__init__.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | null | null | null | #
# * The source code in this file is developed independently by NEC Corporation.
#
# # NLCPy License #
#
# Copyright (c) 2020-2021 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following cond... | 54.342105 | 88 | 0.757385 |
from nlcpy.request import request from nlcpy.request.request import flush from nlcpy.request.request import set_offload_timing_onthefly from nlcpy.request.request import set_offload_timing_lazy from nlcpy.request.request import get_offload_timing from nlcpy.request.request import set_max_request | true | true |
1c0bcc4b97966bc95660017c7ced22f91c03e461 | 343 | py | Python | flask-back/src/DetectedClass.py | lemmau/real-time-detector | 8886efb8ae1233b4c50b26a64596a5c6adcada5a | [
"MIT"
] | null | null | null | flask-back/src/DetectedClass.py | lemmau/real-time-detector | 8886efb8ae1233b4c50b26a64596a5c6adcada5a | [
"MIT"
] | 8 | 2020-07-04T22:23:44.000Z | 2022-02-27T09:42:15.000Z | flask-back/src/DetectedClass.py | lemmau/real-time-detector | 8886efb8ae1233b4c50b26a64596a5c6adcada5a | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class DetectedClass(db.Model):
__tablename__ = 'DetectedClass'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), nullable=False)
description = db.Column(db.String(200), nullable=False)
isDeleted = db.Column(db.B... | 26.384615 | 59 | 0.725948 | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class DetectedClass(db.Model):
__tablename__ = 'DetectedClass'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), nullable=False)
description = db.Column(db.String(200), nullable=False)
isDeleted = db.Column(db.B... | true | true |
1c0bccd4360f2d7abd63a289b46ad3db24085f78 | 4,995 | py | Python | open_gateway/video_sources/video_base.py | sanyaade-teachings/SensiML-open-gateway | 68aabbba7b2edb14937065b5f8a9d1a2f4a64083 | [
"BSD-3-Clause"
] | 20 | 2021-04-24T08:11:00.000Z | 2022-03-24T19:32:20.000Z | open_gateway/video_sources/video_base.py | sanyaade-teachings/SensiML-open-gateway | 68aabbba7b2edb14937065b5f8a9d1a2f4a64083 | [
"BSD-3-Clause"
] | 3 | 2021-04-16T06:49:18.000Z | 2021-10-04T15:55:25.000Z | open_gateway/video_sources/video_base.py | sanyaade-teachings/SensiML-open-gateway | 68aabbba7b2edb14937065b5f8a9d1a2f4a64083 | [
"BSD-3-Clause"
] | 7 | 2021-04-30T19:50:02.000Z | 2022-03-08T19:37:17.000Z | import os
import sys
import threading
import time
import cv2
from open_gateway.video_sources import get_video_source_name
from open_gateway import basedir, ensure_folder_exists
MAX_VIDEO_STREAMS = 1
class VideoBase(object):
def __init__(self, camera_index):
self.vs = None
self.output_frame = None... | 30.090361 | 103 | 0.523323 | import os
import sys
import threading
import time
import cv2
from open_gateway.video_sources import get_video_source_name
from open_gateway import basedir, ensure_folder_exists
MAX_VIDEO_STREAMS = 1
class VideoBase(object):
def __init__(self, camera_index):
self.vs = None
self.output_frame = None... | true | true |
1c0bcd0baf7ce6924b0af4e5f0fa73945e9d2d82 | 5,209 | py | Python | demos/motmetrics4norfair/motmetrics4norfair.py | HaithemH/norfair | 04f80dd900ed38c8537344ee07dec6c583ac4834 | [
"BSD-3-Clause"
] | 2 | 2021-02-27T09:38:12.000Z | 2021-09-24T07:52:01.000Z | demos/motmetrics4norfair/motmetrics4norfair.py | HaithemH/norfair | 04f80dd900ed38c8537344ee07dec6c583ac4834 | [
"BSD-3-Clause"
] | null | null | null | demos/motmetrics4norfair/motmetrics4norfair.py | HaithemH/norfair | 04f80dd900ed38c8537344ee07dec6c583ac4834 | [
"BSD-3-Clause"
] | null | null | null | import os.path
import numpy as np
import norfair
from norfair import Detection, Tracker, metrics, video, drawing
import argparse
frame_skip_period = 1
detection_threshold = 0.01
distance_threshold = 0.4
parser = argparse.ArgumentParser(
description="Evaluate a basic tracker on MOTChallenge data. Display on termin... | 33.391026 | 132 | 0.683816 | import os.path
import numpy as np
import norfair
from norfair import Detection, Tracker, metrics, video, drawing
import argparse
frame_skip_period = 1
detection_threshold = 0.01
distance_threshold = 0.4
parser = argparse.ArgumentParser(
description="Evaluate a basic tracker on MOTChallenge data. Display on termin... | true | true |
1c0bce12e61b6b7573741912901836abd1f372fa | 9,812 | py | Python | tests/models/validators/v3_0_0/jsd_f2fcf04554db9ea4cdc3a7024322.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | tests/models/validators/v3_0_0/jsd_f2fcf04554db9ea4cdc3a7024322.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | tests/models/validators/v3_0_0/jsd_f2fcf04554db9ea4cdc3a7024322.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Identity Services Engine createNetworkAccessAuthenticationRule data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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 Softwa... | 30.377709 | 79 | 0.375968 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from ciscoisesdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidatorF2FcF04554Db9Ea4Cdc3A7024322(object):
def __init__(self):
super(... | true | true |
1c0bce846ef670e25180e71e31476974a2351fbd | 2,748 | py | Python | widgets/centralwidget/ui/welcome.py | ostash-group/GeneticPlotter | 09389407c6d89b8f525f247e7a8af6ff0de1d665 | [
"MIT"
] | 3 | 2021-02-02T18:10:18.000Z | 2021-07-27T14:20:20.000Z | widgets/centralwidget/ui/welcome.py | ostash-group/GeneticPlotter | 09389407c6d89b8f525f247e7a8af6ff0de1d665 | [
"MIT"
] | null | null | null | widgets/centralwidget/ui/welcome.py | ostash-group/GeneticPlotter | 09389407c6d89b8f525f247e7a8af6ff0de1d665 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'welcome.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("For... | 39.826087 | 162 | 0.692868 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(533, 435)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(F... | true | true |
1c0bcf306b8099c3f80d3b3a11ab848776eeb7dd | 156 | py | Python | tests/devices/_internal/__init__.py | cyliangtw/mbed-tools | 69c600c0a5ac1eb0d52b481b5ba020da8bb73d33 | [
"Apache-2.0"
] | 39 | 2020-04-03T13:52:34.000Z | 2022-03-23T13:08:22.000Z | tests/devices/_internal/__init__.py | cyliangtw/mbed-tools | 69c600c0a5ac1eb0d52b481b5ba020da8bb73d33 | [
"Apache-2.0"
] | 306 | 2020-02-06T18:08:43.000Z | 2022-03-25T14:50:18.000Z | tests/devices/_internal/__init__.py | cyliangtw/mbed-tools | 69c600c0a5ac1eb0d52b481b5ba020da8bb73d33 | [
"Apache-2.0"
] | 23 | 2020-03-17T11:42:23.000Z | 2022-01-30T02:56:18.000Z | #
# Copyright (c) 2020-2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Internal implementation tests."""
| 26 | 76 | 0.74359 | true | true | |
1c0bd066ea1d09307818ab5d4b4d4b1ae9533074 | 3,103 | py | Python | trainer/engine_pretrain.py | WangHelin1997/MaskSpec | d4acf1343c780ba481abecbfe426ff657857b8f1 | [
"Apache-2.0"
] | 4 | 2022-03-29T05:41:29.000Z | 2022-03-29T07:25:34.000Z | trainer/engine_pretrain.py | WangHelin1997/MaskSpec | d4acf1343c780ba481abecbfe426ff657857b8f1 | [
"Apache-2.0"
] | null | null | null | trainer/engine_pretrain.py | WangHelin1997/MaskSpec | d4acf1343c780ba481abecbfe426ff657857b8f1 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
#... | 36.940476 | 108 | 0.639704 |
import math
import sys
from typing import Iterable
import torch
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import utils.misc as misc
import utils.lr_sched as lr_sched
def train_one_epoch(model: torch.nn.Module,
data_loader: Iterable, optimizer: torch.... | true | true |
1c0bd0761ca98eb9469f933131b6ace79b8a1d9a | 76 | py | Python | Shell/__init__.py | githubforwuchaofan/SandyP2019 | 10f344a9e1b403096c5fedb93aafdf49cfae6cbe | [
"Apache-2.0"
] | null | null | null | Shell/__init__.py | githubforwuchaofan/SandyP2019 | 10f344a9e1b403096c5fedb93aafdf49cfae6cbe | [
"Apache-2.0"
] | null | null | null | Shell/__init__.py | githubforwuchaofan/SandyP2019 | 10f344a9e1b403096c5fedb93aafdf49cfae6cbe | [
"Apache-2.0"
] | null | null | null | # coding=utf8
"""
_author: wcf
_date: 2018/12/11-下午6:32
_desc: //ToDo
"""
| 8.444444 | 24 | 0.618421 | true | true | |
1c0bd08d3a5929a25bf333c86eb37e2af7e5c1dc | 1,263 | py | Python | Utilities/stm32_crc.py | hikebuddy32/Rebble32 | 810a69eaab87a49c2a1df66b8ea9e796529127f8 | [
"MIT"
] | 1 | 2020-04-29T23:40:03.000Z | 2020-04-29T23:40:03.000Z | Utilities/stm32_crc.py | hikebuddy32/Rebble32 | 810a69eaab87a49c2a1df66b8ea9e796529127f8 | [
"MIT"
] | null | null | null | Utilities/stm32_crc.py | hikebuddy32/Rebble32 | 810a69eaab87a49c2a1df66b8ea9e796529127f8 | [
"MIT"
] | null | null | null | import array
import sys
CRC_POLY = 0x04C11DB7
def process_word(data, crc=0xffffffff):
if (len(data) < 4):
d_array = array.array('B', data)
for x in range(0, 4 - len(data)):
d_array.insert(0,0)
d_array.reverse()
data = d_array.tostring()
d = array.array('I', data)[0... | 24.764706 | 64 | 0.561362 | import array
import sys
CRC_POLY = 0x04C11DB7
def process_word(data, crc=0xffffffff):
if (len(data) < 4):
d_array = array.array('B', data)
for x in range(0, 4 - len(data)):
d_array.insert(0,0)
d_array.reverse()
data = d_array.tostring()
d = array.array('I', data)[0... | true | true |
1c0bd4617092c3d210db97f6a75517e98df54793 | 9,213 | py | Python | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/rl/model_rl_experiment_player.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-07T18:52:33.000Z | 2019-07-06T12:48:18.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/rl/model_rl_experiment_player.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 12 | 2018-12-13T18:04:36.000Z | 2019-06-14T20:49:33.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/rl/model_rl_experiment_player.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-09T21:04:52.000Z | 2019-06-24T07:40:28.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# 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... | 30.812709 | 79 | 0.695647 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
from gym.core import Env
from gym.spaces import Box
from gym.spaces import Discrete
from gym.utils import play
import numpy as np
from PIL import Image
from PIL import ImageDraw
from ... | true | true |
1c0bd463b33086af790282bd9483256a58d8639f | 2,663 | py | Python | controllers/suggestions/suggest_offseason_event_controller.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | controllers/suggestions/suggest_offseason_event_controller.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | controllers/suggestions/suggest_offseason_event_controller.py | enterstudio/the-blue-alliance | b53f752fe1f059b4b6f91c841e1865a6c6b81268 | [
"MIT"
] | null | null | null | from controllers.base_controller import LoggedInHandler
from helpers.suggestions.suggestion_creator import SuggestionCreator
from helpers.suggestions.suggestion_notifier import SuggestionNotifier
from template_engine import jinja2_engine
class SuggestOffseasonEventController(LoggedInHandler):
"""
Allow users ... | 42.951613 | 103 | 0.649643 | from controllers.base_controller import LoggedInHandler
from helpers.suggestions.suggestion_creator import SuggestionCreator
from helpers.suggestions.suggestion_notifier import SuggestionNotifier
from template_engine import jinja2_engine
class SuggestOffseasonEventController(LoggedInHandler):
def get(self):
... | true | true |
1c0bd4db9c347e013e686b38c354bbbba5d2682c | 19,573 | py | Python | exps/utils/eval_utils.py | beneisner/partnet_seg_exps | 54cd57885ba248fb9a35b42664e1c69c7ef62255 | [
"MIT"
] | 70 | 2019-03-26T05:26:35.000Z | 2022-02-15T00:28:50.000Z | exps/utils/eval_utils.py | beneisner/partnet_seg_exps | 54cd57885ba248fb9a35b42664e1c69c7ef62255 | [
"MIT"
] | 12 | 2019-06-27T07:27:08.000Z | 2022-01-05T05:58:07.000Z | exps/utils/eval_utils.py | beneisner/partnet_seg_exps | 54cd57885ba248fb9a35b42664e1c69c7ef62255 | [
"MIT"
] | 13 | 2019-04-08T13:50:30.000Z | 2022-01-28T07:40:13.000Z | import os
import sys
import h5py
import numpy as np
from progressbar import ProgressBar
from commons import check_mkdir
def load_gt_h5(fn):
""" Output: pts B x N x 3 float32
gt_mask B x K x N bool
gt_mask_label B x K uint8
gt_mask_vali... | 40.026585 | 135 | 0.563174 | import os
import sys
import h5py
import numpy as np
from progressbar import ProgressBar
from commons import check_mkdir
def load_gt_h5(fn):
with h5py.File(fn, 'r') as fin:
gt_mask = fin['gt_mask'][:]
gt_mask_label = fin['gt_mask_label'][:]
gt_mask_valid = fin['gt_mask_valid'][:]
gt_... | true | true |
1c0bd5bb52ac3dfc1c37fc7bf658740cf3827f41 | 1,991 | py | Python | .leetcode/55.jump-game.2.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/55.jump-game.2.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/55.jump-game.2.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=55 lang=python3
#
# [55] Jump Game
#
# https://leetcode.com/problems/jump-game/description/
#
# algorithms
# Medium (35.24%)
# Likes: 6069
# Dislikes: 418
# Total Accepted: 613.4K
# Total Submissions: 1.7M
# Testcase Example: '[2,3,1,1,4]'
#
# Given an array of non-negative integers nums, y... | 18.1 | 79 | 0.591662 |
from imports import *
class Solution:
def canJump(self, nums: List[int]) -> bool:
if len(nums) <= 1:
return True
reach = nums[0]
now = 0
while now < reach and reach < len(nums):
now += 1
reach = max(reach, now + nums[now])
return re... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.