hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7902085efe7cf765f12737207cfe1799a58bdf06 | 191 | py | Python | ml-agents/mlagents/trainers/__init__.py | kazukiave/ml-agents | d3157808e757999596f3d514406b38307e441925 | [
"Apache-2.0"
] | 13,653 | 2017-09-19T15:56:02.000Z | 2022-03-31T18:55:07.000Z | ml-agents/mlagents/trainers/__init__.py | yuuharuka/ml-agents | 8963f72703eb2fd08eed2e4338c07e5b5af1376c | [
"Apache-2.0"
] | 3,623 | 2017-09-20T02:50:20.000Z | 2022-03-31T06:37:25.000Z | ml-agents/mlagents/trainers/__init__.py | yuuharuka/ml-agents | 8963f72703eb2fd08eed2e4338c07e5b5af1376c | [
"Apache-2.0"
] | 4,130 | 2017-09-19T17:36:34.000Z | 2022-03-31T12:54:55.000Z | # Version of the library that will be used to upload to pypi
__version__ = "0.28.0.dev0"
# Git tag that will be checked to determine whether to trigger upload to pypi
__release_tag__ = None
| 31.833333 | 77 | 0.769634 |
__version__ = "0.28.0.dev0"
__release_tag__ = None
| true | true |
790208fca1faeed36c22af8e234c55ca9fe70341 | 4,739 | py | Python | openslides_backend/main.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | null | null | null | openslides_backend/main.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | null | null | null | openslides_backend/main.py | peb-adr/openslides-backend | f885105446760413f1bce3bde33241f7cb1205ac | [
"MIT"
] | null | null | null | import logging
import multiprocessing
import os
import signal
import sys
import time
from typing import Any
from datastore.reader.app import register_services
from gunicorn.app.base import BaseApplication
from .shared.env import is_dev_mode
from .shared.interfaces.logging import LoggingModule
from .shared.interfaces.... | 34.591241 | 101 | 0.643807 | import logging
import multiprocessing
import os
import signal
import sys
import time
from typing import Any
from datastore.reader.app import register_services
from gunicorn.app.base import BaseApplication
from .shared.env import is_dev_mode
from .shared.interfaces.logging import LoggingModule
from .shared.interfaces.... | true | true |
7902091b0d4200ad38e755435462aa3350904014 | 6,457 | py | Python | tests/demo.py | FangTang999/Path4GMNS | d319bb4b97a51055c1917820d1f5eaf7b8032a51 | [
"Apache-2.0"
] | 2 | 2021-06-09T09:41:31.000Z | 2021-07-21T14:09:34.000Z | tests/demo.py | zqNiu/Path4GMNS | 666cb425206d6bfc26135c649253e931bfc28003 | [
"Apache-2.0"
] | null | null | null | tests/demo.py | zqNiu/Path4GMNS | 666cb425206d6bfc26135c649253e931bfc28003 | [
"Apache-2.0"
] | null | null | null | import path4gmns as pg
from time import time
def test_download_sample_data_sets():
pg.download_sample_data_sets()
def test_find_shortest_path():
load_demand = False
network = pg.read_network(load_demand)
print('\nshortest path (node id) from node 1 to node 2, '
+network.find_shortest_path... | 34.529412 | 79 | 0.678179 | import path4gmns as pg
from time import time
def test_download_sample_data_sets():
pg.download_sample_data_sets()
def test_find_shortest_path():
load_demand = False
network = pg.read_network(load_demand)
print('\nshortest path (node id) from node 1 to node 2, '
+network.find_shortest_path... | true | true |
79020949305c537ba2dc8a445188490094b20f15 | 2,225 | py | Python | src/compas_fab/backends/ros/backend_features/move_it_add_collision_mesh.py | gramaziokohler/compas_fab | 85ec40887004c33ac9764ba73c1b66c6de154457 | [
"MIT"
] | 8 | 2018-09-09T07:29:03.000Z | 2019-05-14T18:03:20.000Z | src/compas_fab/backends/ros/backend_features/move_it_add_collision_mesh.py | gramaziokohler/compas_fab | 85ec40887004c33ac9764ba73c1b66c6de154457 | [
"MIT"
] | 39 | 2018-09-18T14:16:39.000Z | 2019-07-01T08:07:10.000Z | src/compas_fab/backends/ros/backend_features/move_it_add_collision_mesh.py | gramaziokohler/compas_fab | 85ec40887004c33ac9764ba73c1b66c6de154457 | [
"MIT"
] | 7 | 2019-01-20T22:04:49.000Z | 2019-06-10T16:07:26.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from compas.utilities import await_callback
from compas_fab.backends.interfaces import AddCollisionMesh
from compas_fab.backends.ros.messages import ApplyPlanningSceneRequest
from compas_fab.backends.ros.messa... | 38.362069 | 78 | 0.681798 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from compas.utilities import await_callback
from compas_fab.backends.interfaces import AddCollisionMesh
from compas_fab.backends.ros.messages import ApplyPlanningSceneRequest
from compas_fab.backends.ros.messa... | true | true |
7902099685f65f73855df2c06e5d7f3c20b72cbd | 393 | py | Python | leetcode/python/easy/p1047_removeDuplicates.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1047_removeDuplicates.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1047_removeDuplicates.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | class Solution:
def removeDuplicates(self, S: str) -> str:
i = 1
while i < len(S):
if i <= 0:
i += 1
continue
if S[i] == S[i - 1]:
S = S[:i - 1] + S[i + 1:]
i = i - 1
else:
i = i + 1
... | 21.833333 | 46 | 0.358779 | class Solution:
def removeDuplicates(self, S: str) -> str:
i = 1
while i < len(S):
if i <= 0:
i += 1
continue
if S[i] == S[i - 1]:
S = S[:i - 1] + S[i + 1:]
i = i - 1
else:
i = i + 1
... | true | true |
79020b75eb3cfa7527e60cb4bf3ab7450ecee76f | 2,766 | py | Python | copasi/bindings/python/unittests/Test_CFunctionParameter.py | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 64 | 2015-03-14T14:06:18.000Z | 2022-02-04T23:19:08.000Z | copasi/bindings/python/unittests/Test_CFunctionParameter.py | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 4 | 2017-08-16T10:26:46.000Z | 2020-01-08T12:05:54.000Z | copasi/bindings/python/unittests/Test_CFunctionParameter.py | MedAnisse/COPASI | 561f591f8231b1c4880ce554d0197ff21ef4734c | [
"Artistic-2.0"
] | 28 | 2015-04-16T14:14:59.000Z | 2022-03-28T12:04:14.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the
# University of Virginia, University of Heidelberg, and University
# of Connecticut School of Medicine.
# All rights reserved.
# Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
# Properties, Inc.,... | 32.162791 | 95 | 0.721981 |
import COPASI
import unittest
from types import *
class Test_CFunctionParameter(unittest.TestCase):
def setUp(self):
self.functions=COPASI.CRootContainer.getFunctionList()
self.function=self.functions.findFunction("Iso Uni Uni")
self.assert_(self.function!=None)
self.assert_... | true | true |
79020c5a6767fbe0484883366125346815d1d434 | 3,438 | py | Python | atm/config.py | moeyensj/atm | 0523600cf44423a1ef72ca40fff29bbfbe1281a8 | [
"BSD-3-Clause"
] | 10 | 2019-05-04T01:02:16.000Z | 2021-12-29T11:20:23.000Z | atm/config.py | moeyensj/atm | 0523600cf44423a1ef72ca40fff29bbfbe1281a8 | [
"BSD-3-Clause"
] | 22 | 2019-04-26T03:17:24.000Z | 2021-03-03T23:38:02.000Z | atm/config.py | moeyensj/atm | 0523600cf44423a1ef72ca40fff29bbfbe1281a8 | [
"BSD-3-Clause"
] | 2 | 2019-09-23T05:52:18.000Z | 2021-12-29T11:20:21.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import numpy as np
__all__ = ["Config"]
class Config(object):
"""
Config: Holds configuration settings.
Parameters
----------
fitParameters : list
Parameters to fit.
parameterPriors : dict
Dictionary with parameters as keys, and ... | 28.180328 | 91 | 0.513962 |
import numpy as np
__all__ = ["Config"]
class Config(object):
fitParameters = ["logT1", "logD", "eps"]
parameterPriors = {
"logD": {
"lower": 1,
"upper": 8,
},
"eps": {
"lower": 0.0,
"upper": 1.0},
"logT1": {
... | true | true |
79020c73a919eecb49bc05ec9523af8e6add3076 | 1,457 | py | Python | recipe_scrapers/simplyquinoa.py | hotfix/recipe-scrapers | 0dd87366f137c32f348d14695af8cc4c20d455a7 | [
"MIT"
] | 1 | 2020-08-18T16:45:17.000Z | 2020-08-18T16:45:17.000Z | recipe_scrapers/simplyquinoa.py | hotfix/recipe-scrapers | 0dd87366f137c32f348d14695af8cc4c20d455a7 | [
"MIT"
] | null | null | null | recipe_scrapers/simplyquinoa.py | hotfix/recipe-scrapers | 0dd87366f137c32f348d14695af8cc4c20d455a7 | [
"MIT"
] | null | null | null | from ._abstract import AbstractScraper
from ._utils import get_minutes, normalize_string, get_yields
class SimplyQuinoa(AbstractScraper):
@classmethod
def host(self):
return 'simplyquinoa.com'
def title(self):
return self.soup.find(
'h2',
{'class': 'wprm-recipe-na... | 24.694915 | 61 | 0.533288 | from ._abstract import AbstractScraper
from ._utils import get_minutes, normalize_string, get_yields
class SimplyQuinoa(AbstractScraper):
@classmethod
def host(self):
return 'simplyquinoa.com'
def title(self):
return self.soup.find(
'h2',
{'class': 'wprm-recipe-na... | true | true |
79020d407f7d2dd513661ed3a9e770c03db64696 | 7,196 | py | Python | Functions/visibility_functions.py | LorenzWieseke/GLBTextureTools | 88bfa0e8eef7308573cd43d02b1ddc4dc89be8f7 | [
"MIT"
] | 9 | 2020-03-13T21:39:27.000Z | 2022-03-30T20:48:46.000Z | Functions/visibility_functions.py | LorenzWieseke/GLBTextureTools | 88bfa0e8eef7308573cd43d02b1ddc4dc89be8f7 | [
"MIT"
] | 1 | 2021-04-09T12:55:27.000Z | 2021-04-09T12:55:27.000Z | Functions/visibility_functions.py | LorenzWieseke/GLBTextureTools | 88bfa0e8eef7308573cd43d02b1ddc4dc89be8f7 | [
"MIT"
] | null | null | null | import bpy
from bpy import context
from . import node_functions
from . import material_functions
from . import constants
import mathutils
def update_selected_image(self, context):
sel_texture = bpy.data.images[self.texture_index]
show_image_in_image_editor(sel_texture)
def show_image_in_image_editor(image):... | 38.481283 | 116 | 0.618677 | import bpy
from bpy import context
from . import node_functions
from . import material_functions
from . import constants
import mathutils
def update_selected_image(self, context):
sel_texture = bpy.data.images[self.texture_index]
show_image_in_image_editor(sel_texture)
def show_image_in_image_editor(image):... | true | true |
79020e3b97923b38276d349876f359df32550754 | 1,623 | py | Python | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | 21 | 2017-03-17T16:34:33.000Z | 2022-03-12T14:52:40.000Z | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | null | null | null | classes/jogwidget.py | comgram/gerbil_gui | bacec0047bc2de6bf95b1734af6845896a04aeff | [
"MIT"
] | 7 | 2019-06-08T19:45:23.000Z | 2022-01-04T02:44:41.000Z | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget
class JogWidget(QWidget):
def __init__(self, parent, callback):
super(JogWidget, self).__init__(parent)
self.parent = parent
self.callback = callback
self.wx_current = 0
self.wy_current = 0
... | 30.622642 | 89 | 0.585952 | from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget
class JogWidget(QWidget):
def __init__(self, parent, callback):
super(JogWidget, self).__init__(parent)
self.parent = parent
self.callback = callback
self.wx_current = 0
self.wy_current = 0
... | true | true |
79020f1257c17ad8e9a1448327db4009b9a53be4 | 967 | py | Python | HLTrigger/Configuration/python/HLT_75e33/modules/hltEgammaHcalPFClusterIsoUnseeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltEgammaHcalPFClusterIsoUnseeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/modules/hltEgammaHcalPFClusterIsoUnseeded_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
hltEgammaHcalPFClusterIsoUnseeded = cms.EDProducer("EgammaHLTHcalPFClusterIsolationProducer",
absEtaLowEdges = cms.vdouble(0.0, 1.479),
doRhoCorrection = cms.bool(False),
drMax = cms.double(0.3),
drVetoBarrel = cms.double(0.0),
drVetoEndcap = cms.double(0.0)... | 40.291667 | 93 | 0.718718 | import FWCore.ParameterSet.Config as cms
hltEgammaHcalPFClusterIsoUnseeded = cms.EDProducer("EgammaHLTHcalPFClusterIsolationProducer",
absEtaLowEdges = cms.vdouble(0.0, 1.479),
doRhoCorrection = cms.bool(False),
drMax = cms.double(0.3),
drVetoBarrel = cms.double(0.0),
drVetoEndcap = cms.double(0.0)... | true | true |
79020f30ce61b16c57dac6e6685ac888f80c5f71 | 91,488 | py | Python | Compiler/instructions_tmp.py | nec-mpc/SPDZ-2-Float | 70ef8bb00cd356c5cb91c1754637559a3e3dd60a | [
"BSD-4-Clause-UC"
] | 4 | 2021-02-18T07:52:01.000Z | 2022-02-18T06:28:51.000Z | Compiler/instructions_tmp.py | nec-mpc/SPDZ-2-Float | 70ef8bb00cd356c5cb91c1754637559a3e3dd60a | [
"BSD-4-Clause-UC"
] | null | null | null | Compiler/instructions_tmp.py | nec-mpc/SPDZ-2-Float | 70ef8bb00cd356c5cb91c1754637559a3e3dd60a | [
"BSD-4-Clause-UC"
] | 1 | 2021-08-04T07:56:03.000Z | 2021-08-04T07:56:03.000Z | # Confidential:
# (C) 2017 University of Bristol. See License.txt
""" This module is for classes of actual assembly instructions.
All base classes, utility functions etc. should go in
instructions_base.py instead. This is for two reasons:
1) Easier generation of documentation
2) Ensures that 'from instructions import... | 34.368144 | 189 | 0.566096 |
import itertools
import tools
from random import randint
from Compiler.config import *
from Compiler.exceptions import *
import Compiler.instructions_base as base
import math
_python_input = input
_slots__ = []
code = base.opcodes['LDI']
arg_format = ['cw','i']
def execute(self):
self.a... | true | true |
79020f67f255df76e3945226f5f0570bf89af103 | 5,497 | py | Python | tfx/dsl/compiler/testdata/iris_pipeline_sync.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | 1 | 2021-05-10T10:41:06.000Z | 2021-05-10T10:41:06.000Z | tfx/dsl/compiler/testdata/iris_pipeline_sync.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | null | null | null | tfx/dsl/compiler/testdata/iris_pipeline_sync.py | Saiprasad16/tfx | c1e0704b2a83232469f55598efcdb7808b6c909f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC. 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 applicable law or a... | 38.711268 | 78 | 0.709478 |
import os
import tensorflow_model_analysis as tfma
from tfx.components import CsvExampleGen
from tfx.components import Evaluator
from tfx.components import ExampleValidator
from tfx.components import ImporterNode
from tfx.components import Pusher
from tfx.components import SchemaGen
from tfx.components im... | true | true |
79021088736c1e2ba4efc5f1d65dff9b2dd4a3bf | 1,655 | py | Python | main/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | main/class-1-dealing-with-complex-numbers/class-1-dealing-with-complex-numbers.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | import math
class Complex(object):
def __init__(self, real, imaginary):
self.real = real
self.imaginary = imaginary
def __add__(self, no):
return Complex(self.real + no.real, self.imaginary + no.imaginary)
def __sub__(self, no):
return Complex(self.real - no.real, self.ima... | 35.212766 | 95 | 0.565559 | import math
class Complex(object):
def __init__(self, real, imaginary):
self.real = real
self.imaginary = imaginary
def __add__(self, no):
return Complex(self.real + no.real, self.imaginary + no.imaginary)
def __sub__(self, no):
return Complex(self.real - no.real, self.ima... | true | true |
790211bfa017a8a2d1297cd673098bab535e254d | 18,081 | py | Python | src/main/resources/pydev_tunnel/tunnel_single_script.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | src/main/resources/pydev_tunnel/tunnel_single_script.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | src/main/resources/pydev_tunnel/tunnel_single_script.py | gdlg/k8s-debugger-pycharm-pluggin | 30354f8e6ce3f979650c032e485137ec3f113a2c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporary_... | 182.636364 | 3,959 | 0.673027 |
import contextlib as __stickytape_contextlib
@__stickytape_contextlib.contextmanager
def __stickytape_temporary_dir():
import tempfile
import shutil
dir_path = tempfile.mkdtemp()
try:
yield dir_path
finally:
shutil.rmtree(dir_path)
with __stickytape_temporary_dir() as __stickytape... | true | true |
790212da0bf2d0d6dde2cc84c309acc96c1a0b52 | 445 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/image/_sizey.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/image/_sizey.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/image/_sizey.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class SizeyValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="sizey", parent_name="layout.image", **kwargs):
super(SizeyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 34.230769 | 82 | 0.653933 | import _plotly_utils.basevalidators
class SizeyValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="sizey", parent_name="layout.image", **kwargs):
super(SizeyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
790213553c54c37ddcfefa0a6d8975e443567c48 | 397 | py | Python | src/config/urls.py | JeremySilvaSilva/Django-Rest-Framework-User-Template | 057e9fb44da05f9ea23617d3adeb26af2913575d | [
"MIT"
] | null | null | null | src/config/urls.py | JeremySilvaSilva/Django-Rest-Framework-User-Template | 057e9fb44da05f9ea23617d3adeb26af2913575d | [
"MIT"
] | 3 | 2020-01-10T15:47:26.000Z | 2020-06-06T01:14:17.000Z | src/config/urls.py | JeremyAndress/API-User-Template | 057e9fb44da05f9ea23617d3adeb26af2913575d | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from rest_framework.schemas import get_schema_view
VERSION = 'V1.0.0'
urlpatterns = [
path('admin/', admin.site.urls),
url('api/{}/user/'.format(VERSION),include('app.user.urls',namespace='user')),
url(... | 30.538462 | 82 | 0.715365 | from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from rest_framework.schemas import get_schema_view
VERSION = 'V1.0.0'
urlpatterns = [
path('admin/', admin.site.urls),
url('api/{}/user/'.format(VERSION),include('app.user.urls',namespace='user')),
url(... | true | true |
790213d4b029247f6dc2efb09199f7ffc4857cde | 29,224 | py | Python | python/paddle/fluid/contrib/slim/tests/test_quantization_pass.py | TingquanGao/Paddle | 9b1015d90b4d498ab58df7cff2c3ed27863ce970 | [
"Apache-2.0"
] | 3 | 2021-06-08T14:24:36.000Z | 2021-06-08T14:24:38.000Z | python/paddle/fluid/contrib/slim/tests/test_quantization_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-03-17T07:53:43.000Z | 2021-03-17T07:53:43.000Z | python/paddle/fluid/contrib/slim/tests/test_quantization_pass.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-08-04T14:28:58.000Z | 2021-08-04T14:28:58.000Z | # copyright (c) 2018 paddlepaddle authors. all rights reserved.
#
# licensed under the apache license, version 2.0 (the "license");
# you may not use this file except in compliance with the license.
# you may obtain a copy of the license at
#
# http://www.apache.org/licenses/license-2.0
#
# unless required by app... | 42.29233 | 112 | 0.56919 |
import os
import unittest
import random
import numpy as np
import paddle.fluid as fluid
import six
import paddle
from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import QuantizationTransformPass
from paddle.fluid.contrib.slim.quantization import QuantizationFreezePass... | true | true |
7902143a3d4765fbef4e037174c5457d06039dde | 1,867 | py | Python | parse_reference.py | Dewdis/scholar_tree | 300585e77dc06ee5f4297c5a699eccf76200e934 | [
"MIT"
] | null | null | null | parse_reference.py | Dewdis/scholar_tree | 300585e77dc06ee5f4297c5a699eccf76200e934 | [
"MIT"
] | null | null | null | parse_reference.py | Dewdis/scholar_tree | 300585e77dc06ee5f4297c5a699eccf76200e934 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Possible string formats:
<author(s)> <title> <source> <year>
"""
import re
import pdf
CRED = '\033[91m'
CGREEN = '\33[32m'
CYELLOW = '\33[33m'
CBLUE = '\33[34m'
CVIOLET = '\33[35m'
CBEIGE = '\33[36m'
CWHITE = '\33[37m'
CEND = '\033[0m'
def extract_references_list_by_keyword(text, keyw... | 22.768293 | 71 | 0.528656 |
import re
import pdf
CRED = '\033[91m'
CGREEN = '\33[32m'
CYELLOW = '\33[33m'
CBLUE = '\33[34m'
CVIOLET = '\33[35m'
CBEIGE = '\33[36m'
CWHITE = '\33[37m'
CEND = '\033[0m'
def extract_references_list_by_keyword(text, keyword):
print(text)
match_res = re.search(keyword, text)
ref_text = text[match_re... | true | true |
790214d60cffa2a494c5dcf9a8ff558464d131ab | 149 | py | Python | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 24 | 2021-11-17T02:16:47.000Z | 2022-03-27T01:04:08.000Z | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 9 | 2021-12-03T06:09:27.000Z | 2022-03-29T06:33:53.000Z | src/aijack/defense/ckks/__init__.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 5 | 2022-01-12T09:58:04.000Z | 2022-03-17T09:29:04.000Z | from .encoder import CKKSEncoder # noqa: F401
from .encrypter import CKKSEncrypter # noqa: F401
from .plaintext import CKKSPlaintext # noqa: F401
| 37.25 | 50 | 0.778523 | from .encoder import CKKSEncoder
from .encrypter import CKKSEncrypter
from .plaintext import CKKSPlaintext
| true | true |
790214dde414abac4f210f7302a358649ab58d6e | 417 | py | Python | src/mltoolset/__init__.py | rpeloff/multimodal_one-shot_learning | b08b9deffea5c656f07a616f31850192e32c2aee | [
"MIT"
] | 11 | 2019-05-14T08:52:32.000Z | 2021-11-09T10:01:44.000Z | src/mltoolset/__init__.py | rpeloff/multimodal_one-shot_learning | b08b9deffea5c656f07a616f31850192e32c2aee | [
"MIT"
] | null | null | null | src/mltoolset/__init__.py | rpeloff/multimodal_one-shot_learning | b08b9deffea5c656f07a616f31850192e32c2aee | [
"MIT"
] | 2 | 2019-08-27T08:49:44.000Z | 2021-02-01T15:08:16.000Z | """Welcome to MLToolset, a package to simplify machine learning research!
Author: Ryan Eloff
Contact: ryan.peter.eloff@gmail.com
Date: May 2018
"""
from . import data
from . import nearest_neighbour
from . import neural_blocks
from . import siamese
from . import training
from . import utils
from ._globals import T... | 19.857143 | 73 | 0.786571 |
from . import data
from . import nearest_neighbour
from . import neural_blocks
from . import siamese
from . import training
from . import utils
from ._globals import TF_FLOAT
from ._globals import TF_INT
from ._globals import NP_FLOAT
from ._globals import NP_INT
| true | true |
790216d5aa81a46dd367ab753c7e45365e05f79a | 2,531 | py | Python | v1/list/models.py | atroxtartarus/openeats-api | a4e781e82cb34bc7a68ce9b1b6ab2f1bd35382df | [
"MIT"
] | 11 | 2018-03-04T18:03:30.000Z | 2021-09-04T17:03:24.000Z | v1/list/models.py | atroxtartarus/openeats-api | a4e781e82cb34bc7a68ce9b1b6ab2f1bd35382df | [
"MIT"
] | 42 | 2020-06-05T14:55:57.000Z | 2021-07-14T05:58:09.000Z | v1/list/models.py | jzyrobert/openeats-api | 35e1f1c8e61812e405ec15cc66d8e543d15409b6 | [
"MIT"
] | 40 | 2018-06-22T18:58:19.000Z | 2022-01-31T08:34:05.000Z | #!/usr/bin/env python
# encoding: utf-8
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import AutoSlugField
from v1.recipe.models import Recipe
class GroceryList(models.Model):
"""
The GroceryL... | 34.671233 | 91 | 0.699723 |
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django_extensions.db.fields import AutoSlugField
from v1.recipe.models import Recipe
class GroceryList(models.Model):
title = models.CharField(_("grocery list title"), max_leng... | true | true |
790217b2aca2a8a98689118c8de76d2f34301000 | 18,931 | py | Python | nova/tests/unit/conductor/tasks/test_live_migrate.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/tests/unit/conductor/tasks/test_live_migrate.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/tests/unit/conductor/tasks/test_live_migrate.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 46.513514 | 78 | 0.665258 |
from mox3 import mox
from nova.compute import power_state
from nova.compute import utils as compute_utils
from nova.conductor.tasks import live_migrate
from nova import db
from nova import exception
from nova import objects
from nova.scheduler import utils as scheduler_utils
from nova import test
from nova... | true | true |
7902185c0b6a150ef40224aba2dc5b625c093f33 | 1,945 | py | Python | tests/test_rest_file_region.py | Multiscale-Genomics/mg-rest-file | 7fb9077151ce8e2511296b72b645d92acf95bceb | [
"Apache-2.0"
] | null | null | null | tests/test_rest_file_region.py | Multiscale-Genomics/mg-rest-file | 7fb9077151ce8e2511296b72b645d92acf95bceb | [
"Apache-2.0"
] | null | null | null | tests/test_rest_file_region.py | Multiscale-Genomics/mg-rest-file | 7fb9077151ce8e2511296b72b645d92acf95bceb | [
"Apache-2.0"
] | null | null | null | """
.. See the NOTICE file distributed with this work for additional information
regarding copyright ownership.
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.... | 28.602941 | 91 | 0.698715 |
from __future__ import print_function
import os
import tempfile
import json
import pytest
from context import app
@pytest.fixture
def client(request):
db_fd, app.APP.config['DATABASE'] = tempfile.mkstemp()
app.APP.config['TESTING'] = True
client = app.APP.test_client()
def teardown():
os.cl... | true | true |
79021887c6b9cd27e0c497685345f14bba935307 | 8,041 | bzl | Python | closure/webfiles/web_library.bzl | vrana/rules_closure | cf1e44edb908e9616030cc83d085989b8e6cd6df | [
"Apache-2.0"
] | null | null | null | closure/webfiles/web_library.bzl | vrana/rules_closure | cf1e44edb908e9616030cc83d085989b8e6cd6df | [
"Apache-2.0"
] | null | null | null | closure/webfiles/web_library.bzl | vrana/rules_closure | cf1e44edb908e9616030cc83d085989b8e6cd6df | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The Closure Rules Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.072034 | 86 | 0.584753 |
load(
"//closure/private:defs.bzl",
"create_argfile",
"difference",
"long_path",
"unfurl",
)
def _web_library(ctx):
if not ctx.attr.srcs:
if ctx.attr.deps:
fail("deps can not be set when srcs is not")
if not ctx.attr.exports:
fail("exports ... | true | true |
790218de51ca51344397755629177c60815269a1 | 10,690 | py | Python | sdk/python/pulumi_aws/timestreamwrite/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/timestreamwrite/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/timestreamwrite/outputs.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 46.277056 | 294 | 0.710196 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'TableMagneticStoreWriteProperties',
'TableMagneticStoreWritePropertiesMagneticStoreRejectedDataLocation',
'TableMagneticS... | true | true |
79021946056bd2c746c424e0c738f34b5e634ab9 | 2,926 | py | Python | setup.py | RDFLib/PyRDFa | efc24d4940910ca1e65900c25b62047301bbdcc7 | [
"BSD-3-Clause"
] | 8 | 2015-04-01T19:55:22.000Z | 2020-04-25T08:50:05.000Z | setup.py | DalavanCloud/PyRDFa | fd5c8826fb9e5f6f5a578564b1149fdae6c40aad | [
"BSD-3-Clause"
] | null | null | null | setup.py | DalavanCloud/PyRDFa | fd5c8826fb9e5f6f5a578564b1149fdae6c40aad | [
"BSD-3-Clause"
] | 1 | 2019-02-12T03:15:00.000Z | 2019-02-12T03:15:00.000Z | #!/usr/bin/env python
import sys
import re
def setup_python3():
# Taken from "distribute" setup.py
from distutils.filelist import FileList
from distutils import dir_util, file_util, util, log
from os.path import join
tmp_src = join("build", "src")
log.set_verbosity(1)
fl = FileList()
... | 30.8 | 82 | 0.570745 |
import sys
import re
def setup_python3():
from distutils.filelist import FileList
from distutils import dir_util, file_util, util, log
from os.path import join
tmp_src = join("build", "src")
log.set_verbosity(1)
fl = FileList()
for line in open("MANIFEST.in"):
if not line.s... | true | true |
79021a7712360a761d0b424194f348ac888f99de | 8,899 | py | Python | boids.py | KeithRieck/bedlam | ce5f87a0211b4eecd553b1aae24e3b3664b43c5e | [
"BSD-2-Clause"
] | null | null | null | boids.py | KeithRieck/bedlam | ce5f87a0211b4eecd553b1aae24e3b3664b43c5e | [
"BSD-2-Clause"
] | null | null | null | boids.py | KeithRieck/bedlam | ce5f87a0211b4eecd553b1aae24e3b3664b43c5e | [
"BSD-2-Clause"
] | null | null | null | from bedlam import Game
from bedlam import Scene
from bedlam import Sprite
from balls import Ball
# __pragma__('skip')
document = window = Math = Date = console = 0 # Prevent complaints by optional static checker
# __pragma__('noskip')
# __pragma__('noalias', 'clear')
DEBUG = False
class PVector:
def __init__... | 31.44523 | 117 | 0.539049 | from bedlam import Game
from bedlam import Scene
from bedlam import Sprite
from balls import Ball
document = window = Math = Date = console = 0
DEBUG = False
class PVector:
def __init__(self, xx=0, yy=0):
self.x = xx
self.y = yy
def __str__(self):
return "PVector({},{})".forma... | true | true |
79021a7efcf5dac874e5515c508c1bb0d83f476d | 1,326 | py | Python | local_pypfilt/tests/test_io.py | ruarai/epifx.covid | be7aecbf9e86c3402f6851ea65f6705cdb59f3cf | [
"BSD-3-Clause"
] | null | null | null | local_pypfilt/tests/test_io.py | ruarai/epifx.covid | be7aecbf9e86c3402f6851ea65f6705cdb59f3cf | [
"BSD-3-Clause"
] | null | null | null | local_pypfilt/tests/test_io.py | ruarai/epifx.covid | be7aecbf9e86c3402f6851ea65f6705cdb59f3cf | [
"BSD-3-Clause"
] | null | null | null | """Test cases for the pypfilt.io module."""
import datetime
import numpy as np
import os
from pypfilt.io import read_table, date_column
def test_read_datetime():
# Test data: sequential dates with Fibonacci sequence.
content = """
date count
2020-01-01 1
2020-01-02 1
2020-01-03 2
2020-01... | 25.5 | 66 | 0.617647 |
import datetime
import numpy as np
import os
from pypfilt.io import read_table, date_column
def test_read_datetime():
content = """
date count
2020-01-01 1
2020-01-02 1
2020-01-03 2
2020-01-04 3
2020-01-05 5
2020-01-06 8
2020-01-07 13
2020-01-08 21
2020-01-09 34
... | true | true |
79021aa75a1f91190444e8108f7c4c5a004b7aaa | 200 | py | Python | lightning_transformers/task/nlp/translation/datasets/__init__.py | zhaisilong/lightning-transformers | cd6843b6caa8279df86bb5e808dfccc79ca9c3d2 | [
"Apache-2.0"
] | null | null | null | lightning_transformers/task/nlp/translation/datasets/__init__.py | zhaisilong/lightning-transformers | cd6843b6caa8279df86bb5e808dfccc79ca9c3d2 | [
"Apache-2.0"
] | null | null | null | lightning_transformers/task/nlp/translation/datasets/__init__.py | zhaisilong/lightning-transformers | cd6843b6caa8279df86bb5e808dfccc79ca9c3d2 | [
"Apache-2.0"
] | null | null | null | from lightning_transformers.task.nlp.translation.datasets.wmt16 import WMT16TranslationDataModule
from lightning_transformers.task.nlp.translation.datasets.smiles import SMILESTranslationDataModule
| 40 | 99 | 0.9 | from lightning_transformers.task.nlp.translation.datasets.wmt16 import WMT16TranslationDataModule
from lightning_transformers.task.nlp.translation.datasets.smiles import SMILESTranslationDataModule
| true | true |
79021b0d7e1462d14c84ecc119c3cb047effa787 | 4,245 | py | Python | script.module.placenta/lib/resources/lib/sources/de/movie2z.py | parser4life/tantrumrepo | 3b37145f4772409e538cbddb0b7aa23be525772a | [
"Beerware"
] | 1 | 2021-05-09T19:55:51.000Z | 2021-05-09T19:55:51.000Z | script.module.placenta/lib/resources/lib/sources/de/movie2z.py | parser4life/tantrumrepo | 3b37145f4772409e538cbddb0b7aa23be525772a | [
"Beerware"
] | null | null | null | script.module.placenta/lib/resources/lib/sources/de/movie2z.py | parser4life/tantrumrepo | 3b37145f4772409e538cbddb0b7aa23be525772a | [
"Beerware"
] | 2 | 2020-04-01T22:11:12.000Z | 2020-05-07T23:54:52.000Z | # -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | 35.082645 | 139 | 0.521084 |
= re.search('^\S*', x[1]).group().lower()
url = x[0]['value']
valid, hoster = source_utils.is_host_valid(hoster, hostDict)
if not valid: continue
sources.append({'source': hoster, 'quality': 'SD', 'language': 'de', 'url': url, 'direct': ... | true | true |
79021c270b531509df93b42504fbc84eaea6259f | 94,292 | py | Python | pycherwell/api/teams_api.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 2 | 2020-04-09T16:41:25.000Z | 2020-08-25T21:07:53.000Z | pycherwell/api/teams_api.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 15 | 2020-02-12T14:57:30.000Z | 2020-11-27T23:34:15.000Z | pycherwell/api/teams_api.py | greenpau/pycherwell | 2a25446d5cf86d69e6158067faf27ce250aba966 | [
"Apache-2.0"
] | 2 | 2020-02-12T14:57:38.000Z | 2021-07-30T11:32:28.000Z | # coding: utf-8
"""
Cherwell REST API
Unofficial Python Cherwell REST API library. # noqa: E501
The version of the OpenAPI document: 9.3.2
Contact: See AUTHORS.
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and pyth... | 50.182012 | 404 | 0.62053 |
from __future__ import absolute_import
import re
import six
from pycherwell.api_client import ApiClient
from pycherwell.exceptions import (
ApiTypeError,
ApiValueError
)
class TeamsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClien... | true | true |
79021ca66f3988922ffca3051dc7caa3018d166e | 636 | py | Python | setup.py | planetceres/avenue | ed1369dd759f9ec389d240f624c36e3607583219 | [
"MIT"
] | 11 | 2019-11-13T00:05:07.000Z | 2021-04-28T20:45:27.000Z | setup.py | planetceres/avenue | ed1369dd759f9ec389d240f624c36e3607583219 | [
"MIT"
] | null | null | null | setup.py | planetceres/avenue | ed1369dd759f9ec389d240f624c36e3607583219 | [
"MIT"
] | 1 | 2021-03-01T09:19:32.000Z | 2021-03-01T09:19:32.000Z | from setuptools import setup, find_packages
import os
setup(name='avenue',
version=0.1,
description='Element AI car Simulator',
url='https://github.com/cyrilibrahim/Avenue',
author='ElementAI',
author_email='cyril.ibrahim@elementai.com',
license='',
zip_safe=False,
insta... | 28.909091 | 128 | 0.613208 | from setuptools import setup, find_packages
import os
setup(name='avenue',
version=0.1,
description='Element AI car Simulator',
url='https://github.com/cyrilibrahim/Avenue',
author='ElementAI',
author_email='cyril.ibrahim@elementai.com',
license='',
zip_safe=False,
insta... | true | true |
79021cd12d603381c47e7b41a7d3141cddbee4f4 | 3,820 | py | Python | framework/SupervisedLearning/pickledROM.py | alptezbasaran/raven | fd6fe8fe90b59d6dd3615cfea929722f3e04b2ca | [
"Apache-2.0"
] | 1 | 2018-07-02T21:12:48.000Z | 2018-07-02T21:12:48.000Z | framework/SupervisedLearning/pickledROM.py | alptezbasaran/raven | fd6fe8fe90b59d6dd3615cfea929722f3e04b2ca | [
"Apache-2.0"
] | null | null | null | framework/SupervisedLearning/pickledROM.py | alptezbasaran/raven | fd6fe8fe90b59d6dd3615cfea929722f3e04b2ca | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | 37.821782 | 132 | 0.620942 |
from __future__ import division, print_function, unicode_literals, absolute_import
from .SupervisedLearning import supervisedLearning
class pickledROM(supervisedLearning):
def __init__(self,messageHandler,**kwargs):
self.printTag = 'pickledROM'
self.messageHandler = messag... | true | true |
79021cd32bc08de71246244cc8084ac9adc0fbaf | 2,197 | py | Python | ctsimu/test.py | BAMresearch/ctsimu-toolbox | 2329fe0bba8a89061430649c043c70c58835a435 | [
"Apache-2.0"
] | null | null | null | ctsimu/test.py | BAMresearch/ctsimu-toolbox | 2329fe0bba8a89061430649c043c70c58835a435 | [
"Apache-2.0"
] | null | null | null | ctsimu/test.py | BAMresearch/ctsimu-toolbox | 2329fe0bba8a89061430649c043c70c58835a435 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import os # File and path handling
import numpy
import copy # for deepcopy
import math
from .image import ImageFile, Image, ImageROI, ImageStack
from .geometry import Geometry
from .processing.pipeline import Pipeline
from .processing.step import Step
from .helpers import *
d... | 30.943662 | 119 | 0.631771 |
import os
import numpy
import copy
import math
from .image import ImageFile, Image, ImageROI, ImageStack
from .geometry import Geometry
from .processing.pipeline import Pipeline
from .processing.step import Step
from .helpers import *
def touchDirectory(folder):
if not os.path.exists(folder):
... | true | true |
79021d1fbf174a4318e0c00c0590c81b1657a665 | 7,150 | py | Python | openpyxlzip/formatting/tests/test_formatting.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/formatting/tests/test_formatting.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | openpyxlzip/formatting/tests/test_formatting.py | ankitJoshi03/openpyxlzip | f3b8aa2f80f9d8bc31ce5fcf05c822d88d2ff647 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020 openpyxlzip
# package imports
from openpyxlzip.reader.excel import load_workbook
from openpyxlzip.xml.functions import tostring, fromstring
from openpyxlzip.styles import Border, Side, PatternFill, Color, Font, fills, borders, colors
from openpyxlzip.styles.differential import DifferentialSty... | 35.221675 | 93 | 0.554685 |
from openpyxlzip.reader.excel import load_workbook
from openpyxlzip.xml.functions import tostring, fromstring
from openpyxlzip.styles import Border, Side, PatternFill, Color, Font, fills, borders, colors
from openpyxlzip.styles.differential import DifferentialStyle, DifferentialStyleList
from openpyxlzip.formatting.... | true | true |
79021dbcba2e186f6f4b712e41dcad4f4c8434a7 | 371 | py | Python | raachem/__init__.py | ricalmang/raachem | d00d634957a27e43e706c7faa565fb15b3cf154c | [
"MIT"
] | null | null | null | raachem/__init__.py | ricalmang/raachem | d00d634957a27e43e706c7faa565fb15b3cf154c | [
"MIT"
] | null | null | null | raachem/__init__.py | ricalmang/raachem | d00d634957a27e43e706c7faa565fb15b3cf154c | [
"MIT"
] | null | null | null | from raachem.file_class.gjf import *
from raachem.file_class.inp import *
from raachem.file_class.xyz import *
from raachem.file_class.log import *
from raachem.file_creator.e_analysis import *
from raachem.file_creator.input import *
from raachem.file_creator.xyz import *
from raachem.file_creator.deploy_script... | 33.727273 | 50 | 0.800539 | from raachem.file_class.gjf import *
from raachem.file_class.inp import *
from raachem.file_class.xyz import *
from raachem.file_class.log import *
from raachem.file_creator.e_analysis import *
from raachem.file_creator.input import *
from raachem.file_creator.xyz import *
from raachem.file_creator.deploy_script... | true | true |
79021dbf4a6b5d266f763ea1d317aeecc3dde47c | 5,719 | py | Python | torchero/utils/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 10 | 2020-07-06T13:35:26.000Z | 2021-08-10T09:46:53.000Z | torchero/utils/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 6 | 2020-07-07T20:52:16.000Z | 2020-07-14T04:05:02.000Z | torchero/utils/defaults.py | juancruzsosa/torchero | d1440b7a9c3ab2c1d3abbb282abb9ee1ea240797 | [
"MIT"
] | 1 | 2021-06-28T17:56:11.000Z | 2021-06-28T17:56:11.000Z | from collections import Iterable
from torch import nn
from torch import optim
from torchero import meters
from functools import partial
INVALID_MODE_INFERENCE_MESSAGE = (
"Could not infer mode from meter {meter}"
)
def get_default_mode(meter):
if hasattr(meter.__class__, 'DEFAULT_MODE'):
return geta... | 33.641176 | 121 | 0.600979 | from collections import Iterable
from torch import nn
from torch import optim
from torchero import meters
from functools import partial
INVALID_MODE_INFERENCE_MESSAGE = (
"Could not infer mode from meter {meter}"
)
def get_default_mode(meter):
if hasattr(meter.__class__, 'DEFAULT_MODE'):
return geta... | true | true |
79021f169b28382834d2d33f1ae6c402b7b264ac | 1,025 | py | Python | py/umpire/server/migrations/0010.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/umpire/server/migrations/0010.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/umpire/server/migrations/0010.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | # Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import hashlib
import json
import os
_ENV_DIR = '/var/db/factory/umpire'
_CONFIG_PATH = os.path.join(_ENV_DIR, 'active_umpire.json')
def SaveNewActive... | 29.285714 | 72 | 0.702439 |
import hashlib
import json
import os
_ENV_DIR = '/var/db/factory/umpire'
_CONFIG_PATH = os.path.join(_ENV_DIR, 'active_umpire.json')
def SaveNewActiveConfig(config):
json_config = json.dumps(
config, indent=2, separators=(',', ': '), sort_keys=True) + '\n'
json_name = 'umpire.%s.json' % (
hashli... | true | true |
790220292734acc000c5c1f43fcdc72877f94430 | 3,583 | py | Python | tests/mock.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 1,460 | 2018-10-18T18:40:59.000Z | 2022-03-30T18:00:12.000Z | tests/mock.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 124 | 2018-10-31T06:48:18.000Z | 2022-03-25T06:09:25.000Z | tests/mock.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 236 | 2018-10-19T01:16:21.000Z | 2022-03-05T02:05:31.000Z | from sklearn.exceptions import NotFittedError
class MockFunction:
"""
Mock utility function for testing.
"""
def __init__(self, return_val):
self.return_val = return_val
def __call__(self, *args):
return self.return_val
class MockEstimator:
"""
Mock classifier object for... | 25.963768 | 109 | 0.640246 | from sklearn.exceptions import NotFittedError
class MockFunction:
def __init__(self, return_val):
self.return_val = return_val
def __call__(self, *args):
return self.return_val
class MockEstimator:
def __init__(
self, predict_proba_return=None, predict_return=None, score_ret... | true | true |
790220338e52fd95ded98a8563e8b02afe740b69 | 1,373 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/connection_monitor_query_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"MIT"
] | null | null | null | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/connection_monitor_query_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/connection_monitor_query_result.py | bgsky/azure-sdk-for-python | ec18d0b25be10fddbde416b901b905dfb0896430 | [
"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 ... | 38.138889 | 78 | 0.633649 |
from msrest.serialization import Model
class ConnectionMonitorQueryResult(Model):
_attribute_map = {
'source_status': {'key': 'sourceStatus', 'type': 'str'},
'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'},
}
def __init__(self, **kwargs):
super(Connect... | true | true |
790221c7c259c055129b58e15300b854208937b1 | 2,775 | py | Python | test/data_check/check_linearity_fft.py | kjdavidson/NoisePy | a7445dd2f68f64cb562d6a87096e5f12a2c3b612 | [
"MIT"
] | 74 | 2019-11-08T18:32:36.000Z | 2022-03-27T11:26:53.000Z | test/data_check/check_linearity_fft.py | kjdavidson/NoisePy | a7445dd2f68f64cb562d6a87096e5f12a2c3b612 | [
"MIT"
] | 23 | 2019-11-10T01:30:04.000Z | 2022-03-24T10:23:19.000Z | test/data_check/check_linearity_fft.py | kjdavidson/NoisePy | a7445dd2f68f64cb562d6a87096e5f12a2c3b612 | [
"MIT"
] | 36 | 2019-11-08T19:36:28.000Z | 2022-02-17T06:31:42.000Z | import pyasdf
import numpy as np
import scipy.fftpack
import matplotlib.pyplot as plt
'''
this script takes a chunk of noise spectrum for a station pair and
compare their cross-correlation functions computed using two schemes:
one is averaging the frequency domain and the other is in the time
domain
'''
def cross... | 31.896552 | 87 | 0.670991 | import pyasdf
import numpy as np
import scipy.fftpack
import matplotlib.pyplot as plt
def cross_correlation1(fft1,fft2,maxlag,dt,Nfft):
corr = np.zeros(fft1.shape,dtype=np.complex64)
corr = np.conj(fft1) * fft2
ncorr = np.zeros((fft1.shape[0],Nfft),dtype=np.complex64)
ncorr[:,:Nfft//2] = corr... | true | true |
7902223521790ef3aa633aeb20fc1246cb025f63 | 178 | py | Python | GodwillOnyewuchi/Phase 1/Python Basic 2/day 9 task/task 9.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | GodwillOnyewuchi/Phase 1/Python Basic 2/day 9 task/task 9.py | GREENFONTS/python-challenge-solutions | a9aad85a250892fe41961a7d5e77f67b8d14fc1b | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | GodwillOnyewuchi/Phase 1/Python Basic 2/day 9 task/task 9.py | GREENFONTS/python-challenge-solutions | a9aad85a250892fe41961a7d5e77f67b8d14fc1b | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | #Python program to get the size of an object in bytes
import sys
Object = input("Enter any object: ")
print(f'The size of the object {Object} is {sys.getsizeof(Object)} bytes')
| 29.666667 | 74 | 0.735955 |
import sys
Object = input("Enter any object: ")
print(f'The size of the object {Object} is {sys.getsizeof(Object)} bytes')
| true | true |
79022247169ae3c9e16acb9d5f54fe737a46879d | 25,303 | py | Python | WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | 1 | 2019-06-18T06:52:54.000Z | 2019-06-18T06:52:54.000Z | WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | null | null | null | WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py | JavaScriptTesting/LJS | 9818dbdb421036569fff93124ac2385d45d01c3a | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 38.279879 | 110 | 0.651306 |
import logging
import os
import subprocess
import sys
import time
import urllib2
import xml.dom.minidom
from webkitpy.common.net.file_uploader import FileUploader
try:
import json
except ImportError:
import webkitpy.thirdparty.simplejson as json
_log = logging.getLogger(__... | false | true |
790222b163067014c484f87531fe0ebfc7a295fa | 5,094 | py | Python | tests/components/stream/test_hls.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 3 | 2021-04-27T16:37:48.000Z | 2022-02-23T02:47:33.000Z | tests/components/stream/test_hls.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 48 | 2019-02-06T22:08:09.000Z | 2022-03-31T06:02:22.000Z | tests/components/stream/test_hls.py | miccico/core | 14c205384171dee59c1a908f8449f9864778b2dc | [
"Apache-2.0"
] | 4 | 2019-02-04T15:56:36.000Z | 2020-12-03T02:03:45.000Z | """The tests for hls streams."""
from datetime import timedelta
from unittest.mock import patch
from urllib.parse import urlparse
import av
from homeassistant.components.stream import request_stream
from homeassistant.const import HTTP_NOT_FOUND
from homeassistant.setup import async_setup_component
import homeassista... | 29.616279 | 78 | 0.698469 | from datetime import timedelta
from unittest.mock import patch
from urllib.parse import urlparse
import av
from homeassistant.components.stream import request_stream
from homeassistant.const import HTTP_NOT_FOUND
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests... | true | true |
79022355a0d53b3d1c4f3382dd17d1dccb6b5867 | 2,065 | py | Python | tools/mo/openvino/tools/mo/front/tf/reduce_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2019-09-22T01:05:07.000Z | 2019-09-22T01:05:07.000Z | tools/mo/openvino/tools/mo/front/tf/reduce_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/openvino/tools/mo/front/tf/reduce_ext.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2021-07-14T07:40:50.000Z | 2021-07-27T01:40:03.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.ops.ReduceOps import ReduceProd, ReduceAnd, ReduceMax, ReduceMean, ReduceSum, ReduceL2, ReduceMin
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.graph.graph import Node
clas... | 26.474359 | 120 | 0.685714 |
from openvino.tools.mo.ops.ReduceOps import ReduceProd, ReduceAnd, ReduceMax, ReduceMean, ReduceSum, ReduceL2, ReduceMin
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.graph.graph import Node
class AllFrontExtractor(FrontExtractorOp):
op = 'All'
enabled = True
@c... | true | true |
79022408e15b78bf1ccfa1fa8a176ba4db1d9b7f | 38,012 | py | Python | sonic_installer/main.py | sumukhatv/sonic-utilities | 2b12aadeed3a86ca4ede3aa30b451914c4acb00b | [
"Apache-2.0"
] | null | null | null | sonic_installer/main.py | sumukhatv/sonic-utilities | 2b12aadeed3a86ca4ede3aa30b451914c4acb00b | [
"Apache-2.0"
] | null | null | null | sonic_installer/main.py | sumukhatv/sonic-utilities | 2b12aadeed3a86ca4ede3aa30b451914c4acb00b | [
"Apache-2.0"
] | null | null | null | import configparser
import os
import re
import subprocess
import sys
import time
import utilities_common.cli as clicommon
from urllib.request import urlopen, urlretrieve
import click
from sonic_py_common import logger
from swsscommon.swsscommon import SonicV2Connector
from .bootloader import get_bootloader
from .comm... | 42.141907 | 150 | 0.669631 | import configparser
import os
import re
import subprocess
import sys
import time
import utilities_common.cli as clicommon
from urllib.request import urlopen, urlretrieve
import click
from sonic_py_common import logger
from swsscommon.swsscommon import SonicV2Connector
from .bootloader import get_bootloader
from .comm... | true | true |
7902242e402c503e54f106a528684f979953f800 | 4,952 | py | Python | fastapi_users/db/tortoise.py | okadath/sawfish_users | bf9d8c28a4c924656fa3197661603cbdfd15bce1 | [
"MIT"
] | 1 | 2021-07-29T15:53:22.000Z | 2021-07-29T15:53:22.000Z | fastapi_users/db/tortoise.py | okadath/sawfish_users | bf9d8c28a4c924656fa3197661603cbdfd15bce1 | [
"MIT"
] | 141 | 2020-11-29T19:37:16.000Z | 2022-03-18T04:25:04.000Z | fastapi_users/db/tortoise.py | SeaMLessNuke/fastapi-users | 7186554e30eed2fe3c02b3b097618b200b47081d | [
"MIT"
] | 1 | 2020-11-21T13:05:08.000Z | 2020-11-21T13:05:08.000Z | from typing import Optional, Type
from pydantic import UUID4
from tortoise import fields, models
from tortoise.exceptions import DoesNotExist
from fastapi_users.db.base import BaseUserDatabase
from fastapi_users.models import UD
class TortoiseBaseUserModel(models.Model):
id = fields.UUIDField(pk=True, generated... | 33.917808 | 87 | 0.657108 | from typing import Optional, Type
from pydantic import UUID4
from tortoise import fields, models
from tortoise.exceptions import DoesNotExist
from fastapi_users.db.base import BaseUserDatabase
from fastapi_users.models import UD
class TortoiseBaseUserModel(models.Model):
id = fields.UUIDField(pk=True, generated... | true | true |
79022467c277493c78b0c32ba69ea2b3b273c78b | 387 | py | Python | Python/grafico_3d.py | filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R | c9b72f93b2a6ead49641d765fe2a0f23ffb4b1bf | [
"MIT"
] | null | null | null | Python/grafico_3d.py | filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R | c9b72f93b2a6ead49641d765fe2a0f23ffb4b1bf | [
"MIT"
] | null | null | null | Python/grafico_3d.py | filipeaguiarrod/Formacao-Cientista-de-Dados-com-Python-e-R | c9b72f93b2a6ead49641d765fe2a0f23ffb4b1bf | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
base = pd.read_csv('orchard.csv')
figura = plt.figure()
eixo = figura.add_subplot(1, 1, 1, projection = '3d')
eixo.scatter(base.decrease, base.rowpos, base.colpos)
eixo.set_xlabel('decrease')
eixo.set_ylabel('rowpos')
eixo.set... | 25.8 | 53 | 0.75969 | import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
base = pd.read_csv('orchard.csv')
figura = plt.figure()
eixo = figura.add_subplot(1, 1, 1, projection = '3d')
eixo.scatter(base.decrease, base.rowpos, base.colpos)
eixo.set_xlabel('decrease')
eixo.set_ylabel('rowpos')
eixo.set... | true | true |
7902253815a07aa00bdbf5c9e890e7ad8006f0c7 | 14,112 | py | Python | pysnmp-with-texts/NOKIA-HWM-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/NOKIA-HWM-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/NOKIA-HWM-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 NOKIA-HWM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NOKIA-HWM-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:23:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... | 168 | 1,280 | 0.772321 |
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint = mibBuild... | true | true |
790225e25d838f46b818488245b28e44b81fde95 | 710 | py | Python | warehouse/views.py | thiagolcmelo/dynamic | 9e4e71dd25ce3c778b17b62ef4062273d244a5ac | [
"MIT"
] | null | null | null | warehouse/views.py | thiagolcmelo/dynamic | 9e4e71dd25ce3c778b17b62ef4062273d244a5ac | [
"MIT"
] | null | null | null | warehouse/views.py | thiagolcmelo/dynamic | 9e4e71dd25ce3c778b17b62ef4062273d244a5ac | [
"MIT"
] | null | null | null | # third-party
from flask import render_template, url_for, request, jsonify
# locals
from . import warehouse
@warehouse.route('/element_types', methods=['GET'])
def index():
return render_template("warehouse/element_types.html")
@warehouse.route('/element_type', methods=['POST'])
def create_new_element_type():
... | 26.296296 | 70 | 0.707042 |
from flask import render_template, url_for, request, jsonify
from . import warehouse
@warehouse.route('/element_types', methods=['GET'])
def index():
return render_template("warehouse/element_types.html")
@warehouse.route('/element_type', methods=['POST'])
def create_new_element_type():
print(request.__dic... | true | true |
790227386ce142fb8ecd7023bdcfa79290713f62 | 9,624 | py | Python | SimPEG/electromagnetics/natural_source/survey.py | xli94/simpeg | bf765d73d1c104805e30bcd062426e36a1d48d51 | [
"MIT"
] | 1 | 2021-12-09T18:33:24.000Z | 2021-12-09T18:33:24.000Z | SimPEG/electromagnetics/natural_source/survey.py | albertoakel/teste_mgeo | a0078301f7dfd54431d6b51abcf092079ad0e5a3 | [
"MIT"
] | null | null | null | SimPEG/electromagnetics/natural_source/survey.py | albertoakel/teste_mgeo | a0078301f7dfd54431d6b51abcf092079ad0e5a3 | [
"MIT"
] | 1 | 2021-07-30T19:15:23.000Z | 2021-07-30T19:15:23.000Z | import sys
import numpy as np
from numpy.lib import recfunctions as recFunc
from ..frequency_domain.survey import Survey
from ...data import Data as BaseData
from ...utils import mkvc
from .sources import Planewave_xy_1Dprimary, Planewave_xy_1DhomotD
from .receivers import Point3DImpedance, Point3DTipper
from .utils.p... | 36.732824 | 157 | 0.520989 | import sys
import numpy as np
from numpy.lib import recfunctions as recFunc
from ..frequency_domain.survey import Survey
from ...data import Data as BaseData
from ...utils import mkvc
from .sources import Planewave_xy_1Dprimary, Planewave_xy_1DhomotD
from .receivers import Point3DImpedance, Point3DTipper
from .utils.p... | true | true |
7902275a5ba87c6c4f294a59d97f714f0d537b1a | 77,984 | py | Python | terminusdb_client/woqlclient/woqlClient.py | terminusdb/woql-client-p | 69f824159ee3c4977a9813f81cf3cb00c6efce01 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woqlclient/woqlClient.py | terminusdb/woql-client-p | 69f824159ee3c4977a9813f81cf3cb00c6efce01 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woqlclient/woqlClient.py | terminusdb/woql-client-p | 69f824159ee3c4977a9813f81cf3cb00c6efce01 | [
"Apache-2.0"
] | null | null | null | """woqlClient.py
WOQLClient is the Python public API for TerminusDB"""
import copy
import gzip
import json
import os
import urllib.parse as urlparse
import warnings
from collections.abc import Iterable
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional, Union
import reques... | 33.241262 | 313 | 0.552408 | import copy
import gzip
import json
import os
import urllib.parse as urlparse
import warnings
from collections.abc import Iterable
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional, Union
import requests
from ..__version__ import __version__
from ..errors import Database... | true | true |
7902286a22c1d2ca76b1aa31973b48dc206917ce | 4,725 | py | Python | tests/test_examples.py | MF-Zerai/HiSim | 7497e6791dc937ee6e26ceafbf1bc2ae2449f123 | [
"MIT"
] | null | null | null | tests/test_examples.py | MF-Zerai/HiSim | 7497e6791dc937ee6e26ceafbf1bc2ae2449f123 | [
"MIT"
] | null | null | null | tests/test_examples.py | MF-Zerai/HiSim | 7497e6791dc937ee6e26ceafbf1bc2ae2449f123 | [
"MIT"
] | 1 | 2022-03-13T16:15:36.000Z | 2022-03-13T16:15:36.000Z | import os
from hisim import hisim_main
from hisim.simulationparameters import SimulationParameters
import shutil
import random
from hisim import log
from hisim.utils import PostProcessingOptions
import matplotlib.pyplot as plt
from hisim import utils
@utils.measure_execution_time
def test_basic_household():
# if o... | 44.575472 | 99 | 0.720212 | import os
from hisim import hisim_main
from hisim.simulationparameters import SimulationParameters
import shutil
import random
from hisim import log
from hisim.utils import PostProcessingOptions
import matplotlib.pyplot as plt
from hisim import utils
@utils.measure_execution_time
def test_basic_household():
... | true | true |
790228f0d7b0b7c0c0bf97f9f62fc9c2186c692e | 404 | py | Python | python_part/trees.py | daniel98789/bullet3 | b57aa900293e21f7808ea2697a5b64b494867492 | [
"Zlib"
] | null | null | null | python_part/trees.py | daniel98789/bullet3 | b57aa900293e21f7808ea2697a5b64b494867492 | [
"Zlib"
] | null | null | null | python_part/trees.py | daniel98789/bullet3 | b57aa900293e21f7808ea2697a5b64b494867492 | [
"Zlib"
] | null | null | null | import PyBulletEnv
import Obj
from numpy import random
if __name__ == "__main__":
env = PyBulletEnv.PyBulletEnv()
env.setup()
tree = Obj.Obj("data/tree/Tree.obj")
forest = []
for _ in range(2):
x = random.uniform(0, 20)
y = random.uniform(0, 20)
forest.append(tree.crea... | 18.363636 | 62 | 0.589109 | import PyBulletEnv
import Obj
from numpy import random
if __name__ == "__main__":
env = PyBulletEnv.PyBulletEnv()
env.setup()
tree = Obj.Obj("data/tree/Tree.obj")
forest = []
for _ in range(2):
x = random.uniform(0, 20)
y = random.uniform(0, 20)
forest.append(tree.crea... | true | true |
790229210c0ff020be13cad60a8632a62d337f0e | 2,584 | py | Python | test/test_v3_client.py | mukasaj/Ex-assemblyline-client | f3605157d0d5c8ecc852d8cdf5ef9ae2f15a42a3 | [
"MIT"
] | null | null | null | test/test_v3_client.py | mukasaj/Ex-assemblyline-client | f3605157d0d5c8ecc852d8cdf5ef9ae2f15a42a3 | [
"MIT"
] | null | null | null | test/test_v3_client.py | mukasaj/Ex-assemblyline-client | f3605157d0d5c8ecc852d8cdf5ef9ae2f15a42a3 | [
"MIT"
] | null | null | null |
import assemblyline_client
import mocks
import mock
from base64 import b64decode
def test_bad_cert():
"""Make sure that the client detects that the test cert is self signed."""
with mocks.Server() as server:
try:
assemblyline_client.get_client(server.address)
assert False
... | 38 | 108 | 0.662152 |
import assemblyline_client
import mocks
import mock
from base64 import b64decode
def test_bad_cert():
with mocks.Server() as server:
try:
assemblyline_client.get_client(server.address)
assert False
except assemblyline_client.ClientError as ce:
assert 'CERTIFIC... | true | true |
7902293dc0914a97b8baa901246888adae996d22 | 11,381 | py | Python | utils/training_loop.py | houcharlie/federated | b8b12f2f424f4c637be1e1fe8482ecc94ee3765a | [
"Apache-2.0"
] | null | null | null | utils/training_loop.py | houcharlie/federated | b8b12f2f424f4c637be1e1fe8482ecc94ee3765a | [
"Apache-2.0"
] | null | null | null | utils/training_loop.py | houcharlie/federated | b8b12f2f424f4c637be1e1fe8482ecc94ee3765a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 41.086643 | 80 | 0.734645 |
import contextlib
import os.path
import pprint
import time
from typing import Any, Callable, Dict, List, Optional
from absl import logging
import tensorflow as tf
import tensorflow_federated as tff
class IterativeProcessCompatibilityError(TypeError):
pass
def create_if_not_exists(path):
try:
... | true | true |
790229404fe0d9f9f004577ef9d50df5c9a93fca | 526 | py | Python | full-problems/knapsackWithDuplicates.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | full-problems/knapsackWithDuplicates.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | full-problems/knapsackWithDuplicates.py | vikas-t/DS-Algo | ea654d1cad5374c824c52da9d3815a9546eb43fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# https://practice.geeksforgeeks.org/problems/knapsack-with-duplicate-items/0
def sol(n, w, wt, v):
"""
We do not need to create a 2d array here because all numbers are available
always
Try all items for weight ranging from 1 to w and check if weight
can be picked. Take the max of... | 30.941176 | 78 | 0.587452 |
def sol(n, w, wt, v):
dp = [0 for i in range(w+1)]
for i in range(n):
for j in range(w+1):
if wt[i] <= j:
dp[j] = max(dp[j], v[i]+dp[j-wt[i]])
return dp[w] | true | true |
790229476a7b983d651371dbb6bc37cebd97f560 | 21,127 | py | Python | qsdsan/sanunits/_suspended_growth_bioreactor.py | QSD-for-WaSH/sanitation | cbcbdd7ead382a6e66b51b5193852494ab3f081b | [
"Unlicense"
] | 2 | 2020-11-16T17:27:47.000Z | 2020-11-19T16:10:45.000Z | qsdsan/sanunits/_suspended_growth_bioreactor.py | QSD-for-WaSH/sanitation | cbcbdd7ead382a6e66b51b5193852494ab3f081b | [
"Unlicense"
] | null | null | null | qsdsan/sanunits/_suspended_growth_bioreactor.py | QSD-for-WaSH/sanitation | cbcbdd7ead382a6e66b51b5193852494ab3f081b | [
"Unlicense"
] | 3 | 2020-10-29T16:31:39.000Z | 2020-11-05T17:09:06.000Z | # -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
Joy Zhang <joycheung1994@gmail.com>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-Group/QSDsan/blob/main/... | 38.412727 | 118 | 0.576229 |
from .. import SanUnit, WasteStream, Process, Processes, CompiledProcesses
from ._clarifier import _settling_flux
from sympy import symbols, lambdify, Matrix
from scipy.integrate import solve_ivp
from warnings import warn
from math import floor, ceil
import numpy as np
import pandas as pd
from numba import njit
__al... | true | true |
79022949262001f47530fe0b92a54b64b5b28cf9 | 12,246 | py | Python | tests/test_waterheatermixed.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 19 | 2015-12-08T23:33:51.000Z | 2022-01-31T04:41:10.000Z | tests/test_waterheatermixed.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 2 | 2019-10-04T10:57:00.000Z | 2021-10-01T06:46:17.000Z | tests/test_waterheatermixed.py | marcelosalles/pyidf | c2f744211572b5e14e29522aac1421ba88addb0e | [
"Apache-2.0"
] | 7 | 2015-11-04T02:25:01.000Z | 2021-12-08T03:14:28.000Z | import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.water_heaters_and_thermal_storage import WaterHeaterMixed
log = logging.getLogger(__name__)
class TestWaterHeaterMixed(unittest.TestCase):
def setUp(self):
self.fd,... | 61.848485 | 164 | 0.787686 | import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.water_heaters_and_thermal_storage import WaterHeaterMixed
log = logging.getLogger(__name__)
class TestWaterHeaterMixed(unittest.TestCase):
def setUp(self):
self.fd,... | true | true |
79022ae3850974f846ceba8fa65b58398682e79d | 3,184 | py | Python | tests/utils/wsgi/tests.py | ascan-io/raven-python | 5b3f48c66269993a0202cfc988750e5fe66e0c00 | [
"BSD-3-Clause"
] | 1,108 | 2015-01-02T01:20:00.000Z | 2022-03-09T02:22:40.000Z | tests/utils/wsgi/tests.py | nvllsvm/raven-python | c4403f21973138cd20cf9c005da4fb934836d76e | [
"BSD-3-Clause"
] | 698 | 2015-01-04T11:12:57.000Z | 2022-01-22T08:07:51.000Z | tests/utils/wsgi/tests.py | nvllsvm/raven-python | c4403f21973138cd20cf9c005da4fb934836d76e | [
"BSD-3-Clause"
] | 486 | 2015-01-04T09:00:33.000Z | 2022-03-09T02:37:18.000Z | from raven.utils.testutils import TestCase
from raven.utils.wsgi import get_headers, get_host, get_environ, get_client_ip
class GetHeadersTest(TestCase):
def test_tuple_as_key(self):
result = dict(get_headers({
('a', 'tuple'): 'foo',
}))
self.assertEquals(result, {})
def t... | 32.824742 | 78 | 0.612437 | from raven.utils.testutils import TestCase
from raven.utils.wsgi import get_headers, get_host, get_environ, get_client_ip
class GetHeadersTest(TestCase):
def test_tuple_as_key(self):
result = dict(get_headers({
('a', 'tuple'): 'foo',
}))
self.assertEquals(result, {})
def t... | true | true |
79022b02587d8187215cec19bd318291e2285fc1 | 1,650 | py | Python | Assignment/Environmental_Project/part_A.py | Maruja/Maruja-ILAS-Python | af304bfa2767fb30982e88d4b2138113237ba99d | [
"MIT"
] | null | null | null | Assignment/Environmental_Project/part_A.py | Maruja/Maruja-ILAS-Python | af304bfa2767fb30982e88d4b2138113237ba99d | [
"MIT"
] | null | null | null | Assignment/Environmental_Project/part_A.py | Maruja/Maruja-ILAS-Python | af304bfa2767fb30982e88d4b2138113237ba99d | [
"MIT"
] | null | null | null | from pandas import read_csv
from IPython.display import display
import numpy as np
import sys
import math
###############################
####Maria Eugenia Lopez #####
###############################
def fully_grown_depuration(number_to_remove=0.50):
return plants.loc[plants.height_m > number_to_remove]
def con... | 27.04918 | 75 | 0.621212 | from pandas import read_csv
from IPython.display import display
import numpy as np
import sys
import math
| true | true |
79022c0a04e64d398c42c8992ac71551c676d280 | 248 | py | Python | encuestaapp/encuestaapp/doctype/encuesta/encuesta.py | ErickLopez76/encuestaapp | f700ce3bf1b1d5decaf511876a705e1bb2894168 | [
"MIT"
] | null | null | null | encuestaapp/encuestaapp/doctype/encuesta/encuesta.py | ErickLopez76/encuestaapp | f700ce3bf1b1d5decaf511876a705e1bb2894168 | [
"MIT"
] | null | null | null | encuestaapp/encuestaapp/doctype/encuesta/encuesta.py | ErickLopez76/encuestaapp | f700ce3bf1b1d5decaf511876a705e1bb2894168 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, SIS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Encuesta(Document):
pass
| 22.545455 | 49 | 0.774194 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Encuesta(Document):
pass
| true | true |
79022cd7e04ec932f9a0cabe49501c8ca21093a9 | 8,057 | py | Python | cryptoapis/model/address_tokens_transaction_unconfirmed_omnilayertoken.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | null | null | null | cryptoapis/model/address_tokens_transaction_unconfirmed_omnilayertoken.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | null | null | null | cryptoapis/model/address_tokens_transaction_unconfirmed_omnilayertoken.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | 1 | 2021-07-21T03:35:18.000Z | 2021-07-21T03:35:18.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 43.085561 | 484 | 0.60767 |
import re
import sys
from cryptoapis.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
class... | true | true |
79022d91cb29da2457287e5fc0b7d5dcf474992c | 785 | py | Python | galaxy_api/api/v3/serializers/namespace.py | newswangerd/galaxy-api | af38b8f8931d3e0e6d43c0ab3e752305a9e59241 | [
"Apache-2.0"
] | null | null | null | galaxy_api/api/v3/serializers/namespace.py | newswangerd/galaxy-api | af38b8f8931d3e0e6d43c0ab3e752305a9e59241 | [
"Apache-2.0"
] | null | null | null | galaxy_api/api/v3/serializers/namespace.py | newswangerd/galaxy-api | af38b8f8931d3e0e6d43c0ab3e752305a9e59241 | [
"Apache-2.0"
] | null | null | null | from django.db import transaction
from rest_framework.serializers import ModelSerializer
from galaxy_api.api import models
class NamespaceLinkSerializer(ModelSerializer):
class Meta:
model = models.NamespaceLink
fields = ('name', 'url')
class NamespaceSerializer(ModelSerializer):
links = N... | 26.166667 | 83 | 0.677707 | from django.db import transaction
from rest_framework.serializers import ModelSerializer
from galaxy_api.api import models
class NamespaceLinkSerializer(ModelSerializer):
class Meta:
model = models.NamespaceLink
fields = ('name', 'url')
class NamespaceSerializer(ModelSerializer):
links = N... | true | true |
79022dba482c5c0b18be51a3860de0819c255794 | 2,432 | py | Python | app.py | RodolfoFerro/iris-api | 3034a1629d28feb215be2fdbf24edbd1176ff0d6 | [
"MIT"
] | null | null | null | app.py | RodolfoFerro/iris-api | 3034a1629d28feb215be2fdbf24edbd1176ff0d6 | [
"MIT"
] | null | null | null | app.py | RodolfoFerro/iris-api | 3034a1629d28feb215be2fdbf24edbd1176ff0d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ===============================================================
# Author: Rodolfo Ferro
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro, for
# his workshop in HackSureste 2019 at Universidad... | 22.518519 | 65 | 0.581003 |
from flask import Flask, jsonify, request, render_template
from iris import iris_classifier
from pprint import pprint
import numpy as np
import requests
import json
app = Flask(__name__)
version = 'v0.0'
classifier = iris_classifier()
species = {
'0': 'I. setosa',
'1': 'I. versicolor',
'... | true | true |
79022e001b0a8fc66527c0a45e9e3e15b278f859 | 764 | py | Python | tests/test_modules/test_builtin/test_stringmeta.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | tests/test_modules/test_builtin/test_stringmeta.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | tests/test_modules/test_builtin/test_stringmeta.py | MattTaylorDLS/pymalcolm | 995a8e4729bd745f8f617969111cc5a34ce1ac14 | [
"Apache-2.0"
] | null | null | null | import unittest
from malcolm.modules.builtin.vmetas import StringMeta
class TestValidate(unittest.TestCase):
def setUp(self):
self.string_meta = StringMeta("test string description")
def test_given_value_str_then_return(self):
response = self.string_meta.validate("TestValue")
asser... | 25.466667 | 64 | 0.708115 | import unittest
from malcolm.modules.builtin.vmetas import StringMeta
class TestValidate(unittest.TestCase):
def setUp(self):
self.string_meta = StringMeta("test string description")
def test_given_value_str_then_return(self):
response = self.string_meta.validate("TestValue")
asser... | true | true |
79022edc1efa0813d11211efa020586eec17e0f1 | 1,163 | py | Python | test/integration/daos/test_player_dao.py | jrj92280/python-eve-backend | c0566cdef5e5c75e2b75e59bde804e0d4ce407e3 | [
"MIT"
] | null | null | null | test/integration/daos/test_player_dao.py | jrj92280/python-eve-backend | c0566cdef5e5c75e2b75e59bde804e0d4ce407e3 | [
"MIT"
] | null | null | null | test/integration/daos/test_player_dao.py | jrj92280/python-eve-backend | c0566cdef5e5c75e2b75e59bde804e0d4ce407e3 | [
"MIT"
] | null | null | null | from datetime import datetime
from chess_game.daos.player_dao import PlayerDao
from chess_game.models.player import Player
def test_player_dao_init(mongo_database):
player_dao = PlayerDao(mongo_database)
assert mongo_database == player_dao._mongo_database
def test_dao_create_and_find_player(mongo_database)... | 31.432432 | 88 | 0.736028 | from datetime import datetime
from chess_game.daos.player_dao import PlayerDao
from chess_game.models.player import Player
def test_player_dao_init(mongo_database):
player_dao = PlayerDao(mongo_database)
assert mongo_database == player_dao._mongo_database
def test_dao_create_and_find_player(mongo_database)... | true | true |
79022eea5f202befb3d865da12ea9717575bfe7c | 1,231 | py | Python | lcb_version.py | griels/couchbase-python-client-ng | bcda55109f82e41041cf727d604bb335546f64e4 | [
"Apache-2.0"
] | 1 | 2019-10-01T19:06:29.000Z | 2019-10-01T19:06:29.000Z | lcb_version.py | pauldx/couchbase-python-client | 98bdd44604675f7ad844b39f72e754dec6445cbb | [
"Apache-2.0"
] | null | null | null | lcb_version.py | pauldx/couchbase-python-client | 98bdd44604675f7ad844b39f72e754dec6445cbb | [
"Apache-2.0"
] | null | null | null | import logging
import warnings
lcb_min_version_baseline = (2, 9, 0)
def get_lcb_min_version():
result = lcb_min_version_baseline
try:
# check the version listed in README.rst isn't greater than lcb_min_version
# bump it up to the specified version if it is
import docutils.parsers.rst
... | 38.46875 | 118 | 0.656377 | import logging
import warnings
lcb_min_version_baseline = (2, 9, 0)
def get_lcb_min_version():
result = lcb_min_version_baseline
try:
# bump it up to the specified version if it is
import docutils.parsers.rst
import docutils.utils
import docutils.frontend
par... | true | true |
7902302e000b2b50d5fa2ccfac4751c48f081444 | 4,412 | py | Python | setup.py | zalando/github-maintainer-cli | 786610ab63e3d9e4c94edd0f013f04b006e9624f | [
"Apache-2.0"
] | 10 | 2016-06-07T06:00:27.000Z | 2016-11-26T18:35:13.000Z | setup.py | hjacobs/github-maintainer-cli | 786610ab63e3d9e4c94edd0f013f04b006e9624f | [
"Apache-2.0"
] | 4 | 2015-11-26T17:56:33.000Z | 2016-05-14T09:27:42.000Z | setup.py | zalando-stups/github-maintainer-cli | 786610ab63e3d9e4c94edd0f013f04b006e9624f | [
"Apache-2.0"
] | 2 | 2018-11-17T16:58:39.000Z | 2021-07-09T23:46:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import inspect
import setuptools
from setuptools.command.test import test as TestCommand
from setuptools import setup
if sys.version_info < (3, 4, 0):
sys.stderr.write('FATAL: This script needs to be run with Python 3.4+\n')
sys.exit(1)
__lo... | 31.514286 | 114 | 0.636673 |
import sys
import os
import inspect
import setuptools
from setuptools.command.test import test as TestCommand
from setuptools import setup
if sys.version_info < (3, 4, 0):
sys.stderr.write('FATAL: This script needs to be run with Python 3.4+\n')
sys.exit(1)
__location__ = os.path.join(os.getcwd(), os.path... | true | true |
790230325a2c117d009ad0980a677f43d07b8482 | 3,862 | py | Python | tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/python/data/experimental/benchmarks/parallel_interleave_benchmark.py | abhaikollara/tensorflow | 4f96df3659696990cb34d0ad07dc67843c4225a9 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2019 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... | 36.780952 | 80 | 0.71854 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import numpy as np
from tensorflow.python.client import session
from tensorflow.python.data.experimental.ops import interleave_ops
from tensorflow.python.data.experimental.ops import... | true | true |
790230d92747e5bba04351a3b19b3db38b41c4ac | 2,361 | py | Python | v1/v1.0.0/gui/control_button_frame.py | vt-gs/tracking_client | 81abc803766f935118ad37fa7492a8ab1f7c3582 | [
"MIT"
] | null | null | null | v1/v1.0.0/gui/control_button_frame.py | vt-gs/tracking_client | 81abc803766f935118ad37fa7492a8ab1f7c3582 | [
"MIT"
] | null | null | null | v1/v1.0.0/gui/control_button_frame.py | vt-gs/tracking_client | 81abc803766f935118ad37fa7492a8ab1f7c3582 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#version 2.1
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4 import Qt
import PyQt4.Qwt5 as Qwt
from PyQt4.QtCore import pyqtSignal
class control_button_frame(QtGui.QFrame):
def __init__(self, parent=None, az_el = None):
super(control_button_frame, self).__init__()
... | 34.217391 | 83 | 0.694197 |
from PyQt4 import QtGui
from PyQt4 import QtCore
from PyQt4 import Qt
import PyQt4.Qwt5 as Qwt
from PyQt4.QtCore import pyqtSignal
class control_button_frame(QtGui.QFrame):
def __init__(self, parent=None, az_el = None):
super(control_button_frame, self).__init__()
self.parent = parent
se... | true | true |
790232e93462bb29267dbaff4e7e4e9e469fbbfc | 22,553 | py | Python | python/sls.py | DuttaAbhigyan/robust-adaptive-lqr | 89d5ff606806a389a1ec4026bc5c17fb51573ae6 | [
"MIT"
] | 26 | 2018-06-12T07:58:13.000Z | 2022-03-06T19:45:25.000Z | python/sls.py | DuttaAbhigyan/robust-adaptive-lqr | 89d5ff606806a389a1ec4026bc5c17fb51573ae6 | [
"MIT"
] | null | null | null | python/sls.py | DuttaAbhigyan/robust-adaptive-lqr | 89d5ff606806a389a1ec4026bc5c17fb51573ae6 | [
"MIT"
] | 7 | 2019-05-21T15:47:18.000Z | 2021-12-11T11:13:43.000Z | """sls.py
An implementation of the robust adaptive controller.
Both FIR SLS version with CVXPY and the common
Lyapunov relaxation.
"""
import numpy as np
import cvxpy as cvx
import utils
import logging
import math
import scipy.linalg
from abc import ABC, abstractmethod
from adaptive import AdaptiveMethod
class ... | 33.166176 | 207 | 0.579479 |
import numpy as np
import cvxpy as cvx
import utils
import logging
import math
import scipy.linalg
from abc import ABC, abstractmethod
from adaptive import AdaptiveMethod
class SLSInfeasibleException(Exception):
def __init__(self, msg=None):
super().__init__(msg)
def make_state_space_controller(Phi_x, ... | true | true |
790232f83ba7b743ce4f67462f236a3d4e6f1ec2 | 288 | py | Python | ChatApp/settings.py | xckomorebi/ChatApp | cc59208e4d31391ea7be5075d629479a4fffd2b6 | [
"MIT"
] | null | null | null | ChatApp/settings.py | xckomorebi/ChatApp | cc59208e4d31391ea7be5075d629479a4fffd2b6 | [
"MIT"
] | null | null | null | ChatApp/settings.py | xckomorebi/ChatApp | cc59208e4d31391ea7be5075d629479a4fffd2b6 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
DB_NAME = "chatapp.db"
PROJECT_PATH = Path(__file__).parents[1]
DB_PATH = os.path.join(PROJECT_PATH, "resource", DB_NAME)
PORT_MIN = 1024
PORT_MAX = 65535
DEBUG = os.getenv("CHAT_APP_DEBUG", False)
if DEBUG:
TIMEOUT = 30
else:
TIMEOUT = 0.5
| 16.941176 | 57 | 0.71875 | import os
from pathlib import Path
DB_NAME = "chatapp.db"
PROJECT_PATH = Path(__file__).parents[1]
DB_PATH = os.path.join(PROJECT_PATH, "resource", DB_NAME)
PORT_MIN = 1024
PORT_MAX = 65535
DEBUG = os.getenv("CHAT_APP_DEBUG", False)
if DEBUG:
TIMEOUT = 30
else:
TIMEOUT = 0.5
| true | true |
79023304d3fe4dbdbaea5c808ee5263b5eee52d1 | 628 | py | Python | socialpages/migrations/0002_auto_20200808_1457.py | OjureFred/SocialGram | 37afc8cabff9cccfd7f0577d182b13ed463e7c6e | [
"MIT"
] | null | null | null | socialpages/migrations/0002_auto_20200808_1457.py | OjureFred/SocialGram | 37afc8cabff9cccfd7f0577d182b13ed463e7c6e | [
"MIT"
] | null | null | null | socialpages/migrations/0002_auto_20200808_1457.py | OjureFred/SocialGram | 37afc8cabff9cccfd7f0577d182b13ed463e7c6e | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-08 11:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('socialpages', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='tags',
fields=[
('id', m... | 25.12 | 114 | 0.555732 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('socialpages', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='tags',
fields=[
('id', models.AutoField(auto_created=True, primary_ke... | true | true |
79023356e1315490b562a5a13758e54ec31ee7cb | 10,545 | py | Python | doc/source/notebooks/understanding/models.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | doc/source/notebooks/understanding/models.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | doc/source/notebooks/understanding/models.pct.py | christabella/GPflow | 30824d289f8ee3f58d4249238c8b7267e6a0b2fc | [
"Apache-2.0"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,.pct.py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
... | 36.870629 | 478 | 0.715789 |
and parameters
# - how to set parameter values
# - how to constrain parameters (for example, variance > 0)
# - how to fix model parameters
# - how to apply priors to parameters
# - how to optimize models
#
# Then we'll show how to build a simple logistic regression model, demonstrating the ease of... | true | true |
790233e50052c02361257b8c9267aae19af093d6 | 773 | py | Python | src/data/data/__init__.py | autt/gathering-leto | 37894d8d8ad0381a2aacbb38593325a882b030f5 | [
"MIT"
] | null | null | null | src/data/data/__init__.py | autt/gathering-leto | 37894d8d8ad0381a2aacbb38593325a882b030f5 | [
"MIT"
] | null | null | null | src/data/data/__init__.py | autt/gathering-leto | 37894d8d8ad0381a2aacbb38593325a882b030f5 | [
"MIT"
] | null | null | null | import github
import pandas as pd
def get_issues(repo_addr):
g = github.Github()
repo = g.get_repo(repo_addr)
return repo.get_issues()
def fetch_issue_activity(repo_addr):
g = github.Github()
issues = g.get_repo(repo_addr).get_issues(state="all")
events = []
for issue in issues:
... | 24.15625 | 58 | 0.614489 | import github
import pandas as pd
def get_issues(repo_addr):
g = github.Github()
repo = g.get_repo(repo_addr)
return repo.get_issues()
def fetch_issue_activity(repo_addr):
g = github.Github()
issues = g.get_repo(repo_addr).get_issues(state="all")
events = []
for issue in issues:
... | true | true |
7902343dc241ceeebd3d11296237b38ae4cfc1d6 | 1,034 | py | Python | wiki/views.py | ebonnecab/makewiki | c1f83be59730ac1dd0343ffaadeb0c5a4152ecab | [
"MIT"
] | null | null | null | wiki/views.py | ebonnecab/makewiki | c1f83be59730ac1dd0343ffaadeb0c5a4152ecab | [
"MIT"
] | 5 | 2021-03-19T08:24:16.000Z | 2022-02-10T14:13:59.000Z | wiki/views.py | ebonnecab/makewiki | c1f83be59730ac1dd0343ffaadeb0c5a4152ecab | [
"MIT"
] | null | null | null | from django.shortcuts import render
from wiki.models import Page
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.shortcuts import get_object_or_404,render
class PageList(ListView):
"""
This view grabs all the pages out of the database
returns a... | 29.542857 | 79 | 0.675048 | from django.shortcuts import render
from wiki.models import Page
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.shortcuts import get_object_or_404,render
class PageList(ListView):
model = Page
def get(self, request):
pages = Page.objects.... | true | true |
790234a17a1f74001dc6b1699b4850177c06f8f0 | 354 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractReMonsterWiki.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractReMonsterWiki.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractReMonsterWiki.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z | def extractReMonsterWiki(item):
"""
Parser for 'Re:Monster Wiki'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'WATTT' in item['tags']:
return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=fra... | 32.181818 | 89 | 0.714689 | def extractReMonsterWiki(item):
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
if 'WATTT' in item['tags']:
return buildReleaseMessageWithType(item, 'WATTT', vol, chp, frag=frag, postfix=postfix)
return False
| true | true |
7902350138dbedc0ed6f27a1448c4d252b4b5c83 | 745 | py | Python | providers.py | kwanj-k/sibsco | c5642ea0c908457cd145d4df0a485bedd5f88166 | [
"MIT"
] | null | null | null | providers.py | kwanj-k/sibsco | c5642ea0c908457cd145d4df0a485bedd5f88166 | [
"MIT"
] | 1 | 2021-06-02T00:26:43.000Z | 2021-06-02T00:26:43.000Z | providers.py | kwanj-k/sibsco | c5642ea0c908457cd145d4df0a485bedd5f88166 | [
"MIT"
] | null | null | null | """ Third party api wrappers"""
import os
import json
import nexmo
import africastalking
username = os.getenv('africastalking_username')
api_key = os.getenv('africastalking_api_key')
africastalking.initialize(username, api_key)
sms = africastalking.SMS
class ProvidersWrapper:
""" Class with all the thirdy party ... | 27.592593 | 89 | 0.641611 | import os
import json
import nexmo
import africastalking
username = os.getenv('africastalking_username')
api_key = os.getenv('africastalking_api_key')
africastalking.initialize(username, api_key)
sms = africastalking.SMS
class ProvidersWrapper:
def send_message(number, message):
client = nexmo.Client(ke... | true | true |
7902350dee2a3d3b50074578b7417126b6253c64 | 3,756 | py | Python | external/sbml/bindings/python/test/sbml/TestConstraint_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | 1 | 2019-08-22T17:17:41.000Z | 2019-08-22T17:17:41.000Z | external/sbml/bindings/python/test/sbml/TestConstraint_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | external/sbml/bindings/python/test/sbml/TestConstraint_newSetters.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | #
# @file TestConstraint_newSetters.py
# @brief Constraint unit tests for new set function API
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# $Id$
# $HeadURL$
#
# This test file was converted from src/sbml/test/TestConstraint_newSetters.c
# with the help of conversion sciprt (ctest_... | 32.947368 | 79 | 0.660011 |
import sys
import unittest
import libsbml
class TestConstraint_newSetters(unittest.TestCase):
C = None
def setUp(self):
self.C = libsbml.Constraint(2,4)
if (self.C == None):
pass
pass
def tearDown(self):
self.C = None
pass
def test_Constraint_set... | true | true |
7902351414bba97b6a86f9d7dd4e4476e060249d | 4,785 | py | Python | pymatgen/io/lammps/sets.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | 5 | 2019-04-11T20:57:38.000Z | 2021-12-01T05:00:42.000Z | pymatgen/io/lammps/sets.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | null | null | null | pymatgen/io/lammps/sets.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | 3 | 2019-10-14T19:47:34.000Z | 2020-07-02T08:10:45.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, absolute_import
"""
This module implements classes for reading and generating Lammps inputset.
For the ease of management we divide LAMMPS in... | 40.210084 | 86 | 0.660815 |
from __future__ import division, print_function, unicode_literals, absolute_import
import os
import six
from monty.json import MSONable, MontyDecoder
from pymatgen.io.lammps.data import LammpsData
from pymatgen.io.lammps.input import LammpsInput
__author__ = "Kiran Mathew"
__email__ = "kmathew@lbl.gov"
class... | true | true |
790235b18d33cb3f0ac0276aa588cf0afb57320e | 10,714 | py | Python | data.py | gasteigerjo/gdc | 996bc47acffd86bc9bb1df3293c87a3c7573744f | [
"MIT"
] | 2 | 2022-03-14T11:54:20.000Z | 2022-03-23T20:25:08.000Z | data.py | gasteigerjo/gdc | 996bc47acffd86bc9bb1df3293c87a3c7573744f | [
"MIT"
] | null | null | null | data.py | gasteigerjo/gdc | 996bc47acffd86bc9bb1df3293c87a3c7573744f | [
"MIT"
] | null | null | null | __author__ = "Stefan Weißenberger and Johannes Gasteiger"
__license__ = "MIT"
import os
import numpy as np
from scipy.linalg import expm
import torch
from torch_geometric.data import Data, InMemoryDataset
from torch_geometric.datasets import Planetoid, Amazon, Coauthor
from seeds import development_seed... | 33.376947 | 98 | 0.589696 | __author__ = "Stefan Weißenberger and Johannes Gasteiger"
__license__ = "MIT"
import os
import numpy as np
from scipy.linalg import expm
import torch
from torch_geometric.data import Data, InMemoryDataset
from torch_geometric.datasets import Planetoid, Amazon, Coauthor
from seeds import development_seed... | true | true |
790235b86183ea460af3ada26fdfb231b0d56329 | 3,509 | py | Python | src/genie/libs/parser/dnac/interface.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/dnac/interface.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/dnac/interface.py | kacann/genieparser | 76e19003199c393c59a33546726de3ff5486da80 | [
"Apache-2.0"
] | 1 | 2021-07-07T18:07:56.000Z | 2021-07-07T18:07:56.000Z | """
interface.py
DNAC parsers for the following show commands:
* /dna/intent/api/v1/interface
"""
import os
import logging
import pprint
import re
import unittest
from genie import parsergen
from collections import defaultdict
from ats.log.utils import banner
from genie.metaparser import MetaParser
from... | 35.806122 | 102 | 0.455685 |
import os
import logging
import pprint
import re
import unittest
from genie import parsergen
from collections import defaultdict
from ats.log.utils import banner
from genie.metaparser import MetaParser
from genie.metaparser.util import merge_dict, keynames_convert
from genie.metaparser.util.schemaengine import Schem... | true | true |
790236a048130bda458133b39792d5a4070de4f2 | 409 | py | Python | weblog/migrations/0012_userdetail_phone.py | mmohajer9/Resumo | 625c279e71e98f0d461679d75c6c464f6afcf437 | [
"MIT"
] | 1 | 2019-07-28T10:09:26.000Z | 2019-07-28T10:09:26.000Z | weblog/migrations/0012_userdetail_phone.py | mmohajer9/Resumo | 625c279e71e98f0d461679d75c6c464f6afcf437 | [
"MIT"
] | 8 | 2021-04-08T22:03:32.000Z | 2022-02-10T09:35:46.000Z | weblog/migrations/0012_userdetail_phone.py | mmohajer9/resumo | 625c279e71e98f0d461679d75c6c464f6afcf437 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-18 19:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('weblog', '0011_auto_20190718_1829'),
]
operations = [
migrations.AddField(
model_name='userdetail',
name='phone',
... | 21.526316 | 73 | 0.606357 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('weblog', '0011_auto_20190718_1829'),
]
operations = [
migrations.AddField(
model_name='userdetail',
name='phone',
field=models.CharField(blank=True, ma... | true | true |
7902379c4506ba6e2265e4edddb03e6451a04607 | 20 | py | Python | tests/__init__.py | igorcoding/os-simulation | 1e76fdda75c138025950876a2e7b68e99a55c54a | [
"MIT"
] | null | null | null | tests/__init__.py | igorcoding/os-simulation | 1e76fdda75c138025950876a2e7b68e99a55c54a | [
"MIT"
] | null | null | null | tests/__init__.py | igorcoding/os-simulation | 1e76fdda75c138025950876a2e7b68e99a55c54a | [
"MIT"
] | null | null | null | __author__ = 'igor'
| 10 | 19 | 0.7 | __author__ = 'igor'
| true | true |
79023899cfd004871ee353f9f8be7fd27b9fb485 | 8,357 | py | Python | homework_3/main.py | showerhhh/ComplexNetwork | 344fadee4e85924f45263a43d2110dae2a9394fe | [
"MIT"
] | null | null | null | homework_3/main.py | showerhhh/ComplexNetwork | 344fadee4e85924f45263a43d2110dae2a9394fe | [
"MIT"
] | null | null | null | homework_3/main.py | showerhhh/ComplexNetwork | 344fadee4e85924f45263a43d2110dae2a9394fe | [
"MIT"
] | null | null | null | import functools
import os
import random
import matplotlib.pyplot as plt
import networkx as nx
def make_graph(path):
G = nx.DiGraph()
with open(path, 'r') as f:
lines = f.readlines()
# random.seed(0)
sample_nums = int(len(lines) * 0.00006)
lines = random.sample(lines, sample_... | 31.066914 | 105 | 0.551514 | import functools
import os
import random
import matplotlib.pyplot as plt
import networkx as nx
def make_graph(path):
G = nx.DiGraph()
with open(path, 'r') as f:
lines = f.readlines()
sample_nums = int(len(lines) * 0.00006)
lines = random.sample(lines, sample_nums)
li... | true | true |
790239ddc17a2951e332a4c62c08477ad95f345b | 481 | py | Python | retry.py | IdeaBot/dev-addons | 7dab098908ba335e3ef7470d7619939e1adf7ed3 | [
"MIT"
] | null | null | null | retry.py | IdeaBot/dev-addons | 7dab098908ba335e3ef7470d7619939e1adf7ed3 | [
"MIT"
] | null | null | null | retry.py | IdeaBot/dev-addons | 7dab098908ba335e3ef7470d7619939e1adf7ed3 | [
"MIT"
] | null | null | null | from libs import reaction as reactioncommand
class Reaction(reactioncommand.AdminReactionAddCommand):
'''Retries a text command
**Usage**
React to the message you want to re-run with the retry emoji
(The emoji is server-defined; ask your fellow server members for the correct emoji)'''
def matches(self, react... | 32.066667 | 86 | 0.742204 | from libs import reaction as reactioncommand
class Reaction(reactioncommand.AdminReactionAddCommand):
def matches(self, reaction, user):
return user == reaction.message.author
def action(self, reaction, user, client):
yield from client.on_message(reaction.message)
| true | true |
79023a24d090139dbf75e46e1e692fe8d55cbcfe | 15,128 | py | Python | main.py | crowdbreaks/preprocess | 7d4d375eebf9a36bfbfc166e49fc63e72eb41e12 | [
"MIT"
] | 1 | 2020-06-08T13:43:53.000Z | 2020-06-08T13:43:53.000Z | main.py | crowdbreaks/preprocess | 7d4d375eebf9a36bfbfc166e49fc63e72eb41e12 | [
"MIT"
] | 1 | 2020-12-23T09:41:42.000Z | 2020-12-23T09:41:42.000Z | main.py | crowdbreaks/preprocess | 7d4d375eebf9a36bfbfc166e49fc63e72eb41e12 | [
"MIT"
] | null | null | null | import argparse
import sys, os
import logging
from utils.misc import ArgParseDefault, add_bool_arg
USAGE_DESC = """
python main.py <command> [<args>]
Available commands:
init Initialize project
sync Sync project data from S3
parse Preprocessing of data to generate `/data/1_par... | 85.954545 | 327 | 0.708554 | import argparse
import sys, os
import logging
from utils.misc import ArgParseDefault, add_bool_arg
USAGE_DESC = """
python main.py <command> [<args>]
Available commands:
init Initialize project
sync Sync project data from S3
parse Preprocessing of data to generate `/data/1_par... | true | true |
79023abee7c53a229bdd39700606f299a74e565a | 445 | py | Python | funnyPython/test_wordcloud.py | comeCU/coding-python | 3a35e67f5a92c32734b93b5503e5b08bc63b06bd | [
"MIT"
] | 3 | 2018-07-27T12:56:19.000Z | 2019-10-05T03:48:52.000Z | funnyPython/test_wordcloud.py | comeCU/coding-python | 3a35e67f5a92c32734b93b5503e5b08bc63b06bd | [
"MIT"
] | null | null | null | funnyPython/test_wordcloud.py | comeCU/coding-python | 3a35e67f5a92c32734b93b5503e5b08bc63b06bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# 生成词云
'''
Reference:
https://amueller.github.io/word_cloud/
https://github.com/amueller/word_cloud
'''
from wordcloud import WordCloud
import matplotlib.pyplot as plt
filename = "***.txt" # 文本
with open(filename) as f:
mytext = f.read()
# print(mytext)
w... | 16.481481 | 47 | 0.678652 |
from wordcloud import WordCloud
import matplotlib.pyplot as plt
filename = "***.txt"
with open(filename) as f:
mytext = f.read()
wordcloud = WordCloud().generate(mytext)
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
| true | true |
79023ad609037af95cf26b6ba28f4ebd1572a490 | 26,353 | py | Python | tests/test_lazyfixture.py | TvoroG/pytest-lazy-fixture | 5fd987dd2d539202dec23367291964a33004d3ee | [
"MIT"
] | 242 | 2016-11-22T12:59:58.000Z | 2022-03-25T14:01:10.000Z | tests/test_lazyfixture.py | TvoroG/pytest-lazy-fixture | 5fd987dd2d539202dec23367291964a33004d3ee | [
"MIT"
] | 45 | 2016-11-18T23:37:18.000Z | 2022-02-25T13:45:28.000Z | tests/test_lazyfixture.py | TvoroG/pytest-lazy-fixture | 5fd987dd2d539202dec23367291964a33004d3ee | [
"MIT"
] | 20 | 2016-11-24T21:57:24.000Z | 2022-03-08T18:47:07.000Z | # -*- coding: utf-8 -*-
import pytest
from pytest_lazyfixture import sorted_by_dependency, lazy_fixture, _sorted_argnames
try:
import numpy
except ImportError:
numpy = None
def test_fixture_in_parametrize_with_params(testdir):
items = testdir.getitems("""
import pytest
@pytest.fixture(par... | 28.864184 | 114 | 0.570334 |
import pytest
from pytest_lazyfixture import sorted_by_dependency, lazy_fixture, _sorted_argnames
try:
import numpy
except ImportError:
numpy = None
def test_fixture_in_parametrize_with_params(testdir):
items = testdir.getitems("""
import pytest
@pytest.fixture(params=[1,2])
def ... | true | true |
79023c061fd988d92d1f773fd227a04612682335 | 1,951 | py | Python | xkcd_feed/src/utils.py | lwittchen/twitter-bots | 74458d312aadedde192dc6289912764ee639d34d | [
"MIT"
] | null | null | null | xkcd_feed/src/utils.py | lwittchen/twitter-bots | 74458d312aadedde192dc6289912764ee639d34d | [
"MIT"
] | null | null | null | xkcd_feed/src/utils.py | lwittchen/twitter-bots | 74458d312aadedde192dc6289912764ee639d34d | [
"MIT"
] | null | null | null | from configparser import ConfigParser
import feedparser
import re
import requests
import tweepy
def get_id(xkcd_link: str) -> int:
"""
Exctract comic id from xkcd link
"""
match = re.search(r"\d+", xkcd_link)
if match:
return int(match.group())
else:
return 0
def get_xkcd_rss... | 22.170455 | 81 | 0.621732 | from configparser import ConfigParser
import feedparser
import re
import requests
import tweepy
def get_id(xkcd_link: str) -> int:
match = re.search(r"\d+", xkcd_link)
if match:
return int(match.group())
else:
return 0
def get_xkcd_rss_entries(url: str):
feed = feedparser.parse(... | true | true |
79023c1d1df96a091ab5efcbfe1a4fb02b17ce19 | 3,783 | py | Python | locations/spiders/aldi_uk.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | null | null | null | locations/spiders/aldi_uk.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | null | null | null | locations/spiders/aldi_uk.py | nbeecher/alltheplaces | f28b75ffbd7a6b09aaf80bf3a46cb563527632de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import csv
import scrapy
import re
from locations.items import GeojsonPointItem
COOKIES = {
"bm_sz": "04B124C1C96D68082A9F61BAAAF0B6D5~YAAQdjsvF22E8Xl6AQAACr1VfAxPEt+enarZyrOZrBaNvyuX71lK5QPuDR/FgDEWBZVMRhjiIf000W7Z1PiAjxobrz2Y5LcYMH3CvUNvpdS3MjVLUMGwMEBCf9L5nD5Gs9ho2YL8T7Tz7lY... | 42.988636 | 436 | 0.636532 |
import json
import csv
import scrapy
import re
from locations.items import GeojsonPointItem
COOKIES = {
"bm_sz": "04B124C1C96D68082A9F61BAAAF0B6D5~YAAQdjsvF22E8Xl6AQAACr1VfAxPEt+enarZyrOZrBaNvyuX71lK5QPuDR/FgDEWBZVMRhjiIf000W7Z1PiAjxobrz2Y5LcYMH3CvUNvpdS3MjVLUMGwMEBCf9L5nD5Gs9ho2YL8T7Tz7lYvpolvaOlJnKrHyhCFxxk/uy... | true | true |
79023c79106c69eb94f687636965238bf695f36c | 834 | py | Python | setup.py | usckiki82/mask-query-aide | c1866d79a5f6533dd16aaef856f97abb0af0065e | [
"MIT"
] | null | null | null | setup.py | usckiki82/mask-query-aide | c1866d79a5f6533dd16aaef856f97abb0af0065e | [
"MIT"
] | null | null | null | setup.py | usckiki82/mask-query-aide | c1866d79a5f6533dd16aaef856f97abb0af0065e | [
"MIT"
] | null | null | null | ''' setup module
'''
from distutils.core import setup
# TEMPLATE
setup(
name='mask-query-aide',
version='0.0',
description='python code to train ML for detecting people with masks',
long_description=open('README.rst').read(),
author='Christine Madden',
license=open('LICENSE').read(),
autho... | 23.166667 | 74 | 0.570743 |
from distutils.core import setup
setup(
name='mask-query-aide',
version='0.0',
description='python code to train ML for detecting people with masks',
long_description=open('README.rst').read(),
author='Christine Madden',
license=open('LICENSE').read(),
author_email='christine.m.madden19@g... | true | true |
79023c86315cd9a246e332e449ec82a9a91b6ce9 | 500 | py | Python | features/environment.py | abhisheksr01/zero-2-hero-python-flask-microservice | c94d3c1cee0b6888efdc1ae084b8fe2fcbf7041d | [
"MIT"
] | 4 | 2021-04-28T19:44:52.000Z | 2021-12-15T23:29:22.000Z | features/environment.py | abhisheksr01/zero-2-hero-python-flask-microservice | c94d3c1cee0b6888efdc1ae084b8fe2fcbf7041d | [
"MIT"
] | null | null | null | features/environment.py | abhisheksr01/zero-2-hero-python-flask-microservice | c94d3c1cee0b6888efdc1ae084b8fe2fcbf7041d | [
"MIT"
] | 6 | 2021-04-28T19:43:48.000Z | 2021-12-15T23:29:25.000Z | import subprocess
import time
import os
TEST_TYPE = os.getenv("TEST_TYPE", "bdd")
def before_scenario(context, scenario):
if f"{TEST_TYPE}" == "bdd":
proc = subprocess.Popen(["make", "start"])
time.sleep(4)
context.proc = proc
context.root_url = "http://localhost:5000"
else:
... | 21.73913 | 53 | 0.622 | import subprocess
import time
import os
TEST_TYPE = os.getenv("TEST_TYPE", "bdd")
def before_scenario(context, scenario):
if f"{TEST_TYPE}" == "bdd":
proc = subprocess.Popen(["make", "start"])
time.sleep(4)
context.proc = proc
context.root_url = "http://localhost:5000"
else:
... | true | true |
79023cfc051829bd828ec4faa142cf800e9c09de | 568 | py | Python | testing/tests/001-main/001-empty/002-authenticated/008-repositories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 1 | 2020-12-04T18:43:10.000Z | 2020-12-04T18:43:10.000Z | testing/tests/001-main/001-empty/002-authenticated/008-repositories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | null | null | null | testing/tests/001-main/001-empty/002-authenticated/008-repositories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | null | null | null | with frontend.signin():
frontend.page("repositories", expect={ "document_title": testing.expect.document_title(u"Repositories"),
"content_title": testing.expect.paleyellow_title(0, u"Repositories"),
"pageheader_links": testing.exp... | 81.142857 | 112 | 0.473592 | with frontend.signin():
frontend.page("repositories", expect={ "document_title": testing.expect.document_title(u"Repositories"),
"content_title": testing.expect.paleyellow_title(0, u"Repositories"),
"pageheader_links": testing.exp... | true | true |
79023d27b60a99f51b193b37835bfb18ef0cfe99 | 13,440 | py | Python | foundation_public/models/organization.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 1 | 2020-07-16T10:58:23.000Z | 2020-07-16T10:58:23.000Z | foundation_public/models/organization.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | 13 | 2018-11-30T02:29:39.000Z | 2022-03-11T23:35:49.000Z | foundation_public/models/organization.py | smegurus/smegurus-django | 053973b5ff0b997c52bfaca8daf8e07db64a877c | [
"BSD-4-Clause"
] | null | null | null | from django.db import models
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django_tenants.models import TenantMixin, DomainMixin
from smegurus import constants
from foundation_public.... | 32.230216 | 289 | 0.641741 | from django.db import models
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django_tenants.models import TenantMixin, DomainMixin
from smegurus import constants
from foundation_public.... | true | true |
79023d7f878ceb8595925f0375ba749ae244eb01 | 14,403 | py | Python | MasterScripts/systemprep-linuxmaster.py | plus3it/SystemPrep | 8398093ce6a3c599eca463f9e0245cf5a7d9b896 | [
"Apache-2.0"
] | 9 | 2016-08-30T19:07:31.000Z | 2019-11-13T23:32:28.000Z | MasterScripts/systemprep-linuxmaster.py | plus3it/SystemPrep | 8398093ce6a3c599eca463f9e0245cf5a7d9b896 | [
"Apache-2.0"
] | 30 | 2015-12-23T17:41:11.000Z | 2017-05-25T11:08:25.000Z | MasterScripts/systemprep-linuxmaster.py | plus3it/SystemPrep | 8398093ce6a3c599eca463f9e0245cf5a7d9b896 | [
"Apache-2.0"
] | 12 | 2015-11-16T14:33:49.000Z | 2019-11-13T23:32:38.000Z | #!/usr/bin/env python
import os
import sys
import platform
import tempfile
import urllib2
import shutil
import boto
from boto.exception import BotoClientError
def merge_dicts(a, b):
"""
Merge two dictionaries. If there is a key collision, `b` overrides `a`.
:param a: Dictionary of default settings
:param ... | 41.507205 | 133 | 0.545789 |
import os
import sys
import platform
import tempfile
import urllib2
import shutil
import boto
from boto.exception import BotoClientError
def merge_dicts(a, b):
try:
a.update(b)
except Exception as exc:
raise SystemError('Failed to merge dictionaries. Dictionary A:\n\n'
... | true | true |
79023de4c9ef33e9f01a0cc8011ec1c6f256f074 | 1,026 | py | Python | tensorflow_zero_out/python/ops/convert_to_tflite.py | yuko29/tflite_custom_op | 66df2c5ade62b04b920034e7721c4b6afc60e942 | [
"Apache-2.0"
] | null | null | null | tensorflow_zero_out/python/ops/convert_to_tflite.py | yuko29/tflite_custom_op | 66df2c5ade62b04b920034e7721c4b6afc60e942 | [
"Apache-2.0"
] | null | null | null | tensorflow_zero_out/python/ops/convert_to_tflite.py | yuko29/tflite_custom_op | 66df2c5ade62b04b920034e7721c4b6afc60e942 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import tensorflow_zero_out
import numpy as np
import os
# Create a model using low-level tf.* APIs
class ZeroOut(tf.Module):
@tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.int32)])
def __call__(self, x):
return tensorflow_zero_out.zero_out(x)
model = ZeroOut()
# (ro... | 38 | 80 | 0.722222 | import tensorflow as tf
import tensorflow_zero_out
import numpy as np
import os
class ZeroOut(tf.Module):
@tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.int32)])
def __call__(self, x):
return tensorflow_zero_out.zero_out(x)
model = ZeroOut()
del.__call__.get_concrete_function()
conv... | true | true |
79023ef3bb81610a3394ea5c6833a18d237823c9 | 4,344 | py | Python | test/test_attention.py | jeongwhanchoi/graph-neural-pde | 4323db3bb3badbcfc3c569635b7f8f072946528d | [
"Apache-2.0"
] | 125 | 2021-06-16T09:36:18.000Z | 2022-03-26T00:16:22.000Z | test/test_attention.py | jeongwhanchoi/graph-neural-pde | 4323db3bb3badbcfc3c569635b7f8f072946528d | [
"Apache-2.0"
] | 8 | 2021-06-23T04:49:12.000Z | 2022-03-28T20:25:47.000Z | test/test_attention.py | jeongwhanchoi/graph-neural-pde | 4323db3bb3badbcfc3c569635b7f8f072946528d | [
"Apache-2.0"
] | 20 | 2021-06-23T06:55:35.000Z | 2022-03-21T17:04:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test attention
"""
import unittest
import torch
from torch import tensor
from torch import nn
from function_GAT_attention import SpGraphAttentionLayer, ODEFuncAtt
from torch_geometric.utils import softmax, to_dense_adj
from data import get_dataset
class AttentionTests... | 44.326531 | 113 | 0.67058 |
import unittest
import torch
from torch import tensor
from torch import nn
from function_GAT_attention import SpGraphAttentionLayer, ODEFuncAtt
from torch_geometric.utils import softmax, to_dense_adj
from data import get_dataset
class AttentionTests(unittest.TestCase):
def setUp(self):
self.edge = tensor([[0,... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.