hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f704c56086b8ba866a205345226d91d6b051226d | 200 | py | Python | RULEngine/Game/Field.py | wonwon0/RobocupStrategyIA | 891028f616d476b05b23b40924d7c99502a718e3 | [
"MIT"
] | null | null | null | RULEngine/Game/Field.py | wonwon0/RobocupStrategyIA | 891028f616d476b05b23b40924d7c99502a718e3 | [
"MIT"
] | null | null | null | RULEngine/Game/Field.py | wonwon0/RobocupStrategyIA | 891028f616d476b05b23b40924d7c99502a718e3 | [
"MIT"
] | null | null | null | # Under MIT License, see LICENSE.txt
class Field():
def __init__(self, ball):
self.ball = ball
def move_ball(self, position, delta):
self.ball.set_position(position, delta)
| 20 | 47 | 0.655 |
class Field():
def __init__(self, ball):
self.ball = ball
def move_ball(self, position, delta):
self.ball.set_position(position, delta)
| true | true |
f704c67d98e3a2a857e70406e7c669c763faa37b | 3,213 | py | Python | setup.py | altosaar/nomen | 29170a2011decbc9aa4cae48bd5d8d291a6d9fb8 | [
"MIT"
] | 4 | 2016-12-22T16:37:52.000Z | 2017-05-31T11:12:57.000Z | setup.py | altosaar/nomen | 29170a2011decbc9aa4cae48bd5d8d291a6d9fb8 | [
"MIT"
] | 2 | 2016-12-23T06:15:31.000Z | 2019-03-21T21:36:03.000Z | setup.py | altosaar/nomen | 29170a2011decbc9aa4cae48bd5d8d291a6d9fb8 | [
"MIT"
] | 1 | 2018-07-05T21:14:59.000Z | 2018-07-05T21:14:59.000Z | #!/usr/bin/env python
# setup
# Setup script for installing nomen
##########################################################################
## Imports
##########################################################################
import os
import re
import codecs
from setuptools import setup
from setuptools import find... | 28.945946 | 79 | 0.517585 | true | true | |
f704c68356b63c2761fa7eec5a286419626cb51a | 407 | py | Python | confdgnmi/src/confd_gnmi_netconf_adapter.py | micnovak/ConfD-Demos | 479499e7c5339ae77b611e17196e7516d1f1a1ce | [
"Apache-2.0"
] | 11 | 2019-12-07T20:15:57.000Z | 2022-02-04T18:12:52.000Z | confdgnmi/src/confd_gnmi_netconf_adapter.py | micnovak/ConfD-Demos | 479499e7c5339ae77b611e17196e7516d1f1a1ce | [
"Apache-2.0"
] | 2 | 2020-03-01T11:04:16.000Z | 2021-02-03T14:17:23.000Z | confdgnmi/src/confd_gnmi_netconf_adapter.py | micnovak/ConfD-Demos | 479499e7c5339ae77b611e17196e7516d1f1a1ce | [
"Apache-2.0"
] | 6 | 2019-10-18T15:26:03.000Z | 2021-01-13T10:28:30.000Z | from confd_gnmi_adapter import GnmiServerAdapter
class GnmiNetconfServerAdapter(GnmiServerAdapter):
@classmethod
def get_adapter(cls):
pass
def set(self, prefix, path, val):
pass
def get_subscription_handler(self, subscription_list):
pass
def capabilities(self):
... | 19.380952 | 58 | 0.670762 | from confd_gnmi_adapter import GnmiServerAdapter
class GnmiNetconfServerAdapter(GnmiServerAdapter):
@classmethod
def get_adapter(cls):
pass
def set(self, prefix, path, val):
pass
def get_subscription_handler(self, subscription_list):
pass
def capabilities(self):
... | true | true |
f704c6f312d2240524282b8c816c45e6b8714e15 | 36,146 | py | Python | lightseq/training/ops/pytorch/torch_transformer_layers.py | iRmantou/lightseq | 9a617306fa711a3d6a25ef3eab9bfbe408692189 | [
"Apache-2.0"
] | 1 | 2022-03-27T17:16:16.000Z | 2022-03-27T17:16:16.000Z | lightseq/training/ops/pytorch/torch_transformer_layers.py | iRmantou/lightseq | 9a617306fa711a3d6a25ef3eab9bfbe408692189 | [
"Apache-2.0"
] | null | null | null | lightseq/training/ops/pytorch/torch_transformer_layers.py | iRmantou/lightseq | 9a617306fa711a3d6a25ef3eab9bfbe408692189 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The LightSeq Team
# Copyright Facebook Fairseq
# We use layers from Facebook Fairseq as our baseline
import math
import uuid
from typing import Dict, Optional, Tuple, List
import torch
import torch.nn.functional as F
from torch import Tensor, nn
from torch.nn import Parameter, LayerNorm, Dropout, L... | 38.290254 | 88 | 0.592099 |
import math
import uuid
from typing import Dict, Optional, Tuple, List
import torch
import torch.nn.functional as F
from torch import Tensor, nn
from torch.nn import Parameter, LayerNorm, Dropout, Linear
from lightseq.training.ops.pytorch import util
from lightseq.training.ops.pytorch.layer_base import (
Tr... | true | true |
f704c7064a6678cc5c17790c675482e38ef55a1b | 2,392 | py | Python | api/server/swagger_server/models/api_generate_code_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | null | null | null | api/server/swagger_server/models/api_generate_code_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | 1 | 2021-09-21T23:31:13.000Z | 2021-09-21T23:31:13.000Z | api/server/swagger_server/models/api_generate_code_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 29.9 | 91 | 0.669314 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from swagger_server.models.base_model_ import Model
from swagger_server import util
class ApiGenerateCodeResponse(Model):
def __init__(self, script: str=None):
self.swagger_type... | true | true |
f704c748c77fe552c4d56bef1c5dbb0e85cd8b5f | 917 | py | Python | abc231/c/main.py | nakamuloud/atcoder | aa986bc31ed050bac983888ec500c47f9d12ad2a | [
"MIT"
] | null | null | null | abc231/c/main.py | nakamuloud/atcoder | aa986bc31ed050bac983888ec500c47f9d12ad2a | [
"MIT"
] | null | null | null | abc231/c/main.py | nakamuloud/atcoder | aa986bc31ed050bac983888ec500c47f9d12ad2a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right # type: ignore
from collections import Counter, defaultdict, deque # type: ignore
from fractions import gcd # type: ignore
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, ... | 26.970588 | 103 | 0.61614 |
import sys
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from collections import Counter, defaultdict, deque
from fractions import gcd
from heapq import heapify, heappop, heappush, heappushpop, heapreplace, merge
from itertools import accumulate, combinations, permutat... | true | true |
f704c7ac312e7babdba94522a4ea34a2966ab06b | 4,574 | py | Python | test/dpt_tests/dpt_time_test.py | cyberjunky/xknx | c708ed6a2ca6449b74c6cea197d658e3399b99d1 | [
"MIT"
] | 1 | 2020-12-09T16:17:49.000Z | 2020-12-09T16:17:49.000Z | test/dpt_tests/dpt_time_test.py | cyberjunky/xknx | c708ed6a2ca6449b74c6cea197d658e3399b99d1 | [
"MIT"
] | null | null | null | test/dpt_tests/dpt_time_test.py | cyberjunky/xknx | c708ed6a2ca6449b74c6cea197d658e3399b99d1 | [
"MIT"
] | null | null | null | """Unit test for KNX time objects."""
import unittest
from xknx.dpt import DPTTime, DPTWeekday
from xknx.exceptions import ConversionError
class TestDPTTime(unittest.TestCase):
"""Test class for KNX time objects."""
#
# TEST NORMAL TIME
#
def test_from_knx(self):
"""Test parsing of DPTTi... | 35.184615 | 94 | 0.555969 | import unittest
from xknx.dpt import DPTTime, DPTWeekday
from xknx.exceptions import ConversionError
class TestDPTTime(unittest.TestCase):
def test_from_knx(self):
self.assertEqual(DPTTime().from_knx((0x4D, 0x17, 0x2A)),
{'weekday': DPTWeekday.TUESDAY,
... | true | true |
f704c9482c2b74b28c4faceee71e9f4dcabea3a3 | 316 | py | Python | johann/__init__.py | lobotmcj/johann | c188c6f31446907a5d6a237191540856f02a91a0 | [
"BSD-3-Clause"
] | 11 | 2020-08-27T18:33:09.000Z | 2022-03-18T03:09:03.000Z | johann/__init__.py | johannsdg/johann | c188c6f31446907a5d6a237191540856f02a91a0 | [
"BSD-3-Clause"
] | null | null | null | johann/__init__.py | johannsdg/johann | c188c6f31446907a5d6a237191540856f02a91a0 | [
"BSD-3-Clause"
] | 2 | 2020-09-04T03:07:35.000Z | 2020-11-06T19:08:03.000Z | # Copyright (c) 2019-present, The Johann Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE file. See the AUTHORS file for names of contributors.
"""Johann, lightweight and flexible scenario orchestration"""
__version__ = "0.3.0-alpha"
| 39.5 | 79 | 0.759494 |
__version__ = "0.3.0-alpha"
| true | true |
f704cb298b4264480818031b4a5dc27b92ebb46c | 2,543 | py | Python | o3seespy/command/layer.py | vijaypolimeru/o3seespy | c9ef0c27f685de705721b10eb1ea81c3a3c24c4e | [
"MIT",
"BSD-3-Clause"
] | null | null | null | o3seespy/command/layer.py | vijaypolimeru/o3seespy | c9ef0c27f685de705721b10eb1ea81c3a3c24c4e | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-06-25T15:33:31.000Z | 2021-06-25T15:33:31.000Z | o3seespy/command/layer.py | millen1m/o3seespy | 7eead6aef8055f73af39b969e0d3499a67e1737f | [
"MIT",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:01:42.000Z | 2020-12-12T21:01:42.000Z | from o3seespy.base_model import OpenSeesObject
class LayerBase(OpenSeesObject):
op_base_type = "layer"
class Straight(LayerBase):
"""
The Straight Layer Class
The layer command is used to generate a number of fibers along a line or a circular arc.
"""
op_type = 'straight'
def __ini... | 31.012195 | 119 | 0.604404 | from o3seespy.base_model import OpenSeesObject
class LayerBase(OpenSeesObject):
op_base_type = "layer"
class Straight(LayerBase):
op_type = 'straight'
def __init__(self, osi, mat, num_fiber, area_fiber, start, end):
self.mat = mat
self.num_fiber = int(num_fiber)
self.area_fiber ... | true | true |
f704ccc2e536cf7aaa02ae1d2d184594cab08683 | 14,888 | py | Python | analyze.py | davidmam/BirdNET-Pi | 873c8f4c56b30edb9297134a92a7c5a178c390e4 | [
"Apache-2.0"
] | null | null | null | analyze.py | davidmam/BirdNET-Pi | 873c8f4c56b30edb9297134a92a7c5a178c390e4 | [
"Apache-2.0"
] | null | null | null | analyze.py | davidmam/BirdNET-Pi | 873c8f4c56b30edb9297134a92a7c5a178c390e4 | [
"Apache-2.0"
] | null | null | null | # BirdWeather edits by @timsterc
# Other edits by @CaiusX and @mcguirepr89
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['CUDA_VISIBLE_DEVICES'] = ''
try:
import tflite_runtime.interpreter as tflite
except:
from tensorflow import lite as tflite
import argparse
import operator
import librosa
im... | 42.056497 | 272 | 0.558907 |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['CUDA_VISIBLE_DEVICES'] = ''
try:
import tflite_runtime.interpreter as tflite
except:
from tensorflow import lite as tflite
import argparse
import operator
import librosa
import numpy as np
import math
import time
from decimal import Decimal
impo... | true | true |
f704ccdab8daddc07843c80260a004c3a4b58cc3 | 40,273 | py | Python | tests/unit_test/action/action_test.py | Anitej/kairon | 61d6bd7f230a744303abab42e3b54b0381fee7da | [
"Apache-2.0"
] | null | null | null | tests/unit_test/action/action_test.py | Anitej/kairon | 61d6bd7f230a744303abab42e3b54b0381fee7da | [
"Apache-2.0"
] | null | null | null | tests/unit_test/action/action_test.py | Anitej/kairon | 61d6bd7f230a744303abab42e3b54b0381fee7da | [
"Apache-2.0"
] | null | null | null | import json
import os
os.environ["system_file"] = "./tests/testing_data/system.yaml"
from typing import Dict, Text, Any, List
import pytest
import responses
from mongoengine import connect, disconnect
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from kairon.action_server.data_object... | 45.098544 | 196 | 0.596653 | import json
import os
os.environ["system_file"] = "./tests/testing_data/system.yaml"
from typing import Dict, Text, Any, List
import pytest
import responses
from mongoengine import connect, disconnect
from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from kairon.action_server.data_object... | true | true |
f704ce218171769e1c7e83c8096eabe16908d3e6 | 848 | py | Python | des039.py | LeonardoPereirajr/Curso_em_video_Python | 9d8a97ba3389c8e86b37dfd089fab5d04adc146d | [
"MIT"
] | null | null | null | des039.py | LeonardoPereirajr/Curso_em_video_Python | 9d8a97ba3389c8e86b37dfd089fab5d04adc146d | [
"MIT"
] | null | null | null | des039.py | LeonardoPereirajr/Curso_em_video_Python | 9d8a97ba3389c8e86b37dfd089fab5d04adc146d | [
"MIT"
] | null | null | null | from datetime import date
ano = int(input('ANO de nascimento : '))
ano_hoje = date.today().year
cont = ano_hoje - ano
if cont > 20 :
print(' Quem nasceu em {} tem {} anos em {} . '.format(ano, cont, ano_hoje))
print(' Sua classificação é MASTER. ')
elif cont == 20 :
print(' Quem nasceu em {} tem ... | 44.631579 | 82 | 0.597877 | from datetime import date
ano = int(input('ANO de nascimento : '))
ano_hoje = date.today().year
cont = ano_hoje - ano
if cont > 20 :
print(' Quem nasceu em {} tem {} anos em {} . '.format(ano, cont, ano_hoje))
print(' Sua classificação é MASTER. ')
elif cont == 20 :
print(' Quem nasceu em {} tem ... | true | true |
f704ce6b1a36073883d29f973825dd98381f1c4b | 443 | py | Python | setup.py | msikma/upprint | b617eb7d0a661fb3107d85471520270647766906 | [
"MIT"
] | null | null | null | setup.py | msikma/upprint | b617eb7d0a661fb3107d85471520270647766906 | [
"MIT"
] | null | null | null | setup.py | msikma/upprint | b617eb7d0a661fb3107d85471520270647766906 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='upprint',
packages=['upprint'],
version='0.1',
description='Modified version of pprint with better Unicode output',
author='Michiel Sikma',
author_email='michiel@sikma.org',
url='https://github.com/msikma/upprint',
download_url='https://gith... | 27.6875 | 72 | 0.670429 | from distutils.core import setup
setup(
name='upprint',
packages=['upprint'],
version='0.1',
description='Modified version of pprint with better Unicode output',
author='Michiel Sikma',
author_email='michiel@sikma.org',
url='https://github.com/msikma/upprint',
download_url='https://gith... | true | true |
f704ce98035e4ea27201a97a216cc694ba65d79b | 4,375 | py | Python | tests/test_tokenizers.py | DLPerf/gretel-synthetics | 58a820327e283ecc224de3686aa035b7e32bfaa6 | [
"Apache-2.0"
] | 252 | 2020-03-02T16:41:11.000Z | 2022-03-28T20:57:15.000Z | tests/test_tokenizers.py | DLPerf/gretel-synthetics | 58a820327e283ecc224de3686aa035b7e32bfaa6 | [
"Apache-2.0"
] | 39 | 2020-03-16T18:33:48.000Z | 2021-11-10T19:13:53.000Z | tests/test_tokenizers.py | DLPerf/gretel-synthetics | 58a820327e283ecc224de3686aa035b7e32bfaa6 | [
"Apache-2.0"
] | 36 | 2020-05-21T14:45:27.000Z | 2022-03-01T01:32:58.000Z | from pathlib import Path
from copy import deepcopy
import pytest
from gretel_synthetics.config import BaseConfig
import gretel_synthetics.tokenizers as tok
class SimpleConfig(BaseConfig):
"""Used for simple tokenization tests
"""
def get_generator_class(self):
return None
def get_training... | 36.157025 | 244 | 0.688229 | from pathlib import Path
from copy import deepcopy
import pytest
from gretel_synthetics.config import BaseConfig
import gretel_synthetics.tokenizers as tok
class SimpleConfig(BaseConfig):
def get_generator_class(self):
return None
def get_training_callable(self):
return None
@pytest.fix... | true | true |
f704cec1dcf176a8302a12216b941ecd52d94fca | 16,151 | py | Python | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/rising_hot_sphere.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/rising_hot_sphere.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/pyclaw/examples/euler_gravity_3d/rising_hot_sphere.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
Test problem demonstrating 3D hot-sphere rising in an stabilized atmosphere
in Cartesian coordinates
This problem evolves the 3D Euler equations using an F-wave
method, with gravitational source term modifications.
The primary variables are:
density (rho), x,y, a... | 45.114525 | 1,272 | 0.635626 |
"""
Test problem demonstrating 3D hot-sphere rising in an stabilized atmosphere
in Cartesian coordinates
This problem evolves the 3D Euler equations using an F-wave
method, with gravitational source term modifications.
The primary variables are:
density (rho), x,y, and z momentum (rho*u,rho*v,rho*w), and... | false | true |
f704d041172d3126183353d0f84901d0084003b4 | 82,008 | py | Python | aiida/backends/tests/export_and_import.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | aiida/backends/tests/export_and_import.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | aiida/backends/tests/export_and_import.py | joepvd/aiida_core | 6e9711046753332933f982971db1d7ac7e7ade58 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39.257061 | 114 | 0.574005 |
t tempfile
from aiida.orm import load_node
from aiida.orm.data.base import Str, Int, Float, Bool
from aiida.orm.importexport import export
temp_folder = tempfile.mkdtemp()
try:
values = ("Hello", 6, -1.2399834e12, False)
filename... | true | true |
f704d12c29a0d4090d125d43a95bf1b2c7c9f9ab | 1,372 | py | Python | mvfy/visual/utils/streamer.py | erwingforerocastro/mvfy_visual_py | 8740f21ffa68d0cfced0d0684251b2198488cb0e | [
"MIT"
] | null | null | null | mvfy/visual/utils/streamer.py | erwingforerocastro/mvfy_visual_py | 8740f21ffa68d0cfced0d0684251b2198488cb0e | [
"MIT"
] | null | null | null | mvfy/visual/utils/streamer.py | erwingforerocastro/mvfy_visual_py | 8740f21ffa68d0cfced0d0684251b2198488cb0e | [
"MIT"
] | null | null | null | import asyncio
import base64
import threading
import cv2
import numpy as np
from flask_socketio import SocketIO, emit
from flask import Flask, render_template
import multiprocessing
class Streamer():
def __init__(self) -> None:
"""Constructor
"""
@staticmethod
async def stream_s... | 25.886792 | 92 | 0.573615 | import asyncio
import base64
import threading
import cv2
import numpy as np
from flask_socketio import SocketIO, emit
from flask import Flask, render_template
import multiprocessing
class Streamer():
def __init__(self) -> None:
@staticmethod
async def stream_socket(
url_server: str,
... | true | true |
f704d16684d90b723369d286ddc555a9a4d93ac8 | 4,271 | py | Python | flask_tutorial/marshmallow_demo/flask_exmaple.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | marshmallow_demo/flask_exmaple.py | ftconan/flask-tutorial | d5164c93b5e6a6e3d2b8980e4b846adb7cb21aee | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | marshmallow_demo/flask_exmaple.py | ftconan/flask-tutorial | d5164c93b5e6a6e3d2b8980e4b846adb7cb21aee | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | # coding=utf-8
"""
@author: magician
@date: 2018/9/14
"""
import datetime
from flask_sqlalchemy import SQLAlchemy
from flask import Flask, jsonify, request
from sqlalchemy.exc import IntegrityError
from marshmallow import Schema, fields, ValidationError, pre_load
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_... | 27.733766 | 82 | 0.661203 |
import datetime
from flask_sqlalchemy import SQLAlchemy
from flask import Flask, jsonify, request
from sqlalchemy.exc import IntegrityError
from marshmallow import Schema, fields, ValidationError, pre_load
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'
app.config['SQLALCHEMY_TRACK_MODIFICA... | true | true |
f704d2308a4a0e9874c346c623e3850cac9abfa5 | 6,064 | py | Python | frappe/tests/test_twofactor.py | snehapatil1/frappe | dd2c33e34ad120e6305a2fa230a72d23a7a03e98 | [
"MIT"
] | 1 | 2020-12-07T22:35:21.000Z | 2020-12-07T22:35:21.000Z | frappe/tests/test_twofactor.py | snehapatil1/frappe | dd2c33e34ad120e6305a2fa230a72d23a7a03e98 | [
"MIT"
] | 11 | 2018-04-01T18:36:05.000Z | 2018-10-04T07:56:07.000Z | frappe/tests/test_twofactor.py | snehapatil1/frappe | dd2c33e34ad120e6305a2fa230a72d23a7a03e98 | [
"MIT"
] | 3 | 2018-01-16T17:59:55.000Z | 2019-09-24T16:02:10.000Z | # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest, frappe, pyotp
from werkzeug.wrappers import Request
from werkzeug.test import EnvironBuilder
from frappe.auth import HTTPRequest
from frappe.utils import cint
fro... | 35.255814 | 100 | 0.774571 |
from __future__ import unicode_literals
import unittest, frappe, pyotp
from werkzeug.wrappers import Request
from werkzeug.test import EnvironBuilder
from frappe.auth import HTTPRequest
from frappe.utils import cint
from frappe.twofactor import (should_run_2fa, authenticate_for_2factor, get_cached_user_pass,
two_fa... | true | true |
f704d2c864bad63628fb027f82d866b3cfbf5677 | 6,290 | py | Python | conanfile.py | madebr/conan-swig_installer-1 | 20cd423f4a5e6e1b9e8a7633fa22ad429096c499 | [
"MIT"
] | null | null | null | conanfile.py | madebr/conan-swig_installer-1 | 20cd423f4a5e6e1b9e8a7633fa22ad429096c499 | [
"MIT"
] | null | null | null | conanfile.py | madebr/conan-swig_installer-1 | 20cd423f4a5e6e1b9e8a7633fa22ad429096c499 | [
"MIT"
] | null | null | null | from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
from contextlib import contextmanager
import os
import shutil
class SwigConan(ConanFile):
name = "swig_installer"
version = "4.0.1"
description = "SWIG is a software development tool that con... | 46.592593 | 151 | 0.641017 | from conans import ConanFile, tools, AutoToolsBuildEnvironment
from conans.errors import ConanInvalidConfiguration
from contextlib import contextmanager
import os
import shutil
class SwigConan(ConanFile):
name = "swig_installer"
version = "4.0.1"
description = "SWIG is a software development tool that con... | true | true |
f704d309b2d0f6c310b68088e4d0a88caea2c3aa | 1,168 | py | Python | pv/wsgi.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | pv/wsgi.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | pv/wsgi.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for pv project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setti... | 36.5 | 79 | 0.80137 | import os
import sys
sys.path.append('/srv/pv/pv')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pv.settings")
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# applic... | true | true |
f704d3fbb8a78fe4a901efbbfcc7672e4820d792 | 2,293 | py | Python | python/ray/tune/examples/zoopt_example.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 3 | 2020-12-03T17:48:45.000Z | 2022-01-22T08:09:46.000Z | python/ray/tune/examples/zoopt_example.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 84 | 2021-03-06T08:02:56.000Z | 2022-03-05T08:07:19.000Z | python/ray/tune/examples/zoopt_example.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | """This example demonstrates the usage of ZOOptSearch.
It also checks that it is usable with a separate scheduler.
"""
import time
from ray import tune
from ray.tune.suggest.zoopt import ZOOptSearch
from ray.tune.schedulers import AsyncHyperBandScheduler
from zoopt import ValueType # noqa: F401
def evaluation_fn(s... | 30.573333 | 79 | 0.642826 | import time
from ray import tune
from ray.tune.suggest.zoopt import ZOOptSearch
from ray.tune.schedulers import AsyncHyperBandScheduler
from zoopt import ValueType
def evaluation_fn(step, width, height):
time.sleep(0.1)
return (0.1 + width * step / 100)**(-1) + height * 0.1
def easy_objective(config):
... | true | true |
f704d464d0afc50d7816616dbcf9d13d85e6185a | 3,897 | py | Python | tests/unit/backend/chalice/api_server/mock_auth.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | tests/unit/backend/chalice/api_server/mock_auth.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | 1 | 2021-02-23T22:56:13.000Z | 2021-02-23T22:56:13.000Z | tests/unit/backend/chalice/api_server/mock_auth.py | isabella232/corpora-data-portal | 09ed3cad3165f8b0db854b76404e0d5d0ea0b7d9 | [
"MIT"
] | null | null | null | import urllib
import jose.jwt
import time
import random
import sys
import requests
from flask import Flask, request, redirect, make_response, jsonify
import subprocess
# seconds until the token expires
TOKEN_EXPIRES = 2
# A mocked out oauth server, which serves all the endpoints needed by the oauth type.
class MockO... | 32.747899 | 114 | 0.625353 | import urllib
import jose.jwt
import time
import random
import sys
import requests
from flask import Flask, request, redirect, make_response, jsonify
import subprocess
TOKEN_EXPIRES = 2
class MockOauthApp:
def __init__(self, port):
self.port = port
self.app = Flask("mock_oauth_app")
... | true | true |
f704d4961f151943c889d1c38e2afd4fdd7bde3f | 4,440 | py | Python | topi/python/topi/x86/reduction.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 3 | 2021-02-23T22:06:01.000Z | 2021-09-30T09:59:17.000Z | topi/python/topi/x86/reduction.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 4 | 2021-03-30T11:59:59.000Z | 2022-03-12T00:40:23.000Z | topi/python/topi/x86/reduction.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 3 | 2021-07-20T07:40:15.000Z | 2021-08-03T08:39:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.694215 | 96 | 0.643919 |
from __future__ import absolute_import as _abs
import tvm
from .. import tag
from .. import generic
from ..util import get_const_tuple
def _schedule_reduce(sch, op, is_idx_reduce=False):
if is_idx_reduce:
real_out = op.output(0)
fused = sch[real_out].fuse(*sch[real_out].op.axis)
... | true | true |
f704d5a672c42774980b2e28551ba3d1cd02079a | 741 | py | Python | micropython/boot.py | tinytux/sensor | 2aa2a9ac34335c0b8579018f670b29455cfd47df | [
"MIT"
] | 9 | 2015-01-16T17:12:20.000Z | 2021-02-26T19:39:44.000Z | micropython/boot.py | tinytux/sensor | 2aa2a9ac34335c0b8579018f670b29455cfd47df | [
"MIT"
] | null | null | null | micropython/boot.py | tinytux/sensor | 2aa2a9ac34335c0b8579018f670b29455cfd47df | [
"MIT"
] | 2 | 2017-02-14T05:15:03.000Z | 2017-05-25T10:48:51.000Z | # boot.py -- runs on boot-up
import pyb
pyb.LED(3).on() # indicate we are waiting for switch press
pyb.delay(2000) # wait for user to maybe press the switch
switch_value = pyb.Switch()() # sample the switch at end of delay
pyb.LED(3).off() # indicate that we finished w... | 30.875 | 82 | 0.624831 |
import pyb
pyb.LED(3).on()
pyb.delay(2000)
switch_value = pyb.Switch()()
pyb.LED(3).off()
pyb.LED(4).on()
if switch_value:
pyb.usb_mode('CDC+MSC')
pyb.main('debug.py')
else:
pyb.usb_mode('CDC+HID')
pyb.main('displaytemp... | true | true |
f704d5d4ac02cfcd81c719c22d91a83721a4f86f | 1,151 | py | Python | Milestone2/L2_5_p5_test_vertical.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | Milestone2/L2_5_p5_test_vertical.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | Milestone2/L2_5_p5_test_vertical.py | 4ntLu0/1051-Project | 93ae9b8d312bd6e79949d878d3fb422282de703b | [
"Unlicense"
] | null | null | null | from Cimpl import *
image = load_image(choose_file())
def flip_vertical(image: image) -> Image:
vertical_image = copy(image)
for x in range(get_width(image)):
for y in range(get_height(image)):
flipped_color = get_color(image, -x, y)
set_color(vertical_image, x,... | 28.073171 | 201 | 0.636838 | from Cimpl import *
image = load_image(choose_file())
def flip_vertical(image: image) -> Image:
vertical_image = copy(image)
for x in range(get_width(image)):
for y in range(get_height(image)):
flipped_color = get_color(image, -x, y)
set_color(vertical_image, x,... | true | true |
f704d60e2cb0774267080085fc6a16bc1a8b5cf0 | 1,656 | py | Python | tests/test_norms.py | KDD-OpenSource/coreq | 3d20a033410119afb8a5183ed60967b84f6da5a3 | [
"MIT"
] | 1 | 2018-05-04T21:08:20.000Z | 2018-05-04T21:08:20.000Z | tests/test_norms.py | KDD-OpenSource/coreq | 3d20a033410119afb8a5183ed60967b84f6da5a3 | [
"MIT"
] | null | null | null | tests/test_norms.py | KDD-OpenSource/coreq | 3d20a033410119afb8a5183ed60967b84f6da5a3 | [
"MIT"
] | null | null | null | import BlockCorr
import numpy as np
N = 100
D = 1000
np.random.seed(0)
### WITHOUT CLUSTERS ###
foo = np.random.rand(N, D)
foo_corr = BlockCorr.PearsonTriu(foo)
membs = range(N)
dists = BlockCorr.Loss(foo_corr, foo_corr, membs, True)
print "Identity clustering"
print "--- output ", dists
print "+++ must be (0.0, 0... | 30.666667 | 96 | 0.693237 | import BlockCorr
import numpy as np
N = 100
D = 1000
np.random.seed(0)
earsonTriu(foo)
membs = range(N)
dists = BlockCorr.Loss(foo_corr, foo_corr, membs, True)
print "Identity clustering"
print "--- output ", dists
print "+++ must be (0.0, 0.0, 0.0, 5050)"
membs = np.random.permutation(N)
max_clus = np.max(membs)
... | false | true |
f704d62fcf2ec086efa3468b0494a0f1c3b01a19 | 2,675 | py | Python | sc-actions-provider/app.py | Sage-Bionetworks-IT/cfn-cr-sc-actions-provider | f0550c6b810fbb437e24048de73d429b017750b4 | [
"Apache-2.0"
] | null | null | null | sc-actions-provider/app.py | Sage-Bionetworks-IT/cfn-cr-sc-actions-provider | f0550c6b810fbb437e24048de73d429b017750b4 | [
"Apache-2.0"
] | 4 | 2020-04-28T20:24:30.000Z | 2021-08-17T01:21:17.000Z | sc-actions-provider/app.py | Sage-Bionetworks-IT/cfn-cr-sc-actions-provider | f0550c6b810fbb437e24048de73d429b017750b4 | [
"Apache-2.0"
] | 1 | 2020-04-28T18:42:41.000Z | 2020-04-28T18:42:41.000Z | import boto3
import json
import logging
from crhelper import CfnResource
logger = logging.getLogger(__name__)
helper = CfnResource(
json_logging=False, log_level='DEBUG', boto_level='CRITICAL')
try:
sc = boto3.client("servicecatalog")
except Exception as e:
helper.init_failure(e)
def get_parameters(even... | 34.294872 | 86 | 0.644486 | import boto3
import json
import logging
from crhelper import CfnResource
logger = logging.getLogger(__name__)
helper = CfnResource(
json_logging=False, log_level='DEBUG', boto_level='CRITICAL')
try:
sc = boto3.client("servicecatalog")
except Exception as e:
helper.init_failure(e)
def get_parameters(even... | true | true |
f704d69bd77a243b1e77d53e8cb7b0fdb8daaf27 | 7,384 | py | Python | src/secondaires/rapport/editeurs/bugedit_p/__init__.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/secondaires/rapport/editeurs/bugedit_p/__init__.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/secondaires/rapport/editeurs/bugedit_p/__init__.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | 41.717514 | 79 | 0.641522 |
from primaires.interpreteur.editeur.presentation import Presentation
from primaires.interpreteur.editeur.description import Description
from primaires.interpreteur.editeur.uniligne import Uniligne
from primaires.interpreteur.editeur.entier import Entier
from primaires.interpreteur.editeur... | true | true |
f704d794aec6ae8e930cc4290ff291c234e2423c | 16,527 | py | Python | privatmarket_service.py | dimonklas/robotForPull | 71485ba9612be4cb8916aae4ed6ca183a0f490ba | [
"Apache-2.0"
] | null | null | null | privatmarket_service.py | dimonklas/robotForPull | 71485ba9612be4cb8916aae4ed6ca183a0f490ba | [
"Apache-2.0"
] | null | null | null | privatmarket_service.py | dimonklas/robotForPull | 71485ba9612be4cb8916aae4ed6ca183a0f490ba | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import os
import sys
from dateutil import parser
from datetime import datetime
from pytz import timezone
import re
import datetime
import dateutil.parser
from datetime import timedelta
def modify_test_data(initial_data):
# set user name
# initial_data['procuringEntity']['name'] = u'Товариство ... | 39.538278 | 485 | 0.66104 |
import os
import sys
from dateutil import parser
from datetime import datetime
from pytz import timezone
import re
import datetime
import dateutil.parser
from datetime import timedelta
def modify_test_data(initial_data):
initial_data['procuringEntity']['name'] = u'ТОВ \"СФ \"РУБІЖНЕ\"'
if 'contact... | true | true |
f704d8c0caad083f0db74121655533699125a844 | 22,237 | py | Python | test/input_gen/genModelsRecurrent_v2.py | corner4world/nntrainer | 0f342e8f2a1ec95b4e712aa3390b21cf0ea4efae | [
"Apache-2.0"
] | null | null | null | test/input_gen/genModelsRecurrent_v2.py | corner4world/nntrainer | 0f342e8f2a1ec95b4e712aa3390b21cf0ea4efae | [
"Apache-2.0"
] | null | null | null | test/input_gen/genModelsRecurrent_v2.py | corner4world/nntrainer | 0f342e8f2a1ec95b4e712aa3390b21cf0ea4efae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
##
# Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
#
# @file genModelsRecurrent_v2.py
# @date 19 October 2021
# @brief Generate recurrent model tcs
# @author Jihoon lee <jhoon.it.lee@samsung.com>
from recorder_v2 import record_v2, inspect_file
fro... | 48.765351 | 200 | 0.672168 |
from recorder_v2 import record_v2, inspect_file
from zoneout import Zoneout
import torch
class FCUnroll(torch.nn.Module):
def __init__(self, unroll_for=1, num_fc=1):
super().__init__()
self.fcs = torch.nn.ModuleList([torch.nn.Linear(1, 1) for i in range(num_fc)])
self.unroll_for = ... | true | true |
f704d925011146519241475ec5938c87167815a6 | 1,196 | py | Python | main.py | nikolabebic95/MaterialUiColorsScss | 8f03999534424a84baca5bfd0031b90cf0cca0ae | [
"MIT"
] | null | null | null | main.py | nikolabebic95/MaterialUiColorsScss | 8f03999534424a84baca5bfd0031b90cf0cca0ae | [
"MIT"
] | null | null | null | main.py | nikolabebic95/MaterialUiColorsScss | 8f03999534424a84baca5bfd0031b90cf0cca0ae | [
"MIT"
] | null | null | null | import json
import pathlib
import urllib.request
def main():
# https://gist.github.com/kawanet/a880c83f06d6baf742e45ac9ac52af96
url = 'https://gist.githubusercontent.com/kawanet/a880c83f06d6baf742e45ac9ac52af96/raw' \
'/b4fbc9a730394eb977277e73cc37b60955463f21/material-colors.json'
json... | 37.375 | 116 | 0.637124 | import json
import pathlib
import urllib.request
def main():
url = 'https://gist.githubusercontent.com/kawanet/a880c83f06d6baf742e45ac9ac52af96/raw' \
'/b4fbc9a730394eb977277e73cc37b60955463f21/material-colors.json'
json_file_name = 'material-colors.json'
urllib.request.urlretrieve... | true | true |
f704d9ac6d70bd3e4025d4307a92b148575602ac | 345 | py | Python | bnn_mcmc_examples/examples/mlp/pima/setting1/hmc/sampler.py | papamarkou/bnn_mcmc_examples | 7bb4ecfb33db4c30a8e61e31f528bda0efb24e3d | [
"MIT"
] | 1 | 2021-09-09T15:55:37.000Z | 2021-09-09T15:55:37.000Z | bnn_mcmc_examples/examples/mlp/pima/setting1/hmc/sampler.py | kushagragpt99/bnn_mcmc_examples | 297cdb1e74335860989bebdb4ff6f6322b6adc06 | [
"MIT"
] | null | null | null | bnn_mcmc_examples/examples/mlp/pima/setting1/hmc/sampler.py | kushagragpt99/bnn_mcmc_examples | 297cdb1e74335860989bebdb4ff6f6322b6adc06 | [
"MIT"
] | 1 | 2021-10-05T06:38:57.000Z | 2021-10-05T06:38:57.000Z | # %% Import packages
from eeyore.samplers import HMC
from bnn_mcmc_examples.examples.mlp.pima.setting1.dataloaders import training_dataloader
from bnn_mcmc_examples.examples.mlp.pima.setting1.model import model
# %% Setup HMC sampler
sampler = HMC(model, theta0=model.prior.sample(), dataloader=training_dataloader, ... | 31.363636 | 106 | 0.811594 |
from eeyore.samplers import HMC
from bnn_mcmc_examples.examples.mlp.pima.setting1.dataloaders import training_dataloader
from bnn_mcmc_examples.examples.mlp.pima.setting1.model import model
sampler = HMC(model, theta0=model.prior.sample(), dataloader=training_dataloader, step=0.125, num_steps=6)
| true | true |
f704d9e98bd2692af546a133176acf66958374b4 | 866 | py | Python | heltour/tournament/migrations/0049_auto_20160804_0509.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 41 | 2016-08-17T19:58:42.000Z | 2021-11-08T10:52:07.000Z | heltour/tournament/migrations/0049_auto_20160804_0509.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 257 | 2016-08-17T22:29:05.000Z | 2022-01-13T00:42:05.000Z | heltour/tournament/migrations/0049_auto_20160804_0509.py | zbidwell/heltour | 3895142695096a81cc65c3fefb7d4501ed796f46 | [
"MIT"
] | 31 | 2016-09-23T23:36:14.000Z | 2022-01-14T17:05:08.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-04 05:09
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournament', '0048_auto_20160803_0311'),
]
operations = [
migrations.AddField(
... | 29.862069 | 174 | 0.643187 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournament', '0048_auto_20160803_0311'),
]
operations = [
migrations.AddField(
model_name='alternate',
name='season_player',
... | true | true |
f704dab721959161224d66936f270ee7bed32f72 | 12,634 | py | Python | reconstructPointwise.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | reconstructPointwise.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | reconstructPointwise.py | LLNL/ferdinand | af47b415ea1e9cb21a45b20d1f3854bc7f3a4d70 | [
"Apache-2.0"
] | null | null | null | ##############################################
# #
# Ferdinand 0.40, Ian Thompson, LLNL #
# #
# gnd,endf,fresco,azure,hyrma #
# #
#####################################... | 48.779923 | 166 | 0.616115 | 'capture'): rreac.tag = 'capture'
elif reaction == gnd.getReaction('elastic'): rreac.tag = 'elastic'
elif 'fission' in rreac.label: rreac.tag = rreac.label
else: rreac.tag = 'competitive'
xsecs = {'total':total, 'elastic':elastic, 'fission':fission, 'nonelastic':absorbtion}
... | true | true |
f704dae35a632084b188c064b1c868e00c367228 | 12,829 | py | Python | pylabnet/scripts/counter/monitor_counts.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | null | null | null | pylabnet/scripts/counter/monitor_counts.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | null | null | null | pylabnet/scripts/counter/monitor_counts.py | wi11dey/pylabnet | a6e3362f727c45aaa60e61496e858ae92e85574d | [
"MIT"
] | null | null | null | """ Generic script for monitoring counts from a counter """
import numpy as np
import time
import pyqtgraph as pg
from pylabnet.gui.pyqt.external_gui import Window
from pylabnet.utils.logging.logger import LogClient
from pylabnet.scripts.pause_script import PauseService
from pylabnet.network.core.generic_server import... | 34.029178 | 179 | 0.581651 |
import numpy as np
import time
import pyqtgraph as pg
from pylabnet.gui.pyqt.external_gui import Window
from pylabnet.utils.logging.logger import LogClient
from pylabnet.scripts.pause_script import PauseService
from pylabnet.network.core.generic_server import GenericServer
from pylabnet.network.client_server import si... | true | true |
f704db4f9f14c36b7a4a23d49d7aeb53b61d9f65 | 1,723 | py | Python | app/core/migrations/0001_initial.py | lucaspyproj/learn-app-api | 77d1216c9520c21785c7f56f84d8681a2990a6cf | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | lucaspyproj/learn-app-api | 77d1216c9520c21785c7f56f84d8681a2990a6cf | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | lucaspyproj/learn-app-api | 77d1216c9520c21785c7f56f84d8681a2990a6cf | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-02-16 11:10
# flake8: noqa
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name... | 50.676471 | 266 | 0.639582 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Au... | true | true |
f704db7738c33468077ceb775a163c773f08d47d | 11,918 | py | Python | Notebooks/lib/Message_passing_BN.py | olmosUC3M/Inference-and-Learning-in-discrete-Bayesian-Networks | 12e08f2e3f34146638806212be54837cc22c0516 | [
"MIT"
] | 3 | 2019-05-19T11:26:42.000Z | 2021-07-31T07:28:35.000Z | Notebooks/lib/Message_passing_BN.py | olmosUC3M/Inference-and-Learning-in-discrete-Bayesian-Networks | 12e08f2e3f34146638806212be54837cc22c0516 | [
"MIT"
] | null | null | null | Notebooks/lib/Message_passing_BN.py | olmosUC3M/Inference-and-Learning-in-discrete-Bayesian-Networks | 12e08f2e3f34146638806212be54837cc22c0516 | [
"MIT"
] | null | null | null | ## Message passing over a discrete BN ##
## Library created by Pablo Martínez Olmos, University Carlos III Madrid ##
## olmos@tsc.uc3m.es ##
## Last modification 15/11/2016 ##
import numpy as np
## Messages are stored in the logaritmic domain ##
## Global constants (to control numerical issues)
inf_log=100 #To impo... | 37.360502 | 133 | 0.698439 | or_order)
var_node['input_msgs']=[] #List to store input messages
var_node['observed']=observed_value_index #-1 if the variable is not observed
var_node['inner_factor']=np.zeros([cardinality,1]) #Internal vector used to imposed hard messages when variable is observed
#If variable is observed, the... | true | true |
f704dbc440727caa33f14c21d525c911a2a366fb | 2,262 | py | Python | atlassian_connect_django/rest_framework/authentication.py | gerasev-kirill/atlassian-connect-django | cd44232df512691d9ec14722c38785cf802862e9 | [
"MIT"
] | null | null | null | atlassian_connect_django/rest_framework/authentication.py | gerasev-kirill/atlassian-connect-django | cd44232df512691d9ec14722c38785cf802862e9 | [
"MIT"
] | null | null | null | atlassian_connect_django/rest_framework/authentication.py | gerasev-kirill/atlassian-connect-django | cd44232df512691d9ec14722c38785cf802862e9 | [
"MIT"
] | null | null | null | from six import text_type
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext_lazy as _
from atlassian_connect_django.models.connect import AtlassianUser
from atlassian_connect_django import helpers
from .models i... | 41.127273 | 169 | 0.741821 | from six import text_type
from rest_framework import HTTP_HEADER_ENCODING, exceptions
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext_lazy as _
from atlassian_connect_django.models.connect import AtlassianUser
from atlassian_connect_django import helpers
from .models i... | true | true |
f704dd4818c3b8d3017ae2937945bb191f230b62 | 2,054 | py | Python | python_smaclient/smapi_request.py | jloehel/python_smaclient | ed18efb4e19728f3644eb1e510262def57a1767b | [
"0BSD"
] | null | null | null | python_smaclient/smapi_request.py | jloehel/python_smaclient | ed18efb4e19728f3644eb1e510262def57a1767b | [
"0BSD"
] | null | null | null | python_smaclient/smapi_request.py | jloehel/python_smaclient | ed18efb4e19728f3644eb1e510262def57a1767b | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
import uuid
from construct import Container
class SMAPI_Request(object):
'''
Implentation of a ICUV Request
'''
def __init__(self, function_name, target_identifier,
authenticated_userid=b"", password=b"", additional_parameters=b""):
self._function_n... | 44.652174 | 89 | 0.624635 |
import uuid
from construct import Container
class SMAPI_Request(object):
def __init__(self, function_name, target_identifier,
authenticated_userid=b"", password=b"", additional_parameters=b""):
self._function_name = function_name
self._function_name_length = len(function_name)
... | true | true |
f704ddb7dba518e0334a017e32b36881a1730110 | 22,096 | py | Python | ppmessage/dispatcher/policy.py | augustand/ppmessage | 73beac9c75f751d5026ff7defff23732c7419b43 | [
"Apache-2.0"
] | 6 | 2017-11-03T17:31:52.000Z | 2020-06-14T09:14:36.000Z | ppmessage/dispatcher/policy.py | augustand/ppmessage | 73beac9c75f751d5026ff7defff23732c7419b43 | [
"Apache-2.0"
] | null | null | null | ppmessage/dispatcher/policy.py | augustand/ppmessage | 73beac9c75f751d5026ff7defff23732c7419b43 | [
"Apache-2.0"
] | 16 | 2017-08-08T01:25:47.000Z | 2019-09-17T16:32:06.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 PPMessage.
# Guijin Ding, dingguijin@gmail.com
#
from ppmessage.core.constant import IOS_FAKE_TOKEN
from ppmessage.core.constant import CONVERSATION_TYPE
from ppmessage.core.constant import MESSAGE_SUBTYPE
from ppmessage.core.constant import MESSAGE_STATUS
from ppmes... | 36.342105 | 111 | 0.613052 |
from ppmessage.core.constant import IOS_FAKE_TOKEN
from ppmessage.core.constant import CONVERSATION_TYPE
from ppmessage.core.constant import MESSAGE_SUBTYPE
from ppmessage.core.constant import MESSAGE_STATUS
from ppmessage.core.constant import MESSAGE_TYPE
from ppmessage.core.constant import TASK_STATUS
from ppm... | true | true |
f704e0229ff68105dd98edffdadbd49a9cb411c6 | 1,607 | py | Python | hard-gists/6623972/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/6623972/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/6623972/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
#
# author: syl20bnr (2013)
# goal: Focus the nth window in the current workspace (limited to 10 firsts)
#
# Example of usage in i3 config:
#
# bindsym $mod+0 exec focus_win.py -n 0
# bindsym $mod+1 exec focus_win.py -n 1
# ... ...
# bindsym $mod+8 exec focus_win.py -n 8
# binds... | 26.783333 | 79 | 0.616677 |
import argparse
from subprocess import Popen
import i3
PARSER = argparse.ArgumentParser(prog='focus_win')
PARSER.add_argument('-n', '--number',
required=True,
type=int,
choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
help='Window num... | true | true |
f704e19bda81a664e861029b4b9772bf0a1c979a | 23 | py | Python | demo/chart/test.py | winzipsdo/lighthouse-customization | 3bce54201b4328f5a3daa31497ebbd0dde410ca7 | [
"Apache-2.0"
] | null | null | null | demo/chart/test.py | winzipsdo/lighthouse-customization | 3bce54201b4328f5a3daa31497ebbd0dde410ca7 | [
"Apache-2.0"
] | null | null | null | demo/chart/test.py | winzipsdo/lighthouse-customization | 3bce54201b4328f5a3daa31497ebbd0dde410ca7 | [
"Apache-2.0"
] | null | null | null | import os
print os.path | 11.5 | 13 | 0.826087 | import os
print os.path | false | true |
f704e2908192786114878cd4a17cb8a00a35bca0 | 1,437 | py | Python | tests/test_normalizers.py | gobadiah/jasonpi | c0dc504cb4be5880d3d2dcedeebd9513a8123569 | [
"MIT"
] | null | null | null | tests/test_normalizers.py | gobadiah/jasonpi | c0dc504cb4be5880d3d2dcedeebd9513a8123569 | [
"MIT"
] | null | null | null | tests/test_normalizers.py | gobadiah/jasonpi | c0dc504cb4be5880d3d2dcedeebd9513a8123569 | [
"MIT"
] | 1 | 2019-03-05T09:35:06.000Z | 2019-03-05T09:35:06.000Z | import datetime
from jasonpi.normalizers import facebook_profile, google_profile
def test_facebook_profile():
"""
Test that facebook_profile computes
a correct profile received from facebook oauth.
"""
data = {
'email': 'some@email.com',
'first_name': 'Alfred',
'last_name'... | 33.418605 | 70 | 0.610299 | import datetime
from jasonpi.normalizers import facebook_profile, google_profile
def test_facebook_profile():
data = {
'email': 'some@email.com',
'first_name': 'Alfred',
'last_name': 'Dupont',
'gender': 'male',
'birthday': '02/25/1970'
}
profile = facebook_profile(... | true | true |
f704e2ba80b1a17cddedcb87bc5118b0363446b9 | 441 | py | Python | _draft/x_6_8.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | _draft/x_6_8.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | _draft/x_6_8.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_6_8
#
#
class StockError(Exception):
pass
class NumberError(Exception):
pass
order_count = input('きび団子を何個注文しますか?:')
card_number = input('カード番号を入力してください?(例、0000-0000-0000-0000):')
try:
if int(order_count) > 100:
raise StockError
if card_number != '1111-1111-1111-1111':
raise Num... | 16.333333 | 62 | 0.673469 |
class StockError(Exception):
pass
class NumberError(Exception):
pass
order_count = input('きび団子を何個注文しますか?:')
card_number = input('カード番号を入力してください?(例、0000-0000-0000-0000):')
try:
if int(order_count) > 100:
raise StockError
if card_number != '1111-1111-1111-1111':
raise NumberError
... | true | true |
f704e2ec4bedf7f9433b07f9722cc1c5b621e5ed | 10,014 | py | Python | electrumx/server/daemon.py | bitcoin-global/global-electrumx | 077dc2c3a5bfd9e82dc11784a98f986b8b726336 | [
"MIT"
] | 1 | 2020-06-30T18:50:22.000Z | 2020-06-30T18:50:22.000Z | electrumx/server/daemon.py | bitcoin-global/global-electrumx | 077dc2c3a5bfd9e82dc11784a98f986b8b726336 | [
"MIT"
] | null | null | null | electrumx/server/daemon.py | bitcoin-global/global-electrumx | 077dc2c3a5bfd9e82dc11784a98f986b8b726336 | [
"MIT"
] | 1 | 2020-12-18T17:13:31.000Z | 2020-12-18T17:13:31.000Z | # Copyright (c) 2016-2017, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
'''Class for handling asynchronous connections to a blockchain
daemon.'''
import asyncio
import itertools
import json
import time
import aiohttp
from a... | 37.931818 | 90 | 0.61454 |
import asyncio
import itertools
import json
import time
import aiohttp
from aiorpcx import JSONRPC
from electrumx.lib.util import hex_to_bytes, class_logger
class DaemonError(Exception):
class WarmingUpError(Exception):
class ServiceRefusedError(Exception):
class Daemon(object):
WARMING_UP = -28
... | true | true |
f704e31e46f9b00192e8725b26646591bb78db65 | 644 | py | Python | TODO_LIST/TODO_APP/migrations/0001_initial.py | Amit89499/TODO-APP-DJANGO | 082a4ffb803778378c6a8077ca47cf868bc55ef8 | [
"Apache-2.0"
] | 4 | 2020-06-29T16:00:39.000Z | 2021-05-22T03:40:38.000Z | TODO_LIST/TODO_APP/migrations/0001_initial.py | Amit89499/TODO-APP-DJANGO | 082a4ffb803778378c6a8077ca47cf868bc55ef8 | [
"Apache-2.0"
] | null | null | null | TODO_LIST/TODO_APP/migrations/0001_initial.py | Amit89499/TODO-APP-DJANGO | 082a4ffb803778378c6a8077ca47cf868bc55ef8 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.4 on 2020-06-21 18:32
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='task',
fields=[
('id', mode... | 26.833333 | 115 | 0.555901 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True... | true | true |
f704e383be902dc878749e1e1053016142dfdbac | 457 | py | Python | sportsbet/datasets/__init__.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | 49 | 2020-12-27T15:23:23.000Z | 2022-03-30T19:21:13.000Z | sportsbet/datasets/__init__.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | 5 | 2021-04-23T17:41:30.000Z | 2022-02-02T14:03:37.000Z | sportsbet/datasets/__init__.py | ItzBraveNoob/sports-betting | 521d4ef6bd0e079d508f40609681124edc2c6805 | [
"MIT"
] | 15 | 2021-02-13T02:01:49.000Z | 2022-03-07T01:09:15.000Z | """
The :mod:`sportsbet.datasets` module provides the
tools to download and transform sports betting data.
"""
from ._base import load
from ._soccer._combined import SoccerDataLoader
from ._soccer._fd import FDSoccerDataLoader
from ._soccer._fte import FTESoccerDataLoader
from ._soccer._dummy import DummySoccerDataLoa... | 24.052632 | 52 | 0.770241 |
from ._base import load
from ._soccer._combined import SoccerDataLoader
from ._soccer._fd import FDSoccerDataLoader
from ._soccer._fte import FTESoccerDataLoader
from ._soccer._dummy import DummySoccerDataLoader
__all__ = [
'SoccerDataLoader',
'FDSoccerDataLoader',
'FTESoccerDataLoader',
'DummySoccerD... | true | true |
f704e3f96f343e3769531df6f0c6d75bfe0aa5ca | 66,444 | py | Python | lib/galaxy/webapps/galaxy/controllers/dataset.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/controllers/dataset.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/webapps/galaxy/controllers/dataset.py | Galaxyinternship/Galaxy | 204be086a8c16d6684584cefa9053ed7c86a1784 | [
"CC-BY-3.0"
] | null | null | null | import logging
import os
import urllib
from markupsafe import escape
import paste.httpexceptions
from six import string_types, text_type
from sqlalchemy import false, true
from galaxy import datatypes, model, util, web
from galaxy import managers
from galaxy.datatypes.display_applications.util import decode_dataset_u... | 56.548085 | 258 | 0.59438 | import logging
import os
import urllib
from markupsafe import escape
import paste.httpexceptions
from six import string_types, text_type
from sqlalchemy import false, true
from galaxy import datatypes, model, util, web
from galaxy import managers
from galaxy.datatypes.display_applications.util import decode_dataset_u... | true | true |
f704e406d6064c1b07ddb3fa9237f28659c4ec07 | 7,122 | py | Python | daal4py/sklearn/neighbors/_classification.py | Alexsandruss/daal4py | 6e5a02d3fd46095585e618edba24fc258e8b0052 | [
"Apache-2.0"
] | null | null | null | daal4py/sklearn/neighbors/_classification.py | Alexsandruss/daal4py | 6e5a02d3fd46095585e618edba24fc258e8b0052 | [
"Apache-2.0"
] | null | null | null | daal4py/sklearn/neighbors/_classification.py | Alexsandruss/daal4py | 6e5a02d3fd46095585e618edba24fc258e8b0052 | [
"Apache-2.0"
] | null | null | null | #===============================================================================
# Copyright 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 40.697143 | 85 | 0.641252 |
from ._base import NeighborsBase, KNeighborsMixin
from ._base import parse_auto_method, prediction_algorithm
from sklearn.base import ClassifierMixin as BaseClassifierMixin
from .._utils import (
getFPType,
sklearn_check_version,
get_patch_message,
PatchingConditionsChain)
from .._devi... | true | true |
f704e4bde1c29b09b13e9c055dbbdaff730de2a4 | 383 | py | Python | other/dingding/dingtalk/api/rest/OapiAtsChannelAccountAddRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiAtsChannelAccountAddRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | other/dingding/dingtalk/api/rest/OapiAtsChannelAccountAddRequest.py | hth945/pytest | 83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2020.08.19
'''
from dingtalk.api.base import RestApi
class OapiAtsChannelAccountAddRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.biz_code = None
self.channel_user_identify = None
self.userid = None
def getHttpMethod(self):
return 'POST'
def geta... | 22.529412 | 48 | 0.75718 | from dingtalk.api.base import RestApi
class OapiAtsChannelAccountAddRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.biz_code = None
self.channel_user_identify = None
self.userid = None
def getHttpMethod(self):
return 'POST'
def getapiname(self):
return 'dingtalk.oapi.ats.... | true | true |
f704e67f0939a74be44c84c108717c2e056598e9 | 1,634 | py | Python | tests/test_web_flask/test_c_route.py | RodrigoSierraV/AirBnB_clone_v4 | 314a2f20ea3f1de89255317d0b52a4289b36ccbc | [
"MIT"
] | 5 | 2017-09-12T18:23:55.000Z | 2021-07-27T18:05:37.000Z | tests/test_web_flask/test_c_route.py | petehwu/AirBnB_clone_v4 | bf0528c99662285139aa56fe8e752d239e2f7b2a | [
"MIT"
] | 8 | 2019-09-27T17:23:04.000Z | 2019-09-30T23:31:31.000Z | tests/test_web_flask/test_c_route.py | petehwu/AirBnB_clone_v4 | bf0528c99662285139aa56fe8e752d239e2f7b2a | [
"MIT"
] | 10 | 2017-09-20T18:50:07.000Z | 2022-02-17T20:58:23.000Z | #!/usr/bin/python3
"""
Unit Test for api v1 Flask App
"""
import inspect
import pep8
import web_flask
import unittest
from os import stat
web_flask = __import__('web_flask.2-c_route', globals(), locals(), ['*'])
class TestCRouteDocs(unittest.TestCase):
"""Class for testing Hello Route docs"""
all_funcs = ins... | 29.709091 | 75 | 0.601591 |
import inspect
import pep8
import web_flask
import unittest
from os import stat
web_flask = __import__('web_flask.2-c_route', globals(), locals(), ['*'])
class TestCRouteDocs(unittest.TestCase):
all_funcs = inspect.getmembers(web_flask, inspect.isfunction)
@classmethod
def setUpClass(cls):
prin... | true | true |
f704e6c02a08c79f1e412b550fbc5e2ad285adf4 | 11,273 | py | Python | multiqc_clarity/multiqc_clarity.py | MultiQC/MultiQC_Clarity | 9ac177dffa8c9a5a5d57ec0c6739a74a974b8ab3 | [
"MIT"
] | 1 | 2018-06-18T15:31:10.000Z | 2018-06-18T15:31:10.000Z | multiqc_clarity/multiqc_clarity.py | MultiQC/MultiQC_Clarity | 9ac177dffa8c9a5a5d57ec0c6739a74a974b8ab3 | [
"MIT"
] | 5 | 2017-03-13T17:21:45.000Z | 2019-02-14T12:34:11.000Z | multiqc_clarity/multiqc_clarity.py | MultiQC/MultiQC_Clarity | 9ac177dffa8c9a5a5d57ec0c6739a74a974b8ab3 | [
"MIT"
] | 4 | 2017-03-06T09:47:42.000Z | 2019-02-13T13:19:23.000Z |
from genologics.lims import Lims
from genologics.config import BASEURI, USERNAME, PASSWORD
from multiqc.utils import report, config
from multiqc.modules.base_module import BaseMultiqcModule
from multiqc.plots import table
from collections import OrderedDict
import logging
import re
class MultiQC_clarity_metadata(Ba... | 42.863118 | 129 | 0.548213 |
from genologics.lims import Lims
from genologics.config import BASEURI, USERNAME, PASSWORD
from multiqc.utils import report, config
from multiqc.modules.base_module import BaseMultiqcModule
from multiqc.plots import table
from collections import OrderedDict
import logging
import re
class MultiQC_clarity_metadata(Ba... | true | true |
f704e7c24f57a177cdaf904a0e365c964a9eeb80 | 1,308 | py | Python | setup.py | ScyThe1289/cgen | e644d790fce3a06457eff30044c31eb549d8e2f8 | [
"MIT"
] | null | null | null | setup.py | ScyThe1289/cgen | e644d790fce3a06457eff30044c31eb549d8e2f8 | [
"MIT"
] | null | null | null | setup.py | ScyThe1289/cgen | e644d790fce3a06457eff30044c31eb549d8e2f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open("README.rst", "rt") as inf:
readme = inf.read()
ver_dic = {}
with open("cgen/version.py") as version_file:
version_file_contents = version_file.read()
exec(compile(version_file_contents, "cgen/version.py", 'exec'), ver_dic)... | 29.727273 | 72 | 0.563456 |
from setuptools import setup
with open("README.rst", "rt") as inf:
readme = inf.read()
ver_dic = {}
with open("cgen/version.py") as version_file:
version_file_contents = version_file.read()
exec(compile(version_file_contents, "cgen/version.py", 'exec'), ver_dic)
setup(
name="cgen",
versio... | true | true |
f704e89b073258465eda8a5b1cc588d46c48769f | 1,044 | py | Python | src/robotide/utils/versioncomparator.py | ludovicurbain/SWIFT-RIDE | ab72df08a57101c433bfa5ad44949d9983e4e611 | [
"ECL-2.0",
"Apache-2.0"
] | 775 | 2015-01-12T06:54:09.000Z | 2022-03-25T05:18:05.000Z | src/robotide/utils/versioncomparator.py | ludovicurbain/SWIFT-RIDE | ab72df08a57101c433bfa5ad44949d9983e4e611 | [
"ECL-2.0",
"Apache-2.0"
] | 2,191 | 2015-05-19T16:49:09.000Z | 2022-03-28T21:38:34.000Z | src/robotide/utils/versioncomparator.py | ludovicurbain/SWIFT-RIDE | ab72df08a57101c433bfa5ad44949d9983e4e611 | [
"ECL-2.0",
"Apache-2.0"
] | 382 | 2015-01-24T08:41:44.000Z | 2022-03-13T10:14:20.000Z | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 32.625 | 75 | 0.703065 |
from pkg_resources import parse_version
def cmp_versions(version1, version2):
if version1 is None:
if version2 is None:
return 0
else:
return -1
if version2 is None:
return 1
if parse_version(version1) == parse_version(version2):
retur... | true | true |
f704e942f03f28034ae8717e0065554e929f93f4 | 4,009 | py | Python | zer018_perception/lane_vision/src/homography.py | ZEROSNU/zer018 | c469cf22fa1fdf731b02c79f296ee96d35dccb25 | [
"MIT"
] | 1 | 2019-01-05T07:01:46.000Z | 2019-01-05T07:01:46.000Z | zer018_perception/lane_vision/src/homography.py | ZEROSNU/zer018 | c469cf22fa1fdf731b02c79f296ee96d35dccb25 | [
"MIT"
] | null | null | null | zer018_perception/lane_vision/src/homography.py | ZEROSNU/zer018 | c469cf22fa1fdf731b02c79f296ee96d35dccb25 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import time
'''
TEST FILE using 1000, 1000 output image.
Actual code will have an output image of 200,200, which also means a different homography
'''
#recalculated homography
# homography_front = np.array([[3.12570133882145e-05, 0.000286172662353515, -0.680179732686621],
# [0.0... | 40.494949 | 97 | 0.687204 | import cv2
import numpy as np
import time
homography_front = np.array([[4.62227601649053e-05, 0.000243520884225642, -0.678748083960862],
[0.000969465596108860, -0.00207033488113324, -0.734366621126640],
[1.58512860546350e-07, -6.83048800828728e-06, -0.00119023476366804]])
homography_left = np... | true | true |
f704e9b9373cb103702b97b1698ac5e81ca15084 | 2,543 | py | Python | app/forms/user.py | Kbman99/Flask-Startup | e3fea9c7e16a650abd9768ea1e9aee845dcecfda | [
"MIT"
] | null | null | null | app/forms/user.py | Kbman99/Flask-Startup | e3fea9c7e16a650abd9768ea1e9aee845dcecfda | [
"MIT"
] | null | null | null | app/forms/user.py | Kbman99/Flask-Startup | e3fea9c7e16a650abd9768ea1e9aee845dcecfda | [
"MIT"
] | null | null | null | from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import (Required, Length, Email, ValidationError,
EqualTo)
from app.models import User
class Unique(object):
'''
Custom validator to check an object's attribute
is unique. For e... | 29.917647 | 75 | 0.594573 | from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import (Required, Length, Email, ValidationError,
EqualTo)
from app.models import User
class Unique(object):
def __init__(self, model, field, message):
self.model = model
... | true | true |
f704e9eac8de03f01fa77d9579930caec71292b1 | 22 | py | Python | luvio/externals/domain_api/api.py | nguyenhailong253/luvio-server | 8e75bea4171fc2367cc6d7ebd5a19382932840d5 | [
"MIT"
] | null | null | null | luvio/externals/domain_api/api.py | nguyenhailong253/luvio-server | 8e75bea4171fc2367cc6d7ebd5a19382932840d5 | [
"MIT"
] | null | null | null | luvio/externals/domain_api/api.py | nguyenhailong253/luvio-server | 8e75bea4171fc2367cc6d7ebd5a19382932840d5 | [
"MIT"
] | null | null | null | # Call Domain api here | 22 | 22 | 0.772727 | true | true | |
f704ea950fc187b21bea1b7de6bc90411e2926da | 845 | py | Python | adm/makesedonac.py | AndreySV/sedona | 9fe9e800ba3454b725d96355abee172591ceca1f | [
"AFL-3.0"
] | 26 | 2015-02-16T18:35:06.000Z | 2021-12-22T03:10:32.000Z | adm/makesedonac.py | AndreySV/sedona | 9fe9e800ba3454b725d96355abee172591ceca1f | [
"AFL-3.0"
] | 40 | 2015-09-29T11:19:16.000Z | 2021-07-12T02:53:35.000Z | adm/makesedonac.py | AndreySV/sedona | 9fe9e800ba3454b725d96355abee172591ceca1f | [
"AFL-3.0"
] | 34 | 2015-12-10T02:53:21.000Z | 2022-01-13T16:28:30.000Z | #! /usr/bin/env python3
#
# makesedonac.py
#
# Compile sedonac.jar
#
# Author: Brian Frank
# Creation: 7 Dec 07
#
from __future__ import print_function
import os
import env
import compilejar
depends = [env.sedonaJar]
srcDir = os.path.join(env.src, "sedonac", "src")
jarFile = env.sedonacJar
package... | 17.244898 | 58 | 0.631953 |
from __future__ import print_function
import os
import env
import compilejar
depends = [env.sedonaJar]
srcDir = os.path.join(env.src, "sedonac", "src")
jarFile = env.sedonacJar
packages = [
"sedonac",
"sedonac.analysis",
"sedonac.asm",
"sedonac.ast",
"sedonac.gen",
"sedonac.ir",
"se... | true | true |
f704eb8f47624f4a65229a7680567e12eb42eb47 | 2,619 | py | Python | test/test.py | RLSwanepoel/edsa_packages | 6258dd20c2508c5bcc298b3de86cec9e6a1403d2 | [
"MIT"
] | null | null | null | test/test.py | RLSwanepoel/edsa_packages | 6258dd20c2508c5bcc298b3de86cec9e6a1403d2 | [
"MIT"
] | null | null | null | test/test.py | RLSwanepoel/edsa_packages | 6258dd20c2508c5bcc298b3de86cec9e6a1403d2 | [
"MIT"
] | null | null | null | from edsa_packages import recursion, sorting
#Recursion tests
def test_sum_array():
'''
Make sure sum_array works
'''
assert recursion.sum_array([8, 3, 2, 7, 4]) == 24, 'incorrect'
assert recursion.sum_array([5, 7, 8, 8, 6, 3, 4]) == 41, 'incorrect'
assert recursion.sum_array([25, 14, 2, 3, 5]... | 42.241935 | 175 | 0.613975 | from edsa_packages import recursion, sorting
def test_sum_array():
assert recursion.sum_array([8, 3, 2, 7, 4]) == 24, 'incorrect'
assert recursion.sum_array([5, 7, 8, 8, 6, 3, 4]) == 41, 'incorrect'
assert recursion.sum_array([25, 14, 2, 3, 5]) == 49, 'incorrect'
def test_fibonacci():
assert recursi... | true | true |
f704ec3011295133131ca2780e725d89200d860c | 6,746 | py | Python | bin/3rdparty/awscli/customizations/ec2/bundleinstance.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 36 | 2019-11-06T20:49:07.000Z | 2021-07-07T02:26:52.000Z | bin/3rdparty/awscli/customizations/ec2/bundleinstance.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 21 | 2019-11-10T05:38:06.000Z | 2022-03-10T15:07:48.000Z | bin/3rdparty/awscli/customizations/ec2/bundleinstance.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 7 | 2020-02-13T22:56:46.000Z | 2022-01-22T05:57:34.000Z | # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 37.270718 | 75 | 0.641121 |
import logging
from hashlib import sha1
import hmac
import base64
import datetime
from awscli.compat import six
from awscli.arguments import CustomArgument
logger = logging.getLogger('ec2bundleinstance')
BUCKET_DOCS = ('The bucket in which to store the AMI. '
'You can specify a buck... | true | true |
f704ecdfca4d6662c111ca95bb581c2a4f67afb6 | 891 | py | Python | loadtests/locustfile.py | javieraviles/quarkus-github-flow | 38ecb9cc626b21e621e20cd77a9638780245047c | [
"MIT"
] | 8 | 2020-09-04T02:16:18.000Z | 2022-01-23T18:40:21.000Z | loadtests/locustfile.py | javieraviles/quarkus-github-flow | 38ecb9cc626b21e621e20cd77a9638780245047c | [
"MIT"
] | null | null | null | loadtests/locustfile.py | javieraviles/quarkus-github-flow | 38ecb9cc626b21e621e20cd77a9638780245047c | [
"MIT"
] | 3 | 2020-12-14T19:32:10.000Z | 2022-01-17T15:06:20.000Z | import datetime
from http import HTTPStatus
from locust import HttpUser, task, between
# This test can be run after installing locust through the cli as "locust --host=http://<deployed_host>:<port>"
# Then url http://localhost:8089/ should be access to start the test.
# Can also be run using no UI mode as "locust --no... | 40.5 | 168 | 0.699214 | import datetime
from http import HTTPStatus
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 2)
@task(1)
def get_developers(self):
r = self.client.get("/developers")
assert r.status_code == HTTPStatus.OK, "Unexpected response code: " + s... | true | true |
f704ed56e109cde4331623e75aa489ba21777f29 | 2,861 | py | Python | ipynb_py_convert/__main__.py | max-yue/ipynb-py-convert | 77dc636240560892aedbc8a36532784dee408cfa | [
"MIT"
] | null | null | null | ipynb_py_convert/__main__.py | max-yue/ipynb-py-convert | 77dc636240560892aedbc8a36532784dee408cfa | [
"MIT"
] | null | null | null | ipynb_py_convert/__main__.py | max-yue/ipynb-py-convert | 77dc636240560892aedbc8a36532784dee408cfa | [
"MIT"
] | null | null | null | import json
import sys
from os import path
header_comment = '# %%\n'
def nb2py(notebook):
result = []
cells = notebook['cells']
for cell in cells:
cell_type = cell['cell_type']
if cell_type == 'markdown':
result.append('%s"""\n%s\n"""'%
(header_comm... | 26.009091 | 77 | 0.510311 | import json
import sys
from os import path
header_comment = '# %%\n'
def nb2py(notebook):
result = []
cells = notebook['cells']
for cell in cells:
cell_type = cell['cell_type']
if cell_type == 'markdown':
result.append('%s"""\n%s\n"""'%
(header_comm... | true | true |
f704ee3f89f247b8ce355120ca2318d063278e9c | 1,524 | py | Python | modules/tutorials/pymc3_tutorial.py | ansteh/multivariate | fbd166f9e9a6d721a1d876b6e46db064f43afe53 | [
"Apache-2.0"
] | null | null | null | modules/tutorials/pymc3_tutorial.py | ansteh/multivariate | fbd166f9e9a6d721a1d876b6e46db064f43afe53 | [
"Apache-2.0"
] | null | null | null | modules/tutorials/pymc3_tutorial.py | ansteh/multivariate | fbd166f9e9a6d721a1d876b6e46db064f43afe53 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import time
import matplotlib.pyplot as plt
from pymc3 import Model, Normal, HalfNormal, find_MAP
from scipy import optimize
start_time = time.time()
# Initialize random number generator
np.random.seed(123)
# True parameter values
alpha, sigma = 1, 1
beta = [1, 2.5]
# Size of dataset
size = 100
... | 21.771429 | 78 | 0.700131 | import numpy as np
import time
import matplotlib.pyplot as plt
from pymc3 import Model, Normal, HalfNormal, find_MAP
from scipy import optimize
start_time = time.time()
np.random.seed(123)
alpha, sigma = 1, 1
beta = [1, 2.5]
size = 100
X1 = np.random.randn(size)
X2 = np.random.randn(size) * 0.2
Y = alpha + b... | false | true |
f704ee4619176809e6126c4c9fe27a817e363dc3 | 580 | py | Python | day_02/day_02.py | aclima93/AdventOfCode | 73cc2c194b5ffc27e4d275a3693c148d690bca1f | [
"WTFPL"
] | null | null | null | day_02/day_02.py | aclima93/AdventOfCode | 73cc2c194b5ffc27e4d275a3693c148d690bca1f | [
"WTFPL"
] | null | null | null | day_02/day_02.py | aclima93/AdventOfCode | 73cc2c194b5ffc27e4d275a3693c148d690bca1f | [
"WTFPL"
] | null | null | null |
import sys
input_file = open(sys.argv[1])
input_lines = input_file.readlines()
total_wrapping = 0
total_ribbon = 0
for line in input_lines:
l, w, h = line.split("x")
l = int(l)
w = int(w)
h = int(h)
dimensions = [l, w, h]
min_1 = min(dimensions)
dimensions.remove(min_1)
min_2 = min(... | 20 | 79 | 0.6 |
import sys
input_file = open(sys.argv[1])
input_lines = input_file.readlines()
total_wrapping = 0
total_ribbon = 0
for line in input_lines:
l, w, h = line.split("x")
l = int(l)
w = int(w)
h = int(h)
dimensions = [l, w, h]
min_1 = min(dimensions)
dimensions.remove(min_1)
min_2 = min(... | true | true |
f704ee9eba83abf2786c8b03afb6216b6afd600a | 8,786 | py | Python | responder/models.py | repodevs/responder | 4d15dbc4654038130f43bff48f51627dfd4b5df7 | [
"Apache-2.0"
] | null | null | null | responder/models.py | repodevs/responder | 4d15dbc4654038130f43bff48f51627dfd4b5df7 | [
"Apache-2.0"
] | null | null | null | responder/models.py | repodevs/responder | 4d15dbc4654038130f43bff48f51627dfd4b5df7 | [
"Apache-2.0"
] | null | null | null | import io
import json
import gzip
from base64 import b64decode
from http.cookies import SimpleCookie
import chardet
import rfc3986
import graphene
import yaml
from requests.structures import CaseInsensitiveDict
from requests.cookies import RequestsCookieJar
from starlette.datastructures import MutableHeaders
from sta... | 29.884354 | 121 | 0.600842 | import io
import json
import gzip
from base64 import b64decode
from http.cookies import SimpleCookie
import chardet
import rfc3986
import graphene
import yaml
from requests.structures import CaseInsensitiveDict
from requests.cookies import RequestsCookieJar
from starlette.datastructures import MutableHeaders
from sta... | true | true |
f704ef2c8233458ae3f08016c0e7150a60a3e915 | 6,863 | py | Python | aae.py | anonymous-iclr-2019/acai-iclr-2019 | 233058a8330e8162e199933ee22b8e5fcac22072 | [
"Apache-2.0"
] | 20 | 2018-12-25T05:05:11.000Z | 2021-06-21T02:27:53.000Z | aae.py | anonymous-iclr-2019/acai-iclr-2019 | 233058a8330e8162e199933ee22b8e5fcac22072 | [
"Apache-2.0"
] | 1 | 2021-02-08T23:40:40.000Z | 2021-02-08T23:40:40.000Z | aae.py | anonymous-iclr-2019/acai-iclr-2019 | 233058a8330e8162e199933ee22b8e5fcac22072 | [
"Apache-2.0"
] | 5 | 2018-11-04T22:11:45.000Z | 2019-09-11T12:57:15.000Z | # Copyright 2018
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 40.85119 | 79 | 0.652339 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
from absl import app
from absl import flags
import tensorflow as tf
from lib import data, layers, train, utils, classifiers, eval
FLAGS = flags.FLAGS
class AAE(train.AE):
d... | true | true |
f704ef3af73f982bb2a2835418342e4bbbf74ec9 | 17,036 | py | Python | django/contrib/admin/utils.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | django/contrib/admin/utils.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | django/contrib/admin/utils.py | devops2014/djangosite | db77915c9fd35a203edd8206f702ee4082f04d4a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... | 33.535433 | 94 | 0.617751 | from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... | true | true |
f704effc26992be20ba41471a7122694d4e7fcf5 | 41,290 | py | Python | numba/core/dispatcher.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 2 | 2018-04-09T18:50:16.000Z | 2019-06-11T15:19:51.000Z | numba/core/dispatcher.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 2 | 2015-04-15T20:25:48.000Z | 2021-03-03T12:32:59.000Z | numba/core/dispatcher.py | blair1306/numba | 3b9647d17d653abac15363da604eeb804dbdd15a | [
"BSD-2-Clause"
] | 1 | 2021-05-12T07:29:28.000Z | 2021-05-12T07:29:28.000Z | # -*- coding: utf-8 -*-
import collections
import functools
import os
import struct
import sys
import types as pytypes
import uuid
import weakref
from copy import deepcopy
from numba import _dispatcher
from numba.core import utils, types, errors, typing, serialize, config, compiler, sigutils
from numba.core.compiler... | 37.265343 | 104 | 0.598377 |
import collections
import functools
import os
import struct
import sys
import types as pytypes
import uuid
import weakref
from copy import deepcopy
from numba import _dispatcher
from numba.core import utils, types, errors, typing, serialize, config, compiler, sigutils
from numba.core.compiler_lock import global_com... | true | true |
f704f208405e343692080fea1f8d229afeb2ecb7 | 90,552 | py | Python | src/genie/libs/parser/iosxe/tests/test_show_interface.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/test_show_interface.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/test_show_interface.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
import sys
import unittest
from unittest.mock import Mock
from unittest.mock import patch
from textwrap import dedent
ats_mock = Mock()
with patch.dict('sys.modules',
{'ats' : ats_mock}, autospec=True):
import genie.parsergen
from genie.parsergen import oper_fill
from genie.parse... | 39.115335 | 107 | 0.489774 |
import sys
import unittest
from unittest.mock import Mock
from unittest.mock import patch
from textwrap import dedent
ats_mock = Mock()
with patch.dict('sys.modules',
{'ats' : ats_mock}, autospec=True):
import genie.parsergen
from genie.parsergen import oper_fill
from genie.parsergen import oper_... | true | true |
f704f29d917dfbd51e439f0dd5292f602da50c6f | 8,655 | py | Python | modelci/experimental/model/model_structure.py | FerdinandZhong/ML-Model-CI | 90fa2de056dca05031f0787b96c520dc57dc664d | [
"Apache-2.0"
] | 170 | 2020-06-08T18:30:52.000Z | 2022-03-28T12:08:11.000Z | modelci/experimental/model/model_structure.py | FerdinandZhong/ML-Model-CI | 90fa2de056dca05031f0787b96c520dc57dc664d | [
"Apache-2.0"
] | 146 | 2020-06-14T18:56:27.000Z | 2022-02-27T21:15:59.000Z | modelci/experimental/model/model_structure.py | FerdinandZhong/ML-Model-CI | 90fa2de056dca05031f0787b96c520dc57dc664d | [
"Apache-2.0"
] | 36 | 2020-06-08T18:30:56.000Z | 2022-03-07T18:10:19.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Li Yuanming
Email: yli056@e.ntu.edu.sg
Date: 1/27/2021
ML model structure definitions.
"""
import abc
import inspect
from enum import Enum
from typing import Optional, Union, Tuple, Dict, OrderedDict
from pydantic import BaseModel, PositiveInt, conint, Positiv... | 34.209486 | 115 | 0.669324 |
import abc
import inspect
from enum import Enum
from typing import Optional, Union, Tuple, Dict, OrderedDict
from pydantic import BaseModel, PositiveInt, conint, PositiveFloat, Field, validator
from typing_extensions import Literal
class Operation(Enum):
ADD = 'A'
DELETE = 'D'
MODIFY = 'M'
EMPTY = ... | true | true |
f704f2ca519f891d9320e62953ff55261e97b68a | 5,431 | py | Python | src/thexb/STAGE_topobinner.py | harris-2374/THEx | 04c4f56eb2cf86b8f55ddd6edd3f48029296bf5a | [
"MIT"
] | null | null | null | src/thexb/STAGE_topobinner.py | harris-2374/THEx | 04c4f56eb2cf86b8f55ddd6edd3f48029296bf5a | [
"MIT"
] | null | null | null | src/thexb/STAGE_topobinner.py | harris-2374/THEx | 04c4f56eb2cf86b8f55ddd6edd3f48029296bf5a | [
"MIT"
] | null | null | null | """
Author: Andrew Harris
Python 3.8
"""
import logging
import os
import pandas as pd
from ete3 import Tree
from tqdm import tqdm
############################### Set up logger #################################
def set_logger_level(WORKING_DIR, LOG_LEVEL):
logger = logging.getLogger(__name__)
# Remove existing ... | 38.51773 | 119 | 0.558645 | import logging
import os
import pandas as pd
from ete3 import Tree
from tqdm import tqdm
| true | true |
f704f458109bda2f6012d3166ddc6ff6686bf0f4 | 12,306 | py | Python | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:08:20.000Z | 2020-02-25T13:08:20.000Z | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/bin/Basic/Distance2XXX/reads_or_peaks_distribution_relative2xxx.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
####################################################################################
### Copyright (C) 2015-2019 by ABLIFE
####################################################################################
#########################################################... | 33.715068 | 232 | 0.42719 | true | true | |
f704f4cd9c7fb1284f93ea1a887f87bdb1ce825e | 408 | py | Python | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | 4 | 2020-10-06T17:15:32.000Z | 2021-06-04T06:07:44.000Z | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | 10 | 2020-10-06T18:23:43.000Z | 2020-10-12T00:26:05.000Z | backend/api/models/__init__.py | Leundai/twanalyze | bfccd9de43fae78e1cbdc0a6695f1cf827a3282b | [
"Apache-2.0"
] | null | null | null | # this file structure follows http://flask.pocoo.org/docs/1.0/patterns/appfactories/
# initializing db in api.models.base instead of in api.__init__.py
# to prevent circular dependencies
from .base import db
from .Email import Email
from .Person import Person
from .VideoInfo import VideoInfo
__all__ = ["db", "Email", ... | 34 | 84 | 0.767157 |
from .base import db
from .Email import Email
from .Person import Person
from .VideoInfo import VideoInfo
__all__ = ["db", "Email", "Person", "VideoInfo"]
| true | true |
f704f52a0332da8f345d14dd4fef2d97a4463857 | 4,181 | py | Python | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 118 | 2019-08-31T04:33:18.000Z | 2022-03-28T21:12:14.000Z | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 15 | 2019-12-05T01:29:46.000Z | 2022-02-18T17:13:46.000Z | Scripts/sims4communitylib/classes/interactions/common_interaction_override_name.py | ColonolNutty/Sims4CommunityLibrary | 684f28dc3c7deb4d9fd520e21e63942b65a91d31 | [
"CC-BY-4.0"
] | 28 | 2019-09-07T04:11:05.000Z | 2022-02-07T18:31:40.000Z | """
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from typing import Any, Union
from interactions.base.inter... | 48.057471 | 242 | 0.717771 | from typing import Any, Union
from interactions.base.interaction import Interaction
from interactions.context import InteractionContext
from protocolbuffers.Localization_pb2 import LocalizedString
from sims.sim import Sim
from sims4.utils import flexmethod
from sims4communitylib.logging.has_class_log import HasClassLo... | true | true |
f704f5d9631a52161bb607794d67acaf0b67e1cb | 129,671 | py | Python | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | 1 | 2017-09-08T04:32:21.000Z | 2017-09-08T04:32:21.000Z | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/layers/python/layers/layers.py | drothlis/tensorflow | 04c318b69c5b565436cfeeaab1cb7fd5419dde27 | [
"Apache-2.0"
] | 1 | 2017-09-12T19:41:26.000Z | 2017-09-12T19:41:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 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
#
# Un... | 43.469997 | 95 | 0.672857 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
import six
from tensorflow.contrib.framework.python.ops import add_arg_scope
from tensorflow.contrib.framework.python.ops import variables
from tensorflow.contrib.l... | true | true |
f704f90ac3c9d0634fcdcbb3eca1f502fa10cc71 | 3,596 | py | Python | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | 1 | 2022-03-15T17:23:52.000Z | 2022-03-15T17:23:52.000Z | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | null | null | null | aa2ua_cube.py | jotelha/smampppp | 729e4733b436e68adfe07bcaa39a47727d0c8dd8 | [
"MIT"
] | 1 | 2018-04-06T11:29:44.000Z | 2018-04-06T11:29:44.000Z | #!/usr/bin/env python
""" Maps point charges obtained by GPAW and HORTON on the original'
' GROMACS topology initially modified by insertHbyList.py """
## jlh 2018/04/02
import ast
import h5py
import ase.io
from ase.io.cube import read_cube_data
import parmed as pmd
from parmed import gromacs
from insertHby... | 44.95 | 87 | 0.682147 |
ort h5py
import ase.io
from ase.io.cube import read_cube_data
import parmed as pmd
from parmed import gromacs
from insertHbyList import insertHbyList
import argparse
def main():
parser = argparse.ArgumentParser(\
description='Converts an all-atom cube file into united-atom'
' representation b... | true | true |
f704fa8cf0c91be4a9dab86662c520f3207e5d08 | 5,352 | py | Python | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.7/site-packages/colormath/color_diff_matrix.py | rchen2123/ryu | 99400f8c421c1a84b4c7e80dd26224b36ee6d779 | [
"Apache-2.0"
] | null | null | null | """
This module contains the formulas for comparing Lab values with matrices
and vectors. The benefit of using NumPy's matrix capabilities is speed. These
calls can be used to efficiently compare large volumes of Lab colors.
"""
import numpy
def delta_e_cie1976(lab_color_vector, lab_color_matrix):
"""
Calcul... | 31.668639 | 116 | 0.604634 |
import numpy
def delta_e_cie1976(lab_color_vector, lab_color_matrix):
return numpy.sqrt(
numpy.sum(numpy.power(lab_color_vector - lab_color_matrix, 2), axis=1))
def delta_e_cie1994(lab_color_vector, lab_color_matrix,
K_L=1, K_C=1, K_H=1, K_1=0.045, K_2=0.015):
C_1 = numpy.sqrt(... | true | true |
f704fab0af522b8019096eec4487783464bda665 | 3,827 | py | Python | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | IntranetExam.py | capturemathan/Amrita_Intranet_ExamPapers | 8d11b5c9ce8d1641e05d219acfa91b2f5b2b6584 | [
"MIT"
] | null | null | null | import os
import webbrowser
import time
import random
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
from time import sleep
cont = 1
print("Welcome to Qp Bank !")
sleep(1)
print("Crafted with love by Mathan.S")
sleep(1)
print("Ensure your connectivity to Amrita Wifi f... | 29.898438 | 85 | 0.679906 | import os
import webbrowser
import time
import random
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
from time import sleep
cont = 1
print("Welcome to Qp Bank !")
sleep(1)
print("Crafted with love by Mathan.S")
sleep(1)
print("Ensure your connectivity to Amrita Wifi f... | true | true |
f704fb25ca1ed4fdc84a58c5353bd993763a5b53 | 820 | py | Python | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | amulet/api/history.py | Podshot/Amulet-Core | 678a722daa5e4487d193a7e947ccceacac325fd2 | [
"MIT"
] | null | null | null | from __future__ import annotations
from .data_structures import Stack
from .operation import Operation
class HistoryManager:
def __init__(self):
self.undo_stack: Stack[Operation] = Stack()
self.redo_stack: Stack[Operation] = Stack()
def add_operation(self, operation_instance: Operation):
... | 29.285714 | 59 | 0.702439 | from __future__ import annotations
from .data_structures import Stack
from .operation import Operation
class HistoryManager:
def __init__(self):
self.undo_stack: Stack[Operation] = Stack()
self.redo_stack: Stack[Operation] = Stack()
def add_operation(self, operation_instance: Operation):
... | true | true |
f704fbc9f2528b864b8b22eb0ac9981a1560e438 | 5,522 | py | Python | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | null | null | null | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | 43 | 2020-02-14T16:15:15.000Z | 2020-07-14T12:05:09.000Z | mainapp/webapp/figures/linechart.py | thomashusebo/inf219-visualize-2d-sensor-data | 87572c46579887fb212fdfb6f413e271edc77bfe | [
"MIT"
] | null | null | null | import plotly.graph_objects as go
from mainapp.app_settings import cell_length_meter
def getLineChart(
data,
timestamp,
coordinates,
colorScale,
timeline,
color_range,
dragmode=False,
quick_select_range=True,
calibration_time=None,
show_... | 29.216931 | 108 | 0.458892 | import plotly.graph_objects as go
from mainapp.app_settings import cell_length_meter
def getLineChart(
data,
timestamp,
coordinates,
colorScale,
timeline,
color_range,
dragmode=False,
quick_select_range=True,
calibration_time=None,
show_... | true | true |
f704fc4963a514b11f2efd68c503b1d00784b219 | 5,508 | py | Python | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 1 | 2022-02-09T22:56:49.000Z | 2022-02-09T22:56:49.000Z | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | 6 | 2018-10-19T10:04:23.000Z | 2019-12-09T20:29:12.000Z | tests/sentry/models/test_projectownership.py | AlexWayfer/sentry | ef935cda2b2e960bd602fda590540882d1b0712d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.api.fields.actor import Actor
from sentry.models import ProjectOwnership, User, Team
from sentry.models.projectownership import resolve_actors
from sentry.ownership.grammar import Rule, Owner, Matcher, dump_schema
class ProjectO... | 32.210526 | 101 | 0.535766 | from __future__ import absolute_import
from sentry.testutils import TestCase
from sentry.api.fields.actor import Actor
from sentry.models import ProjectOwnership, User, Team
from sentry.models.projectownership import resolve_actors
from sentry.ownership.grammar import Rule, Owner, Matcher, dump_schema
class ProjectO... | true | true |
f704fc910bd0b1ded2564c2c436dd36c7bac1bc0 | 609 | py | Python | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | Lezaza/hotpoor_autoclick_xhs | 52eafad8cce59353a9de5bf6e488e8a2602e5536 | [
"Apache-2.0"
] | 1 | 2021-12-21T10:42:46.000Z | 2021-12-21T10:42:46.000Z | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | 2 | 2021-11-03T11:36:44.000Z | 2021-11-05T07:58:13.000Z | Redmi_note9/PUCO_Bob/day_start/show_test_0.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | 1 | 2021-10-09T10:28:57.000Z | 2021-10-09T10:28:57.000Z | import os
import time
# os.system("adb shell monkey -p com.xingin.xhs -c android.intent.category.LAUNCHER 1")
# os.system("sleep 4")
# os.system("adb shell input tap 1000 150")
# os.system("sleep 2")
# os.system("adb shell input text PUCO")
# os.system("sleep 2")
# os.system("adb shell input tap 1000 150")
# os.system... | 32.052632 | 87 | 0.692939 | import os
import time
for i in range(0,50):
os.system("adb shell input swipe 340 1200 340 400 1000")
os.system("adb shell input swipe 340 600 340 1800 1000")
time.sleep(1)
os.system("adb shell input swipe 340 1400 340 200 1000")
time.sleep(2)
| true | true |
f704ff4f170ca5bfc8ac19a642a71a7b7ae80975 | 4,955 | py | Python | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 21 | 2020-03-05T20:03:58.000Z | 2022-03-14T23:17:42.000Z | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 60 | 2020-02-14T22:53:01.000Z | 2022-03-26T07:24:19.000Z | test/test_output.py | keurfonluu/toughio | 1db0600ee5ad1abb5ca858c81c8ac5226c9dbb4f | [
"BSD-3-Clause-LBNL"
] | 6 | 2020-02-28T08:15:36.000Z | 2022-03-13T23:26:24.000Z | import os
import helpers
import numpy
import pytest
import toughio
write_read = lambda output, writer_kws, reader_kws: helpers.write_read(
"output",
output,
toughio.write_output,
toughio.read_output,
writer_kws=writer_kws,
reader_kws=reader_kws,
)
@pytest.mark.parametrize(
"filename, da... | 28.641618 | 88 | 0.574975 | import os
import helpers
import numpy
import pytest
import toughio
write_read = lambda output, writer_kws, reader_kws: helpers.write_read(
"output",
output,
toughio.write_output,
toughio.read_output,
writer_kws=writer_kws,
reader_kws=reader_kws,
)
@pytest.mark.parametrize(
"filename, da... | true | true |
f70501b6041b222ae4cdc6349c3646848546cf5f | 271 | py | Python | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/XORAGN/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | #Question Link
#https://www.codechef.com/problems/XORAGN
t=int(input())
for a0 in range(t):
n=int(input())
a=list(map(int,input().split()))
res=0
for i in a:
res=res^i #xorring all the values present
print(2*res) #doubling the result obtained
| 24.636364 | 49 | 0.645756 |
t=int(input())
for a0 in range(t):
n=int(input())
a=list(map(int,input().split()))
res=0
for i in a:
res=res^i
print(2*res)
| true | true |
f705031b38df3c5a63196a68e3910cb0f10187d4 | 716 | py | Python | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | 3 | 2021-08-17T19:21:22.000Z | 2021-08-23T17:58:52.000Z | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | null | null | null | control_plotly/utils.py | vincentchoqueuse/python-control-plotly | 5f4f7d354d4de2628ea52a5e544ebeb138d106bc | [
"MIT"
] | null | null | null | import control as ctl
import numpy as np
def damp(sys,display=False):
pole_list = []
m_list = []
wn_list = []
for pole in sys.pole():
pole = pole.astype(complex) # WTF: the python control "damp" function is buggy due to this missing cast !
if ctl.isctime(sys):
pole_continu... | 24.689655 | 113 | 0.564246 | import control as ctl
import numpy as np
def damp(sys,display=False):
pole_list = []
m_list = []
wn_list = []
for pole in sys.pole():
pole = pole.astype(complex)
if ctl.isctime(sys):
pole_continuous = pole
else:
pole_continuous = np.log(pole)/sys.dt
... | true | true |
f705039b1f57c4a0a916cbfd3c1650721de1f279 | 3,014 | py | Python | airflow/providers/apache/hive/sensors/hive_partition.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | airflow/providers/apache/hive/sensors/hive_partition.py | Hartorn/airflow | a79e2d4c4aa105f3fac5ae6a28e29af9cd572407 | [
"Apache-2.0"
] | 37 | 2020-07-21T07:50:02.000Z | 2022-03-29T22:31:28.000Z | airflow/providers/apache/hive/sensors/hive_partition.py | vuppalli/airflow | dfe8337ca2d3ed173d9ecc112938271519792c40 | [
"Apache-2.0"
] | 2 | 2018-07-24T08:54:45.000Z | 2018-08-31T13:41:50.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 40.186667 | 91 | 0.674851 |
from airflow.providers.apache.hive.hooks.hive import HiveMetastoreHook
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils.decorators import apply_defaults
class HivePartitionSensor(BaseSensorOperator):
template_fields = ('schema', 'table', 'partition',)
ui... | true | true |
f7050439ef98c033793027024ec1d306c91c767c | 15,018 | py | Python | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | metadata-ingestion/src/datahub/ingestion/source/sql_common.py | hmjahle/datahub_upstream | 62d5306a28e0df6b6b67a5f46c01dd508caada60 | [
"Apache-2.0"
] | null | null | null | import logging
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type
from urllib.parse import quote_plus
import pydantic
from sqlalchemy import create_engine, inspect
from sqlalchemy.engine.reflection import Inspector
from sqlal... | 35.757143 | 118 | 0.639433 | import logging
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Type
from urllib.parse import quote_plus
import pydantic
from sqlalchemy import create_engine, inspect
from sqlalchemy.engine.reflection import Inspector
from sqlal... | true | true |
f70504c11afdc0157e75d2a01ec110e01f694f06 | 132,215 | py | Python | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 7 | 2018-04-12T17:11:04.000Z | 2021-12-02T14:01:47.000Z | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 1 | 2021-12-01T08:11:51.000Z | 2021-12-01T08:11:51.000Z | Lib/test/test_unicode.py | KinkowanWinter/Transcendental-Number-Utilization | 5f6d1d32850ad2cd2d03cc6f796d32ba7876fc39 | [
"PSF-2.0"
] | 4 | 2018-04-27T18:03:08.000Z | 2020-04-12T23:14:29.000Z | """ Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import _string
import codecs
import itertools
import operator
import struct
import string
import sys
import unittest
import warnings
from test import support, str... | 45.465956 | 120 | 0.534886 | import _string
import codecs
import itertools
import operator
import struct
import string
import sys
import unittest
import warnings
from test import support, string_tests
def search_function(encoding):
def decode1(input, errors="strict"):
return 42
def encode1(input, errors="strict"):
return... | true | true |
f705051db073657252741e08c08f2ef3c4cd9b70 | 11,317 | py | Python | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 244 | 2015-01-01T12:04:44.000Z | 2022-03-25T23:38:39.000Z | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 6 | 2015-08-18T08:19:10.000Z | 2022-03-05T02:32:36.000Z | tools/trove-pylint.py | a4913994/openstack_trove | 3b550048dd1e5841ad0f3295679e0f0b913a5687 | [
"Apache-2.0"
] | 178 | 2015-01-02T15:16:58.000Z | 2022-03-23T03:30:20.000Z | #!/usr/bin/env python
# Copyright 2016 Tesora, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.242165 | 85 | 0.567111 |
import fnmatch
import json
from collections import OrderedDict
import io
import os
import re
import sys
from pylint import lint
from pylint.reporters import text
DEFAULT_CONFIG_FILE = "tools/trove-pylint.config"
DEFAULT_IGNORED_FILES = ['trove/tests']
DEFAULT_IGNORED_CODES = []
DEFAULT_IGNORED_MESSAGES ... | true | true |
f7050555bf105b4cac50608f7fef5821912f5697 | 18,791 | py | Python | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 14 | 2020-06-01T14:22:43.000Z | 2022-02-01T15:46:13.000Z | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 8 | 2020-12-17T08:23:46.000Z | 2021-11-10T14:59:06.000Z | training_utility/run_pretraining_adapter.py | ai-nikolai/Retrograph-1 | 54bd534d47218ca437c422a1abe5b1e995f55d71 | [
"Apache-2.0"
] | 5 | 2020-06-01T14:21:17.000Z | 2021-10-01T09:47:38.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 37.961616 | 82 | 0.699164 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from retrograph.modeling import modeling_adapter as modeling
from retrograph.modeling import optimization_adapter as optimization
import tensorflow as tf
flags = tf.flags
FLAGS = flag... | true | true |
f70505938a0336b31ecf199133d778d0e94de7ec | 514 | py | Python | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | 1 | 2021-07-08T19:28:06.000Z | 2021-07-08T19:28:06.000Z | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | null | null | null | set3/p3_4.py | Felpezs/IPL_2021 | eaef2baec96f16c1486f4ec5af6eff097f81fcd2 | [
"MIT"
] | null | null | null | def lend_money(debts, person, amount):
value = debts.get(person, 0)
quantity = [amount]
if value != 0:
debts[person] = value + quantity
else:
debts[person] = quantity
print(debts)
def amount_owed_by(debts, person):
value = debts.get(person, [0])
out = sum(va... | 21.416667 | 41 | 0.583658 | def lend_money(debts, person, amount):
value = debts.get(person, 0)
quantity = [amount]
if value != 0:
debts[person] = value + quantity
else:
debts[person] = quantity
print(debts)
def amount_owed_by(debts, person):
value = debts.get(person, [0])
out = sum(va... | true | true |
f705065a635806e4fe8266665d0d44bcb7dfdec4 | 914 | py | Python | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/Scratch-ML | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | 4 | 2021-09-18T23:52:10.000Z | 2021-09-25T04:04:10.000Z | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/My-ML-From-Scratch | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | null | null | null | scratchML/examples/linear_discriminant_analysis.py | TimS-ml/My-ML-From-Scratch | 0ea010e2b7ead5f98ba9a0db621cc7d7471e97af | [
"MIT"
] | null | null | null | from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from scratchML.supervised_learning import LDA
from scratchML.utils import calculate_covariance_matrix, accuracy_score
from scratchML.utils import normalize, standardize, train_test_split, Plot
from scr... | 24.052632 | 77 | 0.712254 | from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from scratchML.supervised_learning import LDA
from scratchML.utils import calculate_covariance_matrix, accuracy_score
from scratchML.utils import normalize, standardize, train_test_split, Plot
from scr... | true | true |
f70506c4e20561258cf4dc497d8803a8bee3c74e | 1,046 | py | Python | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 7 | 2022-03-16T06:55:04.000Z | 2022-03-18T07:03:25.000Z | python_modules/libraries/dagster-papertrail/setup.py | bitdotioinc/dagster | 4fe395a37b206b1a48b956fa5dd72bf698104cca | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | from setuptools import find_packages, setup
def get_version():
version = {}
with open("dagster_papertrail/version.py") as fp:
exec(fp.read(), version) # pylint: disable=W0122
return version["__version__"]
if __name__ == "__main__":
setup(
name="dagster-papertrail",
version=... | 32.6875 | 108 | 0.614723 | from setuptools import find_packages, setup
def get_version():
version = {}
with open("dagster_papertrail/version.py") as fp:
exec(fp.read(), version)
return version["__version__"]
if __name__ == "__main__":
setup(
name="dagster-papertrail",
version=get_version(),
... | true | true |
f70507b2d08d3c940b4529557fed1acefff47752 | 7,835 | py | Python | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | lcd1232/django-ratelimit2 | 417c677bea537304e48a0015d07902209a2e905a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Django Ratelimit documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 4 15:55:31 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | 32.110656 | 80 | 0.716273 |
import sys, os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Django Ratelimit'
copyright = u'2014, James Socol'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.... | true | true |
f705081a5da8e010e9ba2f98abb883270d65219a | 2,122 | py | Python | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | setup.py | powderflask/django_assess | cff25c0544a57ed9d7ddb3db3543268e51394875 | [
"MIT"
] | null | null | null | import sys, os, re
from setuptools import setup, Command, find_packages
from setuptools.command.test import test
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
... | 29.472222 | 99 | 0.655985 | import sys, os, re
from setuptools import setup, Command, find_packages
from setuptools.command.test import test
class CleanCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./*.pyc ./*.egg-... | true | true |
f705083b28a464c87e5ea58fd371f06a46d09124 | 16,794 | py | Python | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | tests/platform_tests/api/test_chassis.py | vdahiya12/sonic-mgmt | f785cd0bd07f8d2deb0b4bab16feb64f2eeba054 | [
"Apache-2.0"
] | null | null | null | import logging
import re
import pytest
import yaml
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.platform_api import chassis
from platform_api_test_base import PlatformApiTestBase
logger = logging.getLogger(__name__)
pytestmark = [
pytest.mark.disable_loganalyzer, # disab... | 52.317757 | 146 | 0.711742 | import logging
import re
import pytest
import yaml
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.platform_api import chassis
from platform_api_test_base import PlatformApiTestBase
logger = logging.getLogger(__name__)
pytestmark = [
pytest.mark.disable_loganalyzer,
py... | true | true |
f705088ca6ef0bf0d1e239d32b41a163dbc29fd3 | 5,189 | py | Python | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/api_support/instrument.py | mrakitin/opentrons | d9c7ed23d13cdb62bd1bc397dc2871d4bd5b77e9 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Optional, Any
from opentrons import types
from opentrons.calibration_storage import get
from opentrons.calibration_storage.types import TipLengthCalNotFound
from opentrons.hardware_control.dev_types import PipetteDict
from opentrons.protocol_api.labware import Labware, Well
from opent... | 36.034722 | 77 | 0.671035 | import logging
from typing import Optional, Any
from opentrons import types
from opentrons.calibration_storage import get
from opentrons.calibration_storage.types import TipLengthCalNotFound
from opentrons.hardware_control.dev_types import PipetteDict
from opentrons.protocol_api.labware import Labware, Well
from opent... | true | true |
f70508c8381da2991bd613dc3eb8473318c12f5a | 436 | py | Python | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | null | null | null | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | 8 | 2021-03-19T10:14:39.000Z | 2022-03-12T00:24:41.000Z | cookies/admin.py | ADpDinamo/site | d7313cd6c151a381ccc803b81768673587cb8d45 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import CookiePageText, TOSPageText, StatutPageText
# Register your models here.
class CookieAdmin(admin.ModelAdmin):
pass
class TOSPageTextAdmin(admin.ModelAdmin):
pass
class StatutPageTextAdmin(admin.ModelAdmin):
pass
admin.site.register(CookiePageText, Cooki... | 29.066667 | 63 | 0.823394 | from django.contrib import admin
from .models import CookiePageText, TOSPageText, StatutPageText
class CookieAdmin(admin.ModelAdmin):
pass
class TOSPageTextAdmin(admin.ModelAdmin):
pass
class StatutPageTextAdmin(admin.ModelAdmin):
pass
admin.site.register(CookiePageText, CookieAdmin)
admin.site.register(... | true | true |
f7050908f1d5cb294790a504bf31adbcb7c5b54b | 41,157 | py | Python | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | src/pyg_base/_pandas.py | nclarey/pyg-base | a7b90ea2ad4d740d8e7f8c4a7c9d341d36373862 | [
"MIT"
] | null | null | null | """
We want to simplify the operations for pandas dataframes assuming we are using timeseries as the main objects.
When we have multiple timeseries, we will:
1) calculate joint index using df_index()
2) reindex each timeseries to the joint index
We then need to worry about multiple columns if there a... | 36.134328 | 247 | 0.551449 | from pyg_base._types import is_df, is_str, is_num, is_tss, is_int, is_arr, is_ts, is_arrs, is_tuples, is_pd
from pyg_base._dictable import dictable
from pyg_base._as_list import as_list
from pyg_base._zip import zipper
from pyg_base._reducer import reducing, reducer
from pyg_base._decorators import wrapper
from pyg_ba... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.