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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1fe6831592c480fb9284db1c562e756c8627c0 | 4,311 | py | Python | pyzoo/zoo/pipeline/api/keras/optimizers.py | Wesley-Du/analytics-zoo | e4ca11b219a43bceec99aba39cf30c8aa368e8b3 | [
"Apache-2.0"
] | 35 | 2020-07-03T06:31:12.000Z | 2020-07-12T08:38:10.000Z | pyzoo/zoo/pipeline/api/keras/optimizers.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 2 | 2018-10-31T01:20:05.000Z | 2018-11-02T06:06:35.000Z | pyzoo/zoo/pipeline/api/keras/optimizers.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 4 | 2019-02-25T03:26:56.000Z | 2019-03-06T04:41:31.000Z | #
# Copyright 2018 Analytics Zoo 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 law or agreed to... | 33.418605 | 94 | 0.627001 |
from bigdl.util.common import *
from bigdl.optim.optimizer import OptimMethod, Default
from zoo.pipeline.api.keras.base import ZooKerasCreator
from zoo.common.utils import callZooFunc
if sys.version >= '3':
long = int
unicode = str
class Adam(OptimMethod, ZooKerasCreator):
def __init__(s... | true | true |
1c1fe6d2ced001430a72ce7f79447a75d8ff1842 | 787 | py | Python | var/spack/repos/builtin/packages/r-rhdf5lib/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/r-rhdf5lib/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-rhdf5lib/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRhdf5lib(RPackage):
"""hdf5 library as an R package.
Provides C and C++ hdf5 libr... | 34.217391 | 73 | 0.733164 |
from spack import *
class RRhdf5lib(RPackage):
homepage = "https://bioconductor.org/packages/Rhdf5lib"
git = "https://git.bioconductor.org/packages/Rhdf5lib.git"
version('1.6.3', commit='11ac3069f28b0068002db9c645817401f6c5b3c4')
version('1.4.3', commit='f6be8c2659b2daa17541506058917b79814... | true | true |
1c1fe72d31331d17d3b1997f833fe10bbca7c56b | 1,080 | py | Python | src/mayaToFuji/mtfu_devmodule/scripts/Fuji/AETemplate/AEFujishaderTemplate.py | haggi/OpenMaya | 746e0740f480d9ef8d2173f31b3c99b9b0ea0d24 | [
"MIT"
] | 42 | 2015-01-03T15:07:25.000Z | 2021-12-09T03:56:59.000Z | src/mayaToFuji/mtfu_devmodule/scripts/Fuji/AETemplate/AEFujishaderTemplate.py | haggi/OpenMaya | 746e0740f480d9ef8d2173f31b3c99b9b0ea0d24 | [
"MIT"
] | 66 | 2015-01-02T13:28:44.000Z | 2022-03-16T14:00:57.000Z | src/mayaToFuji/mtfu_devmodule/scripts/Fuji/AETemplate/AEFujishaderTemplate.py | haggi/OpenMaya | 746e0740f480d9ef8d2173f31b3c99b9b0ea0d24 | [
"MIT"
] | 12 | 2015-02-07T05:02:17.000Z | 2020-07-10T17:21:44.000Z | import pymel.core as pm
import logging
log = logging.getLogger("ui")
class BaseTemplate(pm.ui.AETemplate):
def addControl(self, control, label=None, **kwargs):
pm.ui.AETemplate.addControl(self, control, label=label, **kwargs)
def beginLayout(self, name, collapse=True):
pm.ui.AETe... | 30.857143 | 73 | 0.651852 | import pymel.core as pm
import logging
log = logging.getLogger("ui")
class BaseTemplate(pm.ui.AETemplate):
def addControl(self, control, label=None, **kwargs):
pm.ui.AETemplate.addControl(self, control, label=label, **kwargs)
def beginLayout(self, name, collapse=True):
pm.ui.AETe... | true | true |
1c1fe7ab4c93604ace28df278a8cc125b2d93009 | 103 | py | Python | src/app/mod_question/__init__.py | tcouch360/WarwickQnA | 904502ccc99a7f20692ea1a942ca2df34404c625 | [
"MIT"
] | 15 | 2018-07-20T08:38:42.000Z | 2021-12-06T08:25:47.000Z | src/app/mod_question/__init__.py | tcouch360/WarwickQnA | 904502ccc99a7f20692ea1a942ca2df34404c625 | [
"MIT"
] | null | null | null | src/app/mod_question/__init__.py | tcouch360/WarwickQnA | 904502ccc99a7f20692ea1a942ca2df34404c625 | [
"MIT"
] | 12 | 2018-03-02T02:36:20.000Z | 2022-02-12T16:08:52.000Z | #from flask import Blueprint
#mod_question = Blueprint('mod_question', __name__)
#from . import views | 20.6 | 51 | 0.776699 | true | true | |
1c1fe87506144d667872b6b8c8db82f7009704f1 | 3,103 | py | Python | DQM/DTMonitorModule/python/test/hltdt_dqm_sourceclient-live_GlobalRun_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/DTMonitorModule/python/test/hltdt_dqm_sourceclient-live_GlobalRun_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/DTMonitorModule/python/test/hltdt_dqm_sourceclient-live_GlobalRun_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("HLT-DTDQM")
#----------------------------
#### Event Source
#----------------------------
process.load("DQM.Integration.test.inputsource_cfi")
process.EventStreamHttpReader.consumerName = 'DT DQM Consumer'
#----------------------------
#### DQM Environ... | 34.865169 | 142 | 0.700935 | import FWCore.ParameterSet.Config as cms
process = cms.Process("HLT-DTDQM")
rce_cfi")
process.EventStreamHttpReader.consumerName = 'DT DQM Consumer'
ad("DQMServices.Components.DQMEnvironment_cfi")
llectorHost = 'srv-c2d05-13.cms'
process.DQM.collectorPort = 9190
process.dqmEnv.subSystemFolder = 'DT'
process.dq... | true | true |
1c1fe8dee52f3802efc472f03f66720e240dee08 | 1,409 | py | Python | oscar/apps/search/app.py | michaelBenin/django-oscar | f45d38b5d3ffa10756d95c625fb90a27185ce1e1 | [
"BSD-3-Clause"
] | 1 | 2015-11-07T12:37:50.000Z | 2015-11-07T12:37:50.000Z | oscar/apps/search/app.py | michaelBenin/django-oscar | f45d38b5d3ffa10756d95c625fb90a27185ce1e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/search/app.py | michaelBenin/django-oscar | f45d38b5d3ffa10756d95c625fb90a27185ce1e1 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, url
from django.conf import settings
from oscar.core.application import Application
from oscar.apps.search import views, forms
from haystack.views import search_view_factory
from haystack.query import SearchQuerySet
class SearchApplication(Application):
name = 'search'
... | 36.128205 | 81 | 0.654365 | from django.conf.urls import patterns, url
from django.conf import settings
from oscar.core.application import Application
from oscar.apps.search import views, forms
from haystack.views import search_view_factory
from haystack.query import SearchQuerySet
class SearchApplication(Application):
name = 'search'
... | true | true |
1c1fe9b57f7e2b35727153499d93f4c9a16957f2 | 306 | py | Python | find-a-string.py | MathewsPeter/HackerRankPython | 5667120f1f7ca3d5fb8105c9e3a5e391d2123274 | [
"MIT"
] | null | null | null | find-a-string.py | MathewsPeter/HackerRankPython | 5667120f1f7ca3d5fb8105c9e3a5e391d2123274 | [
"MIT"
] | null | null | null | find-a-string.py | MathewsPeter/HackerRankPython | 5667120f1f7ca3d5fb8105c9e3a5e391d2123274 | [
"MIT"
] | null | null | null | def count_substring(string, sub_string):
c = 0
for i in range(len(string) - len(sub_string) + 1):
match = 1
for j in range(len(sub_string)):
if string[i+j] != sub_string[j]:
match = 0
break
if match:
c+=1
return c
| 25.5 | 54 | 0.48366 | def count_substring(string, sub_string):
c = 0
for i in range(len(string) - len(sub_string) + 1):
match = 1
for j in range(len(sub_string)):
if string[i+j] != sub_string[j]:
match = 0
break
if match:
c+=1
return c
| true | true |
1c1fea2d4d23d2a2bbf12951d56967e0f6f23e42 | 1,178 | py | Python | notebooks/_solutions/case4_air_quality_processing21.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 183 | 2016-08-24T12:32:07.000Z | 2022-03-26T14:05:04.000Z | notebooks/_solutions/case4_air_quality_processing21.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 1 | 2017-08-28T14:22:40.000Z | 2017-08-28T14:22:40.000Z | notebooks/_solutions/case4_air_quality_processing21.py | rprops/Python_DS-WS | b2fc449a74be0c82863e5fcf1ddbe7d64976d530 | [
"BSD-3-Clause"
] | 204 | 2016-08-24T14:22:58.000Z | 2022-03-29T15:09:03.000Z | def read_airbase_file(filename, station):
"""
Read hourly AirBase data files.
Parameters
----------
filename : string
Path to the data file.
station : string
Name of the station.
Returns
-------
DataFrame
Processed dataframe.
"""
# co... | 31 | 108 | 0.614601 | def read_airbase_file(filename, station):
hours = ["{:02d}".format(i) for i in range(24)]
colnames = ['date'] + [item for pair in zip(hours, ['flag']*24) for item in pair]
data = pd.read_csv(filename, sep='\t', header=None, na_values=[-999, -9999], names=colnames)
data = da... | true | true |
1c1fea81123ad296c215f26bd7a3d1f35e1d6faf | 5,601 | py | Python | lukuvinkkikirjasto/tests/video_tip_repository_test.py | Veikkosuhonen/ohtu-lukuvinkkikirjasto | 839bc2c4e511561d28e1546ccc8d7720c2cbef86 | [
"MIT"
] | null | null | null | lukuvinkkikirjasto/tests/video_tip_repository_test.py | Veikkosuhonen/ohtu-lukuvinkkikirjasto | 839bc2c4e511561d28e1546ccc8d7720c2cbef86 | [
"MIT"
] | null | null | null | lukuvinkkikirjasto/tests/video_tip_repository_test.py | Veikkosuhonen/ohtu-lukuvinkkikirjasto | 839bc2c4e511561d28e1546ccc8d7720c2cbef86 | [
"MIT"
] | null | null | null | import sqlite3
from typing import Any
import unittest
from repositories.video_tip_repository import VideoTipRepository
from entities.video_tip import VideoTip
class TestVideoTipRepository(unittest.TestCase):
def setUp(self):
#repository.delete_all()
self.connection = sqlite3.connect(":memory:")
... | 40.586957 | 133 | 0.630602 | import sqlite3
from typing import Any
import unittest
from repositories.video_tip_repository import VideoTipRepository
from entities.video_tip import VideoTip
class TestVideoTipRepository(unittest.TestCase):
def setUp(self):
self.connection = sqlite3.connect(":memory:")
self.connection.ro... | true | true |
1c1feab400e5d1115722a4dd69b6387671a72c0f | 579 | py | Python | extra/docker/django/config/development_settings.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | null | null | null | extra/docker/django/config/development_settings.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | 13 | 2020-02-12T00:12:52.000Z | 2022-02-12T09:42:36.000Z | extra/docker/django/config/development_settings.py | rlaneyjr/project_pawz | 27f316ef35968ed1319ec0585a050ebed795763a | [
"MIT"
] | null | null | null | from .common_settings import *
DEBUG = True
SECRET_KEY = 'secret key'
DATABASES['default']['NAME'] = 'mailape'
DATABASES['default']['USER'] = 'mailape'
DATABASES['default']['PASSWORD'] = 'development'
DATABASES['default']['HOST'] = 'localhost'
DATABASES['default']['PORT'] = '5432'
MAILING_LIST_FROM_EMAIL = 'mailape... | 24.125 | 49 | 0.735751 | from .common_settings import *
DEBUG = True
SECRET_KEY = 'secret key'
DATABASES['default']['NAME'] = 'mailape'
DATABASES['default']['USER'] = 'mailape'
DATABASES['default']['PASSWORD'] = 'development'
DATABASES['default']['HOST'] = 'localhost'
DATABASES['default']['PORT'] = '5432'
MAILING_LIST_FROM_EMAIL = 'mailape... | true | true |
1c1feb0714b33bf8e4914c2ff28d64195f65942a | 738 | py | Python | pyslm/run.py | leonardojacomussi/PySLM | 94283afa022cd113129b4f42f1745e22ad3730f9 | [
"MIT"
] | 1 | 2021-07-23T17:13:40.000Z | 2021-07-23T17:13:40.000Z | pyslm/run.py | leonardojacomussi/PySLM | 94283afa022cd113129b4f42f1745e22ad3730f9 | [
"MIT"
] | null | null | null | pyslm/run.py | leonardojacomussi/PySLM | 94283afa022cd113129b4f42f1745e22ad3730f9 | [
"MIT"
] | 2 | 2021-06-14T10:47:44.000Z | 2021-12-29T16:29:30.000Z | from PyQt5 import QtWidgets
import pyslm
import sys
def AdvFreqAnalyzer():
application = QtWidgets.QApplication(sys.argv)
start = pyslm.setSLM()
print('*************** PySLM.AdvFreqAnalyzer was started! ***************\n')
sys.exit(application.exec_())
print('***************** PySLM.AdvFreqAnalyzer... | 32.086957 | 81 | 0.575881 | from PyQt5 import QtWidgets
import pyslm
import sys
def AdvFreqAnalyzer():
application = QtWidgets.QApplication(sys.argv)
start = pyslm.setSLM()
print('*************** PySLM.AdvFreqAnalyzer was started! ***************\n')
sys.exit(application.exec_())
print('***************** PySLM.AdvFreqAnalyzer... | true | true |
1c1feb993310612afc9b28c202d81ed2670cb486 | 3,007 | py | Python | tests/test_fee_parser.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | tests/test_fee_parser.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | tests/test_fee_parser.py | m4rc1e/fontFeatures | 522f60ac632ab0a087477cfb57e23a96c33aee99 | [
"BSD-3-Clause"
] | null | null | null | from fontFeatures.feeLib import FeeParser, GlyphSelector
import fontFeatures.feeLib.ClassDefinition as DefineClass
from ometa.builder import writePython
from ometa.grammar import OMeta
from babelfont import Babelfont
import pytest
import os
import re
def alltrim(a):
a = re.sub("lookupflag 0;", "", a)
a = re.s... | 27.587156 | 86 | 0.600599 | from fontFeatures.feeLib import FeeParser, GlyphSelector
import fontFeatures.feeLib.ClassDefinition as DefineClass
from ometa.builder import writePython
from ometa.grammar import OMeta
from babelfont import Babelfont
import pytest
import os
import re
def alltrim(a):
a = re.sub("lookupflag 0;", "", a)
a = re.s... | true | true |
1c1fece79d2e695649ab0db1e5e892b9b8371873 | 1,796 | py | Python | lib/encryption/fernet.py | sachio222/socketchat_v3 | cd62b892842f6708055359fa2384269038f425dc | [
"MIT"
] | 1 | 2020-11-30T03:54:35.000Z | 2020-11-30T03:54:35.000Z | lib/encryption/fernet.py | sachio222/socketchat_v3 | cd62b892842f6708055359fa2384269038f425dc | [
"MIT"
] | null | null | null | lib/encryption/fernet.py | sachio222/socketchat_v3 | cd62b892842f6708055359fa2384269038f425dc | [
"MIT"
] | null | null | null | import os
from cryptography.fernet import Fernet
import config.filepaths as paths
key_path = paths.fernet128_keys + 'secret.key'
class FernetCipher():
def __init__(self, path=key_path):
self.enc_dict = {}
self.key_path = path
self._check_path(self.key_path)
try:
self.... | 26.028986 | 56 | 0.577394 | import os
from cryptography.fernet import Fernet
import config.filepaths as paths
key_path = paths.fernet128_keys + 'secret.key'
class FernetCipher():
def __init__(self, path=key_path):
self.enc_dict = {}
self.key_path = path
self._check_path(self.key_path)
try:
self.... | true | true |
1c1fed3386c7e5fae244dadf160b0725745b9c9e | 13,117 | py | Python | tests/generic_views/urls.py | shinshin86/django | 5cc81cd9eb69f5f7a711412c02039b435c393135 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2017-03-30T06:28:50.000Z | 2017-03-30T06:28:55.000Z | tests/generic_views/urls.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 57 | 2018-10-08T12:37:30.000Z | 2018-10-08T17:39:26.000Z | tests/generic_views/urls.py | Blaahborgh/django | c591bc3ccece1514d6b419826c7fa36ada9d9213 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2018-01-08T08:14:29.000Z | 2020-11-04T08:46:29.000Z | from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import path, re_path
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import views
from .models import Book
urlpatterns = [
# Temp... | 58.297778 | 119 | 0.713349 | from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import path, re_path
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import views
from .models import Book
urlpatterns = [
p... | true | true |
1c1fef279b861f536c2aff8e193ccd5eb77e9552 | 470 | py | Python | marina-rest-api/marina/urls.py | alecmerdler/cs-496 | 45323c7fc97ce1054f526b10c8c3b1e3df01f0d4 | [
"MIT"
] | null | null | null | marina-rest-api/marina/urls.py | alecmerdler/cs-496 | 45323c7fc97ce1054f526b10c8c3b1e3df01f0d4 | [
"MIT"
] | null | null | null | marina-rest-api/marina/urls.py | alecmerdler/cs-496 | 45323c7fc97ce1054f526b10c8c3b1e3df01f0d4 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from marina.views import MainView, BoatViewSet, SlipViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'boats', BoatViewSet, base_name="boats")
router.register(r'slips', SlipViewSet, base_name="s... | 27.647059 | 59 | 0.742553 | from django.conf.urls import include, url
from django.contrib import admin
from marina.views import MainView, BoatViewSet, SlipViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'boats', BoatViewSet, base_name="boats")
router.register(r'slips', SlipViewSet, base_name="s... | true | true |
1c1fef8d8244a2a7dbfd44c09a67212134a73bd1 | 7,040 | py | Python | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | import logging
import pytest
from ocs_ci.ocs import constants
from ocs_ci.framework.testlib import (
skipif_ocs_version,
ManageTest,
tier1,
skipif_ocp_version,
)
from ocs_ci.ocs.resources.pod import cal_md5sum, verify_data_integrity
from ocs_ci.helpers.helpers import wait_for_resource_state, create_pod... | 34.009662 | 87 | 0.591903 | import logging
import pytest
from ocs_ci.ocs import constants
from ocs_ci.framework.testlib import (
skipif_ocs_version,
ManageTest,
tier1,
skipif_ocp_version,
)
from ocs_ci.ocs.resources.pod import cal_md5sum, verify_data_integrity
from ocs_ci.helpers.helpers import wait_for_resource_state, create_pod... | true | true |
1c1ff088c35750ff42e68cb341cc7576fcd05130 | 2,637 | py | Python | server/auvsi_suas/migrations/0006_target_blank.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | server/auvsi_suas/migrations/0006_target_blank.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | server/auvsi_suas/migrations/0006_target_blank.py | derekbt96/interop | 13f044c831d81745f75c7baa46d0aba6694f01a9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('auvsi_suas', '0005_target'),
]
operations = [
migrations.AlterField(
model_name='target',
name='alph... | 39.358209 | 79 | 0.43193 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('auvsi_suas', '0005_target'),
]
operations = [
migrations.AlterField(
model_name='target',
name='alphanumeric',
... | true | true |
1c1ff08ddcf2fa64bb968dc44eafe37a2e72fb61 | 3,669 | py | Python | utility-service/message_pb2_grpc.py | ovaphlow/himawari | d4090f6d6369ccf207ed3d9050a0cd2fcd8c20fd | [
"MIT"
] | null | null | null | utility-service/message_pb2_grpc.py | ovaphlow/himawari | d4090f6d6369ccf207ed3d9050a0cd2fcd8c20fd | [
"MIT"
] | 22 | 2020-04-27T02:50:16.000Z | 2021-09-02T12:56:01.000Z | utility-service/message_pb2_grpc.py | ovaphlow/himawari | d4090f6d6369ccf207ed3d9050a0cd2fcd8c20fd | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import message_pb2 as message__pb2
class MessageStub(object):
"""Missing associated documentation comment in .proto file"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channe... | 37.824742 | 96 | 0.651949 |
import grpc
import message_pb2 as message__pb2
class MessageStub(object):
def __init__(self, channel):
self.Save = channel.unary_unary(
'/miscdata.Message/Save',
request_serializer=message__pb2.SaveRequest.SerializeToString,
response_deserializer=message_... | true | true |
1c1ff115fa01f934e9e80d9f2111d49d75d8dc08 | 28,963 | py | Python | src/python/pants/task/task.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 94 | 2015-01-15T21:24:20.000Z | 2022-02-16T16:55:43.000Z | src/python/pants/task/task.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 5 | 2020-07-18T01:04:43.000Z | 2021-05-10T08:40:56.000Z | src/python/pants/task/task.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 47 | 2015-02-25T02:20:07.000Z | 2022-03-21T00:59:16.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
from abc import abstractmethod
from builtins import filter, map, obj... | 39.56694 | 100 | 0.710355 |
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import sys
from abc import abstractmethod
from builtins import filter, map, object, set, str, zip
from contextlib import contextmanager
from hashlib import sha1
from itertools import repeat
from future.utils import PY3
f... | true | true |
1c1ff1ac485c0f21ac3367048d9b6c20d8162d92 | 7,530 | py | Python | main.py | yuyasugano/technical | 9bb60b961cb993d6c355793499dbc72c245f3ab2 | [
"MIT"
] | null | null | null | main.py | yuyasugano/technical | 9bb60b961cb993d6c355793499dbc72c245f3ab2 | [
"MIT"
] | null | null | null | main.py | yuyasugano/technical | 9bb60b961cb993d6c355793499dbc72c245f3ab2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import csv
import time
import json
import requests
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import mpl_finance
headers = {'Content-Type': 'application/json'}
api_url_base = 'https://public.bitbank.cc'
pair =... | 36.028708 | 128 | 0.60093 |
import csv
import time
import json
import requests
import numpy as np
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import mpl_finance
headers = {'Content-Type': 'application/json'}
api_url_base = 'https://public.bitbank.cc'
pair = 'btc_jpy'
period... | true | true |
1c1ff220354cc451d9be899c3b01a81dce15b552 | 4,461 | py | Python | builder/runner/flogo/PythonService/runner_standalone.py | SteveNY-Tibco/labs-lightcrane-services | 451e37b3daf1de567dff0af62858c849ee177ded | [
"BSD-3-Clause"
] | 1 | 2022-03-28T19:38:34.000Z | 2022-03-28T19:38:34.000Z | builder/runner/flogo/PythonService/runner_standalone.py | SteveNY-Tibco/labs-lightcrane-services | 451e37b3daf1de567dff0af62858c849ee177ded | [
"BSD-3-Clause"
] | null | null | null | builder/runner/flogo/PythonService/runner_standalone.py | SteveNY-Tibco/labs-lightcrane-services | 451e37b3daf1de567dff0af62858c849ee177ded | [
"BSD-3-Clause"
] | 4 | 2021-11-04T13:53:30.000Z | 2022-03-15T16:11:14.000Z | from __future__ import print_function
from concurrent import futures
from flask import Flask, request
from flask_restful import Resource, Api, reqparse, abort
from threading import Thread
import http.client
import io
import os
import time
import importlib
import json
try:
from urllib.parse import urlparse
except... | 33.541353 | 117 | 0.619592 | from __future__ import print_function
from concurrent import futures
from flask import Flask, request
from flask_restful import Resource, Api, reqparse, abort
from threading import Thread
import http.client
import io
import os
import time
import importlib
import json
try:
from urllib.parse import urlparse
except... | true | true |
1c1ff2395223c43ae07439de51763e30c1a3a9ae | 698 | py | Python | Scripts/Miscellaneous/Youtube_Downloader/youtube_downloader.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 437 | 2020-09-24T13:57:39.000Z | 2022-03-30T12:45:56.000Z | Scripts/Miscellaneous/Youtube_Downloader/youtube_downloader.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 355 | 2020-09-24T13:53:16.000Z | 2022-03-27T04:20:40.000Z | Scripts/Miscellaneous/Youtube_Downloader/youtube_downloader.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 315 | 2020-09-24T18:41:19.000Z | 2022-03-07T05:53:01.000Z | import youtube_dl
import sys
opts = {
"outtmpl": "./videos/%(title)s.%(ext)s",
}
def banner():
print('\t"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""')
print("\t Youtube Downloader ")
print('\t"""""""""""""""""""""""""""""""... | 21.8125 | 87 | 0.412607 | import youtube_dl
import sys
opts = {
"outtmpl": "./videos/%(title)s.%(ext)s",
}
def banner():
print('\t"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""')
print("\t Youtube Downloader ")
print('\t"""""""""""""""""""""""""""""""... | true | true |
1c1ff24f15ae94b3c8ec5ce936787a9cfc1cd46e | 5,141 | py | Python | tests/test_logic_layer.py | pietrobarbiero/pytorch_explainer | beb7d6f40acab1d0bf79bf8dfb0425c7dd4ea174 | [
"Apache-2.0"
] | 28 | 2021-06-05T17:20:09.000Z | 2022-02-24T20:59:43.000Z | tests/test_logic_layer.py | pietrobarbiero/pytorch_explainer | beb7d6f40acab1d0bf79bf8dfb0425c7dd4ea174 | [
"Apache-2.0"
] | 1 | 2021-09-24T08:00:21.000Z | 2021-10-05T10:55:00.000Z | tests/test_logic_layer.py | pietrobarbiero/pytorch_explainer | beb7d6f40acab1d0bf79bf8dfb0425c7dd4ea174 | [
"Apache-2.0"
] | 2 | 2021-08-22T09:31:07.000Z | 2021-10-03T04:51:16.000Z | import unittest
import torch
from pytorch_lightning import seed_everything
from torch.nn.functional import one_hot
import torch_explain as te
from torch_explain.logic.metrics import test_explanation, complexity, concept_consistency, formula_consistency
from torch_explain.logic.nn import entropy, psi
from torch_explai... | 36.204225 | 139 | 0.511768 | import unittest
import torch
from pytorch_lightning import seed_everything
from torch.nn.functional import one_hot
import torch_explain as te
from torch_explain.logic.metrics import test_explanation, complexity, concept_consistency, formula_consistency
from torch_explain.logic.nn import entropy, psi
from torch_explai... | true | true |
1c1ff28a4027dbe352e3736666045fbe39c096e8 | 8,669 | py | Python | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_pages_parent_section_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_pages_parent_section_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_pages_parent_section_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.821839 | 188 | 0.704233 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Asyn... | true | true |
1c1ff2ae7076a2ba0ed94ac3c5607ad3098fc78a | 1,328 | py | Python | EDScoutCore/OutputRecorder.py | MrTimbones/ed-scout | 2fd6d09368e77e214cf8e677d4569c4b81986122 | [
"MIT"
] | 116 | 2020-08-06T22:00:41.000Z | 2022-03-22T21:06:20.000Z | EDScoutCore/OutputRecorder.py | MrTimbones/ed-scout | 2fd6d09368e77e214cf8e677d4569c4b81986122 | [
"MIT"
] | 126 | 2020-08-10T03:58:00.000Z | 2022-03-11T18:21:47.000Z | EDScoutCore/OutputRecorder.py | MrTimbones/ed-scout | 2fd6d09368e77e214cf8e677d4569c4b81986122 | [
"MIT"
] | 20 | 2020-08-19T17:27:34.000Z | 2021-10-01T23:28:08.000Z | import json
import os
import platform
from pathlib import Path
from datetime import datetime
class OutputRecorder:
def __init__(self, file_name_prefix):
osname = platform.system()
if osname == 'Windows':
recording_dir = os.path.join(os.path.expanduser('~'), 'AppData', 'Loc... | 34.947368 | 114 | 0.59488 | import json
import os
import platform
from pathlib import Path
from datetime import datetime
class OutputRecorder:
def __init__(self, file_name_prefix):
osname = platform.system()
if osname == 'Windows':
recording_dir = os.path.join(os.path.expanduser('~'), 'AppData', 'Loc... | true | true |
1c1ff3406ea2e8a5bc3651d7aafdd5cf5ad0fa6f | 2,165 | py | Python | multiclass2multilabel.py | suvadeep-iitb/finetune_alexnet_with_tensorflow | 16d88f2a870ef4c0a1febc1807419f68f0481752 | [
"BSD-3-Clause"
] | null | null | null | multiclass2multilabel.py | suvadeep-iitb/finetune_alexnet_with_tensorflow | 16d88f2a870ef4c0a1febc1807419f68f0481752 | [
"BSD-3-Clause"
] | null | null | null | multiclass2multilabel.py | suvadeep-iitb/finetune_alexnet_with_tensorflow | 16d88f2a870ef4c0a1febc1807419f68f0481752 | [
"BSD-3-Clause"
] | null | null | null | import pickle
import numpy as np
from scipy.sparse import csr_matrix
import sys, os
def get_label2id(label_map_file):
label_map = open(label_map_file).readlines()
label_map = [l.split() for l in label_map]
num_labels = len(label_map)
label2id = {label_map[i][0]: i for i in range(num_labels)}
pa... | 29.657534 | 110 | 0.668822 | import pickle
import numpy as np
from scipy.sparse import csr_matrix
import sys, os
def get_label2id(label_map_file):
label_map = open(label_map_file).readlines()
label_map = [l.split() for l in label_map]
num_labels = len(label_map)
label2id = {label_map[i][0]: i for i in range(num_labels)}
pa... | true | true |
1c1ff41006a3cc5115f1df31f49dc32ff5537427 | 8,115 | py | Python | hpi_torch/fastai_learner.py | doublechenching/hpi | 68675bbd06497e41593526d7d4f58001d758c29d | [
"MIT"
] | 7 | 2019-03-12T08:47:37.000Z | 2019-10-15T13:27:41.000Z | hpi_torch/fastai_learner.py | doublechenching/hpi | 68675bbd06497e41593526d7d4f58001d758c29d | [
"MIT"
] | null | null | null | hpi_torch/fastai_learner.py | doublechenching/hpi | 68675bbd06497e41593526d7d4f58001d758c29d | [
"MIT"
] | null | null | null | #encoding: utf-8
from fastai.conv_learner import *
class DPNConvnetBuilder():
"""
# Args
ps: float list, dropout rate of dense layers
"""
def __init__(self, f,
n_classes,
is_multi,
is_reg,
ps=None,
xtra_fc=Non... | 33.8125 | 105 | 0.543068 |
from fastai.conv_learner import *
class DPNConvnetBuilder():
def __init__(self, f,
n_classes,
is_multi,
is_reg,
ps=None,
xtra_fc=None,
xtra_cut=0,
custom_head=None,
pretrained=T... | true | true |
1c1ff4cc4bc9fcd5a92d50857ff01bf4765440f9 | 52 | py | Python | Variado_GeekUniversity/guppe/geek/geek1.py | PauloFTeixeira/curso_python | 9040c7dcc5262620f6330bb9637710bb8899bc6b | [
"MIT"
] | null | null | null | Variado_GeekUniversity/guppe/geek/geek1.py | PauloFTeixeira/curso_python | 9040c7dcc5262620f6330bb9637710bb8899bc6b | [
"MIT"
] | null | null | null | Variado_GeekUniversity/guppe/geek/geek1.py | PauloFTeixeira/curso_python | 9040c7dcc5262620f6330bb9637710bb8899bc6b | [
"MIT"
] | null | null | null |
pi = 3.1456
def funcao1(a, b):
return a + b
| 6.5 | 18 | 0.519231 |
pi = 3.1456
def funcao1(a, b):
return a + b
| true | true |
1c1ff5dafa633101ac1353f79119479b70299c34 | 25,083 | py | Python | ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 applicab... | 33.759085 | 75 | 0.566559 |
import base64
import logging
import netaddr
from ryu.ofproto import ether
from ryu.ofproto import inet
from ryu.ofproto import ofproto_v1_2
from ryu.ofproto import ofproto_v1_2_parser
from ryu.lib import hub
LOG = logging.getLogger('ryu.lib.ofctl_v1_2')
DEFAULT_TIMEOUT = 1.0
def str_to_int(src):
... | true | true |
1c1ff680f37fc49ce0fd9286dfa4640457f77504 | 987 | py | Python | config.py | EsauKip/Blog-post | e5716af25139ab4e867767990f04f0749fc9bf40 | [
"MIT"
] | null | null | null | config.py | EsauKip/Blog-post | e5716af25139ab4e867767990f04f0749fc9bf40 | [
"MIT"
] | null | null | null | config.py | EsauKip/Blog-post | e5716af25139ab4e867767990f04f0749fc9bf40 | [
"MIT"
] | null | null | null | import os
import re
class Config:
'''
General configuration parent class
'''
SECRET_KEY='1a6c4143b228d08b6025c2e4b543c627'
SQLALCHEMY_DATABASE_URI ='postgresql+psycopg2://moringa:kiprono12@localhost/blogpost'
UPLOADED_PHOTOS_DEST ='app/static/photos'
MAIL_SERVER = 'smtp.googlemail.com... | 21.456522 | 89 | 0.693009 | import os
import re
class Config:
SECRET_KEY='1a6c4143b228d08b6025c2e4b543c627'
SQLALCHEMY_DATABASE_URI ='postgresql+psycopg2://moringa:kiprono12@localhost/blogpost'
UPLOADED_PHOTOS_DEST ='app/static/photos'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_... | true | true |
1c1ff6a869b0e938944893c0e7c1c53fbbe41c15 | 3,230 | bzl | Python | packages/esbuild/helpers.bzl | happy-co/rules_nodejs | 422e95b38b53476e7e214f5c51d6f197b9b589e6 | [
"Apache-2.0"
] | null | null | null | packages/esbuild/helpers.bzl | happy-co/rules_nodejs | 422e95b38b53476e7e214f5c51d6f197b9b589e6 | [
"Apache-2.0"
] | 5 | 2021-09-02T20:40:21.000Z | 2022-03-02T11:05:22.000Z | packages/esbuild/helpers.bzl | saxicek/rules_nodejs | 9d0ec93010dea6a914a190d9d6316fed7628ad71 | [
"Apache-2.0"
] | null | null | null | """
Utility helper functions for the esbuild rule
"""
load("@build_bazel_rules_nodejs//third_party/github.com/bazelbuild/bazel-skylib:lib/paths.bzl", "paths")
def strip_ext(f):
"Strips the extension of a file."
return f.short_path[:-len(f.extension) - 1]
def resolve_js_input(f, inputs):
"""Find a corresp... | 28.333333 | 118 | 0.626006 |
load("@build_bazel_rules_nodejs//third_party/github.com/bazelbuild/bazel-skylib:lib/paths.bzl", "paths")
def strip_ext(f):
return f.short_path[:-len(f.extension) - 1]
def resolve_js_input(f, inputs):
if f.extension == "js" or f.extension == "mjs":
return f
no_ext = strip_ext(f)
for i in inpu... | true | true |
1c1ff790d7a778112b50244c1858c98e436f4067 | 2,958 | py | Python | eval_f.py | toeybaa/FCN | 062719f85f78d7fb933f6271759bb8b644d2d592 | [
"BSD-2-Clause"
] | 1 | 2016-06-22T05:35:51.000Z | 2016-06-22T05:35:51.000Z | eval_f.py | toeybaa/FCN | 062719f85f78d7fb933f6271759bb8b644d2d592 | [
"BSD-2-Clause"
] | null | null | null | eval_f.py | toeybaa/FCN | 062719f85f78d7fb933f6271759bb8b644d2d592 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from PIL import Image
print 'test'
import caffe
import matplotlib.pyplot as plt
from scipy.spatial import distance as dis
import scipy as sy
plt.switch_backend('agg')
from matplotlib import cm
# load image, switch to BGR, subtract mean, and make dims C x H x W for Caffe
im = Image.open('/home/inoue... | 34.395349 | 116 | 0.629141 | import numpy as np
from PIL import Image
print 'test'
import caffe
import matplotlib.pyplot as plt
from scipy.spatial import distance as dis
import scipy as sy
plt.switch_backend('agg')
from matplotlib import cm
im = Image.open('/home/inoue/external_data/VOCdevkit/VOCdevkit/VOC2007/JPEGImages/000001.jpg')
in_... | false | true |
1c1ff7a4a8dc70e8357490bd02ebf39b282c8b65 | 878 | py | Python | app/test/test5.py | sappachok/django-anaconda | 1ffd33ded759f622b6db23a3550a898b62350403 | [
"MIT"
] | null | null | null | app/test/test5.py | sappachok/django-anaconda | 1ffd33ded759f622b6db23a3550a898b62350403 | [
"MIT"
] | 7 | 2019-12-06T05:34:28.000Z | 2021-06-10T18:25:17.000Z | app/test/test5.py | sappachok/django-datasci | 1ffd33ded759f622b6db23a3550a898b62350403 | [
"MIT"
] | null | null | null | import subprocess
import sys
import time
if __name__ == "__main__": # a guard from unintended usage
input_buffer = sys.stdin # a buffer to get the user input from
output_buffer = sys.stdout # a buffer to write rasa's output to
proc = subprocess.Popen(["python3","-i","-q","-u"], # start the process
... | 54.875 | 93 | 0.617312 | import subprocess
import sys
import time
if __name__ == "__main__":
input_buffer = sys.stdin
output_buffer = sys.stdout
proc = subprocess.Popen(["python3","-i","-q","-u"], # start the process
stdin=subprocess.PIPE, # pipe its STDIN so we can write to it
... | true | true |
1c1ff7eeb91c7345b69e020dadd606bc962ba4a3 | 19,320 | py | Python | src/utils/create.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/utils/create.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/utils/create.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | """
This module gathers all the essential database-creation
functions for the game engine's various object types.
Only objects created 'stand-alone' are in here, e.g. object Attributes
are always created directly through their respective objects.
Each creation_* function also has an alias named for the entity being
c... | 35.449541 | 118 | 0.665839 | """
This module gathers all the essential database-creation
functions for the game engine's various object types.
Only objects created 'stand-alone' are in here, e.g. object Attributes
are always created directly through their respective objects.
Each creation_* function also has an alias named for the entity being
c... | false | true |
1c1ff813164c0dc7f8aa91e308c93dc81d806a0d | 587 | py | Python | scripts/mk_defs.py | yamachu/LibOpenJTalk | 43d970cc8db98e37d5e48e725d51a0eaef04151b | [
"Unlicense"
] | 1 | 2018-02-27T17:45:51.000Z | 2018-02-27T17:45:51.000Z | scripts/mk_defs.py | yamachu/LibOpenJTalk | 43d970cc8db98e37d5e48e725d51a0eaef04151b | [
"Unlicense"
] | 2 | 2018-02-28T07:04:12.000Z | 2021-08-19T12:05:11.000Z | scripts/mk_defs.py | yamachu/LibOpenJTalk | 43d970cc8db98e37d5e48e725d51a0eaef04151b | [
"Unlicense"
] | null | null | null | import re
import os
from pathlib import Path
proj_root = Path(os.path.dirname(os.path.abspath(__file__))).parent
target_dir = proj_root / 'library'
with open(target_dir / 'libopenjtalk.h') as f:
funcs = [s.strip() for s in f if 'Open_JTalk_' in s]
func_name_re = re.compile(r'.*(Open_JTalk_.*)\(.*')
func_names =... | 27.952381 | 67 | 0.657581 | import re
import os
from pathlib import Path
proj_root = Path(os.path.dirname(os.path.abspath(__file__))).parent
target_dir = proj_root / 'library'
with open(target_dir / 'libopenjtalk.h') as f:
funcs = [s.strip() for s in f if 'Open_JTalk_' in s]
func_name_re = re.compile(r'.*(Open_JTalk_.*)\(.*')
func_names =... | true | true |
1c1ff82e3ae1114fb73f80648f940df78a7b1b4a | 12,566 | py | Python | cc/PRESUBMIT.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | cc/PRESUBMIT.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | cc/PRESUBMIT.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for cc.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit A... | 38.078788 | 86 | 0.645074 |
import re
import string
CC_SOURCE_FILES=(r'^cc[\\/].*\.(cc|h)$',)
def CheckChangeLintsClean(input_api, output_api):
source_filter = lambda x: input_api.FilterSourceFile(
x, white_list=CC_SOURCE_FILES, black_list=None)
return input_api.canned_checks.CheckChangeLintsClean(
input_api, output_api, sou... | true | true |
1c1ff8351fe470927ffb52b600cfda885c38db3f | 14,008 | py | Python | rllab/torch/algos/behavior_clone.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | rllab/torch/algos/behavior_clone.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | rllab/torch/algos/behavior_clone.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning
# submitted to NeurIPS 2019 for review
# All rights reserved.
import torch
from rllab.algos.base import Algorithm
from rllab.misc.overrides import overrides
import rllab.misc.logger as logger
import numpy as np
from rllab.torch.ut... | 53.060606 | 146 | 0.623572 |
import torch
from rllab.algos.base import Algorithm
from rllab.misc.overrides import overrides
import rllab.misc.logger as logger
import numpy as np
from rllab.torch.utils import torch as torch_utils
from rllab.dynamic_models.cartpole_model import CartPoleModel
import scipy
from tqdm import tqdm
import sys
class B... | true | true |
1c1ff94cd9adfb0c3e046cc653956de43ca4950f | 107 | py | Python | src/random_lk/_utils.py | nuuuwan/random_lk | 0dab21b67393effd86bd9c39083a88568eea7857 | [
"MIT"
] | null | null | null | src/random_lk/_utils.py | nuuuwan/random_lk | 0dab21b67393effd86bd9c39083a88568eea7857 | [
"MIT"
] | null | null | null | src/random_lk/_utils.py | nuuuwan/random_lk | 0dab21b67393effd86bd9c39083a88568eea7857 | [
"MIT"
] | null | null | null | """Utils."""
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('random_lk')
| 15.285714 | 39 | 0.747664 |
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('random_lk')
| true | true |
1c1ff9faf25f638ee9222be9caa3ea446e889840 | 637 | py | Python | testScrapeBot.py | rbuhner/PySC2_TestBot | 5c39aff91bef1123069d1173dd2bfb734829991d | [
"Apache-2.0"
] | null | null | null | testScrapeBot.py | rbuhner/PySC2_TestBot | 5c39aff91bef1123069d1173dd2bfb734829991d | [
"Apache-2.0"
] | 2 | 2020-06-26T22:54:20.000Z | 2020-06-26T22:59:05.000Z | testScrapeBot.py | rbuhner/PySC2_TestBot | 5c39aff91bef1123069d1173dd2bfb734829991d | [
"Apache-2.0"
] | null | null | null | import requests
import urllib.request
import time
from bs4 import BeautifulSoup
baseurl = 'base url here'
url = 'url goes here'
response = requests.get(url) #Response should be 200 for success
soup = BeautifulSoup(response.text, "html.parser")
soup.findAll('a') #Gets all <a> tags, or hyperlinks; returns as array, acc... | 37.470588 | 89 | 0.745683 | import requests
import urllib.request
import time
from bs4 import BeautifulSoup
baseurl = 'base url here'
url = 'url goes here'
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
soup.findAll('a') ink = soup.findAll('a')[1]['href']
download_url = baseurl + link
urllib.request.urlretriev... | false | true |
1c1ffc3f03853f17c643c49a2c5e416a9481dad3 | 385 | py | Python | ozpcenter/api/library/urls.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2018-10-05T17:03:01.000Z | 2018-10-05T17:03:01.000Z | ozpcenter/api/library/urls.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 1 | 2017-01-06T19:20:32.000Z | 2017-01-06T19:20:32.000Z | ozpcenter/api/library/urls.py | emosher/ozp-backend | d31d00bb8a28a8d0c999813f616b398f41516244 | [
"Apache-2.0"
] | 7 | 2016-12-16T15:42:05.000Z | 2020-09-05T01:11:27.000Z | """
Library URLs
"""
from django.conf.urls import url, include
from rest_framework_nested import routers
import ozpcenter.api.library.views as views
router = routers.SimpleRouter()
router.register(r'library', views.LibraryViewSet)
router.register(r'self/library', views.UserLibraryViewSet, base_name='applicationlibrar... | 24.0625 | 95 | 0.776623 | from django.conf.urls import url, include
from rest_framework_nested import routers
import ozpcenter.api.library.views as views
router = routers.SimpleRouter()
router.register(r'library', views.LibraryViewSet)
router.register(r'self/library', views.UserLibraryViewSet, base_name='applicationlibraryentry')
urlpatterns... | true | true |
1c1ffc9fbd4ce468581be16d08093ea284847ede | 1,070 | py | Python | storage/tmp.py | rdelfin/personal-site | cb89a9b9fe4d2c522e18d953c5a26e28219066e8 | [
"MIT"
] | null | null | null | storage/tmp.py | rdelfin/personal-site | cb89a9b9fe4d2c522e18d953c5a26e28219066e8 | [
"MIT"
] | null | null | null | storage/tmp.py | rdelfin/personal-site | cb89a9b9fe4d2c522e18d953c5a26e28219066e8 | [
"MIT"
] | null | null | null | from storage.interface import IStorage, KeyNotFoundError
from typing import List
import os
class TmpStorage(IStorage):
SOURCE_DIR = "/tmp/personal-site-data"
def __init__(self):
if not os.path.exists(self.SOURCE_DIR):
os.makedirs(self.SOURCE_DIR)
def get_blob(self, key: str) -> bytes... | 28.157895 | 61 | 0.584112 | from storage.interface import IStorage, KeyNotFoundError
from typing import List
import os
class TmpStorage(IStorage):
SOURCE_DIR = "/tmp/personal-site-data"
def __init__(self):
if not os.path.exists(self.SOURCE_DIR):
os.makedirs(self.SOURCE_DIR)
def get_blob(self, key: str) -> bytes... | true | true |
1c1ffccc15aadc4afdf6f36f0ebdeb0471b850c5 | 3,041 | py | Python | Experiments/Rulebased/utils.py | hellovertex/hanabi_pool_of_states | 7c70eab276e7e85c8db6b8e8de2951bdbd794dd2 | [
"Apache-2.0"
] | null | null | null | Experiments/Rulebased/utils.py | hellovertex/hanabi_pool_of_states | 7c70eab276e7e85c8db6b8e8de2951bdbd794dd2 | [
"Apache-2.0"
] | null | null | null | Experiments/Rulebased/utils.py | hellovertex/hanabi_pool_of_states | 7c70eab276e7e85c8db6b8e8de2951bdbd794dd2 | [
"Apache-2.0"
] | null | null | null | import traceback
COLORS_INV = ['B', 'W', 'G', 'Y', 'R']
RANKS_INV = [4, 3, 2, 1, 0]
C_COUNT = [3, 2, 2, 2, 1]
def stringify_env_config(cfg):
c = str(cfg['colors'])
r = str(cfg['ranks'])
p = str(cfg['players'])
h = str(cfg['hand_size'])
i = str(cfg['max_information_tokens'])
l = str(cfg['max_... | 34.556818 | 118 | 0.653732 | import traceback
COLORS_INV = ['B', 'W', 'G', 'Y', 'R']
RANKS_INV = [4, 3, 2, 1, 0]
C_COUNT = [3, 2, 2, 2, 1]
def stringify_env_config(cfg):
c = str(cfg['colors'])
r = str(cfg['ranks'])
p = str(cfg['players'])
h = str(cfg['hand_size'])
i = str(cfg['max_information_tokens'])
l = str(cfg['max_... | true | true |
1c1ffdb951781a3c163769f2140d9ec915cb8e05 | 5,253 | py | Python | iota/filters.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | iota/filters.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | iota/filters.py | joWeiss/iota.lib.py | e168aaf7101d4eea2fa98340ef793cc870270597 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from typing import Text
import filters as f
from filters.macros import filter_macro
from six import binary_type, moves as compat, text_type
from iota import Address, TryteString, TrytesCompatible
from iota.crypto.ad... | 25.62439 | 80 | 0.669713 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from typing import Text
import filters as f
from filters.macros import filter_macro
from six import binary_type, moves as compat, text_type
from iota import Address, TryteString, TrytesCompatible
from iota.crypto.addresses import... | true | true |
1c1fff05dd55b6657eec8a0c9aaede13dbed9d07 | 7,205 | py | Python | twilio/rest/pricing/v1/voice/number.py | neetaramaswamy/twilio-python | 28472ffab1a170824ba17f12a6c1692a5e849439 | [
"MIT"
] | 30 | 2018-06-12T12:00:53.000Z | 2021-05-02T01:27:16.000Z | venv/lib/python3.6/site-packages/twilio/rest/pricing/v1/voice/number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 10 | 2020-06-06T01:10:07.000Z | 2022-03-12T00:12:22.000Z | venv/lib/python3.6/site-packages/twilio/rest/pricing/v1/voice/number.py | ostar0816/mc-crypto | 80ad9896aed1dc952f819a404a458ccfad207d8e | [
"MIT"
] | 4 | 2018-06-12T14:14:20.000Z | 2018-06-19T16:01:49.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
fr... | 27.188679 | 91 | 0.602359 |
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
class NumberList(ListResource):
def __init__(self, version):
super(Numb... | true | true |
1c1fff3fadcb482ae65d5df4d99ba2d2eda88275 | 4,285 | py | Python | platformio/commands/home/command.py | StefanBruens/platformio-core | 4f1ccfe58ff5719cb72c213093a173023b960782 | [
"Apache-2.0"
] | null | null | null | platformio/commands/home/command.py | StefanBruens/platformio-core | 4f1ccfe58ff5719cb72c213093a173023b960782 | [
"Apache-2.0"
] | null | null | null | platformio/commands/home/command.py | StefanBruens/platformio-core | 4f1ccfe58ff5719cb72c213093a173023b960782 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 32.709924 | 80 | 0.673746 |
import mimetypes
import socket
from os.path import isdir
import click
from platformio import exception
from platformio.managers.core import get_core_package_dir, inject_contrib_pysite
@click.command("home", short_help="PIO Home")
@click.option("--port", type=int, default=8008, help="HTTP port, defau... | true | true |
1c1fff7fca4bd41bd722972474c9e2dc15665428 | 616 | py | Python | algo-c-to-_/examples/horner_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | algo-c-to-_/examples/horner_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | algo-c-to-_/examples/horner_.py | nobi56/aRepo | 4d444647ceedd239a1bc37bfa31ba8f204fca0ef | [
"CC0-1.0"
] | null | null | null | #
# from src/horner.c
#
# double horner(int, double a[], double) to horner
#
from horner import horner
def fmt(a):
assert len(a) > 0, "ERROR: 'a' must be a list/tuple that contains at least one element."
r = []
for i in range(len(a)-1, 1, -1):
r.append("{0} * x^{1}".format(a[i], i))
if len(a... | 23.692308 | 92 | 0.527597 |
from horner import horner
def fmt(a):
assert len(a) > 0, "ERROR: 'a' must be a list/tuple that contains at least one element."
r = []
for i in range(len(a)-1, 1, -1):
r.append("{0} * x^{1}".format(a[i], i))
if len(a) >= 2:
r.append("{0} * x".format(a[1]))
r.append(str(a[0]))
... | true | true |
1c1fffe9b2eed8c791ea376e638bd7041b783de0 | 922 | py | Python | project/RealEstateMarketPlace/views/RegisterView.py | Mihaaai/RealEstateMarketplace | 9b9fa1376436801303e1ed0207ef09845a7d827e | [
"Apache-2.0"
] | null | null | null | project/RealEstateMarketPlace/views/RegisterView.py | Mihaaai/RealEstateMarketplace | 9b9fa1376436801303e1ed0207ef09845a7d827e | [
"Apache-2.0"
] | null | null | null | project/RealEstateMarketPlace/views/RegisterView.py | Mihaaai/RealEstateMarketplace | 9b9fa1376436801303e1ed0207ef09845a7d827e | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import reverse
from django.contrib.auth import authenticate, login
from ..models import User
from django.views.generic import CreateView
from ..forms import RegisterForm
class RegisterView(CreateView):
form_class = RegisterForm
template_name = 'register_template.html'
model = User
... | 27.939394 | 66 | 0.686551 | from django.shortcuts import reverse
from django.contrib.auth import authenticate, login
from ..models import User
from django.views.generic import CreateView
from ..forms import RegisterForm
class RegisterView(CreateView):
form_class = RegisterForm
template_name = 'register_template.html'
model = User
... | true | true |
1c2000912db610c228cafad11b58910e103fefca | 10,857 | py | Python | pyoti/plugins/modifications/baseline.py | cellular-nanoscience/pyotic | 4cf68d4fd4efe2f1cbb4bb6fd61a66af0d15eaff | [
"Apache-2.0"
] | 1 | 2018-06-12T11:46:54.000Z | 2018-06-12T11:46:54.000Z | pyoti/plugins/modifications/baseline.py | cellular-nanoscience/pyotic | 4cf68d4fd4efe2f1cbb4bb6fd61a66af0d15eaff | [
"Apache-2.0"
] | 6 | 2017-09-08T09:02:20.000Z | 2018-11-14T10:22:01.000Z | pyoti/plugins/modifications/baseline.py | cellular-nanoscience/pyotic | 4cf68d4fd4efe2f1cbb4bb6fd61a66af0d15eaff | [
"Apache-2.0"
] | 3 | 2017-09-08T11:08:28.000Z | 2019-07-17T21:40:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 5 15:23:27 2017
@author: Tobias Jachowski
"""
import collections
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import UnivariateSpline
from pyoti.modification.modification import Modification, GraphicalMod
from pyoti import helpers as hp
from... | 35.480392 | 80 | 0.625495 |
import collections
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import UnivariateSpline
from pyoti.modification.modification import Modification, GraphicalMod
from pyoti import helpers as hp
from pyoti import traces as tc
from pyoti.evaluate import signal as sn
from pyoti.evaluate.tether ... | true | true |
1c2000a0c540e83de6f51c5241e3a6eba69d3149 | 603 | py | Python | News/folium.py | clowdcap/mysite | 2fd6a2f69cfc58ef012138340ae86d8896bff647 | [
"MIT"
] | null | null | null | News/folium.py | clowdcap/mysite | 2fd6a2f69cfc58ef012138340ae86d8896bff647 | [
"MIT"
] | null | null | null | News/folium.py | clowdcap/mysite | 2fd6a2f69cfc58ef012138340ae86d8896bff647 | [
"MIT"
] | null | null | null | import folium
from geopy.geocoders import Nominatim
import pandas as pd
mapa = folium.Map(
zoom_start=14,
location=[-25.371781,-49.4141514],
control_scale=True)
ler = pd.read_excel('./tables/locais.xlsx')
ler.drop_duplicates(inplace=True)
locator = Nominatim(user_agent="myGeocoder")
location = locator.ge... | 26.217391 | 87 | 0.669983 | import folium
from geopy.geocoders import Nominatim
import pandas as pd
mapa = folium.Map(
zoom_start=14,
location=[-25.371781,-49.4141514],
control_scale=True)
ler = pd.read_excel('./tables/locais.xlsx')
ler.drop_duplicates(inplace=True)
locator = Nominatim(user_agent="myGeocoder")
location = locator.ge... | true | true |
1c2001eebb0299d884ac9e1e666d3f47e4e71793 | 6,975 | py | Python | plugins/assist.py | UotaniSayo/ClanBattleAssistant | ecbaa9d5f38749a05af9a66a09ed0c56ea03424e | [
"MIT"
] | null | null | null | plugins/assist.py | UotaniSayo/ClanBattleAssistant | ecbaa9d5f38749a05af9a66a09ed0c56ea03424e | [
"MIT"
] | null | null | null | plugins/assist.py | UotaniSayo/ClanBattleAssistant | ecbaa9d5f38749a05af9a66a09ed0c56ea03424e | [
"MIT"
] | null | null | null | #assist.py
#辅助指令,与公会战报刀查刀功能不直接相关
#目前指令:
#查询boss信息
#发色图(未测试)
#查询,添加,删除作业
from __future__ import unicode_literals
from nonebot import on_command, CommandSession
from nonebot.permission import GROUP, PRIVATE_FRIEND
import re
import csv
from plugins.getEroPic import getEroPic
#指令:查询boss信息,返回boss的双防
#可选参数:boss的阶段数和编号
@o... | 24.21875 | 111 | 0.662509 |
from __future__ import unicode_literals
from nonebot import on_command, CommandSession
from nonebot.permission import GROUP, PRIVATE_FRIEND
import re
import csv
from plugins.getEroPic import getEroPic
@on_command('askBoss', aliases=['查boss', '查Boss', '查BOSS'], permission=GROUP | PRIVATE_FRIEND, only_to_me=T... | true | true |
1c20025519428ccb0fdd23b05eb693ceea055085 | 420 | py | Python | app/migrations/0008_rename_comments_comment.py | LoisaKitakaya/The-Blog | 6f2abd70e7d65de938f162b6219c468e5736a1da | [
"MIT"
] | null | null | null | app/migrations/0008_rename_comments_comment.py | LoisaKitakaya/The-Blog | 6f2abd70e7d65de938f162b6219c468e5736a1da | [
"MIT"
] | null | null | null | app/migrations/0008_rename_comments_comment.py | LoisaKitakaya/The-Blog | 6f2abd70e7d65de938f162b6219c468e5736a1da | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-02-14 13:31
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('app', '0007_comments'),
]
operations = [
migrat... | 21 | 66 | 0.635714 |
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('app', '0007_comments'),
]
operations = [
migrations.RenameModel(
old_name='Comments... | true | true |
1c20029d482e1b52a88d5df813b77725fcf50bee | 21,913 | py | Python | barectf/cli.py | auxoncorp/barectf | da3db9ccf49ccdfd91346a9284b303f17e3da459 | [
"MIT"
] | 44 | 2015-01-22T00:05:27.000Z | 2022-02-23T02:58:32.000Z | barectf/cli.py | auxoncorp/barectf | da3db9ccf49ccdfd91346a9284b303f17e3da459 | [
"MIT"
] | 21 | 2015-02-25T23:15:50.000Z | 2022-03-04T15:23:34.000Z | barectf/cli.py | auxoncorp/barectf | da3db9ccf49ccdfd91346a9284b303f17e3da459 | [
"MIT"
] | 16 | 2015-02-25T22:38:02.000Z | 2022-03-04T12:07:46.000Z | # The MIT License (MIT)
#
# Copyright (c) 2014-2020 Philippe Proulx <pproulx@efficios.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitatio... | 36.643813 | 123 | 0.661023 |
import termcolor
import os.path
import barectf
import barectf.config_parse_common as barectf_config_parse_common
import barectf.argpar as barectf_argpar
from typing import Any, List, Iterable, NoReturn
import typing
from barectf.typing import Index, Count
import sys
import os
def _print_error... | true | true |
1c2003c76d5b2ebf4cd1a19615de8de41374a32b | 4,184 | py | Python | cloudshell/devices/networking_utils.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | null | null | null | cloudshell/devices/networking_utils.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | 34 | 2016-11-28T10:52:44.000Z | 2019-10-01T08:52:59.000Z | cloudshell/devices/networking_utils.py | QualiSystems/cloudshell-networking-devices | f316cefca174975424ec21854b672335feaf8f87 | [
"Apache-2.0"
] | 1 | 2017-05-23T08:46:45.000Z | 2017-05-23T08:46:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from functools import wraps
import jsonpickle
from urlparse import urlsplit, urlunsplit
def validate_vlan_number(number):
try:
if int(number) > 4000 or int(number) < 1:
return False
except ValueError:
return False
return True
def vali... | 32.184615 | 103 | 0.571224 |
from functools import wraps
import jsonpickle
from urlparse import urlsplit, urlunsplit
def validate_vlan_number(number):
try:
if int(number) > 4000 or int(number) < 1:
return False
except ValueError:
return False
return True
def validate_vlan_range(vlan_range):
result ... | true | true |
1c2003ea0cf257f7c66b2db55def47180b3ddc68 | 567 | py | Python | api/resources_portal/migrations/0006_auto_20201203_1858.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | null | null | null | api/resources_portal/migrations/0006_auto_20201203_1858.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | 536 | 2019-11-13T15:49:03.000Z | 2022-03-28T20:17:24.000Z | api/resources_portal/migrations/0006_auto_20201203_1858.py | AlexsLemonade/resources-portal | d91c6c8d6135461faccbc78ef2b0be3f9b358f21 | [
"BSD-3-Clause"
] | 1 | 2020-04-03T02:07:29.000Z | 2020-04-03T02:07:29.000Z | # Generated by Django 2.2.13 on 2020-12-03 18:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("resources_portal", "0005_auto_20201027_2129"),
]
operations = [
migrations.RenameField(
model_name="materialrequest", old_name=... | 25.772727 | 95 | 0.634921 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("resources_portal", "0005_auto_20201027_2129"),
]
operations = [
migrations.RenameField(
model_name="materialrequest", old_name="is_active", new_name="is_active_requester",
... | true | true |
1c2004a9c55fef426508ea28558dc4b851b46110 | 4,706 | py | Python | configs/single_seg/no_src_GANloss/train_usa_disc_02.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | 1 | 2020-11-05T19:51:23.000Z | 2020-11-05T19:51:23.000Z | configs/single_seg/no_src_GANloss/train_usa_disc_02.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | configs/single_seg/no_src_GANloss/train_usa_disc_02.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | # variants
model_type = 'SingleSegXYZ'
runner = 'SingleSegRunner02'
lambda_GANLoss = 0.1
src_acc_threshold = 1.0
tgt_acc_threshold = 0.6
seg_discriminator = dict(type='FCDiscriminatorCE', in_dim=64)
seg_optimizer = dict(type='Adam', lr=0.0002, weight_decay=0.001)
return_fusion_feats = False
point_cloud_range = [-50,... | 30.166667 | 136 | 0.674458 |
model_type = 'SingleSegXYZ'
runner = 'SingleSegRunner02'
lambda_GANLoss = 0.1
src_acc_threshold = 1.0
tgt_acc_threshold = 0.6
seg_discriminator = dict(type='FCDiscriminatorCE', in_dim=64)
seg_optimizer = dict(type='Adam', lr=0.0002, weight_decay=0.001)
return_fusion_feats = False
point_cloud_range = [-50, 0, -5, 50... | true | true |
1c2004f9fcab3b22c878706ac14c45c86e7203a5 | 67,875 | py | Python | pysnmp-with-texts/A3COM-HUAWEI-IKE-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/A3COM-HUAWEI-IKE-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/A3COM-HUAWEI-IKE-MONITOR-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module A3COM-HUAWEI-IKE-MONITOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-IKE-MONITOR-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:05:17 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | 145.032051 | 6,659 | 0.782527 |
h3cCommon, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "h3cCommon")
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, SingleValueConstraint,... | true | true |
1c20085a5b6ed7d3e69b25d065229575a87f77ed | 3,082 | py | Python | src/main.py | mfjkri/cdc-helper | e9f8fd7fc80aebe911985d22c6ca46406ccd2a8a | [
"MIT"
] | 7 | 2021-12-25T14:26:04.000Z | 2022-01-23T05:26:53.000Z | src/main.py | mfjkri/cdc-helper | e9f8fd7fc80aebe911985d22c6ca46406ccd2a8a | [
"MIT"
] | null | null | null | src/main.py | mfjkri/cdc-helper | e9f8fd7fc80aebe911985d22c6ca46406ccd2a8a | [
"MIT"
] | null | null | null | #!/media/Programming/repos/py/_selenium/CDC_HELPER/venv/bin/python
import datetime
import time, sys, os
sys.path.insert(0, os.getcwd())
from src.website_handler import handler, Types
from src.utils.common import utils
from src.utils.log import Log
from src.utils.captcha.two_captcha import Captcha as TwoCaptcha
from s... | 41.648649 | 135 | 0.631733 |
import datetime
import time, sys, os
sys.path.insert(0, os.getcwd())
from src.website_handler import handler, Types
from src.utils.common import utils
from src.utils.log import Log
from src.utils.captcha.two_captcha import Captcha as TwoCaptcha
from src.utils.notifications.notification_manager import NotificationMan... | true | true |
1c20087a22d5227a8e8d46ba08be777b96f7655f | 1,534 | py | Python | sprint-challenge/aq_dashboard.py | ldtownsend/DS-Unit-3-Sprint-3-Productization-and-Cloud | 630db987a10898ef53e17b7566dfb69570a6e507 | [
"MIT"
] | null | null | null | sprint-challenge/aq_dashboard.py | ldtownsend/DS-Unit-3-Sprint-3-Productization-and-Cloud | 630db987a10898ef53e17b7566dfb69570a6e507 | [
"MIT"
] | null | null | null | sprint-challenge/aq_dashboard.py | ldtownsend/DS-Unit-3-Sprint-3-Productization-and-Cloud | 630db987a10898ef53e17b7566dfb69570a6e507 | [
"MIT"
] | null | null | null | """OpenAQ Air Quality Dashboard with Flask."""
import openaq
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
APP = Flask(__name__)
@APP.route('/')
def root():
"""Base view."""
records_over_10 = Record.query.filter(Record.value >=10).all()
return str(records_over_10)
# Functio... | 32.638298 | 82 | 0.653194 | import openaq
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
APP = Flask(__name__)
@APP.route('/')
def root():
records_over_10 = Record.query.filter(Record.value >=10).all()
return str(records_over_10)
def measurements(city='Los Angeles', parameter='pm25'):
api = openaq.Open... | true | true |
1c20093132960aa9dd358fb55a3bec8dbe5a8a8a | 1,515 | py | Python | ds/Deque.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | 2 | 2021-01-14T08:58:05.000Z | 2021-11-25T21:25:16.000Z | ds/Deque.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | null | null | null | ds/Deque.py | BaiqiangGit/Data-Structure-and-Algorithms---Python3 | 964a41f210356b8d7b192bf54a2a1eb9a754b19e | [
"Apache-2.0"
] | 1 | 2021-01-14T08:58:06.000Z | 2021-01-14T08:58:06.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## Baiqiang XIA implementation of data structures
## double ended queue
class deque(object):
## init
def __init__(self, limit):
self.deque = []
self.size = 0
self.limit = limit
## print
def __str__(self):
return ' '.join... | 26.578947 | 60 | 0.517492 |
eque = []
self.size = 0
self.limit = limit
f __str__(self):
return ' '.join([str(f) for f in self.deque])
is_empty(self):
return True if self.size == 0 else False
def is_full(self):
return True if self.size == self.limit else False
insertRear... | true | true |
1c200abab222eec95d9423c9c95eb5178053b800 | 1,251 | py | Python | set/check_strict_super_set.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 37 | 2019-04-03T07:19:57.000Z | 2022-01-09T06:18:41.000Z | set/check_strict_super_set.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 16 | 2020-08-11T08:09:42.000Z | 2021-10-30T17:40:48.000Z | set/check_strict_super_set.py | nayanapardhekar/Python | 55ea0cc1dd69192b25cb71358cd03cc2ce13be0a | [
"MIT"
] | 130 | 2019-10-02T14:40:20.000Z | 2022-01-26T17:38:26.000Z | '''
You are given a set and other sets.
Your job is to find whether set is a strict superset of each of the sets.
Print True, if is a strict superset of each of the sets. Otherwise, print False.
A strict superset has at least one element that does not exist in its subset.
Example
Set is a strict superset of ... | 23.603774 | 83 | 0.704237 |
s = set(map(int, input().split()))
n1=int(input())
c=0
for i in range(n1):
s1=set(map(int, input().split()))
if s.issuperset(s1):
c+=1
else:
print(False)
break
if c==n1:
print(True)
| true | true |
1c200bc33275499b493a585a6dc206b63470f8a2 | 15,635 | py | Python | src/perceptual_sim_training/models/dist_model.py | morzh/stylegan2-encoder-pytorch | ae3635030a0d4d88e2bd2aba301ea4b4c2dd7894 | [
"MIT"
] | null | null | null | src/perceptual_sim_training/models/dist_model.py | morzh/stylegan2-encoder-pytorch | ae3635030a0d4d88e2bd2aba301ea4b4c2dd7894 | [
"MIT"
] | null | null | null | src/perceptual_sim_training/models/dist_model.py | morzh/stylegan2-encoder-pytorch | ae3635030a0d4d88e2bd2aba301ea4b4c2dd7894 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import zoom
import f... | 42.486413 | 327 | 0.612728 |
from __future__ import absolute_import
import sys
sys.path.append('..')
sys.path.append('.')
import numpy as np
import torch
from torch import nn
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
from .base_model import BaseModel
from scipy.ndimage import zoom
import f... | true | true |
1c200bec1a191ba75df30f958193bbfbd97fc651 | 2,832 | py | Python | setup.py | OrangutanGaming/Mixer.py | b77030c1cade01f43459001fb4b111ee1cb933f7 | [
"MIT"
] | null | null | null | setup.py | OrangutanGaming/Mixer.py | b77030c1cade01f43459001fb4b111ee1cb933f7 | [
"MIT"
] | null | null | null | setup.py | OrangutanGaming/Mixer.py | b77030c1cade01f43459001fb4b111ee1cb933f7 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2019 Nihaal Sangha (Orangutan)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... | 35.848101 | 99 | 0.66702 |
import re
from setuptools import find_packages, setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
with open('mixer/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not version:
raise ... | true | true |
1c200c4abe99a47bb1db735918940a5a636402d4 | 9,195 | py | Python | resource/pypi/cffi-1.9.1/demo/_curses_build.py | hipnusleo/Laserjet | f53e0b740f48f2feb0c0bb285ec6728b313b4ccc | [
"Apache-2.0"
] | null | null | null | resource/pypi/cffi-1.9.1/demo/_curses_build.py | hipnusleo/Laserjet | f53e0b740f48f2feb0c0bb285ec6728b313b4ccc | [
"Apache-2.0"
] | null | null | null | resource/pypi/cffi-1.9.1/demo/_curses_build.py | hipnusleo/Laserjet | f53e0b740f48f2feb0c0bb285ec6728b313b4ccc | [
"Apache-2.0"
] | null | null | null | import sys
if sys.platform == 'win32':
#This module does not exist in windows
raise ImportError('No module named _curses')
from cffi import FFI
ffi = FFI()
ffi.cdef("""
typedef ... WINDOW;
typedef ... SCREEN;
typedef unsigned long... mmask_t;
typedef unsigned char bool;
typedef unsigned long...... | 28.033537 | 72 | 0.704513 | import sys
if sys.platform == 'win32':
raise ImportError('No module named _curses')
from cffi import FFI
ffi = FFI()
ffi.cdef("""
typedef ... WINDOW;
typedef ... SCREEN;
typedef unsigned long... mmask_t;
typedef unsigned char bool;
typedef unsigned long... chtype;
typedef chtype attr_t;
typ... | true | true |
1c200d9ad9a13ee99e02448d0e3823a7763ef128 | 668 | py | Python | Basic/test_merge_sort.py | Jh123x/COMP-550-Algorithms-and-Analysis | 1bc0b7fb8c48dc52cf89704557795aa87290e88b | [
"MIT"
] | null | null | null | Basic/test_merge_sort.py | Jh123x/COMP-550-Algorithms-and-Analysis | 1bc0b7fb8c48dc52cf89704557795aa87290e88b | [
"MIT"
] | null | null | null | Basic/test_merge_sort.py | Jh123x/COMP-550-Algorithms-and-Analysis | 1bc0b7fb8c48dc52cf89704557795aa87290e88b | [
"MIT"
] | null | null | null | from MergeSort import merge_sort
def test_merge_sort_random():
array = [7, 3, 5, 1, 9, 4, 2, 6, 8]
arr_cpy = array.copy()
expected = sorted(array)
result = merge_sort(arr_cpy, 0, len(arr_cpy) - 1)
assert result == expected
def test_merge_sort_reversed():
array = [i for i in range(10, 0, -1)]... | 25.692308 | 53 | 0.643713 | from MergeSort import merge_sort
def test_merge_sort_random():
array = [7, 3, 5, 1, 9, 4, 2, 6, 8]
arr_cpy = array.copy()
expected = sorted(array)
result = merge_sort(arr_cpy, 0, len(arr_cpy) - 1)
assert result == expected
def test_merge_sort_reversed():
array = [i for i in range(10, 0, -1)]... | true | true |
1c200dc819313fbcf6b8ae3a5d0898c5a799cc4f | 361 | py | Python | adaptation_methods/norm.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | 2 | 2021-10-30T06:48:05.000Z | 2021-12-17T07:19:49.000Z | adaptation_methods/norm.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | null | null | null | adaptation_methods/norm.py | kylematoba/pest | 749b3f02cc98d3bf06dc7e2142306fc6d252f3ce | [
"MIT"
] | 1 | 2022-02-21T14:51:08.000Z | 2022-02-21T14:51:08.000Z | import torch
import torch.nn as nn
from utils import freeze_except_bn
class NormTraining(nn.Module):
def __init__(self, model, **unused):
super().__init__()
self.model = model
self.model = freeze_except_bn(self.model)
def forward(self, x):
clean = torch.split(x, int(x.size(0) ... | 25.785714 | 53 | 0.645429 | import torch
import torch.nn as nn
from utils import freeze_except_bn
class NormTraining(nn.Module):
def __init__(self, model, **unused):
super().__init__()
self.model = model
self.model = freeze_except_bn(self.model)
def forward(self, x):
clean = torch.split(x, int(x.size(0) ... | true | true |
1c200df6880c2c1c72b6fe18437307eacd815fde | 7,737 | py | Python | cv_utils.py | MrDavidYu/img_utils | 707f07390b539c822dafd625febc2aa3887832c8 | [
"MIT"
] | null | null | null | cv_utils.py | MrDavidYu/img_utils | 707f07390b539c822dafd625febc2aa3887832c8 | [
"MIT"
] | null | null | null | cv_utils.py | MrDavidYu/img_utils | 707f07390b539c822dafd625febc2aa3887832c8 | [
"MIT"
] | null | null | null | import cv2
import math
import numpy as np
from PIL import Image
import pytesseract
"""
List of helper, enhancement and transformation funcs commonly used for OCR and
CV processing given image or bounding box information. N.B. bbox format in
Tensorflow Object Detection format, i.e. [y_min, x_min, y_max, x_max]... | 38.1133 | 80 | 0.643531 | import cv2
import math
import numpy as np
from PIL import Image
import pytesseract
def apply_OCR(img, img_num):
ret_string = "test"
SCREEN_WIDTH = 128
SCREEN_HEIGHT = 64
if img is None:
print("Reading image failed, img is None")
exit(1)
... | true | true |
1c200e99d37c41ae15baba182ff4c3fc113ed689 | 1,721 | py | Python | main/forms.py | h4k1m13or/SEEKJOBS | 03b4619b802563b37f837fc9b405719d64935dd0 | [
"MIT"
] | 2 | 2021-03-16T21:47:17.000Z | 2021-03-20T10:44:00.000Z | main/forms.py | h4k1m13or/SEEKJOBS | 03b4619b802563b37f837fc9b405719d64935dd0 | [
"MIT"
] | null | null | null | main/forms.py | h4k1m13or/SEEKJOBS | 03b4619b802563b37f837fc9b405719d64935dd0 | [
"MIT"
] | null | null | null | from django import forms
class RegistrationForm(forms.Form):
email = forms.EmailField(required=True)
username = forms.CharField(max_length=32)
password1 = forms.CharField(widget=forms.PasswordInput, max_length=32)
sexe = forms.CharField(max_length=10)
first_name = forms.CharField(max_length=50)
... | 27.31746 | 74 | 0.722836 | from django import forms
class RegistrationForm(forms.Form):
email = forms.EmailField(required=True)
username = forms.CharField(max_length=32)
password1 = forms.CharField(widget=forms.PasswordInput, max_length=32)
sexe = forms.CharField(max_length=10)
first_name = forms.CharField(max_length=50)
... | true | true |
1c2010704907500890c01c424e85d6fbc85c8800 | 1,485 | py | Python | plugins/markdown.py | magentix/magentix.github.io | c1096c791acb04ccd857bef30d71839ad8328b5d | [
"BSD-2-Clause"
] | null | null | null | plugins/markdown.py | magentix/magentix.github.io | c1096c791acb04ccd857bef30d71839ad8328b5d | [
"BSD-2-Clause"
] | null | null | null | plugins/markdown.py | magentix/magentix.github.io | c1096c791acb04ccd857bef30d71839ad8328b5d | [
"BSD-2-Clause"
] | null | null | null | """
Copyright (c) 2022, Magentix
This code is licensed under simplified BSD license (see LICENSE for details)
StaPy Markdown Plugin - Version 1.0.0
Requirements:
- markdown
- pymdown-extensions
"""
import markdown
import os
import re
def file_content_opened(content: str, args: dict) -> str:
if _get_file_extensio... | 31.595745 | 96 | 0.664646 | import markdown
import os
import re
def file_content_opened(content: str, args: dict) -> str:
if _get_file_extension(args['path']) != 'md':
return content
extensions = ['fenced_code', 'tables', 'attr_list', 'md_in_html', 'pymdownx.tilde', 'nl2br']
content = markdown.markdown(content, tab_length=2,... | true | true |
1c20108d9fe28981a3553a255df7ab05f5f74d45 | 10,103 | py | Python | app/api/employee/query.py | lunyamwis/appraisal-system | 6bee12acd3507a59411b6ed5c5fc515cf7ccfbc0 | [
"MIT"
] | null | null | null | app/api/employee/query.py | lunyamwis/appraisal-system | 6bee12acd3507a59411b6ed5c5fc515cf7ccfbc0 | [
"MIT"
] | 1 | 2021-08-12T06:17:52.000Z | 2021-08-12T06:17:52.000Z | app/api/employee/query.py | lunyamwis/appraisal-system | 6bee12acd3507a59411b6ed5c5fc515cf7ccfbc0 | [
"MIT"
] | null | null | null | import graphene
from django.db.models import Q
from graphene_django.types import ObjectType
from graphql_extensions.auth.decorators import login_required
from graphene.types.generic import GenericScalar
from app.api.helpers.pagination_helper import pagination_helper
from app.api.helpers.permission_required import toke... | 35.449123 | 82 | 0.625656 | import graphene
from django.db.models import Q
from graphene_django.types import ObjectType
from graphql_extensions.auth.decorators import login_required
from graphene.types.generic import GenericScalar
from app.api.helpers.pagination_helper import pagination_helper
from app.api.helpers.permission_required import toke... | true | true |
1c2011ae5acf14f58aecb430ea463efd1946abbf | 14,005 | py | Python | third_party/tests/Ibex/vendor/lowrisc_ip/dvsim/testplanner/class_defs.py | parzival3/Surelog | cf126533ebfb2af7df321057af9e3535feb30487 | [
"Apache-2.0"
] | 156 | 2019-11-16T17:29:55.000Z | 2022-01-21T05:41:13.000Z | third_party/tests/Ibex/vendor/lowrisc_ip/dvsim/testplanner/class_defs.py | parzival3/Surelog | cf126533ebfb2af7df321057af9e3535feb30487 | [
"Apache-2.0"
] | 414 | 2021-06-11T07:22:01.000Z | 2022-03-31T22:06:14.000Z | third_party/tests/Ibex/vendor/lowrisc_ip/dvsim/testplanner/class_defs.py | parzival3/Surelog | cf126533ebfb2af7df321057af9e3535feb30487 | [
"Apache-2.0"
] | 30 | 2019-11-18T16:31:40.000Z | 2021-12-26T01:22:51.000Z | # Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""TestplanEntry and Testplan classes for maintaining testplan entries
"""
import re
import sys
from collections import OrderedDict
import mistletoe
from tabulate import ... | 39.562147 | 94 | 0.503963 |
import re
import sys
from collections import OrderedDict
import mistletoe
from tabulate import tabulate
class TestplanEntry():
name = ""
desc = ""
milestone = ""
tests = []
fields = ("name", "desc", "milestone", "tests")
milestones = ("N.A.", "V1", "V2", "V3")
def __init__(self, nam... | true | true |
1c2011ba866798a80b5bfd0aeff3db726c417370 | 2,720 | py | Python | append_new_normal_form.py | Jacfger/simple-stuffs | 5596a03ec7a42a2f32b695ed73afb8c6a3cce030 | [
"MIT"
] | 9 | 2021-09-19T18:20:43.000Z | 2022-03-07T07:58:28.000Z | append_new_normal_form.py | Jacfger/simple-stuffs | 5596a03ec7a42a2f32b695ed73afb8c6a3cce030 | [
"MIT"
] | 1 | 2022-03-09T08:15:17.000Z | 2022-03-09T08:15:17.000Z | append_new_normal_form.py | Jacfger/simple-stuffs | 5596a03ec7a42a2f32b695ed73afb8c6a3cce030 | [
"MIT"
] | 3 | 2021-09-23T07:27:47.000Z | 2022-03-07T08:45:51.000Z | import argparse
import os
import pandas as pd
import json
from pandas.core.frame import DataFrame
from fol.foq_v2 import (concate_n_chains, copy_query,
negation_sink,
binary_formula_iterator,
concate_iu_chains,
decompose_D... | 35.789474 | 108 | 0.615074 | import argparse
import os
import pandas as pd
import json
from pandas.core.frame import DataFrame
from fol.foq_v2 import (concate_n_chains, copy_query,
negation_sink,
binary_formula_iterator,
concate_iu_chains,
decompose_D... | true | true |
1c20123ca4936442ac924594699ffce3742cabfd | 987 | py | Python | 01_mysite/mysite/urls.py | victordomingos/Learning_Django | 2fb51224d02b50bee69c6c2c773eecf4e4485cfb | [
"MIT"
] | 1 | 2020-03-10T15:09:14.000Z | 2020-03-10T15:09:14.000Z | 01_mysite/mysite/urls.py | victordomingos/Learning_Django | 2fb51224d02b50bee69c6c2c773eecf4e4485cfb | [
"MIT"
] | null | null | null | 01_mysite/mysite/urls.py | victordomingos/Learning_Django | 2fb51224d02b50bee69c6c2c773eecf4e4485cfb | [
"MIT"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.961538 | 85 | 0.703141 | from django.contrib import admin
from django.contrib.auth import views
from django.urls import path, include
urlpatterns = [
path('accounts/login/', views.LoginView.as_view(), name='login'),
path('accounts/logout/', views.LogoutView.as_view(next_page='/'), name='logout'),
path('admin/', admin.site.urls),
... | true | true |
1c20129aa5685e97c7fc85e0bb8e139602aebe55 | 1,632 | py | Python | tests/stream/test_library.py | rdbhost/mopidy | cb15ccef08b15c30ab6cbbac2419622d0804e7ac | [
"Apache-2.0"
] | null | null | null | tests/stream/test_library.py | rdbhost/mopidy | cb15ccef08b15c30ab6cbbac2419622d0804e7ac | [
"Apache-2.0"
] | null | null | null | tests/stream/test_library.py | rdbhost/mopidy | cb15ccef08b15c30ab6cbbac2419622d0804e7ac | [
"Apache-2.0"
] | null | null | null | import mock
import pytest
from mopidy.internal import path
from mopidy.models import Track
from mopidy.stream import actor
from tests import path_to_data_dir
@pytest.fixture
def config():
return {
"proxy": {},
"stream": {
"timeout": 1000,
"metadata_blacklist": [],
... | 25.5 | 73 | 0.70098 | import mock
import pytest
from mopidy.internal import path
from mopidy.models import Track
from mopidy.stream import actor
from tests import path_to_data_dir
@pytest.fixture
def config():
return {
"proxy": {},
"stream": {
"timeout": 1000,
"metadata_blacklist": [],
... | true | true |
1c2013293575f660aea5a3daaeb4db43e4e6784f | 1,105 | py | Python | utilities/word_coverage.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 21 | 2018-08-05T15:13:00.000Z | 2021-09-29T04:42:30.000Z | utilities/word_coverage.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 5 | 2019-02-10T12:48:32.000Z | 2021-06-16T10:30:22.000Z | utilities/word_coverage.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 7 | 2019-07-12T12:41:43.000Z | 2022-03-24T14:27:04.000Z | from sklearn.feature_extraction.text import CountVectorizer
from gensim.models.keyedvectors import KeyedVectors
import datasetUtils as dsu
import numpy as np
def countWords(embeddings_dataset):
tot_words = 0
found_words = 0
for document in data:
words = analyzer(document)
if len(words) < 1:... | 29.078947 | 67 | 0.663348 | from sklearn.feature_extraction.text import CountVectorizer
from gensim.models.keyedvectors import KeyedVectors
import datasetUtils as dsu
import numpy as np
def countWords(embeddings_dataset):
tot_words = 0
found_words = 0
for document in data:
words = analyzer(document)
if len(words) < 1:... | true | true |
1c2013bf2028d7cbb724ad158588fa5ef3a19f2f | 9,824 | py | Python | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import rlkit.misc.hyperparameter as hyp
from rlkit.demos.source.dict_to_mdp_path_loader import EncoderDictToMDPPathLoader
from rlkit.launchers.experiments.ashvin.awac_rig import awac_rig_experiment
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.arglauncher import run_variants
from rlkit.t... | 36.117647 | 126 | 0.610037 | import rlkit.misc.hyperparameter as hyp
from rlkit.demos.source.dict_to_mdp_path_loader import EncoderDictToMDPPathLoader
from rlkit.launchers.experiments.ashvin.awac_rig import awac_rig_experiment
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.arglauncher import run_variants
from rlkit.t... | true | true |
1c20145bde8f7e81289601e644b5731db0380352 | 2,437 | py | Python | src/test_servers.py | adriennekarnoski/http-server | 9316323066e72d33932e9f0a4f999bde7d5451b0 | [
"MIT"
] | null | null | null | src/test_servers.py | adriennekarnoski/http-server | 9316323066e72d33932e9f0a4f999bde7d5451b0 | [
"MIT"
] | null | null | null | src/test_servers.py | adriennekarnoski/http-server | 9316323066e72d33932e9f0a4f999bde7d5451b0 | [
"MIT"
] | null | null | null | """Testing server response to requests."""
from server import response_error
from client import client_socket
from server import response_ok
from server import parse_request
def test_response_message_response():
"""Testing for ok msg function."""
ok_message = response_ok((1, 2, 3))
assert ok_message[:15] ... | 30.4625 | 106 | 0.688551 | from server import response_error
from client import client_socket
from server import response_ok
from server import parse_request
def test_response_message_response():
ok_message = response_ok((1, 2, 3))
assert ok_message[:15] == 'HTTP/1.1 200 OK'
def test_405_error_message_response():
returned = clien... | true | true |
1c20147c51dc26c669259716d94fa4808b838410 | 83,881 | py | Python | tensorflow/python/training/saver_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2016-12-12T09:46:14.000Z | 2016-12-12T09:46:14.000Z | tensorflow/python/training/saver_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/saver_test.py | connectthefuture/tensorflow | 93812423fcd5878aa2c1d0b68dc0496980c8519d | [
"Apache-2.0"
] | 1 | 2019-11-04T11:58:30.000Z | 2019-11-04T11:58:30.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... | 41.36144 | 112 | 0.649217 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import math
import os.path
import random
import shutil
import tempfile
import time
import numpy as np
import six
import tensorflow as tf
from google.protobuf.any_pb2 import An... | true | true |
1c201485c79ac3c3b6f2f97f7f51edb3ea493866 | 1,040 | py | Python | app/core/migrations/0004_recipe.py | Einsicht1/recipe-app-api | cae04fe08158191a5081c8d3832bab7abc9eca39 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Einsicht1/recipe-app-api | cae04fe08158191a5081c8d3832bab7abc9eca39 | [
"MIT"
] | null | null | null | app/core/migrations/0004_recipe.py | Einsicht1/recipe-app-api | cae04fe08158191a5081c8d3832bab7abc9eca39 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-31 04:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
... | 35.862069 | 118 | 0.603846 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_ingredient'),
]
operations = [
migrations.CreateModel(
name='Recipe',
fields=[
... | true | true |
1c201569ddb864ec1b9511f1b0549cbfa1fbd37c | 16,330 | bzl | Python | haskell/nixpkgs.bzl | niteria/rules_haskell | 38548f1e773f764d06b04f927b46316029a3029c | [
"Apache-2.0"
] | null | null | null | haskell/nixpkgs.bzl | niteria/rules_haskell | 38548f1e773f764d06b04f927b46316029a3029c | [
"Apache-2.0"
] | null | null | null | haskell/nixpkgs.bzl | niteria/rules_haskell | 38548f1e773f764d06b04f927b46316029a3029c | [
"Apache-2.0"
] | null | null | null | """Workspace rules (Nixpkgs)"""
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_package",
"nixpkgs_sh_posix_configure",
)
load(
":private/pkgdb_to_bzl.bzl",
"pkgdb_to_bzl",
)
load(
":private/workspace_utils.bzl",
"define_rule",
"execute_or_fail_loudly",
"resolve_label... | 40.221675 | 140 | 0.690998 |
load(
"@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl",
"nixpkgs_package",
"nixpkgs_sh_posix_configure",
)
load(
":private/pkgdb_to_bzl.bzl",
"pkgdb_to_bzl",
)
load(
":private/workspace_utils.bzl",
"define_rule",
"execute_or_fail_loudly",
"resolve_labels",
)
load(":private/validate_at... | true | true |
1c2015bb819aad92b81ec8b1a7fddcd96c2e1135 | 11,727 | py | Python | python/DL_for_HTT/post_training/utils.py | lucastorterotot/DL_for_HTT_mass | 2aff7741b5f497114dd826f9b167f66f2cdaa329 | [
"MIT"
] | null | null | null | python/DL_for_HTT/post_training/utils.py | lucastorterotot/DL_for_HTT_mass | 2aff7741b5f497114dd826f9b167f66f2cdaa329 | [
"MIT"
] | null | null | null | python/DL_for_HTT/post_training/utils.py | lucastorterotot/DL_for_HTT_mass | 2aff7741b5f497114dd826f9b167f66f2cdaa329 | [
"MIT"
] | 1 | 2021-06-17T07:46:29.000Z | 2021-06-17T07:46:29.000Z | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import DL_for_HTT.common.NN_settings as NN_default_settings
import DL_for_HTT.post_training.macros as macros
def load_model_from_json(input_json):
model_name = input_json.split('/')[-1].replace('.json', '')
if model_name[:3] =... | 39.352349 | 162 | 0.565618 | import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import DL_for_HTT.common.NN_settings as NN_default_settings
import DL_for_HTT.post_training.macros as macros
def load_model_from_json(input_json):
model_name = input_json.split('/')[-1].replace('.json', '')
if model_name[:3] =... | true | true |
1c2015eba7745db9bb8c8ec0a7e63e292c179d4a | 5,530 | py | Python | paperboy/scheduler/airflow/paperboy.airflow.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 233 | 2018-11-01T09:17:08.000Z | 2022-03-22T08:27:24.000Z | paperboy/scheduler/airflow/paperboy.airflow.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 99 | 2018-10-17T21:48:42.000Z | 2021-05-07T08:33:36.000Z | paperboy/scheduler/airflow/paperboy.airflow.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 29 | 2018-11-01T11:33:08.000Z | 2022-01-12T22:12:19.000Z | # This is the jinja2 templatized DAG that generates
# the job operator. It has the following form as an
# example:
#
# Job -> Report -> Papermill -> NBConvert -> ReportPost -\
# \--> Report -> Papermill -> Voila -> Dokku -> ReportPost --\
# \-> Report -> Papermill -> NBConvert -> ReportPost ----... | 33.113772 | 99 | 0.613743 |
import json
from base64 import b64decode
from paperboy.scheduler.airflow_operators import JobOperator, JobCleanupOperator
from paperboy.scheduler.airflow_operators import ReportOperator, ReportPostOperator
from paperboy.scheduler.airflow_operators import PapermillOperator, NBConvertOperator
from paperb... | true | true |
1c2015f15788d0e742ce7a920fcfd3c4faf9c7af | 865 | py | Python | Python3/224.basic-calculator.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/224.basic-calculator.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/224.basic-calculator.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=224 lang=python3
#
# [224] Basic Calculator
#
# @lc code=start
class Solution(object):
def calculate(self, s):
"""
:type s: str
:rtype: int
"""
res, num, sign = 0, 0, 1
stack = []
for c in s:
if c.isdigit():
... | 22.179487 | 44 | 0.36185 |
class Solution(object):
def calculate(self, s):
res, num, sign = 0, 0, 1
stack = []
for c in s:
if c.isdigit():
num = 10 * num + int(c)
elif c == "+" or c == "-":
res = res + sign * num
num = 0
sig... | true | true |
1c20165ad9baba1582e479640328378d62360a3f | 4,493 | py | Python | lenstronomy/Workflow/alignment_matching.py | Thomas-01/lenstronomy | 36db4c7f43ba28d6bdecdab1f15c537043f4a286 | [
"MIT"
] | null | null | null | lenstronomy/Workflow/alignment_matching.py | Thomas-01/lenstronomy | 36db4c7f43ba28d6bdecdab1f15c537043f4a286 | [
"MIT"
] | null | null | null | lenstronomy/Workflow/alignment_matching.py | Thomas-01/lenstronomy | 36db4c7f43ba28d6bdecdab1f15c537043f4a286 | [
"MIT"
] | null | null | null | __author__ = 'sibirrer'
import time
import copy
from lenstronomy.Sampling.sampler import choose_pool
from lenstronomy.ImSim.MultiBand.single_band_multi_model import SingleBandMultiModel
from lenstronomy.Sampling.Samplers.pso import ParticleSwarmOptimizer
class AlignmentFitting(object):
"""
class which execut... | 33.529851 | 131 | 0.647229 | __author__ = 'sibirrer'
import time
import copy
from lenstronomy.Sampling.sampler import choose_pool
from lenstronomy.ImSim.MultiBand.single_band_multi_model import SingleBandMultiModel
from lenstronomy.Sampling.Samplers.pso import ParticleSwarmOptimizer
class AlignmentFitting(object):
def __init__(self, multi_b... | true | true |
1c2016eb219245c9e7f7e3aa881e2b3e4b0c3241 | 253 | py | Python | sheerland/sheerland/doctype/company/company.py | geylduron/agriapp | d68bb68bd78431ca49a5509c6d690747e09ef4f5 | [
"MIT"
] | null | null | null | sheerland/sheerland/doctype/company/company.py | geylduron/agriapp | d68bb68bd78431ca49a5509c6d690747e09ef4f5 | [
"MIT"
] | null | null | null | sheerland/sheerland/doctype/company/company.py | geylduron/agriapp | d68bb68bd78431ca49a5509c6d690747e09ef4f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017, sheerland and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Company(Document):
pass
| 23 | 49 | 0.778656 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Company(Document):
pass
| true | true |
1c201717a034175893a71c54841e652b1f02c5d7 | 45,767 | py | Python | lingvo/core/quant_utils.py | xsppp/gpipe_with_Mnist | 4486e675c7b52c7519a6d39f97e9b22ed5461944 | [
"Apache-2.0"
] | 1 | 2020-10-19T06:14:06.000Z | 2020-10-19T06:14:06.000Z | lingvo/core/quant_utils.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | lingvo/core/quant_utils.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2018 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 ... | 34.963331 | 80 | 0.670505 |
import lingvo.compat as tf
from lingvo.core import base_layer
from lingvo.core import hyperparams
from lingvo.core import py_utils
from lingvo.core import summary_utils
import numpy as np
class QuantizableLayer(base_layer.BaseLayer):
@classmethod
def Params(cls):
p = super().Params()
p.De... | true | true |
1c2018ef2b0668a5fe5beb054b65048e4b7306a7 | 3,057 | py | Python | source/banco/bd_calibracao.py | Atzingen/controleForno-interface | 6a8968527f8b76c7d0c7ea26f8c8aca728fe4d2d | [
"MIT"
] | null | null | null | source/banco/bd_calibracao.py | Atzingen/controleForno-interface | 6a8968527f8b76c7d0c7ea26f8c8aca728fe4d2d | [
"MIT"
] | 5 | 2016-09-06T15:54:00.000Z | 2016-09-15T15:05:41.000Z | source/banco/bd_calibracao.py | Atzingen/controleForno-interface | 6a8968527f8b76c7d0c7ea26f8c8aca728fe4d2d | [
"MIT"
] | null | null | null | # -*- coding: latin-1 -*-
import sqlite3, datetime
def cria_tabela_calibracao(caminho_banco):
try:
db = sqlite3.connect(caminho_banco)
cursor = db.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS calibracao
(id INTEGER PRIMARY KEY,nome TEXT,s1_A REAL,s2_A REAL,s3_A REAL,s4_A REAL,s5_A REAL,s6_A REAL,
... | 29.114286 | 96 | 0.690873 |
import sqlite3, datetime
def cria_tabela_calibracao(caminho_banco):
try:
db = sqlite3.connect(caminho_banco)
cursor = db.cursor()
cursor.execute('''CREATE TABLE IF NOT EXISTS calibracao
(id INTEGER PRIMARY KEY,nome TEXT,s1_A REAL,s2_A REAL,s3_A REAL,s4_A REAL,s5_A REAL,s6_A REAL,
s1_B REAL,s2_B REAL,... | false | true |
1c201967a4247939514eb64f9b46f0e398bafa1b | 503 | py | Python | emojiApi.py | RoryAlexis/BibleEmojiMaker | 8d8aff9cc211faab7acdf69fc1b423c2c874eca8 | [
"MIT"
] | null | null | null | emojiApi.py | RoryAlexis/BibleEmojiMaker | 8d8aff9cc211faab7acdf69fc1b423c2c874eca8 | [
"MIT"
] | null | null | null | emojiApi.py | RoryAlexis/BibleEmojiMaker | 8d8aff9cc211faab7acdf69fc1b423c2c874eca8 | [
"MIT"
] | null | null | null | import requests
import json
def getEmoji(myWord):
myAPIkey = "8cb402f051b482a2dac6edef871dfdb2910c8aa2"
apiURL = "https://emoji-api.com/emojis?search={}&access_key={}".format(myWord, myAPIkey)
try:
page = requests.get(apiURL)
emojiJSON = page.json()[0]
emojiToReturn = emoji... | 31.4375 | 97 | 0.642147 | import requests
import json
def getEmoji(myWord):
myAPIkey = "8cb402f051b482a2dac6edef871dfdb2910c8aa2"
apiURL = "https://emoji-api.com/emojis?search={}&access_key={}".format(myWord, myAPIkey)
try:
page = requests.get(apiURL)
emojiJSON = page.json()[0]
emojiToReturn = emoji... | true | true |
1c201a1a82f83b95af069718c7acff3ceef63360 | 19,110 | py | Python | acq4/pyqtgraph/reload.py | aaronoldre/acq4 | 92bb41d1bc11dbfe24ec9030e0c556708839fe4a | [
"MIT"
] | null | null | null | acq4/pyqtgraph/reload.py | aaronoldre/acq4 | 92bb41d1bc11dbfe24ec9030e0c556708839fe4a | [
"MIT"
] | null | null | null | acq4/pyqtgraph/reload.py | aaronoldre/acq4 | 92bb41d1bc11dbfe24ec9030e0c556708839fe4a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Magic Reload Library
Luke Campagnola 2010
Python reload function that actually works (the way you expect it to)
- No re-importing necessary
- Modules can be reloaded in any order
- Replaces functions and methods with their updated code
- Changes instances to use updated classes
- Aut... | 33.763251 | 213 | 0.586342 |
from __future__ import print_function
import inspect, os, sys, gc, traceback, types
from .debug import printExc
try:
from importlib import reload as orig_reload
except ImportError:
orig_reload = reload
py3 = sys.version_info >= (3,)
def reloadAll(prefix=None, debug=False):
failed = []
changed = [... | true | true |
1c201b532f5ab41bd5d223c4ea4eacb24c1a668e | 2,548 | py | Python | homeassistant/components/hydrawise/binary_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/hydrawise/binary_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/hydrawise/binary_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for Hydrawise sprinkler binary sensors."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA,
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.const... | 30.333333 | 85 | 0.709184 | from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA,
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant... | true | true |
1c201ca88ed360bb7cfaae219abe252e13885fe7 | 332 | py | Python | Ejercicios/c. Listas de listas/Ejercicios listas de listas -ImprimirCulebra - Nivel5.py | lufe089/material-intro-prog | c5b653587aa128e957d31b7f818795303da216d5 | [
"MIT"
] | 1 | 2022-01-30T17:19:08.000Z | 2022-01-30T17:19:08.000Z | Ejercicios/c. Listas de listas/Ejercicios listas de listas -ImprimirCulebra - Nivel5.py | lufe089/material-intro-prog | c5b653587aa128e957d31b7f818795303da216d5 | [
"MIT"
] | null | null | null | Ejercicios/c. Listas de listas/Ejercicios listas de listas -ImprimirCulebra - Nivel5.py | lufe089/material-intro-prog | c5b653587aa128e957d31b7f818795303da216d5 | [
"MIT"
] | 1 | 2021-12-27T15:47:04.000Z | 2021-12-27T15:47:04.000Z | # Haga un programa que imprima el recorrido de una matriz en forma de culebra.
# Ejemplo
# Dada la siguiente matriz:
# [[1, 2, 3, 4, 5],
# [6, 7, 8, 9, 10],
# [11, 12, 13, 14, 15],
# [16, 17, 18, 19, 20],
# [21, 22, 23, 24, 25]]
# Su programa debe imprimir:
# 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 ... | 25.538462 | 78 | 0.584337 | true | true | |
1c201dacd38962ab9d7efd4a2c6d6bdb0d82844f | 2,491 | py | Python | baselines/cmaes/logs/default/source_files/agent.py | StanfordVL/lagom | e5994df7f866e35cb30140bae0d997e3f63ea876 | [
"MIT"
] | 1 | 2020-01-09T06:43:13.000Z | 2020-01-09T06:43:13.000Z | baselines/cmaes/logs/default/source_files/agent.py | StanfordVL/lagom | e5994df7f866e35cb30140bae0d997e3f63ea876 | [
"MIT"
] | null | null | null | baselines/cmaes/logs/default/source_files/agent.py | StanfordVL/lagom | e5994df7f866e35cb30140bae0d997e3f63ea876 | [
"MIT"
] | 1 | 2019-05-13T06:29:11.000Z | 2019-05-13T06:29:11.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from gym.spaces import Discrete
from gym.spaces import Box
from lagom import BaseAgent
from lagom.utils import pickle_dump
from lagom.envs import flatdim
from lagom.envs.wrappers import get_wrapper
from l... | 36.101449 | 127 | 0.662385 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from gym.spaces import Discrete
from gym.spaces import Box
from lagom import BaseAgent
from lagom.utils import pickle_dump
from lagom.envs import flatdim
from lagom.envs.wrappers import get_wrapper
from l... | true | true |
1c201e152f818759d71dacff84a066faa0ae5998 | 1,373 | py | Python | app/cookie_and_header_params.py | girip11/fastapi_tryouts | 137a20a703f8e68956c4ef43fffa6be8bf43757a | [
"MIT"
] | null | null | null | app/cookie_and_header_params.py | girip11/fastapi_tryouts | 137a20a703f8e68956c4ef43fffa6be8bf43757a | [
"MIT"
] | 1 | 2021-04-01T04:41:53.000Z | 2021-04-01T04:41:53.000Z | app/cookie_and_header_params.py | girip11/fastapi_tryouts | 137a20a703f8e68956c4ef43fffa6be8bf43757a | [
"MIT"
] | null | null | null | from typing import Optional, List
from fastapi import APIRouter, Cookie, Header
router = APIRouter()
# Cookies can have parameter validation and data type conversion
# similar Path, Body, Query
@router.get("/cookie_params/")
async def get_cookie_params(dummy_cookie: Optional[str] = Cookie(None)):
return {"dummy_... | 40.382353 | 150 | 0.742899 | from typing import Optional, List
from fastapi import APIRouter, Cookie, Header
router = APIRouter()
@router.get("/cookie_params/")
async def get_cookie_params(dummy_cookie: Optional[str] = Cookie(None)):
return {"dummy_cookie": dummy_cookie}
@router.get("/header_params/")
async def get_header_params(
... | true | true |
1c201e7f9d70a85f498d7306bede8b631b98b457 | 260 | py | Python | common/gameConstants.py | climbablebug44/synergy | dc9bec9da56d436842151e9ceaf004a7db3ed8d0 | [
"MIT"
] | null | null | null | common/gameConstants.py | climbablebug44/synergy | dc9bec9da56d436842151e9ceaf004a7db3ed8d0 | [
"MIT"
] | null | null | null | common/gameConstants.py | climbablebug44/synergy | dc9bec9da56d436842151e9ceaf004a7db3ed8d0 | [
"MIT"
] | null | null | null | """
Constants for the game
File has no individual meaning
"""
color = {
"BLACK": (0, 0, 0),
"GREEN": (0, 255, 0),
"RED": (255, 0, 0),
"BLUE": (255, 0, 0),
"WHITE": (255, 255, 255)
}
screenSize = (800, 600)
playerSize = (100, 124)
| 16.25 | 34 | 0.503846 |
color = {
"BLACK": (0, 0, 0),
"GREEN": (0, 255, 0),
"RED": (255, 0, 0),
"BLUE": (255, 0, 0),
"WHITE": (255, 255, 255)
}
screenSize = (800, 600)
playerSize = (100, 124)
| true | true |
1c201e83b16b2734b33f541658e4061cb5f9896a | 8,583 | py | Python | bamboos/docker/environment/common.py | onedata/web-client | 58905dfb8d1e7d85e4fe1dd87ba93ae0b5d04519 | [
"MIT"
] | 1 | 2017-10-10T16:38:15.000Z | 2017-10-10T16:38:15.000Z | bamboos/docker/environment/common.py | onedata/web-client | 58905dfb8d1e7d85e4fe1dd87ba93ae0b5d04519 | [
"MIT"
] | null | null | null | bamboos/docker/environment/common.py | onedata/web-client | 58905dfb8d1e7d85e4fe1dd87ba93ae0b5d04519 | [
"MIT"
] | null | null | null | # coding=utf-8
"""Authors: Łukasz Opioła, Konrad Zemek
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'
A custom utils library used across docker scripts.
"""
from __future__ import print_function
import argparse
import inspect
import json
import os
import req... | 31.788889 | 95 | 0.648491 |
from __future__ import print_function
import argparse
import inspect
import json
import os
import requests
import time
import sys
from . import docker
from timeouts import *
import tempfile
import stat
try:
import xml.etree.cElementTree as eTree
except ImportError:
import xml.etree.ElementTree as eTree
requ... | true | true |
1c201e99e27dee5658ed9a09781f46c84753ff79 | 1,172 | py | Python | braggi-rest-api/braggi_rest_api/rest_api/Braggi_Engine/Run.py | SushritPasupuleti/Braggi-A-Python-Based-Contextual-Chatbot-Framework | c81fa4bb0551d2d32fedc5c5d5fbf17940f5d2b1 | [
"MIT"
] | 6 | 2018-07-01T14:55:50.000Z | 2020-11-02T13:22:07.000Z | braggi-rest-api/braggi_rest_api/rest_api/Braggi_Engine/Run.py | SushritPasupuleti/Braggi-A-Python-Based-Contextual-Chatbot-Framework | c81fa4bb0551d2d32fedc5c5d5fbf17940f5d2b1 | [
"MIT"
] | null | null | null | braggi-rest-api/braggi_rest_api/rest_api/Braggi_Engine/Run.py | SushritPasupuleti/Braggi-A-Python-Based-Contextual-Chatbot-Framework | c81fa4bb0551d2d32fedc5c5d5fbf17940f5d2b1 | [
"MIT"
] | 2 | 2018-09-10T11:45:22.000Z | 2019-11-21T11:40:20.000Z | #%%
from rest_api.Braggi_Engine import Text_Processing_Engine
from rest_api.Braggi_Engine import Classifier
def Run_Model(user_in, Trained=True):
if Trained == False:
intents = Text_Processing_Engine.intents_loader()
words, intent_classes, sentence_corpus = Text_Processing_Engine.intents_parser(in... | 43.407407 | 107 | 0.723549 |
from rest_api.Braggi_Engine import Text_Processing_Engine
from rest_api.Braggi_Engine import Classifier
def Run_Model(user_in, Trained=True):
if Trained == False:
intents = Text_Processing_Engine.intents_loader()
words, intent_classes, sentence_corpus = Text_Processing_Engine.intents_parser(inten... | true | true |
1c201fb28871e0739e9374c85a66f7fab5dc669c | 1,659 | py | Python | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | 1 | 2017-12-13T20:28:32.000Z | 2017-12-13T20:28:32.000Z | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | """
"""
from django.utils import unittest
from django.core import management
from sendim.models import Alert, Event
from sendim.tests.defs import create_event, create_alert
class Event_TestCase(unittest.TestCase):
"""
"""
def setUp(self):
management.call_command('loaddata', 'test_supervisor.json', database='def... | 33.18 | 131 | 0.742013 |
from django.utils import unittest
from django.core import management
from sendim.models import Alert, Event
from sendim.tests.defs import create_event, create_alert
class Event_TestCase(unittest.TestCase):
def setUp(self):
management.call_command('loaddata', 'test_supervisor.json', database='default', verbosity=0... | true | true |
1c201fda0b58aa5500d21fb6727128b12ea451b7 | 5,714 | py | Python | openpeerpower/components/xiaomi/device_tracker.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/xiaomi/device_tracker.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/xiaomi/device_tracker.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Support for Xiaomi Mi routers."""
import logging
import requests
import voluptuous as vol
from openpeerpower.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from openpeerpower.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, HTTP_OK
import ope... | 33.028902 | 81 | 0.619531 | import logging
import requests
import voluptuous as vol
from openpeerpower.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from openpeerpower.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, HTTP_OK
import openpeerpower.helpers.config_validation ... | true | true |
1c2021fe31c75208ac202fc567ff298674cde487 | 132 | py | Python | api/urls.py | RESTBench/python-django-orm | 6ed6f8059d31ba95cc8427cf56342021ec03384a | [
"MIT"
] | null | null | null | api/urls.py | RESTBench/python-django-orm | 6ed6f8059d31ba95cc8427cf56342021ec03384a | [
"MIT"
] | null | null | null | api/urls.py | RESTBench/python-django-orm | 6ed6f8059d31ba95cc8427cf56342021ec03384a | [
"MIT"
] | null | null | null | from django.conf.urls import url
from contact import views
urlpatterns = [
url(r'^contact/$', views.ContactList.as_view()),
]
| 16.5 | 52 | 0.712121 | from django.conf.urls import url
from contact import views
urlpatterns = [
url(r'^contact/$', views.ContactList.as_view()),
]
| true | true |
1c20222412787c87293bdcc05be6434a5fb2a3ea | 9,552 | py | Python | adi_study_watch/nrf5_sdk_15.2.0/validation/test_scripts/usecase_test.py | ArrowElectronics/Vital-Signs-Monitoring | ba43fe9a116d94170561433910fd7bffba5726e7 | [
"Unlicense"
] | 5 | 2021-06-13T17:11:19.000Z | 2021-12-01T18:20:38.000Z | adi_study_watch/nrf5_sdk_15.2.0/validation/test_scripts/usecase_test.py | ArrowElectronics/Vital-Signs-Monitoring | ba43fe9a116d94170561433910fd7bffba5726e7 | [
"Unlicense"
] | null | null | null | adi_study_watch/nrf5_sdk_15.2.0/validation/test_scripts/usecase_test.py | ArrowElectronics/Vital-Signs-Monitoring | ba43fe9a116d94170561433910fd7bffba5726e7 | [
"Unlicense"
] | 1 | 2022-01-08T15:01:44.000Z | 2022-01-08T15:01:44.000Z | import time
# **************** Added for robot file execution ***************** #
import sys
import os
sys.path.insert(0, os.path.join(os.path.abspath(__file__), '../../'))
# **************** ****************************** ***************** #
import common
from common import ConditionCheckFailure
from utils import meas... | 47.054187 | 117 | 0.713777 | import time
import sys
import os
sys.path.insert(0, os.path.join(os.path.abspath(__file__), '../../'))
import common
from common import ConditionCheckFailure
from utils import meas_check
def use_case_ecg():
capture_time = 20
ref_dict = {'ref_qrs_amp': 0.1, 'ref_hr': 70}
common.watch_shell.do_disable_... | true | true |
1c202438d2a3f337bab4e2207a53cea6ca7ce868 | 37,749 | py | Python | ci-scripts/epc.py | simula/openairinterface5g | fc4fd340794198518ff0ff4c067e3b2b2d4e6a09 | [
"Apache-2.0"
] | 6 | 2019-12-27T00:55:47.000Z | 2021-11-16T11:36:20.000Z | ci-scripts/epc.py | Ting-An-Lin/OAI_ORAN_FHI_integration | 0671d428ce5ad5d6040b393c90679d59c074bd2d | [
"Apache-2.0"
] | 2 | 2021-06-17T05:01:55.000Z | 2021-11-24T14:23:54.000Z | ci-scripts/epc.py | Ting-An-Lin/OAI_ORAN_FHI_integration | 0671d428ce5ad5d6040b393c90679d59c074bd2d | [
"Apache-2.0"
] | 15 | 2019-12-27T00:55:51.000Z | 2022-03-28T02:13:45.000Z | #/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Publ... | 55.35044 | 229 | 0.645554 |
import sys
import re
import logging
import os
import time
import signal
from multiprocessing import Process, Lock, SimpleQueue
import sshconnection as SSH
import helpreadme as HELP
import constants as CONST
class EPCManagement():
def __init__(sel... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.